August 25th, 2000, 02:35 AM
-
hi
here i am updating a record in
one.php3. when i am updating a record it should go to another page two.php3 here its not working what is the problem ..
this fie name is one.php3
<?php
mysql_connect("xxxxx", "XXXXXXX", "xxxxx");
mysql_select_db("sadjkljsdf");
mysql_query("update realestate set contactperson ='$cp', phoneno='$cpn', emailid ='$ei',
cellno='$cn', proptype='$pt', transtype='$tt', location='$pl', area='$pa', cost='$cr', other='$od', address='$ca',
nor='$nor' where idno=$idno");
if(mysql_affected_rows()==1)
{
header("Location:'http//www.xxxxxxxxxx.com/two.php3'");
exit();
}
else
{
echo"<font face=verdana size=2><b>Record Not Modified.</b></font>";
}
?>
August 25th, 2000, 03:01 AM
-
You didn't say anything about the way your script doesn't work. Do you receive any error message?
The first thing I can think of is that maybe you left an empty line (ore more) before writing the php tag "<?" in one.php3.
In this case, you receive a message like "Cannot send header information...headers already sent by...".
Be carefull not to output anything before "Header:.." because the redirect will not be made.
August 25th, 2000, 03:01 AM
-
<<
<?php
mysql_connect("xxxxx", "XXXXXXX", "xxxxx");
mysql_select_db("sadjkljsdf");
mysql_query("update realestate set contactperson ='$cp', phoneno='$cpn', emailid ='$ei',
cellno='$cn', proptype='$pt', transtype='$tt', location='$pl', area='$pa', cost='$cr', other='$od', address='$ca',
nor='$nor' where idno=$idno");
if(mysql_affected_rows()==1)
{
header("Location:'http//www.xxxxxxxxxx.com/two.php3'");
exit();
}
else
{
echo"<font face=verdana size=2><b>Record Not Modified.</b></font>";
}
?>
>>
Sundar,
In your update statement you have to put "AND" in between the fields(ie,contactperson ='$cp' AND phoneno='$cpn' AND);
try this:
<?php
$con=mysql_connect("xxxxx", "XXXXXXX", "xxxxx");
//db connectivity string..
mysql_select_db("sadjkljsdf",$con);
//select your database
$result=mysql_query("update realestate set contactperson ='$cp' AND phoneno='$cpn' AND emailid ='$ei' AND
cellno='$cn' AND proptype='$pt' AND transtype='$tt'AND location='$pl' AND area='$pa'AND cost='$cr'AND other='$od'AND address='$ca'AND
nor='$nor' where idno=$idno",$con);
//issue update query
if(mysql_affected_rows($result)==1)
{
header("Location:http//www.xxxxxxxxxx.com/two.php3");
exit();
}
else
{
echo"<font face=verdana size=2><b>Record Not Modified.</b></font>";
}
?>
make sure that their is no white space or html code before your "<?" (ie, before your php deliminator).otherwise it won't redirect the page to 'two.php3'.
i think this will help you in some way.
Good Luck!!
------------------
SR -
webshiju.com
www.jobxyz.com-IT Career Portal
ezipindia.com--WebStudio
"The fear of the LORD is the beginning of knowledge..."
August 25th, 2000, 03:32 AM
-
sir,
it's updating the record with out and between the column names but browser displaying the one.php3 page, but i want to display the two.php3. then i can try without spaces before the <?Php
thank u sir,
August 25th, 2000, 03:47 AM
-
<<
but i want to display the two.php3. then i can try without spaces before the <?Php
>>
Are you getting a header error now?.
if yes then check your script.you should not put any thing before your "<?" ( i mean no white space or any html code before that).
<<
header("Location:'http//www.xxxxxxxxxx.com/two.php3'");
>>
no need to put "'" quote around the URL.
header("Location: http//www.xxxxxxxxxx.com/two.php3");
------------------
SR -
webshiju.com
www.jobxyz.com-IT Career Portal
ezipindia.com--WebStudio
"The fear of the LORD is the beginning of knowledge..."
August 25th, 2000, 03:56 AM
-
thank u sir,
its working fine like
header("Location:/two.php3");
i have given spaces before<?php
that's the problem.
thank you sir,
bala sundar.