Uncaught syntaxerror: unexpected token php

I tired using the proxy solution in

Origin http://localhost is not allowed by Access-Control-Allow-Origin.?

and on the file proxy.php I have

In main I have




Title









Upcoming Movies

Now I call main.html in my localhost in Google chrome and the console says error on first line of php. I'm not sure what the problem is. The error message is: Uncaught SyntaxError: Unexpected token <

Uncaught syntaxerror: unexpected token php

3 Years Ago

Dear ,

We have an billing script when we enter value on the submition page it will create an recipt number and other details
we have entered in the form on the page recipt.php that was the first code. Past year the script was working fine but
now it was showing us an error in the concole of our browser " Uncaught SyntaxError: Unexpected token ;"

We don't know what to do or how to resolve this isse in the recipt.php page was are pushing customer mobile number

and an message to tsms.php we have included our both codes below if any one can help that will be a greate help
for us as because of this issue the billing process are stopped completely so please help ..

our recipt.php which will show recipt details and also trigger sms to tsms.php

select("select * from `cus_scheme` where `customer_id` = '$customer_id' AND `cus_scheme_id` = '$cus_scheme_id' ",false);

            if( empty($check_scheme_exist) ){  
            //header("location:a_manage_payment.php"); 
            }else{    

                $scheme_payment = $con->select("select * from `payment` where `payment_id`='$payment_id' ",false);
                if(!empty($scheme_payment)){
                $scheme_payment_receipt_no = $scheme_payment['p_receipt_no'];
                $_SESSION['receipt_no'] = $scheme_payment_receipt_no;
                $scheme_payment_date = $scheme_payment['p_paid_date'];
                $scheme_payment_name = $scheme_payment['customer_id'];
                $scheme_payment_name = $con->select("select * from `customer` where `customer_id` = '$scheme_payment_name' ",false);
                if(empty($scheme_payment_name)){ header("location:a_manage_payment.php"); }else{  
                $scheme_payment_fname = $scheme_payment_name['fullname'];
                $scheme_payment_amount = $scheme_payment['p_amount'];
                //$scheme_payment_weight = $scheme_payment['p_gold_weight'];
                //$scheme_payment_gold_rate = $scheme_payment['current_gold_rate'];
                $sPayment = $con->select("select count(*) as tot from `payment` where `cus_scheme_id` = '$cus_scheme_id' ",false);
                $countIns = $sPayment['tot']; 
                $mobile = $scheme_payment_name['phone_1'];
                $messages  = "Dear ".$scheme_payment_fname.", Receipt NO:".$scheme_payment_receipt_no." payment received KWD: ".$scheme_payment_amount." Thanks"; 

                }

                }else{
                    //header("location:a_manage_payment.php"); 
                }

            }

    }

        else{ 
        header("location:s_apsearch.php");
    }

?>


    
        
        Receipt
        
        
        
        

        
        

         
        
        
        
        

        
        
        
        
        

        

       

    

    

        
        


tsms.php SMS PHP CODE

So please help me it was too urgent

Recommended Answers

I don't see it but there are hundreds of lines of code here. You as the author, developer or maintainer need to narrow it down to the line that is throwing this error.

Jump to Post

All 3 Replies

rproffitt 2,331 "Nothing to see here." Moderator

3 Years Ago

Uncaught syntaxerror: unexpected token php

3 Years Ago

I have spend hours to resolve this issue but didn't got any answer from google that's why I have posted this here if your know how to resolve help me

rproffitt 2,331 "Nothing to see here." Moderator

3 Years Ago

@annya. Then it's old school debugging. I take it you didn't get any line number or full line of text on the error. This means you get to go old school on the problem. That is, insert some output to a log file or screen (I supplied a link how) so you can track down what line is failing.

Using any of the output methods at https://www.w3schools.com/js/js_output.asp you place (psuedo-code here) lines where you suspect it failing like this: console.log("At line 100"). Eventually you find the line that fails and either you see the issue or have to log the variables on the line to see why it complains.

It's work but something a programmer does when the script doesn't show a line number or content when it fails.

Reply to this topic

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.