Jump to content

[SOLVED] passing a php variable when opening new page


dmikester1

Recommended Posts

I am working on a file directory listing and file editor.  I have a index.php file which lists directory contents and a "create new file" link which pops up a new window to create a file within the working directory.  I am popping up that new window with javascript and I'm not sure how to pass the variable containing the working directory as I do that.  Here is the line of JS code that opens the new window:

win = window.open('MikesFileEditor.php','name','height=650, width=700,toolbar=no,directories=no, status=no, menubar=no,scrollbars=no,resizable=no');

 

Any help would be greatly appreciated.  Thanks!

Mike

 

P.S. I just had an idea that I could set the filedir variable to getcwd(); in MikesFileEditor.php, but since MikesFileEditor.php is in the home directory, that won't work either.

Try adding "value=<?=$value_here?>" at the end of the file link, so it would look like "MikesFileEditor.php?value=<?=$value_here?>"

 

value is the id that MikesFileEditor.php would pull, using $_GET from the url and $value_here would be the content.

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.