Ребят, выручайте кто знает. Вот часть кода: PHP: <?php require_once 'main_mywebsite.php'; echo <<<_END //beginning of the output <script> function checkUser(user) { if(user.value == '') { O('info').innerHTML = '' return } //ajax-request HTML params = "user=" + user.value //params will be sent to the server request = new ajaxRequest() //the object of the ajax-request request.open("POST", "checkuser.php", true) //set to the asynchronous mode request.setrequestHeader("Content-type", "application/x-www-form-urlencoded") request.setRequestHeader("Content-length", params.length) //configure the titles required for the server to be aware of the receipt request.setRequestHeader("Connection", "close") request.onreadystatechange = function() { if(this.readystate == 4)//returns control of the action until 4 is returned if(this.status == 200)//the call went well if(this.responseText!=null) O('info').innerHTML = this.responseText//In this line, using the method getElementByID is a link to ele- //the ment info, and then its innerHTML property is set to the value returned //An AJAX call. } request.send(params) } function ajaxRequest() { try {var request = new XMLHttpRequest()} catch(e1) { try {request = new ActiveXObject("Msxml2.XMLHTTP")} catch(e2){ try {request = newActiveXObject("Microsoft.XMLHTTP")} catch(e3){ request = false }}} return request } </script> <div class='main'><h3>Please enter your details to sign up</h3> _END; ?> выдает ошибку ( ! )Parse error: syntax error, unexpected '<<' (T_SL) in C:\wamp64\www\signup_mywebsite.php on line3 не пойму в чем проблема??
А не легче сделать следующее PHP: <?php require_once 'main_mywebsite.php'; ?> Код (Javascript): <script> function checkUser(user) { if(user.value == '') { O('info').innerHTML = '' return } //ajax-request HTML params = "user=" + user.value //params will be sent to the server request = new ajaxRequest() //the object of the ajax-request request.open("POST", "checkuser.php", true) //set to the asynchronous mode request.setrequestHeader("Content-type", "application/x-www-form-urlencoded") request.setRequestHeader("Content-length", params.length) //configure the titles required for the server to be aware of the receipt request.setRequestHeader("Connection", "close") request.onreadystatechange = function() { if(this.readystate == 4)//returns control of the action until 4 is returned if(this.status == 200)//the call went well if(this.responseText!=null) O('info').innerHTML = this.responseText//In this line, using the method getElementByID is a link to ele- //the ment info, and then its innerHTML property is set to the value returned //An AJAX call. } request.send(params) } function ajaxRequest() { try {var request = new XMLHttpRequest()} catch(e1) { try {request = new ActiveXObject("Msxml2.XMLHTTP")} catch(e2){ try {request = newActiveXObject("Microsoft.XMLHTTP")} catch(e3){ request = false }}} return request } </script> <div class='main'><h3>Please enter your details to sign up</h3>