syntax error: unexpected token <

后端 未结 15 2167
一整个雨季
一整个雨季 2020-11-29 02:20

I\'ve tried many things and there\'s no way, always appears this error I tried to use only one option to see if passed, changed the call of jquery, but not.

I looked

15条回答
  •  温柔的废话
    2020-11-29 03:22

    I was also having syntax error: unexpected token < while posting a form via ajax. Then I used curl to see what it returns:

    curl -X POST --data "firstName=a&lastName=a&email=array@f.com&pass=aaaa&mobile=12345678901&nID=123456789123456789&age=22&prof=xfd" http://handymama.co/CustomerRegistration.php
    

    I got something like this as a response:


    Warning: Cannot modify header information - headers already sent by (output started at /home/handymama/public_html/CustomerRegistration.php:1) in /home/handymama/public_html/CustomerRegistration.php on line 3

    Warning: Cannot modify header information - headers already sent by (output started at /home/handymama/public_html/CustomerRegistration.php:1) in /home/handymama/public_html/CustomerRegistration.php on line 4

    Warning: Cannot modify header information - headers already sent by (output started at /home/handymama/public_html/CustomerRegistration.php:1) in /home/handymama/public_html/CustomerRegistration.php on line 7

    Warning: Cannot modify header information - headers already sent by (output started at /home/handymama/public_html/CustomerRegistration.php:1) in /home/handymama/public_html/CustomerRegistration.php on line 8

    So all I had to do is just change the log level to only errors rather than warning.

    error_reporting(E_ERROR);
    

提交回复
热议问题