Jump to content

Syntax error


RON_ron

Recommended Posts

Parse error: syntax error, unexpected T_VARIABLE in /home/abc/dyomails.php on line 13

 

<?php
$link = mysql_connect("localhost","acb","passw01");
mysql_select_db("my_cottonmails");

$query = 'SELECT * FROM dyomails';
$results = mysql_query($query);

echo "<?xml version=\"1.0\"?>\n";
echo "<dyomails>\n";

$SomeVar = $fin

$query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'";
$results = mysql_query($query);
	if($line = mysql_fetch_assoc($results)) 
{
	echo "<item>" . $line["Email"] . "</item>\n";
}
}

echo "</dyomails>\n";
mysql_close($link);

?>

Link to comment
https://forums.phpfreaks.com/topic/176587-syntax-error/
Share on other sites

I need somethig like shown below ($sentOk)for the previous code. What can I do?

 

$sentOk = mail("$to",$subject,$message,$headers); 

echo "sentOk=" . $sentOk;

 

 

E.g.

<?PHP
$to = "[email protected]";

$subject = "$subject"; 
$headers = "From:" .$email."\r\n"; 
$message = "Name: " . $name;	

$sentOk = mail("$to",$subject,$message,$headers); 

echo "sentOk=" . $sentOk;

?>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930956
Share on other sites

sorry for the confusion. As you know this PHP is a server side PHP. I need something to send to my flash file. SO that it confirms the variables are been sent to the PHP.

 

 

In this case $sentOk

$sentOk = mail("$to",$subject,$message,$headers); 

echo "sentOk=" . $sentOk;

 

I need something like for this code. (i have no idea on PHP)  :)

<?php
$link = mysql_connect("localhost","acb","passw01");
mysql_select_db("my_cottonmails");

$query = 'SELECT * FROM dyomails';
$results = mysql_query($query);

echo "<?xml version=\"1.0\"?>\n";
echo "<dyomails>\n";

$SomeVar = $fin;

$query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'";
$results = mysql_query($query);
	if($line = mysql_fetch_assoc($results)) 
{
	echo "<item>" . $line["Email"] . "</item>\n";
}

echo "</dyomails>\n";
mysql_close($link);

?>

Link to comment
https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930965
Share on other sites

i'M not sure I understand, you want to send a confirmation email in that code, or you need to know if the SQL query has worked?

 

$SomeVar = $fin;

   $query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'";
   $results = mysql_query($query);
   if($results){
       //IT WORKS
       if($line = mysql_fetch_assoc($results))
       {
           echo "<item>" . $line["Email"] . "</item>\n";
       }
   }
   else{
      //DOESN'T WORK
      echo mysql_error($link);
   }

Link to comment
https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-931460
Share on other sites

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.