myndcraft Posted November 24, 2008 Share Posted November 24, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/134111-spaces-in-http_get_vars/ Share on other sites More sharing options...
premiso Posted November 24, 2008 Share Posted November 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/134111-spaces-in-http_get_vars/#findComment-698105 Share on other sites More sharing options...
myndcraft Posted November 24, 2008 Author Share Posted November 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/134111-spaces-in-http_get_vars/#findComment-698122 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.