SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    applying the spf lotion V + E + R + T's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is this a PHP conflict?

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

    PHP Code:
    <?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($emailFILTER_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

    PHP Code:
    <?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 Code:
    <?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
    Proud SPF member since 2001!

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    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

  3. #3
    applying the spf lotion V + E + R + T's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, please see this post as I did some further troubleshooting:

    I have 2 PHP tags on a page:

    PHP Code:
    <?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($emailFILTER_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 Code:
    <?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:
    PHP Code:
    <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!
    Proud SPF member since 2001!

  4. #4
    applying the spf lotion V + E + R + T's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed the problem.
    Proud SPF member since 2001!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •