Jump to content

whats wrong with this single line


Rifts

Recommended Posts

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>';
}      

?>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.