473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

declare one variable

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
3 3583
[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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: wk6pack | last post by:
Hi, I was wondering why when I declare the dim variable outside the try statement, I could use the .dispose() function but when I declare it inside the try statement, I get Name 'varname' is not...
6
by: rick | last post by:
Noob problem. I prefer to keep all my scripts in an external '.js' file. I am currently loading the external '.js' file from the header. Problem is I would like to declare a global variable in the...
6
by: **Developer** | last post by:
Notice below I sometimes used the "A" version. I found by cut-and-try that only the "A" version would work correctly. Anyone have a suggestion of why the "W" version would not work correctly? ...
6
by: Jakob Bieling | last post by:
Hi, I recently noticed that my compiler (VC++7.1) allows me to declare variables inside the expression for an if-statement, like so: if (int i = 0) { i = 1; }
8
by: redefined.horizons | last post by:
I would like to have an array declaration where the size of the array is dependent on a variable. Something like this: /* Store the desired size of the array in a variable named "array_size". */...
6
by: John Bailo | last post by:
I created a sproc with 3 input parameters and one output parameter. I want to test it in the "Run SQL Scripts" app of Navigator. I wrote this code: DECLARE RTNDATE CHAR(10) DEFAULT ''; CALL...
1
by: ares.lagae | last post by:
- I have a typelist and I want to declare a member variable for each of the types. How can I do that? E.g. I have the typelist "typedef boost::mpl::vector<int, float> types;" and I want to declare...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
4
by: macneed | last post by:
how can i declare a variable inside a if case? if(today != recordday) { string NewRecordOfToday; } .. other work... .. .. if(today != recordday)
1
by: yu83thang | last post by:
Hi, May I know how to declare a Class in C++ window application form? Below is my code and error as shown below as well. here is my class declaration: ref class CLoadObj { public:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.