Jump to content

Communication With Php


ameliabob

Recommended Posts

I am trying to write a file on the browser side. I know that this is not allowed in JS so what I am trying to do is to get data from JS into PHP to write the file

	function Traceit(dir, whatisit){<?php		fwrite($debugFile, dir.", ".whatisit);		fclose($debugFile);?>			}

Traceit is called from a JavaScript function.Am I off in the wrong direction??

Link to comment
Share on other sites

PHP runs before the page is loaded, and once it has output the page, all the PHP code is gone.The code you just displayed, once parsed and sent to the client, will look something like this:

function Traceit(dir, whatisit){  <b>Warning:</b> Unexpected T_STRING on line <b>XX</b> in <b>/home/www/file.php</b>}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...