Thread: Redirect
View Single Post

   
  #4 (permalink)  
Old 02-28-2008, 07:35 AM
Garry Jones
 
Posts: n/a
Default Re: Redirect

"Good Man" <heyho@letsgo.com> skrev i meddelandet
news:Xns97A2A23587951sonicyouth@216.196.97.131...

> That being said, the PHP function Header() is what you are looking for.
> So, on your PHP page that processes the MySQL data, the following code
> should be entered AFTER all processing and BEFORE any output to the
> screen:
>


Ok, I know this question is now off topic. However, I have followed your
answer and can't get it to work. As this loosely connected to MySql I take
the extreme liberty of asking for more clarity. This is the php page that
processes the MySQL data.

<?
$realname=$_POST['realname'];
$land=$_POST['land'];
mysql_connect("localhost", "myusername", "mypassword") or
die(mysql_error());
mysql_select_db("my_database") or die(mysql_error());
mysql_query("INSERT INTO `animals` VALUES ('$realname', '$land')");
Header("Location: http://www.mydomain.com/");
?>

But it does not work, it adds the data in correctly and leaves the user on a
totally blank page.

Any idea?

Garry Jones
Sweden


Reply With Quote