|
Posted by maya on 06/23/06 04:22
Gordon Burditt wrote:
> You redirect or you present a page. You don't get to do both.
I guess you're right, no need for html output if all you're doing is
db-stuff then redirecting..
> And if you try, the page you try to present won't be seen.
>
>
>>but: if, like in my case, for example, I delete data (passed in req)
>
>>from db THEN I redirect pg back to referer, how can I put redirect code
>
>>BEFORE anything else? I have to do db stuff, disconnect from db, THEN
>>do the redirect.. this is my code at then of file in question:
>>
>><html><head>css.. etc.. </head><body>
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ THIS IS THE PROBLEM!!!
>
>>php: do db stuff... then:
>>mysql_close($conn);
>>echo "<br><br><b>connection to db closed.</b><br><br><br>\n\n";
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ THIS IS ALSO A PROBLEM
>
>>$URL = "out.php?msg=selected+records+have+been+deleted+from+the+database.";
>>header("Location: $URL");
>>?>
>></body>
>></html>
>>
>>(this is not a serious problem since can do with JavaScript, but just
>>wondering what the deal is here... in Java you do redirect with RESPONSE
>>object, and you can put redirect code wherever you want.. I don't quite
>>understand why this is a problem in PHP..)
>
>
> PHP runs on the *SERVER*.
Of course I know PHP runs on the server.. what I meant is..
<?
all php..
mysql_close($conn);
?>
<script language="JavaScript" type="text/javascript">
location =
'out.php?msg=selected+records+have+been+deleted+from+the+database.';
</script>
>
>
>>(does $_RESPONSE exist in PHP? I looked here,
>
>
> No.
>
ok, good to know.. thank you...
Navigation:
[Reply to this message]
|