FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » Newbie Question - Ignore missing ? links in URL
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Newbie Question - Ignore missing ? links in URL [message #33566] Thu, 07 September 2006 16:01 Go to previous message
rgraylint is currently offline  rgraylint   United States
Messages: 2
Registered: September 2006
Location: US
Karma:
Junior Member
I'm using links (correct term?) in the URL to pass in data. For example: www.site.com/index.php?phone=555-1212

Everything works fine when I use the following code and pass in a 'phone' value as above.
<?php
$ph = $_GET['phone'];
echo $ph;
?>

The problem is I don't always want to require a 'phone' value in the URL. If someone visits the page with: "www.site.com/index.php" I get this error complaining about the attempt to $_GET the 'phone' value when none exists:

Notice: Undefined index: e in p:\WWW\site.com\index.php on line (##)

I'm trying to make the page work (without errors) even if the URL doesn't contain the 'phone' link value it is expecting. I need a way to test if the 'phone' value was passed in with the URL before I try to assign it to a variable. Is this possible?

Thanks for your help! - Robert
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: how to add javascript in php
Next Topic: need help. please!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Sep 30 09:22:06 GMT 2024

Total time taken to generate the page: 0.06204 seconds