Jump to content

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

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.