One drop of code bugging me during $_POST using $_GET var
Posted: Sun Mar 20, 2011 1:39 am
User clicks on a url, ie: example.com/AEQ438J
When I perform this in the code below:
$referrer displays correctly BEFORE if($_POST['form']), however during the if($_POST['form']) $referrer is empty.
How can I fix my code so that $referrer is not empty during the time the user posts their email address in the form?
Thank you!
When I perform this in the code below:
Code: Select all
$referrer = $_GET['_url'];
// echo $referrer displays the referrer ID contents correctly as "AEQ438J"
if ( ! empty($referrer))
{
$mysqli->query("UPDATE coming_soon_emails SET clicks = clicks + 1 WHERE code='" . $referrer ."'");
}
// this also updates the database correctly as it should
if (!empty($_POST['email'])){
// echo $referrer displays the referrer ID contents as BLANK. It should display "AEQ438J"!
.....How can I fix my code so that $referrer is not empty during the time the user posts their email address in the form?
Thank you!