Don't mean to start a discussion whatsoever, I


love php, but

one thing i can't do in php is


Response.Redirect("page.asp") .


Apart from that no complains so far :)




Um, as I understand it this is simple to do in php.  Just use:

header("Location: $somestring");

Here's the ASP code I found when I looked up what response.redirect does:

<%
u_location=request.form("u_location")
if u_location <> "" then
response.redirect (u_location)
end if
%>

<form method="post" action="redirect_varible.asp">
<select size="1" name="u_location">
<option value="http://www.goto.com";>GoTo.com</option>
<option value="http://www.priceline.com";>Priceline.com</option>
<option value="http://www.alladvantage.com";>AllAdvantage.com</option>
</select>
<input type="submit" value="Submit">
</form>



Here's how I'd code the same thing is php:

<?php
       if isdefined($_POST["u_location"]
       {
           $newpage = $_POST["u_location"];

           header("Location:  $newpage");
      }


<form method="post" action="redirect_varible.php">
<select size="1" name="u_location">
<option value="http://www.goto.com";>GoTo.com</option>
<option value="http://www.priceline.com";>Priceline.com</option>
<option value="http://www.alladvantage.com";>AllAdvantage.com</option>
</select>
<input type="submit" value="Submit">
</form>


As I understand it, all response.redirect does is tell the browser to go to another page. That's all the header function does too. I use this all the time if people aren't authenticate to push them to the login page or if they aren't using https to connect, to push them to the https url.

Am I missing something here?

The only snage with the header function is that you must not print or
echo anything to the browser before you use it.  In other words you
can't do this:

<html>
<body>
<p>I moved you to another page.</p>
<?php header("Location: http://someotherpage.com";); ?>
</body>
</html>

Whoops. Just realized that this was coming through the mysql lists, so it's OT. Original poster can e-mail me off list with questions.

Bob




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to