By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,441 Members | 998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,441 IT Pros & Developers. It's quick & easy.

declare one variable

P: n/a
hello.
in my linux machine in the php.ini i have register_globals on
i one page i have:

<?php
if($que){
echo($que);
}
?>

and appears this error:
Notice: Undefined variable: que in c:\inetpub\wwwroot\web\kk.php on line 2

why?
how can i solve it?

(i am beggining wht php,sorry)
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
[ZaToPeK] wrote:
hello.
in my linux machine in the php.ini i have register_globals on
i one page i have:

<?php
if($que){
echo($que);
}
?>

and appears this error:
Notice: Undefined variable: que in c:\inetpub\wwwroot\web\kk.php on line 2

why?
how can i solve it?


if(isset($que) && $que != '') {
echo $que;
}

:)

Regards,
Johan

Jul 17 '05 #2

P: n/a
Check your php.ini file and change error_reporting = E_ALL ^ E_NOTICE so php
wont check for undeclared variable. if you want to keep php to repport all,
then you have to initialise your variable.
$que = "" ; or $que = Null; //at the beginning

Savut

"[ZaToPeK]" <bo**@excite.com> wrote in message
news:e0**************************@posting.google.c om...
hello.
in my linux machine in the php.ini i have register_globals on
i one page i have:

<?php
if($que){
echo($que);
}
?>

and appears this error:
Notice: Undefined variable: que in c:\inetpub\wwwroot\web\kk.php on line 2

why?
how can i solve it?

(i am beggining wht php,sorry)

Jul 17 '05 #3

P: n/a
echo @$que;

Don't need to check to see if the variable is set. If it's empty, echo
outputs nothing.

Uzytkownik "[ZaToPeK]" <bo**@excite.com> napisal w wiadomosci
news:e0**************************@posting.google.c om...
hello.
in my linux machine in the php.ini i have register_globals on
i one page i have:

<?php
if($que){
echo($que);
}
?>

and appears this error:
Notice: Undefined variable: que in c:\inetpub\wwwroot\web\kk.php on line 2

why?
how can i solve it?

(i am beggining wht php,sorry)

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.