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
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 = "mail@mail.com";

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

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

echo "sentOk=" . $sentOk;

?>

 

 

 

Link to comment
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.