Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old December 13th, 2007, 02:27 AM   #1
New Member
 

Join Date: Nov 2007
Location: Oregon
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Posie is on a distinguished road
[SOLVED] close current window in php script

I have a form to email script. At the end of the script, after the email has been submitted, the script echos "The consultation form has been submitted...Thank you"

This echo is now alone on the window. Is it possible to add on a function to close this window? Could this be done within the php script, after the "thank you" echo?

Or does this need to be placed within an html page including the php script, in javascript? (creating a button to click to close the window)

Thanks for all the great advice!
Posie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 13th, 2007, 02:30 AM   #2
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 954
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: close current window in php script

You simply need to write out some javascript with php

Code:
echo 'The consultation form has been submitted... Thank You!<br /><br /><button onclick="window.close()">Close Window</button>'
Cheers
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 13th, 2007, 02:33 AM   #3
New Member
 

Join Date: Nov 2007
Location: Oregon
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Posie is on a distinguished road
Re: close current window in php script

Wow, man! You are fast!

Thanks a bunch!
Posie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 13th, 2007, 02:42 AM   #4
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 954
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: close current window in php script

LOL right place at the right time.. Glad it works
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 13th, 2007, 07:00 AM   #5
New Member
 

Join Date: Dec 2007
Location: UK
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 prydie is on a distinguished road
Re: [SOLVED] close current window in php script

That was javascript... you printed the js in php but still not php... I wonder is there a php function that does this as well. Anyone know?
prydie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 13th, 2007, 07:04 AM   #6
Highly Reputable Member
SuperMember
 
Rakuli's Avatar
 

Join Date: Sep 2007
Location: Australia
Age: 25
Posts: 954
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold Rakuli is a splendid one to behold
Re: [SOLVED] close current window in php script

No. LOL simple as that.... PHP is server side, it does not affect the client computer in any way. It serves the text/data to be loaded and this is all, it writes the javascript but cannot interact with the client at all
__________________
Luke Dingle . com
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 13th, 2007, 06:29 PM   #7
New Member
 

Join Date: Dec 2007
Location: UK
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 prydie is on a distinguished road
Re: [SOLVED] close current window in php script

What a stupid question to have put to you guys and having coded php for as long as i have you would have thought I'd put two and two together. I am always trying to explain to people server side and client side scripting and yet I get it wrong myself... man im embarrassed!
prydie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 14th, 2007, 02:38 AM   #8
Highly Reputable Member
 

Join Date: Apr 2007
Location: Willich, Germany
Age: 22
Posts: 592
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 c010depunkk is a jewel in the rough c010depunkk is a jewel in the rough c010depunkk is a jewel in the rough c010depunkk is a jewel in the rough
Re: [SOLVED] close current window in php script

hehe. Don't worry... It also took me ages to understand that concept - PHP is server-side and generates HTML.....
c010depunkk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
link to close window in html page cgst81 HTML, XHTML and CSS 1 June 1st, 2008 08:34 AM
[SOLVED] press button to close window R8515198 HTML, XHTML and CSS 2 January 27th, 2008 01:39 PM
[SOLVED] Getting the current domain MikeHopley PHP 4 November 22nd, 2007 02:40 PM
[SOLVED] open new window from main window AdRock Other Languages 1 November 1st, 2007 12:45 AM
resizing current window with java danydrunk Other Languages 2 July 12th, 2006 06:27 PM


Search Engine Optimization by vBSEO 3.2.0 RC8