Jump to content

Recommended Posts

Hi im gettting the below error on this for, line 70 looks ok to me, i have typed "ine 70 where it is, can any one help?

 

 

 

Parse error: syntax error, unexpected T_VARIABLE in /home/tyspicsc/public_html/posthate/test submit/submit_action.php on line 70

 

<html> 
<head> 
</head> 
<body> 

<?php 
/* grabs the POST variables and puts them into variables that we can use */ 
$time = date("d/m/Y ", time());
$date = date("d/m/Y H:i:s", time());
$tname=$_POST['tname']; 
$temail=$_POST['temail']; 
$yname=$_POST['yname']; 
$yemail=$_POST['yemail']; 
$cat=$_POST['cat'];
$msg=$_POST['mag']; 
$site_name=$_POST["mysite.com"];
$site_email=$_POST["mail@mail.com"]; 
$site_url=$_POST["www.mysite.com"]; 
$verif_box = $_REQUEST["verif_box"];

// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
// if verification code was correct send the message and show this page

//---------VALIDATION--------> 
    if($tname){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your there name<br>\n";//----> ERROR if no input 
            } 

    if($temail){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your there email<br>\n";//----> ERROR if no input 
            } 

    if($yname){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your name<br>\n";//----> ERROR if no input 
            } 

    if($yemail){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your email<br>\n";//----> ERROR if no input 
            } 

    if($msg){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your message<br>\n";//----> ERROR if no input 
            } 


//-------->ERROR FREE?? 
    if($error==""){ 
        echo 'submit.php'; 
//---------------------------------- 
$mailContent="" 
            ."Hello xxxxsomeone has posted on the site.\n\n"            
		 ." ".$msg."\n\n\n\n" 

            ." ".$site_name."\n" 
		."--------------------------\n" 
            ." ".$site_url."\n"
//---------------------------------- 
$toAddress="mysite@mail.com/* this is line 70 */ 
$subject="my subject"; /* change this! */ 
$recipientSubject="a new post"; /* change this! */ 
$receiptMessage = "" 
."Hello ".$tname." you.\n\n"             ." ".$msg."\n\n\n\n" 

            ." ".$site_name."\n" 
		."--------------------------\n" 
            ." ".$site_url."\n"
//---------------------------------- 
mail($email, $subject, $receiptMessage,"From:$toAddress"); 
//---------------------------------- 
mail($toAddress,$recipientSubject,$mailContent,"From:$email"); 
//--->echo $mailContent; 

////////////////////////////////////////  CONNECT TO MYSQL DB  //////////////////// 
// OPEN CONNECTION ---> 
$connection=mysql_connect("localhost","user", "pass") or die("Unable to connect!"); /* change this! */ 

mysql_select_db("database") or die("Unable to select database!"); /* change this! */ 

//  EXECUTE QUERY ---> 
$query="INSERT INTO name ( 
            name, 
            email, 
            msg, 
            date, 
            category, 
            yname, 
            yemail, 
            time,) 
        VALUES( 
            '".$tname."', 
            '".$temail."', 
            '".$msg."', 
            '".$date."', 
            '".$cat."', 
            '".$yname."', 
            '".$yemail."', 
            '".$time."',)"; 
//////-----> 
$result=mysql_query($query) or die("Error in query:".mysql_error()); 
//if ($result) 
    //echo mysql_affected_rows()." row inserted into the database effectively."; 

//  CLOSE CONNECTION ---> 
mysql_close($connection); 

// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
} else {
// if verification code was incorrect then return to contact page and show error
header("Location:".$_SERVER['HTTP_REFERER']."?tname=$tname&temail=$temail&yname=$yname&yemail=$yemail&wrong_code=true");
exit;

/////////////////////////////////////////////////////////////////////////////////// 
        } 
    else{ 

            print "Sorry, but the form cannot be sent until the fields indicated are filled out completely - <br>\n"; 
            print "$error<br>\n"; 
            print "<br>\n"; 
            print "<br>\n"; 
            print "Please use your \"Back\" button to return to the form to correct the omissions.  Thank you.<br>\n"; 
        } 

?> 
</body> 
</html> 

