OriginalBoy Posted July 11, 2008 Share Posted July 11, 2008 Hey, I have a system where you enter the zip code and then it takes you to a form. I already get all the zip information but i need to print it in the form. Here is the code i am trying to use. value="<?php print("$city")?>" Its not doing it, why? Quote Link to comment https://forums.phpfreaks.com/topic/114277-print-in-html-form/ Share on other sites More sharing options...
waynew Posted July 11, 2008 Share Posted July 11, 2008 Check to see if $city isn't empty or isset. Also, try echo. Quote Link to comment https://forums.phpfreaks.com/topic/114277-print-in-html-form/#findComment-587624 Share on other sites More sharing options...
rhodesa Posted July 11, 2008 Share Posted July 11, 2008 if that doesn't work, then $city isn't set/is empty...what is the code before that sets $city? Quote Link to comment https://forums.phpfreaks.com/topic/114277-print-in-html-form/#findComment-587625 Share on other sites More sharing options...
craygo Posted July 11, 2008 Share Posted July 11, 2008 value="<?php echo $city; ?>" That should do the job, as long as $city is set otherwise try something like this. I assuming the value is coming from some form. I will use POST but if you are using GET then change it $city = isset($_POST['city']) ? $_POST['city'] : ""; then you can use the code above without getting any errors Ray Quote Link to comment https://forums.phpfreaks.com/topic/114277-print-in-html-form/#findComment-587631 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.