Link: works as an a href, but not in php
Upon submitting a form I want it to redirect to where it came from.
Using this: <a href="form_update.php?beer_id=<?php echo $row_beer_update['beer_id']; ?>">
I can create a link that will take me to the page I want with the right information. Unfortunately into won't work on the submit button. So I'd have to click once to submit the info, and again on the link to go to the page I want.
Using this:
mysql_select_db($database_beer_diary, $beer_diary);
$Result1 = mysql_query($updateSQL, $beer_diary) or die(mysql_error());
$row_beer_update = mysql_fetch_assoc($Result1);
$updateGoTo = "detail_sheet.php?recordID=";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
It will go to the page I want, but it doesn't have the information I want on it.
So trying to combine the two:
mysql_select_db($database_beer_diary, $beer_diary);
$Result1 = mysql_query($updateSQL, $beer_diary) or die(mysql_error());
$row_beer_update = mysql_fetch_assoc($Result1);
$updateGoTo = "detail_sheet.php?recordID=".echo $row_beer_update['beer_id'];
This is the closest I got (I've tried several variations, but none worked). On this attempt I keep on getting "parse eror" but I can't see what's missing.
Any ideas?
Thanks
