Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Thanked 0 Times in 0 Posts

    mail / sql insert scrip does nothing (no errors)

    hi my script wont work im not getting any errors any more bt none of the things its supposed to do are working.

    1 it wont go to the submit page when complete
    2 the image verification doesnt work
    3 emails arnt sent
    4 data not inserted in the database

    i have been looking everywhere and i can work it out? i downloaded zend and checked the code and even that had no errors??

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

    PHP Code:

    /* 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());
    $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 

    if($tname){//----> CHECK input 

    $error.="Please, go back and fill out your there name<br>\n";//----> ERROR if no input 

    $temail){//----> CHECK input 

    $error.="Please, go back and fill out your there email<br>\n";//----> ERROR if no input 

    $yname){//----> CHECK input 

    $error.="Please, go back and fill out your name<br>\n";//----> ERROR if no input 

    $yemail){//----> CHECK input 

    $error.="Please, go back and fill out your email<br>\n";//----> ERROR if no input 

    $msg){//----> CHECK input 

    $error.="Please, go back and fill out your message<br>\n";//----> ERROR if no input 

    //-------->ERROR FREE?? 
    ."Hello xxxxsomeone has posted on the site.\n\n"            
    ." ".$msg."\n\n\n\n" 

    ." ".$site_name."\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" 
    ." ".$site_url."n";
    //--->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 ( 
    $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 ---> 

    // delete the cookie so it cannot sent again by refreshing this page
    } else {
    // if verification code was incorrect then return to contact page and show error amd keep all the field fillex out



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


    any help would be great thanks

  2. #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Denver, Colorado USA
    Thanked 506 Times in 494 Posts
    Your code contains a fatal parse error -
    Parse error: syntax error, unexpected T_ELSE in ....\yourfile.php on line 126
    You should always check your web server log for errors and/or turn on full error reporting on your development system to get PHP to tell you why your code might not be working.

    For fatal parse errors, turning on full error reporting using code in your script file won't work as the code is never executed. This requires turning on full error reporting in either the php.ini or a .htaccess file.

    In your php.ini -
    error_reporting  =  E_ALL
    display_errors = On
    Stop and start your web server to get any changes made to php.ini to take effect.
    Last edited by CFMaBiSmAd; 06-03-2007 at 11:46 AM. Reason: shortened error message
    Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts