FYI:
I hope this doesn't change anything, but I'm running PHP 4.x. I see your signature, NogDog.
Appreciate the help.
I'm trying to understand and I hate to wear thin on your patience.
Here's my code so far:
<?php
include("cdb.php");
if($_POST['Submit']){
$id=$_POST['id'];
$n=$_POST['n'];
$cc=$_POST['cc'];
$st=$_POST['st'];
$ea=$_POST['ea'];
$cd=$_POST['cd'];
$url=$_POST['url'];
$approved=$_POST['approved'];
if (mysql_affected_rows($cdb) > 0)
{
mysql_query("UPDATE candidatesubmit SET n='$n', cc='$cc', st='$st', ea='$ea', cd='$cd', url='$url', approved='$approved' WHERE id='$id'");
header("location:ff_View.php");
exit;
}
else
{
echo mysql_error();
}
}
$id=$_GET['id'];
$result=mysql_query("SELECT * FROM candidatesubmit WHERE id='$id'");
$row=mysql_fetch_assoc($result);
mysql_close();
?>
<html>
<body>
<form method="post" action="<? echo $PHP_SELF; ?>">
<p>Name :
<input name="n" type="text" id="n" value="<? echo $row['n']; ?>"/>
<br />
<p>City County Come From :
<input name="cc" type="text" id="cc" value="<? echo $row['cc']; ?>"/>
<br />
<p>State :
<input name="st" type="text" id="st" value="<? echo $row['st']; ?>"/>
<br />
<p>Email :
<input name="ea" type="text" id="ea" value="<? echo $row['ea']; ?>"/>
<br />
<p>Office Held / Currently Running For :
<input name="cd" type="text" id="cd" value="<? echo $row['cd']; ?>"/>
<br />
<p>URL :
<input name="url" type="text" id="url" value="<? echo $row['url']; ?>"/>
<br />
<p>Approved :
<input name="approved" type="text" id="approved" value="<? echo $row['approved']; ?>"/>
<br />
</p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
</body>
</html>
My connect function in cdb.php is related to $cdb.
Here's cdb.php (my database connect include) with the info blanked out:
<?
$cdb = mysql_connect("xxx", "xxx", "xxx");
mysql_select_db("xxx");
?>
Now, I submit and it redirects me to a blank form page -- not the header.
Sorry I'm such a noob guys! :-p
Regards,
C