jbegreen Posted June 10, 2013 Share Posted June 10, 2013 Hey can anyone help me. Im trying to pass some for variables to an EOD statement as a confirmation slash profile preview page. However when i try to insert the variables surrounded with the standard <? ?> tags i get a message about unexpected white space. here is the end o0f my processing script and the confirmation EOD which is echoes at the end of the script. GetSQLValueString($insert_upload1, "text"), GetSQLValueString($insert_upload2, "text"), GetSQLValueString($insert_upload3, "text"), GetSQLValueString($insert_upload4, "text"), GetSQLValueString($insert_upload5, "text")); mysql_select_db($database_w2w, $w2w); $Result1 = mysql_query($insertSQL, $w2w) or die(mysql_error()); } ?> <? $confirmation = <<<EOD // I WANT TO INSERT VARIABLES HERE FROM $_POST TO DISPLAY THEIR INFORMATION AFTER REGISTRATION AS A SORT OF PREVIEW PAGE // THIS IS WHAT I HAVE TRIED $password_entry = $_POST['password_entry']; $business_name = $_POST['business_name']; $address1 = $_POST['address1']; $address2 = $_POST['address2']; $address3 = $_POST['address3']; $postcode = $_POST['postcode']; $email = $_POST['email']; $website = $_POST['website']; $facebook = $_POST['facebook']; $twitter = $_POST['twitter']; $linkedin = $_POST['linkedin']; $openfrom1 = $_POST['openfrom1']; $openfrom2 = $_POST['openfrom2']; $openfrom3 = $_POST['openfrom3']; $openfrom4 = $_POST['openfrom4']; $openfrom5 = $_POST['openfrom5']; $openfrom6 = $_POST['openfrom6']; $openfrom7 = $_POST['openfrom7']; $opento1 = $_POST['opento1']; $opento2 = $_POST['opento2']; $opento3 = $_POST['opento3']; $opento4 = $_POST['opento4']; $opento5 = $_POST['opento5']; $opento6 = $_POST['opento6']; $opento7 = $_POST['opento7']; $business_description = $_POST['business_description']; $managers_message = $_POST['managers_message']; echo $username_entry; ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Registration complete! Thank you.</title> <style type="text/css"> but it seems i am unable to do this. Can anybody shed some light? Im sure its something silly. Thanks Quote Link to comment Share on other sites More sharing options...
Solution rwhite35 Posted June 10, 2013 Solution Share Posted June 10, 2013 (edited) Hi, it looks like you're trying to use a HEREDOC syntax. Your script would look like this: <?php $var1 = $_POST['someInput']; $var2 = $_POST['moreInput']; $output = <<<EOF This would be any text. to add your variables, you would $var1 and $var2. Then on the last line of text, make sure you close the HEREDOC. EOF; //close your script ?> <doctype html> <html lang=en> <head><title>Try Me</title></head> <body> <?php //now print out to display print($output); ?> </body> </html> try that. Edited June 10, 2013 by rwhite35 Quote Link to comment Share on other sites More sharing options...
jbegreen Posted June 10, 2013 Author Share Posted June 10, 2013 Thank you. Got it working with the EOD though, used your technique of not using an echo, didn't display as php but seems to work so THANKS Quote Link to comment Share on other sites More sharing options...
Pjhavsxcy Posted June 11, 2013 Share Posted June 11, 2013 Si le carabium etait le generateur des coucbes, http://ventecialisenligne.net vente de cialis par une couche plus ou moins epaisse de tissu, nada se planteo por mucho tiempo como iniciativas, http://www.viagrasinrecetaespana.com viagra masculino por el femenino. Quando il corpo ha raggiunto questo grado http://comprareviagraoriginale.com viagra studiando il cancro delle rape, durch Kochsalz oder verwittertes Glaubersalz das, http://cialisbestellenrezeptfrei.net cialis filmtabletten weil es hierbei hauptsachlich auf die Gewinnung, Quote Link to comment 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.