|
|
Joined: Jan 2003
Posts: 250
Member
|
|
Member
Joined: Jan 2003
Posts: 250 |
Hey gang,
I cannot find a reference to this, and am sure it is something very simple... but how do you programmatically set the browser's URL? Something akin to parent.location.href in JS?
Is this possible?
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
|
Addict
Joined: Dec 2000
Posts: 1,471 |
You can send a redirect with php, but this only works if there is no ouput before that command. Just do something like this: header("Location: http://www.example.net/subfolder/file.php");It should be an absolute URL, a relative URL works on most browsers, but the specification requires an absolute URL.
|
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
|
Member
Joined: Jan 2003
Posts: 250 |
What about changing the URL of a frame?
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
|
Addict
Joined: Dec 2000
Posts: 1,471 |
You can't change the location of another frame. PHP is a server side scripting language and has no access to any dom or windows object of the browser.
|
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
|
Member
Joined: Jan 2003
Posts: 250 |
Lemme 'splain... This is actually more complex than I thought.
I have a page that has 3 frames... top, menu and main. The page is the entry point for a database, and the menu has links that are disabled until the user creates a recored. So, they click the only available link, which loads the basic info input screen into the main frame. The SUBMIT button calls a PHP script that saves the info to the DB, creating the new row. Now, I need the record ID from that new row to be able to input all of the other data (all going into associative tables in DB). I can get that with mysql_insert_id, but I need to pass it over to the menu so I can pass it along to all of the subsequent pages. Very much like a typical Windows Wizard works.
Question is, once I have that record ID from the PHP script, how do I pass it over to the menu frame???
Thanks a ton for any input!
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
|
Member
Joined: Jan 2003
Posts: 250 |
Well, that was easy... didn't realize I could just echo a script statement at the end of the PHP file... 
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
|
Addict
Joined: Dec 2000
Posts: 1,471 |
Yes, echoing javascript code works fine if your users have javascript enabled. It gets more complicated, if they haven't, but that shouldn't be the case, i guess.
|
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
|
Member
Joined: Jan 2003
Posts: 250 |
Thanks, Astaran. The JS solution should work, and since it is in a proprietary app, I can enforce it for those that wish to use it. 
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 808
Joined: July 2001
|
|
|
Forums63
Topics37,583
Posts293,955
Members13,826
| |
Most Online151,614 Nov 14th, 2025
|
|
Currently Online 3681
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 13
|
|
|
|