Hi All,
I found out that I can use the header function to redirect a page. However,
it gives me an error like that:
Warning: Cannot add header information - headers already sent by (output
started at /xxx/xxx/html/xx.php:10) in /xxx/xxx/html/xx.php on line 11
Here's my code:
<?php
$name=$_POST["name"];
$email=$_POST["email"];
$phone=$_POST["phone"];
$xxxx=$_POST["xxxx"];
$currentUserId= $_POST["userid"];
if (($name != "") && ($email != "") && ($phone != "") && ($xxxx!= "")) {
echo "processed $userid";
Header("Locatio n: http://localhost/xxxx/xxxx.asp?id=" . $currentUserId) ;
}
?>
What I want to do is migrate some data. So my source data is in an MS
access file, and I've found that I can't simply export the data. So I
created a form in ASP that will pull each row from the access db into a
form. The form will auto submit to a PHP. The php will take the submitted
info and save it to the mysql db. Then it will return the user to the
original ASP with the userid that was just processed. The ASP will update
the Access database to show that the row has been saved, and then load the
next row and continue the process.
In ASP, I could say
response.redire ct(http://localhost/location.asp?userid=xxx)
When I try this in PHP, it complains with the above error message.
Can anyone help?
Thanks,
Z
I found out that I can use the header function to redirect a page. However,
it gives me an error like that:
Warning: Cannot add header information - headers already sent by (output
started at /xxx/xxx/html/xx.php:10) in /xxx/xxx/html/xx.php on line 11
Here's my code:
<?php
$name=$_POST["name"];
$email=$_POST["email"];
$phone=$_POST["phone"];
$xxxx=$_POST["xxxx"];
$currentUserId= $_POST["userid"];
if (($name != "") && ($email != "") && ($phone != "") && ($xxxx!= "")) {
echo "processed $userid";
Header("Locatio n: http://localhost/xxxx/xxxx.asp?id=" . $currentUserId) ;
}
?>
What I want to do is migrate some data. So my source data is in an MS
access file, and I've found that I can't simply export the data. So I
created a form in ASP that will pull each row from the access db into a
form. The form will auto submit to a PHP. The php will take the submitted
info and save it to the mysql db. Then it will return the user to the
original ASP with the userid that was just processed. The ASP will update
the Access database to show that the row has been saved, and then load the
next row and continue the process.
In ASP, I could say
response.redire ct(http://localhost/location.asp?userid=xxx)
When I try this in PHP, it complains with the above error message.
Can anyone help?
Thanks,
Z
Comment