Jump to content

PHP and Javascript


k3Bobos

Recommended Posts

I'm reasonably new to both PHP and Javascript (Microsoft background.......I know, it's my own fault!) but have managed to get my galleries up and running using PHP.

Now I want to call a javascript open.window function passing it the image file name and size.

All goes well until my image filename has a space in it............. (no, I can't just remove them)

I've tried every combination of ' and " and building variables rather than putting it all in-line, to no avail.

This is the last attempt before I threw the PC out the window :-

$varbuildit= "loc=$base$dir&image=$dirm$imagetext[0]";
$varahref ="javascript:OpenPage('./disp-JS.php?$varbuildit','window1',$width,$height)";

need to pass (as an example)

javascript:OpenPage('./disp-JS.php?loc=./pics/big/&image=./pics/medium/Hello World.jpg','window1',600,400)

What is does is try this :-

javascript:OpenPage('./disp-JS.php?loc=./pics/big/&image=./pics/medium/Hello

Any pointers would be VERY appreciated!

Thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/4644-php-and-javascript/
Share on other sites

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.