Previous Thread
Next Thread
Print Thread
Rate Thread
#245200 05/03/2003 11:58 AM
Joined: Jan 2003
Posts: 250
Member
Member
Offline
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
Sponsored Links
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
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
Offline
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
Offline
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
Offline
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
Sponsored Links
Joined: Jan 2003
Posts: 250
Member
Member
Offline
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
Offline
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
Offline
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

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 3681
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 13
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)