View previous topic :: View next topic |
Author |
Message |
kisore -
Joined: 02 Aug 2003 Posts: 1 Location: USA
|
Posted: Sat Aug 02, 2003 3:00 am Post subject: if($action=='blah) |
|
|
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 |
|
|
yupsie -
Joined: 31 Jul 2003 Posts: 5
|
Posted: Sat Aug 02, 2003 3:50 am Post subject: |
|
|
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 |
|
|
cad3 -
Joined: 12 Jun 2003 Posts: 25 Location: Hellhole City
|
Posted: Sat Aug 02, 2003 5:49 am Post subject: |
|
|
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 |
|
|
|