Thank you so much i got a few more errors after that. just missing some surly brackets, but nw i have 2 more problems

 

1:) it wont go to the submit page when complete

2:) the image verification doesnt work

 

 

here is my code, i have explained the image verification in the comments, ( i know it works because im using it on another script)

 

 

<html> 
<head> 
</head> 
<body> 

<?php 
/* grabs the POST variables and puts them into variables that we can use */ 
$time = date("d/m/Y ", time());
$date = date("d/m/Y H:i:s", time());
$tname=$_POST['tname']; 
$temail=$_POST['temail']; 
$yname=$_POST['yname']; 
$yemail=$_POST['yemail']; 
$cat=$_POST['cat'];
$msg=$_POST['mag']; 
$site_name=$_POST["mysite.com"];
$site_email=$_POST["mail@mail.com"]; 
$site_url=$_POST["www.mysite.com"]; 
$verif_box = $_REQUEST["verif_box"];

// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
// if verification code was correct send the message and show this page 

//---------VALIDATION--------> 
    if($tname){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your there name<br>\n";//----> ERROR if no input 
            } 

    if($temail){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your there email<br>\n";//----> ERROR if no input 
            } 

    if($yname){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your name<br>\n";//----> ERROR if no input 
            } 

    if($yemail){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your email<br>\n";//----> ERROR if no input 
            } 

    if($msg){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your message<br>\n";//----> ERROR if no input 
            } 


//-------->ERROR FREE?? 
    if($error==""){ 
        echo 'submit.php'; 
//---------------------------------- 
$mailContent="" 
            ."Hello xxxxsomeone has posted on the site.\n\n"            
		 ." ".$msg."\n\n\n\n" 

            ." ".$site_name."\n" 
		."--------------------------\n" 
            ." ".$site_url."\n";
//---------------------------------- 
$toAddress="mysite@mail.com";/* this is line 70 */ 
$subject="my subject"; /* change this! */ 
$recipientSubject="a new post"; /* change this! */ 
$receiptMessage = "" 
."Hello ".$tname." you.nn"             ." ".$msg."nnnn" 

            ." ".$site_name."n" 
		."--------------------------n" 
            ." ".$site_url."n";
//---------------------------------- 
mail($email, $subject, $receiptMessage,"From:$toAddress"); 
//---------------------------------- 
mail($toAddress,$recipientSubject,$mailContent,"From:$email"); 
//--->echo $mailContent; 

////////////////////////////////////////  CONNECT TO MYSQL DB  //////////////////// 
// OPEN CONNECTION ---> 
$connection=mysql_connect("localhost","user", "pass") or die("Unable to connect!"); /* change this! */ 

mysql_select_db("database") or die("Unable to select database!"); /* change this! */ 

//  EXECUTE QUERY ---> 
$query="INSERT INTO name ( 
            name, 
            email, 
            msg, 
            date, 
            category, 
            yname, 
            yemail, 
            time,) 
        VALUES( 
            '".$tname."', 
            '".$temail."', 
            '".$msg."', 
            '".$date."', 
            '".$cat."', 
            '".$yname."', 
            '".$yemail."', 
            '".$time."',)"; 
//////-----> 
$result=mysql_query($query) or die("Error in query:".mysql_error()); 
//if ($result) 
    //echo mysql_affected_rows()." row inserted into the database effectively."; 

//  CLOSE CONNECTION ---> 
mysql_close($connection); 

// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
} else {
// if verification code was incorrect then return to contact page and show error amd keep all the field fillex out
header("Location:".$_SERVER['HTTP_REFERER']."?tname=$tname&temail=$temail&yname=$yname&yemail=$yemail&wrong_code=true");
exit;

/////////////////////////////////////////////////////////////////////////////////// 
        } 
    else{ 

            print "Sorry, but the form cannot be sent until the fields indicated are filled out completely - <br>n"; 
            print "$error<br>n"; 
            print "<br>n"; 
            print "<br>n"; 
            print "Please use your "Back\" button to return to the form to correct the omissions.  Thank you.<br>\n"; 
        } 

?> 
</body> 
</html> 

 

 

so now im not getting errors and not actually getting the emails and its noty checking the image??

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.