What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Redirect

PHP Redirect
Author: Message:
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. PHP Redirect
Ok, I have an upload code that uploads a song and creates a web page for that song. When the code is done running it want it to go to another page in the same window. Like a "Your song is now uploaded page". How would I redirect it to a new page when the code is done doing its thing?
[Image: top.gif]
03-03-2005 11:21 PM
Profile PM Web Find Quote Report
Concord Dawn
Veteran Member
*****

Avatar
This is a loopy fruit.

Posts: 1203
Reputation: 16
34 / Male / –
Joined: Feb 2004
RE: PHP Redirect
Google or PHP.net.
[Image: 7.png]
03-03-2005 11:22 PM
Profile E-Mail PM Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: PHP Redirect
As long as you havnt outputed any thing else you can use.
code:
header("Location: newpage");
But if you want it to show a message you could output a javascript redirect script with the page.
Or use a meta tag.
03-03-2005 11:25 PM
Profile PM Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
39 / Male / Flag
Joined: Aug 2004
Status: Away
RE: PHP Redirect
If you haven't outputted text or cookies or the like, you can use header("Location: somepage.php")

If it gives you a "headers already sent" error, you'll have to use JavaScript or a meta tag.



Edit: :dodgy: Madman was faster :refuck:

This post was edited on 03-03-2005 at 11:27 PM by L. Coyote.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

03-03-2005 11:26 PM
Profile PM Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. RE: PHP Redirect
Yea it gives me a "headers already sent" error. So how would I activate the javascript redirect when the php is done? Would I just put it at the end of the PHP code out of the <?php ?> tags?
[Image: top.gif]
03-03-2005 11:49 PM
Profile PM Web Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
39 / Male / Flag
Joined: Aug 2004
Status: Away
RE: PHP Redirect
quote:
Originally posted by DJeX
Would I just put it at the end of the PHP code out of the <?php ?> tags?
Yes, it can be put like that...
code:
<?
// php code
?>
<!-- javascript code -->
Or like this...
code:
<?
// php code
   if no error
?>
<!-- javascript code -->
<?
   else (some error happened)
   exit
?>

Edit: note I put pseudo-code (non-PHP), just to give you an idea of how it would look. That is not correct, and should be "translated" to PHP. I'm saying this just in case. :p

This post was edited on 03-04-2005 at 12:01 AM by L. Coyote.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

03-03-2005 11:59 PM
Profile PM Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: PHP Redirect
* fluffy_lobster vomits on javascript

Google meta redirection :google:
03-04-2005 12:13 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On