Jump to content

Spaces in $HTTP_GET_VARS


myndcraft

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.

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.