Lol ok guys this is my last question because i've just about finished my entire script. All i was after was, when someone enters a new messege and presses submit, i want it to automatically go to the index page (where the originally are) instead of going to an ugly white page with a link back to the index.
Im using the form with the action in a seperate page, so heres the code for that page:
So if u guys can tell me what i have to do to get that redirect it'll be great, i've played around with a few different codes and most of them give me errors about the headers or something. Thanks in Advance!
I Don't Really Get What You Mean But I Suppouse You Might Make THis:
<a href="filename.php?from=previous.php">On</a>
On Click İt'd Call Filename.php but add a value
$from ="previous.php";
then you can call previous file($from) by code
header( Location:"$_SERVER['DOCUMENT_ROOT']/$from" );
That's All. Hope I Help'd
I EDIT MY MESSAGE:
since it's on foprm action you must write
<form action="filename.php?from=previous.php" method="post">
or
<form action="filename.php?from=$SCRIPT_NAME" method="post">
Last edited by Hackerdragons; 11-23-03 at 05:11 AM.
You can't do the header function because there is already output that has been sent to the browser. So you have to include. Of course there's no reason simaone couldn't alter the code to only send the data after it was successful or unseuccessful.
And the code above will produce the same results as yours. There's not one way better than the other on that.