sonny Posted July 24, 2009 Share Posted July 24, 2009 Hi I am new to PHP but trying new things every day. I am trying to pass a IP address over to display.php this is my simple form page code below. <form action="display.php" method="post"> Name: <input type="text" name="IP" /> <input type="submit" /> </form> And this is the code line inside my next page named display.php I need to insert that ip address into, my line below causes errors can someone show me the correct syntax to do this? $location = GeoIP_record_by_addr($gi, '$_POST["IP"]'); I am trying to place a IP address entered in a form into that location= above Thanks Link to comment https://forums.phpfreaks.com/topic/167337-solved-php-form-value-question/ Share on other sites More sharing options...
vineld Posted July 24, 2009 Share Posted July 24, 2009 What error do you get? What shows when you do echo $_POST["IP"] in display.php? Link to comment https://forums.phpfreaks.com/topic/167337-solved-php-form-value-question/#findComment-882362 Share on other sites More sharing options...
sonny Posted July 24, 2009 Author Share Posted July 24, 2009 What error do you get? What shows when you do echo $_POST["IP"] in display.php? It was a parse error Thank you for helping I found the syntax problem it was a ' the code below works now $location = GeoIP_record_by_addr($gi, $_POST["ipp"]); Link to comment https://forums.phpfreaks.com/topic/167337-solved-php-form-value-question/#findComment-882366 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.