Jump to content

Recommended Posts

Ok on my mailing script

 

it is suppose to call the e-mail from the database and e-mail someone per minuet

 

but I get this error

 

Parse error: syntax error, unexpected T_VARIABLE in /mounted-storage/home48c/sub007/sc33591-LWQU/uploads/vote/mailing.php on line 15

 

here is line 15

 

$to = "comptech21@gmail.com";

 

here is the script

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<title>Mailing Peep</title>
<meta http-equiv="Refresh" content="60; URL="mailing.php">
<?php
include "config.php";
mysql_connect($server, $db_user, $db_pass) or die (mysql_error()); 
$result = mysql_db_query($database, "select * from $table WHERE email = '$email'") or die (mysql_error()); 

   while ($qry = mysql_fetch_array($result)) {

$qry[email] = $email 
   

$to = "comptech21@gmail.com";
$subject = "Lubbock Cooper High School Band";
$message = "I would like to vote for Lubbock Cooper High School Band!";
$from = $email
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Being Sent. Your vote will be sent ever 60s or in 1 Minuet. What ever e-mail you entered will be used as the returend address. Please do not close this window.";
}
?>

</html>

 

-Thanks

 

 

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

well I think I fixed all the ";" problems

 

please look at it again and tell me what you think, cuz I am still getting the same error

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<title>Mailing Peep</title>
<meta http-equiv="Refresh" content="60; URL="mailing.php">
<?php
include "config.php";
mysql_connect($server, $db_user, $db_pass) or die (mysql_error()); 
$result = mysql_db_query($database, "select * from $table WHERE email = '$email'") or die (mysql_error()); 

   while ($qry = mysql_fetch_array($result)) {

$qry[email] = $email 
   

$to = "comptech21@gmail.com";
$subject = "Lubbock Cooper High School Band";
$message = "I would like to vote for Lubbock Cooper High School Band!";
$from = $email;
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Being Sent. Your vote will be sent ever 60s or in 1 Minuet. What ever e-mail you entered will be used as the returend address. Please do not close this window.";
}
?>

</html>

 

-Thanks Again!

Link to comment
https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379799
Share on other sites

hey wow thanks!

 

can you help me with this one?

 

this is my "insert.php" it suppose to take the inputed address from start.php and add it to the database and redirect to mailing.php to e-mail

but it does not add the e-mail to the database, and it does not redirect.

 

here is the code

 

<?php 
include ("config.php");

// connect to the mysql server

$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());

// select the database

mysql_select_db($database)
or die ("Could not select database because ".mysql_error());

// insert the data

// always set a form condiction.....

if(isset($_POST['submit'])){

//<<<<dont post within database statements......

$email=$_POST["email"]; 

$insert = mysql_query("insert into $table values ('$email')")
or die("Could not insert data because ".mysql_error());

// print a success message
echo "E-Mail Added To Database, starting to e-mail.";
echo "<meta http-equiv=Refresh content=2; URL=mailing.php>";

}
?>

 

-Thanks a ton!

Link to comment
https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379807
Share on other sites

ok I get this error

 

Parse error: syntax error, unexpected T_STRING in /mounted-storage/home48c/sub007/sc33591-LWQU/uploads/vote/insert.php on line 15

 

here is line 15

$insert = INSERT INTO $table (field) values ('$email'));

 

I am not sure what I am doing wrong.

 

please help a poor noob

 

-Thanks Guys!

Link to comment
https://forums.phpfreaks.com/topic/74871-new-error/#findComment-380064
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.