Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Variable Issue...

Status
Not open for further replies.

HilarySJ

Technical User
Jul 12, 2001
4
US
I am running a CGI script that has a chat script running within it.

It works great...however, I want to be able to set up a drop down box that allows people to do *actions* to another person chatting in the room.

For example:

JaneDoe gives JohnDoe a hug.

However, the variable to get "JohnDoe" (or the selected chatter) to show up is:

%$HN

Because of the "$", the CGI script reads "%$HN" to be an unknown variable and I end up with this:

JaneDoe gives % a hug.

Is there any way to get the script to read %$HN just 'as is' rather than trying to interpret it as a blank variable? Is there a way to define the variable leaving the $ intact?

I tried putting something like this in:

$personal = "%$HN"

...but it just goes to read that $HN as an undefined variable becoming an unending circle lol!

Any help would be very much appreciated!

Thank you!!!

~Hilary~
 
Instead of having this:

[tt]
$personal = "%$HN"
[/tt]

Have this:

[tt]
$personal = "\%$HN";
[/tt]

The backslash is called escaping the the value. So you escape the value and make it print literally.

Hope this helps.

-Vic
vic cherubini
krs-one@cnunited.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash
====
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top