Jump to content

How do I execute a PHP page from HTML using javascript?


megetron

Recommended Posts

Hello all,

 

I am trying to create a link tracker.

 

I created a javascript file : trackincode.php?lid=1 and in it this line:

Response.Write("document.write(\"Hello World\");");

Now, I want to call this file from an HTML file, so I copy/paste this HTML:

<script language='javascript'  type='text/javascript'>

var r=document.referrer;

var counter = new Object();

counter.src = 'http://domain.com/trackingcode.php?lid=7&r='+r;

</script><script src=http://domain.com/trackingcode.php?lid=7>

</script>

 

unfortunattly the code does not display the text "Helloo World" and the file is not executed... Any suggestions?

 

NOTE: I know this code works on another servers...

 

Response.write() - is this wrapped in ASP or something?

please ignore "Response.Write"...my mistake.

the full code is this:

<?echo "document.write(\"Hello World\");";?>

Here you have a link to the file (I rename the file to "get_trackingcode1.php")

http://affilinn.co.il/get_trackingcode1.php?aid=1&linkid=N1

 

I expect to see "Hello World" text when calling the page using javascript.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.