Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder low tech's Avatar
    Join Date
    Dec 2009
    Posts
    851
    Thanks
    172
    Thanked 93 Times in 93 Posts

    unexpected ';' OR unexpected T_IF

    Hi all

    after all the hard work ,now I get this

    unexpected ';' a---- nd IF I remove that I get

    unexpected T_IF


    Any help here would be fantastic ---- I have no idea:-(


    The offending llines are

    PHP Code:
    $nm mysql_num_rows($the_result);
    if (
    $nm == 0
    I tried to hightlight them but of course that didn't work hahahhaa

    PHP Code:
    $res fgets ($fp1024);
        if (
    strcmp ($res"VERIFIED") == 0) {
                
    // check the payment_status is Completed
                // on error notify
            
    if (($payment_status == ‘Completed’) && 
                (
    $receiver_email == $notify_email) && // receiver_email === yr account email 
                
    ($mc_gross == $amount_required ) && //payment === yr reqd payment 
                
    ($mc_currency == $mycurrency)) {
        
                
    //create MySQL connection
                
    $Connect = @mysql_connect($DB_Server$DB_Username$DB_Password)
                or die(
    "Couldn't connect to MySQL:<br>" mysql_error() . "<br>" mysql_errno());

                
    //select database
                
    $Db = @mysql_select_db($DB_DBName$Connect)
                or die(
    "Couldn't select database:<br>" mysql_error(). "<br>" mysql_errno());

                
    //check if transaction ID has been processed before
                // on error notify
                
    $checkquery "SELECT txn_id FROM users WHERE txn_id='".$txn_id."'";
                
    $the_result mysql_query($checkquery$Connect) or die("Duplicate txn id check query failed:<br>" mysql_error() . "<br>" // mysql_errno());



                
    $nm mysql_num_rows($the_result);
                if (
    $nm == 0)[ {




                    
    ////execute query
                    
    mysql_query(CODE THAT GOES HERE IS TESTE)
                    
                    
    // PAYMENT VALIDATED & VERIFIED!  

                    
    $mail_From "From: me@mybiz.com";
                    
    $mail_To "me@mybiz.com";
                    
    $mail_Subject "VERIFIED IPN";
                    
                    
    $message "  
     
                    Thank you for registering  "
    ;  

                    
    $headers 'From:myself@mybiz.com' "\r\n"
                    
    mail($mail_To$mail_Subject,  $message "\n\n" $mail_From$headers);
                }else{
                    
    // DUPLICATE: error notify 
                    
    mail($notify_email"VERIFIED DUPLICATED TRANSACTION""$user_email\n $result\n $payment_status\n $receiver_email\n $mc_gross\n $mc_currency");
                }
            }else {
                
    // PAYMENT: error notify
                
    mail($notify_email"Payment PROBLEM""$user_email\n $payment_status\n $reciever_email\n $mc_gross\n $mc_currency");
            }
        }
        elseif (
    strcmp ($res"INVALID") == 0) { OTHER CODE HERE
    LT
    Last edited by low tech; 11-07-2010 at 12:52 PM.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,248
    Thanks
    12
    Thanked 340 Times in 336 Posts
    I’d say it’s because you commented out mysql_errno().
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • Users who have thanked Dormilich for this post:

    low tech (11-07-2010)

  • #3
    Regular Coder low tech's Avatar
    Join Date
    Dec 2009
    Posts
    851
    Thanks
    172
    Thanked 93 Times in 93 Posts
    Hi Dormilich


    Holy smokes how did you see that and how did I get that there hahhaa

    unblievable

    you got eys like an eagle:-)

    thanks

    off to test

    EDIT
    yep now I have a kind of working code:-)

    magic
    LT
    Last edited by low tech; 11-07-2010 at 10:54 AM.

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,248
    Thanks
    12
    Thanked 340 Times in 336 Posts
    Quote Originally Posted by low tech View Post
    Holy smokes how did you see that and how did I get that there hahhaa
    let’s call it: "Experience"


    maybe a more accurate answer is: because I learned to think like a PHP Parser.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Posting Permissions

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