Forum Moderators: coopster
<?php
if ($submit == "click"){
PutEnv("ORACLE_SID=Banking");
$conn = OCILogon("user","pass");
if($conn == false){
echo OCIError($conn)."<BR>";
exit;
}
$query = "update customer set streetaddress = '$address', state = '$state', city = '$city', zip ='zip' where social = '108901234'";
$cursor = OCIParse ($conn, $query);
if ($cursor == false){
echo OCIError($cursor)."<BR>";
exit;
}
$result = OCIExecute($cursor);
if ($result ==false){
echo OCIError($cursor)."<BR>";
exit;
}
OCICommit($conn);
OCILogoff($conn);
}
else{
echo "<html>";
echo "<head>";
echo "<title>some title</title>";
echo "</head>";
echo "<body>";
echo "<form method ="post" action= "updatecustomer.php">";
echo "<p><strong>Street Address:</strong><input type ="text" name ="address" maxlength= 40>";
echo "<p><strong>City:</strong><input type ="text" name="city" maxlength= 15>";
echo "<p><strong>State:</strong><input type = "text" name="state" maxlength = 2>";
echo "<p><strong>Zip:</strong><input type = "text" name="zip" maxlength = 5>";
echo "<input type ="submit" name= "submit" value = "click"><input type= "reset" value= "Clear">";
echo "</form>";
echo "</body>";
echo "</html>";
}
?>
these are lines 29 and 30
echo "<body>";
echo "<form method ="post" action= "updatecustomer.php">";
Please Help Thanks
[edited by: jatar_k at 5:00 am (utc) on June 6, 2004]
[edit reason] removed specifics [/edit]
You need to escape quotes in the string you are echoing:
echo "<form method ="post" action= "updatecustomer.php">";
should be:
echo "<form method=\"post\" action= \"updatecustomer.php\">";
Rather than escaping all of the quotes in that html chunk you can switch out of php like so:
<?php
your code here
else{
?>
<html>
<head>
<title>Wachovia Bank-Sean's Bank</title>
</head>
<?php
}
?>
Hope that helps
Example:
echo '<form method ="post" action= "updatecustomer.php">';
$number = 5;
echo 'My number is $number.';
My number is $number.
$number = 5;
echo "My number is $number.";
My number is 5.
So it depends on the overall situation what's more efficient.