Jump to content

update/edit


andy_b_1502

Recommended Posts

mrMarcus that worked, thank you.

 

And yes there is still an issue with the header re-direct to view01.php.

 

Is there any way around this, as the session at the top of the page is set so that if a unauthorized user tired to get to that page, it drops out to index.php with out a valid log in... 

Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

On submitting the form (with SOME of the fields left blank)

 

the details that were previously there are replaced by the blank fields (if left blank in the form)

 

How can i eradicate this problem from happening?

 

Thanks

Link to comment
Share on other sites

<?PHP
session_start();

include ('php only scripts/db.php');
$id = $_GET['id'];
$website = $_GET['website'];
$phone = $_GET['phone'];
$phone2 = $_GET['phone2'];
$premiumuser_decription = $_GET['premiumuser_decription'];

$website = isset($_POST['$website']);
$phone = isset($_POST['$phone']);
$phone2 = isset($_POST['$phone2']);
$premiumuser_decription = isset($_POST['$premiumuser_decription']);

$query = "UPDATE companies SET website = '". mysql_real_escape_string($website) ."', phone = '". mysql_real_escape_string($phone) ."', phone2 = '". mysql_real_escape_string($phone2) ."', premiumuser_description = '". mysql_real_escape_string($premiumuser_decription) ."' WHERE id = ". mysql_real_escape_string($id);
$result = mysql_query($query ) or die("SELECT Error: ".mysql_error());
header("Location: view01.php?id=" . $id); 
exit(0);
?>

 

i was thinking something like this? any ideas?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.