javascript - regarding CSRF_TOKEN=XXXXX error in php -
csrf_token=xxxxxxx error occured during loading of page , new html starts automatically after completion of html tag includes javascript , csrf_token generates in it, how solve prob? here below java script automatically generates during loading of page
</body> </html>(here main html tag finishes) <html><script language="javascript"> var tokenname = 'csrf_token'; var tokenvalue = '8d3addc012a4f77e390b4cef8a95a7d81f9b250f'; function updatetags() { var = document.all ? document.all : document.getelementsbytagname('*'); var len = all.length; (var = 0; < len; i++) { var e = all[i]; updatetag(e, 'src'); updatetag(e, 'href'); } } function updateforms() { var forms = document.getelementsbytagname('form'); (i = 0; < forms.length; i++) { var html = forms[i].innerhtml; html += '<input type=hidden name=' + tokenname + ' value=' + tokenvalue + ' />'; forms[i].innerhtml = html; } } function updatetag(element, attr) { var location = element.getattribute(attr); if (location != null && location != '' && ishttplink(location)) { var index = location.indexof('?'); if (index != -1) { location = location + '&' + tokenname + '=' + tokenvalue; } else { location = location + '?' + tokenname + '=' + tokenvalue; } element.setattribute(attr, location); } } function ishttplink(src) { var result = 0; if (src.substring(0, 4) != 'http' || src.substring(0, 1) == '/') { result = 1; } return result; } updatetags(); updateforms(); </script></html>
Comments
Post a Comment