burnthand Posted February 19, 2008 Share Posted February 19, 2008 Hi there, I'm new to the PHP Freaks forum, but i thought i'd give it a shot to see if anybody here knows the answer or has any suggestions. I'm trying to pass post data between forms - here is the receiving form. <?php $companyName = $_POST["companyName"]; $information = $_POST["information"]; $testimonial = $_POST["testimonial"]; $weburl = $_POST["weburl"]; $localaddress = $_POST["localaddress"]; $username = $_POST["username"]; $password = $_POST["password"]; $public = $_POST["public"]; $username = $_POST["username"]; /** * * * @version $Id$ * @copyright 2008 */ ?> <html><head></head><body><p><?php echo $companyName; ?></p> <p><?php echo $information; ?></p> <p><?php echo $testimonial; ?></p> <p><?php echo $weburl; ?></p> <p><?php echo $localaddress; ?></p> <p><?php echo $username; ?></p></body></html> <?php ?> This form and the sending form works on our public web server but for some reason if i try and process the form locally using WAMP the output is returning:- <html><head></head><body><p><? echo $companyName; ?></p> <p><? echo $information; ?></p> <p><? echo $testimonial; ?></p> <p><? echo $weburl; ?></p> <p><? echo $localaddress; ?></p> <p><? echo $username; ?></p></body></html> Instead of the actual data contained within those variables. I'm really in the dark as to why this is happening. Is it something to do with the way php is processing the form? Quote Link to comment https://forums.phpfreaks.com/topic/91867-passing-variables-between-forms/ Share on other sites More sharing options...
wildteen88 Posted February 19, 2008 Share Posted February 19, 2008 It is because you're using short tags (<? ?> or <?= ?>). I'd would highly recommend you change your script to use the full PHP tags (<?php ?> or <?php echo ?>). Using full PHP tags will allow your code to be more portable/compatible with other PHP setups. Quote Link to comment https://forums.phpfreaks.com/topic/91867-passing-variables-between-forms/#findComment-470744 Share on other sites More sharing options...
burnthand Posted February 21, 2008 Author Share Posted February 21, 2008 thanks for getting back to me. that sorted it. cheers wildteen88! Quote Link to comment https://forums.phpfreaks.com/topic/91867-passing-variables-between-forms/#findComment-472560 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.