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

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

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

Postby imroue » 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("window.open('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?

Jay

Postby Jay » 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("window.open('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


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests