Rifts Posted November 26, 2009 Share Posted November 26, 2009 echo '".($_POST['email'])."'; Quote Link to comment https://forums.phpfreaks.com/topic/182989-whats-wrong-with-this-single-line/ Share on other sites More sharing options...
vinpkl Posted November 26, 2009 Share Posted November 26, 2009 why are using opening and closing brackets. also without seeing more code nobody can judge the problem. vineet Quote Link to comment https://forums.phpfreaks.com/topic/182989-whats-wrong-with-this-single-line/#findComment-965842 Share on other sites More sharing options...
oni-kun Posted November 26, 2009 Share Posted November 26, 2009 echo '".($_POST['email'])."'; Yes.. Use something SIMPLE and correct, such as this: echo $_POST['email']; Quote Link to comment https://forums.phpfreaks.com/topic/182989-whats-wrong-with-this-single-line/#findComment-965843 Share on other sites More sharing options...
Rifts Posted November 26, 2009 Author Share Posted November 26, 2009 here is the full code <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("clients", $con); echo '".($_POST['email'])."'; ?> im getting error Parse error: parse error, expecting `','' or `';'' in C:\wamp\www\homepage\google.php on line 150 which is that original line i posted also here is where im getting "email" from <?php $extract = mysql_query ("SELECT * FROM members ORDER BY `date` DESC"); $numrows = mysql_num_rows ($extract); echo"Select USER: <select name='email'>"; while ($row = mysql_fetch_assoc($extract)) { echo '<option name="'.$row['firstname'].'('.$row['date'].')">'.$row['firstname'].' ('.$row['date'].')</option>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/182989-whats-wrong-with-this-single-line/#findComment-965845 Share on other sites More sharing options...
premiso Posted November 26, 2009 Share Posted November 26, 2009 echo '".($_POST['email'])."'; That is not proper syntax. Fix that to this: echo $_POST['email']; As stated earlier, or if you want the quotes to also be echo'ed out: echo '"{$_POST['email']}"'; But yea, that was the error, you just had improper syntax so of course it would throw a syntax error. You may want to read more up on PHP Syntax to help you avoid this in the future. Quote Link to comment https://forums.phpfreaks.com/topic/182989-whats-wrong-with-this-single-line/#findComment-965973 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.