-1

I need to go back to the page id after update. How can I get back the id.

    <?php
    include '/dbconn.php';
    $title=  mysql_real_escape_string($_REQUEST['title']);
    $body=  mysql_real_escape_string($_REQUEST['body']);
    $ID=  mysql_real_escape_string($_REQUEST['save']);
    $sql="UPDATE itemDB SET title='$title', body='$body' WHERE ID='$ID'";
    mysql_query($sql) or die(mysql_error());
    // Is where I need your help
    // I tried this echo ID; but it's still not working
    header('location:././lookup.php?ItemID=$ID');
    ?>

Error message:

Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\xampp\htdocs\saving.php on line 10

trincot
  • 317,000
  • 35
  • 244
  • 286

1 Answers1

0

You have to use double-quotes ("), otherwise $ID won't be replaced. Also, ././ as a path doesn't make that much sense to me.

Try it with header("Location: lookup.php?ItemID=$ID"); (if it's in the same directory)

aw31n
  • 161
  • 1
  • 3