slj90 Posted November 15, 2010 Share Posted November 15, 2010 Hello, I am trying to make a page with a text box in where the user enters their post code and hits 'Submit' then it loads a new page with an embeded google maps map of that area. with the following code: <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=gym+**POSTCODE**&sll=37.0625,-95.677068&sspn=30.461748,86.572266&ie=UTF8&hq=gym&hnear=**POSTCODE**,+United+Kingdom&output=embed"></iframe><br /><small><a href="http://www.google.com/maps?f=q&source=embed&hl=en&geocode=&q=gym+**POSTCODE**&sll=37.0625,-95.677068&sspn=30.461748,86.572266&ie=UTF8&hq=gym&hnear=**POSTCODE**,+United+Kingdom" style="color:#0000FF;text-align:left">View Larger Map</a> I have typed **POSTCODE** where the user input needs to go.. Any ideas how this could be done? Thanks Link to comment https://forums.phpfreaks.com/topic/218695-simple-form-help/ Share on other sites More sharing options...
revraz Posted November 15, 2010 Share Posted November 15, 2010 Not sure if it's just me or IE, but I can't see any of the code in that box. Link to comment https://forums.phpfreaks.com/topic/218695-simple-form-help/#findComment-1134312 Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2010 Share Posted November 15, 2010 If that's the script that follows the form submission, you'd need to replace **POSTCODE** with <?php echo (isset($_POST['postcode']) && !empty($_POST['postcode'])) ? $_POST['postcode'] : 'enter_a_default_postcode_here'; ?> Make sure the $_POST index matches the name of your form field, and enter a default to be used in the event the user fails to enter one. Link to comment https://forums.phpfreaks.com/topic/218695-simple-form-help/#findComment-1134448 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.