View Single Post

  #3 (permalink)  
Old 05-16-2006
tim
 
Posts: n/a
Default Re: Space Issue with my PHP page


MS wrote:
> I am a newbie to PHP so hopefully this is a easy question.
>
> I am pulling data off of one server, which holds our data base and
> posts it to my PHP page.
>
> I have the following code on my php page:
>
>
> $pfirstname = $_POST['NFIRST0'];
> $plastname = $_POST['NLAST0'];
> $paddress = $_POST['NSTREET0'];
> $pxaddress = $_POST['NEXTRAADDRESS0']; etc....
>
> For the $paddress variable, it is skipping anything after a space. For
> example, if the address is 1234 Main, the only data that pulls in to my
> php page would be 1234. It would skip the Main. This is also occuring
> with other variables as well.
>
> Anyone have any ideas to why this is happening?


Hi there

How are you delivering the data to your page?

It could be because spaces in post data need to be converted to
pluses(+) or %32 before delivery

If you are using php to send the data to the php page then use the
urlencode function on the data before you post it
http://uk.php.net/urlencode

Tim

Reply With Quote