Re: url string being split
| From: | Vikash Kumar | Date: | Thu, 26 Apr 2012 17:02:11 +0000 |
| Subject: | Re: url string being split | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317700@lists.php.net to get a copy of this message | ||
On 26 April 2012 22:27, Chris Stinemetz <chrisstinemetz@gmail.com> wrote:
> Hello list,
>
> I'm trying to pass a query string through $_GET but for some reason
> the array is being split on '&'. How may I avoid this so it stays
> intacted?
>
> user selection portion:
>
> while($storerow = mysql_fetch_assoc($storesresult))
> echo '<h4><a href="store.php?id=' .
> $storerow['store_subject'] . '">'
> . $storerow['store_subject'] . '</a></h4> at ' .
> date('m-d-Y h:i:s A',
> strtotime($storerow['real_time_date']));
>
> produces url string:
>
> http://westeng/forum/store.php?id=Wiser Communication, LLC
> -& - Sprague
> Ave
>
>
> print("<pre>".print_r($_GET,true)."</pre>"); ## results below
>
> Array
> (
> [id] => Wiser Communication, LLC -
> [-_Sprague_Ave] =>
> )
>
> How do I make it so the string isn't split into two elements in the
> array? I want it to stay instact.
>
You should urlencode the query parameter.
>
> Thank you,
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>