Is this a PHP conflict?

I have to insert 2 PHP tags on a single page:

<?php$fname = $_POST['fname'];$lname = $_POST['lname'];$email = $_POST['email'];$address = $_POST['address'];$city = $_POST['city'];$state = $_POST['state'];$zipcode = $_POST['zipcode'];$phone1 = $_POST['phone1'];$phone2 = $_POST['phone2'];$phone3 = $_POST['phone3'];
if( !filter_var($email, FILTER_VALIDATE_EMAIL) || empty($email) ) {	// Invalid Email	header("Location: http://domain.com");}
$location = "http://www.test.com/?fname=$fname&lname=$lname&pp1=$phone1&pp2=$phone2&pp3=$phone3&email=$email&straddr=$address&city=$city&state=$state&zip=$zipcode";?>

And

<?phprequire_once('geoipcity.inc');$gi = geoip_open('GeoLiteCity.dat', GEOIP_STANDARD);$location = GeoIP_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);geoip_close($gi);?>

However, when I combine the two (one on top of the other right above <html>) and it doesn’t work when I try to query the GeoIP tag using the following:

<?php$region = apache_note("GEOIP_REGION_NAME");echo($region);?>

There seems to be some sort of conflict between the two? Or is there a way to combine them on a page? Thanks :slight_smile:

What does “doesn’t work” mean? Do you get an error?

And that code would be much better readable (and understandable) if it wasn’t all massed together in one long line :slight_smile:

Sorry, please see this post as I did some further troubleshooting:

I have 2 PHP tags on a page:

<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$phone1 = $_POST['phone1'];
$phone2 = $_POST['phone2'];
$phone3 = $_POST['phone3'];

if( !filter_var($email, FILTER_VALIDATE_EMAIL) || empty($email) ) {    // Invalid Email    header("Location: http://renttoownlocal.com/final2.php?error=1");}
$location = "http://delta.rspcdn.com/xprr/red/PID/45/SID/Local,rtolp1?fname=$fname&lname=$lname&pp1=$phone1&pp2=$phone2&pp3=$phone3&email=$email&straddr=$address&city=$city&state=$state&zip=$zipcode";?>

And

<?php
require_once('geoipcity.inc');
$gi = geoip_open('GeoLiteCity.dat', GEOIP_STANDARD);
$location = GeoIP_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
?>

Somewhere else on the page, I have the following line:

<input type="button" class="creditbtn" id="popup_submit_form" onclick="window.location.href='<?php echo $location; ?>';" />

The <?php echo $location; ?> tag is making my page blank. Is there a workaround to fix this? Thanks!

Fixed the problem. :slight_smile: