Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

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

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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?
User avatar
imroue
New php-forum User
New php-forum User
 
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

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
Jay
 


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron