PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Wed Jul 16, 2003 8:24 pm
I was wondering if it's possible to send a 'dead' or 'ghost' variable to a PHP page... like this... my_php_page.php?BOB
...and then in the PHP page check if BOBs 'ghost' is there?
I've tried
but it tells me that BOB doesn't exist. Is there another way of checking?
There is a reason for me wanting to do this but I don't want to do something like... my_php_page.php?BOB=1 ...even though I know it will work.
Any ideas?
m@ndio
Forum Regular
Posts: 163 Joined: Fri Jun 06, 2003 12:09 pm
Location: UK
Post
by m@ndio » Thu Jul 17, 2003 2:23 am
so you wana send a variable with no value?
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Thu Jul 17, 2003 2:46 am
er.. yep. That sums it up nicely.
Can it be done?
Tubbietoeter
Forum Contributor
Posts: 149 Joined: Fri Mar 14, 2003 2:41 am
Location: Germany
Post
by Tubbietoeter » Thu Jul 17, 2003 3:07 am
sure you can
thesite.php?BOB=&
m@ndio
Forum Regular
Posts: 163 Joined: Fri Jun 06, 2003 12:09 pm
Location: UK
Post
by m@ndio » Thu Jul 17, 2003 8:19 am
that wont work, as php will convert this to a string value conaining nothing.
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Thu Jul 17, 2003 9:53 am
Basically I'm just trying to make things look tidy.
Instead of the url looking something like news.php?latest=1, or news.php?latest=true.... I'm just trying to see if it's possible to just use news.php?latest
..maybe I should checkout the $POST variables and stuff to see if that can see a 'ghost' variable...... or even rip apart the url in PHP and see what's at the end of it.
Any suggestions would be cool
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Thu Jul 17, 2003 11:08 am
Ah... sweet. Just what I was after... good 'ol PHP
Cheers mate.
jamesm87
Forum Newbie
Posts: 21 Joined: Sat May 31, 2003 1:54 pm
Location: London, UK
Post
by jamesm87 » Thu Jul 17, 2003 1:03 pm
Surly to check Isset you have to do it in an
If Clause
eg
Code: Select all
<?php
if (isset($ghost))
{
blah
}
?>
But then again I might just have the wrong Idea!
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Thu Jul 17, 2003 1:30 pm
jamesm87 wrote: Surly to check Isset you have to do it in an If Clause
Yeah I know I was just being lazy and lot typing all the code
?>