Page 1 of 1

Javacript inside PHP

Posted: Fri Jul 27, 2007 1:11 am
by iknownothing
Hey Guys,

I have the following line:

Code: Select all

$theurl = '?><script>window.location</script><?';
does anyone know how I can make this work. The reason why, is because the Javacript Get URL is the only one that shows Anchor tags, which I then need to convert into PHP to strip the string.


Thanks.

Posted: Fri Jul 27, 2007 6:32 am
by volka
php runs on the server. All output (echo, print, readfile ...) is sent to the client as repsonse to the request. The client parses the response and doesn't care if php did or didn't produce that data. The client might execute the javascript code in the response data.