LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 05-21-2007, 03:25 AM   #1
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Rep: Reputation: 15
ampersand problem in cgi script...


Hi ,

I am executing a script that call in a request....to a diff server...

When i am passing the parameters its not working properly..

Suppose i send ...

"pageid=first"."\u0026"."serv=1.0"


in the server log the query string is ...

"pageid=first0026serv=1.0"


Of i sent it as

"pageid=first"."&"."serv=1.0"

then the query string is ...
"pageid=first" the second part is getting truncated..

if append 2 &'s the the reuslt would be...

"pageid=first&&serv=1.0"


but what i want is ....

"pageid=first&serv=1.0"


Any idea where i might have gone wrong...

Regards
 
Old 05-21-2007, 03:40 AM   #2
nkoplm
Member
 
Registered: May 2005
Distribution: Fedora
Posts: 92

Rep: Reputation: 15
what language are you using?
 
Old 05-21-2007, 04:03 AM   #3
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nkoplm
what language are you using?

I am using perl language
 
Old 05-21-2007, 04:45 AM   #4
nkoplm
Member
 
Registered: May 2005
Distribution: Fedora
Posts: 92

Rep: Reputation: 15
try using ' quotes instead of "

ie

$url = 'pageid=first&serv=1.0';

if you have variables imbeded in your string then you will have to figgure out the difference between ' and ", just google it, theres lots of info im sure
 
Old 05-21-2007, 05:07 AM   #5
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nkoplm
try using ' quotes instead of "

ie

$url = 'pageid=first&serv=1.0';

if you have variables imbeded in your string then you will have to figgure out the difference between ' and ", just google it, theres lots of info im sure
I tried usind ' insted of "

but the result is ....
pageid=first and the serv part is missing...

I am using LPW:UserAgent to send the request to the server...
 
Old 05-21-2007, 06:45 AM   #6
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Original Poster
Rep: Reputation: 15
Question

I made some change...made some advancement...& is done an now it is =

"pageid=" .$pageid.'&'."serv".$serv

it gives....

pageid=first&serv1.0

but when in insert the '= '...

"pageid=" .$pageid.'&'."serv".'='.$serv

it gives only

pageid=first...

There has to be some explanation for this..
 
Old 05-22-2007, 03:12 AM   #7
nkoplm
Member
 
Registered: May 2005
Distribution: Fedora
Posts: 92

Rep: Reputation: 15
just try

'pageid='.$pageid.'&serv='.$serv
 
  


Reply

Tags
perl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ampersand problem in cgi script... Sherlock Programming 1 05-22-2007 08:42 AM
sendmail and cgi script problem snapperhead Linux - Networking 0 02-13-2007 01:10 PM
CGI-Script Problem shipon_97 Linux - Newbie 1 05-09-2006 03:30 AM
CGI-script problem on Apache2 jkt2000 Linux - Networking 3 01-28-2005 05:38 AM
alternative way to write an ampersand (or another fix to my superkaramba problem)? fibbi Linux - Software 1 04-23-2004 03:51 PM


All times are GMT -5. The time now is 11:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration