Jump to content

[SOLVED] passing a php variable when opening new page


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.