if (isset($_GET['CX']) && $_GET['CX'] == '99999')
{
// Do something
}
elseif (isset($_GET['CX']) && $_GET['CX'] == '88888')
{
// Do something else
}
else
{
// Do the default thing
}
Main Topics
Browse All TopicsHi guys-
I'm lost when it comes to PHP. 500 points to the person who helps with the PHP code for the following.
If the url variable 'CX' exists in the URL and it is equal to '99999', out put some html and javascript.
if the url variable "CX" exists in the URL and it is equal to '88888', output some other html and javascript
if the url variable 'CX' does not exists, output some default html and javascript.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
One minor note: There is an instance that your request does not cover:
CX exists, and is a value other than '99999' or '88888'. So to be more complete, we might do something like this:
if (isset($_GET['CX']) && $_GET['CX'] == '99999')
{
// Do something
}
elseif (isset($_GET['CX']) && $_GET['CX'] == '88888')
{
// Do something else
}
elseif (isset($_GET['CX']))
{
// Show an error, or take a required action
}
else
{
// Do the default thing
}
no problem, as it will echo "default", is that not what is suppose to happen?
Because it is behaving correctly on my computer, if i enter
test.php?CX=12334 --> this outputs default
test.php --> this outputs default
test.php?CX=99999 ->this outputs 99999
test.php?CX=88888 -> this outputs 88888
So the problem is....?
Business Accounts
Answer for Membership
by: nizsmoPosted on 2007-10-28 at 19:53:08ID: 20167356
<?php
$CX = $_REQUEST["CX"];
if($CX=='99999')
{
// output some html or javascript
}
else if($CX=='88888')
{
// output some html or javascript
}
else
{
// output default stuff
}
?>
Is this what you are wanting?