damerit Posted September 30, 2008 Share Posted September 30, 2008 Problem: The below code of field "callersCompany" chops off the remaining fields when there is an '&' sign. For example, "Smith & Wesson". Everything after Smith is lost. Question: What php method would solve this? Or, how could I handle the passing of the '&' sign? I tried htmlspecialchars(). $fccmail=$chkemail."?importance=High&subject=".$notifTsubj." ".$row_Record['callersCompany']." - ".$row_Record['callerCity'].", ".$row_Record['callerStateProv']." - ".$row_Record['pType']." - ".$row_Record['sType']."&" Thanks. Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/ Share on other sites More sharing options...
Maq Posted September 30, 2008 Share Posted September 30, 2008 It's not the & sign, well it is but first it's the space. You need to use URLencode(). Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/#findComment-653902 Share on other sites More sharing options...
damerit Posted September 30, 2008 Author Share Posted September 30, 2008 Thank you, Maq. I did notice that a '+' sign was added between the spaces of the text using the urlencode() function. I wounder if I should use the the grep function. Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/#findComment-653933 Share on other sites More sharing options...
Maq Posted September 30, 2008 Share Posted September 30, 2008 You should see a "%20" instead of the spaces in the URL. Check out, urlencode(). You can also decode it using urldecode(). Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/#findComment-653944 Share on other sites More sharing options...
damerit Posted September 30, 2008 Author Share Posted September 30, 2008 This is solved. It was the rawurlencode() function that worked. The urlencode() function added '+' signs for spaces. How do we post this as solved? Thanks again, Maq. Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/#findComment-654050 Share on other sites More sharing options...
discomatt Posted September 30, 2008 Share Posted September 30, 2008 There's a solved button. And you want spaces as + signs if you're using it in a URL... according to standards anyways. Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/#findComment-654053 Share on other sites More sharing options...
Maq Posted September 30, 2008 Share Posted September 30, 2008 No problem, glad I could help, yeah there a topic solved button or something in the lower left hand. Link to comment https://forums.phpfreaks.com/topic/126463-solved-proper-passing-of-amp-in-text-field/#findComment-654086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.