Bluehost.com Web Hosting $6.95

'&' Sign in _GET Parameter

This is a discussion on '&' Sign in _GET Parameter within the PHP General forums, part of the PHP Programming Forums category; Hello All, I am using an application where I retrieve user profile from a MySQL DB using the Company Name . ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-22-2003
Pushpinder Singh Garcha
 
Posts: n/a
Default '&' Sign in _GET Parameter

Hello All,

I am using an application where I retrieve user profile from a MySQL
DB using the Company Name . I pass the name of the company to the PHP
script as a '$_GET' parameter. e.g. when the name of the company is
'IBM'. , the URL with the query string would look like :
http://masterstream.com/CRM/full_profile_1.php?name=IBM

Now one of the records had a name : PSG & Inc. , in this case the URL
with the query string would look like
http://masterstream.com/CRM/full_pro...=PSG%20&%20Inc.

However in the case of the latter I am not able to pull out any records
from the MySQL database. It says that "no records with the name were
found". I went ahead and tweaked the name of the company, to remove
the "&" sign in 'PSG & Inc.' Now the query works fine. Can some one
throw some light here. I am sure something minor is to be done when
passing the name of the company in the parent script.

Thanks in advance
--Pushpinder



Reply With Quote
  #2 (permalink)  
Old 08-22-2003
Gabriel Guzman
 
Posts: n/a
Default Re: [PHP] '&' Sign in _GET Parameter

On Fri, 2003-08-22 at 12:05, Pushpinder Singh Garcha wrote:
> Hello All,
>
> I am using an application where I retrieve user profile from a MySQL
> DB using the Company Name . I pass the name of the company to the PHP
> script as a '$_GET' parameter. e.g. when the name of the company is
> 'IBM'. , the URL with the query string would look like :
> http://masterstream.com/CRM/full_profile_1.php?name=IBM
>
> Now one of the records had a name : PSG & Inc. , in this case the URL
> with the query string would look like
> http://masterstream.com/CRM/full_pro...=PSG%20&%20Inc


no, this is not how it should look... the '&' in the above query string
is saying the variable 'name' ends and a new variable follows. If you
are submitting this in a form using method=get... it should look
something like:

?name=PSG+%26+Inc

if you are really passing this in a form using method=get, then this
should be handled automatically.

how are you accessing the passed variable?

$_GET['name'] ??



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:56 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0