Help with redirect
Moderator: General Moderators
Help with redirect
I need some suggestion about redirecting a page. I've a php script that when a user choose an option from a drop down menu, a javascript open a new page at that moment for the user to input something, once it's done the user can click on the Close button to close this window. After that, I want the php script to redirect to some place (e.g. http://myplace.com) instead of remain at the drop down menu. Could someone tell me how to do this. Thanks...
-
PhpMachine
- Forum Commoner
- Posts: 42
- Joined: Thu Apr 19, 2007 11:26 am
This is easily done with JS.
For instance:
or
For instance:
Code: Select all
document.location.href = "http://myplace.com";Code: Select all
window.location.href = "http://myplace.com"-
PhpMachine
- Forum Commoner
- Posts: 42
- Joined: Thu Apr 19, 2007 11:26 am
One mistake of mine.
You do this in the opened window, not the opener window...
On the close button, set the following to the "onclick" attribute of the button:
You do this in the opened window, not the opener window...
On the close button, set the following to the "onclick" attribute of the button:
Code: Select all
opener.location.href="http://myplace.com";Ok, I tried with the following, but it's not working. Am I missing something?
Code: Select all
<input style="color: #A52A2A" type=submit value="Close Window" onclick="javascript:window.location = 'http://www.yahoo.com';">- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<input style="color: #A52A2A" type="submit" onClick="location.href='http://yahoo.com'">