How to pass a variable using $_get to get the value later

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

Fri Oct 18, 2002 6:09 pm

I need to pass a variable using $_get (or anything).
The variable is actually a path such as "/path/pics"

this is what i have
$picsFolderFile = "/path/pics";

Code: Select all

<a name='myPic' onClick=goToSlideShow('<?php echo $picsFolderFile ?>'); >
          TESTIN </a>

Code: Select all

function goToSlideShow(var1)
   eval("'myhello.php?albumPath=<?php echo "$var1"; ?>','','fullscreen=1,toolbar=1,scrollbars=1, resizable=1')");}

When i do this i get unterminated string constant???

Any ideas?


Sat Oct 19, 2002 11:04 am

You're mixing Javascript and PHP! This can't be done! However, you can fix it by using
function goToSlideShow(var1)
eval("'myhello.php?albumPath=' + var1,'','fullscreen=1,toolbar=1,scrollbars=1, resizable=1')");}

That will restore it to javascript so it uses it's own variable

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 7 guests