if($action=='blah)

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
kisore
-


Joined: 02 Aug 2003
Posts: 1
Location: USA

PostPosted: Sat Aug 02, 2003 3:00 am    Post subject: if($action=='blah) Reply with quote

Code:
<?
if($action=='blah')
{
echo "blah"
}
?>


and when i got to test.php i got error
Quote:
Notice: Undefined variable: action in C:\Documents and Settings\kisore\Desktop\www\test.php on line 3


what's the problem? 8O please help! it seems like the action tag doens't work.
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
yupsie
-


Joined: 31 Jul 2003
Posts: 5

PostPosted: Sat Aug 02, 2003 3:50 am    Post subject: Reply with quote

maybe you should go to test.php with the following URL:

test.php?action=blah

if you do so already maybe your register_globals is set to off in your php.ini

you can turn it on but you can also use the so called superglobals

then your code will be:
Code:

<?
if($_GET['action']=='blah')
{
echo "blah"
}
?>
Back to top View user's profile Send private message
cad3
-


Joined: 12 Jun 2003
Posts: 25
Location: Hellhole City

PostPosted: Sat Aug 02, 2003 5:49 am    Post subject: Reply with quote

you hav 2 define the variable action
if it is in the url
example:
http://localhost/file.php?action=blah

then u should use the parse_url() function
Code:

parse_url($_SERVER['QUERY_STRING']);

then continue wit da rest of da code

if not then u should jus define the variable manually
like
$blah = wateva u want;
$action = $blah;
_________________
Dark Dragon
        CAD3|net
Back to top View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group