Jump to content

Recommended Posts

I understand this is breaking against good form, but hopefully someone can help me out.  For an internal application a jsp page (not written by me) is calling a php page.  The link is formatted like this

 

javascript:openNotesWindow('http://cumulus/Firestar/notes.php?recordID=6626&recordName=FA08021_FPO.jpg&cumulusUser=cumulus&recordPath=:/Volumes/Stock/Photodisc/Business%20&%20Industry%20Illustrated/FPO:FA08021_FPO.jpg')

 

The problem is that the 'space' (%20) is causing a problem when I load my variables

	$theVars = $HTTP_GET_VARS;

$recordID = $theVars["recordID"];
$action = $theVars["action"];
$recordName = $theVars["recordName"];
$cumulusUser = $theVars["cumulusUser"];
$noteText = $theVars["noteText"];
$noteSubject = $theVars["noteSubject"];
$submit = $theVars["submit"];
$noteIDX = $theVars["noteIDX"];
$recordPath = $theVars["recordPath"];

 

recordPath is now equal to ':/Volumes/Stock/Photodisc/Business' rather than ':/Volumes/Stock/Photodisc/Business%20&%20Industry%20Illustrated/FPO:FA08021_FPO.jpg'

 

Is there a way to change the way I am handling the "getting" of the variables to not break the path string? 

 

If there isn't can anyone think of a way to manipulate the array '$theVars' to essentially rebuild the full and proper path?

 

 

Link to comment
https://forums.phpfreaks.com/topic/134111-spaces-in-http_get_vars/
Share on other sites

convert the spaces to dashes or underscores...then when you retrieve it either account for that or convert them back to spaces.

 

Also $HTTP_GET_VARS is long since deprecated. Use $_GET instead.

 

I was originally going to do as you suggested by doing some string manipulation prior to creating the link, but my knowledge of java is zero and thats the page which is generating the link.

 

I will, though if I need to figure it out, but I was hoping there was a way to rebuild the path in the php page itself.

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.