Lamez Posted October 26, 2007 Share Posted October 26, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/ Share on other sites More sharing options...
GingerRobot Posted October 26, 2007 Share Posted October 26, 2007 You're missing the semi-colon at the end of this line: $from = $email Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-378533 Share on other sites More sharing options...
corillo181 Posted October 26, 2007 Share Posted October 26, 2007 and another one before that too. you got a few omitted semicolons Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-378540 Share on other sites More sharing options...
Lamez Posted October 28, 2007 Author Share Posted October 28, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379799 Share on other sites More sharing options...
AndyB Posted October 28, 2007 Share Posted October 28, 2007 Surely $qry = $email should be $email = $qry['email']; Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379802 Share on other sites More sharing options...
Lamez Posted October 28, 2007 Author Share Posted October 28, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379807 Share on other sites More sharing options...
Lamez Posted October 28, 2007 Author Share Posted October 28, 2007 anyone? ??? Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379967 Share on other sites More sharing options...
peranha Posted October 28, 2007 Share Posted October 28, 2007 This should get rid of the insert problem. $insert = INSERT INTO $table (field) values ('$email')"); $result = mysql_query($insert) or die ("Error in query: $insert. ".mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-379982 Share on other sites More sharing options...
Lamez Posted October 28, 2007 Author Share Posted October 28, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-380064 Share on other sites More sharing options...
Lamez Posted October 28, 2007 Author Share Posted October 28, 2007 ok I got the last error fixed what does this mean? Error in query: INSERT INTO email (field) values ('test@test.com'). Unknown column 'field' in 'field list' Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-380065 Share on other sites More sharing options...
marcus Posted October 28, 2007 Share Posted October 28, 2007 $insert = "INSERT INTO $table (`field`) VALUES('$email');"; You need a column in your database table named field to have the query execute properly. Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-380066 Share on other sites More sharing options...
peranha Posted October 28, 2007 Share Posted October 28, 2007 Replace field with the field name in your table. Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-380073 Share on other sites More sharing options...
Lamez Posted October 28, 2007 Author Share Posted October 28, 2007 oh ok I got that fixed, but it is not working right! try for your self http://uploads.lamezz.com/vote/start.php Quote Link to comment https://forums.phpfreaks.com/topic/74871-new-error/#findComment-380076 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.