473,399 Members | 4,177 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,399 software developers and data experts.

Why did this not give an error?

This line

while(!adminok && ($i>=0))

was missing a $-sign, should be while(!$adminok && ($i>=0))

Though, it did not give an error, and I do not have any adminok
elsewhere... so how come, that it accepted this, and the programme
failed instead...?

WBR
Sonnich

Dec 17 '07 #1
5 1154
This line
>
while(!adminok && ($i>=0))

was missing a $-sign, should be while(!$adminok && ($i>=0))

Though, it did not give an error, and I do not have any adminok
elsewhere... so how come, that it accepted this, and the programme
failed instead...?
Probably because error display was off and you did not provide any error
handling. Mind you, not displaying errors is good on a production
machine, as it won't help any hackers by showing internals of your code.

Furthermore, any word that is not defined as a constant and used as a
value is taken as an unquoted string. So your code actually was treated as:

while(!'adminok' && ($i>=0))

Regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Dec 17 '07 #2
On Dec 17, 9:47 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nlwrote:
This line
while(!adminok && ($i>=0))
was missing a $-sign, should be while(!$adminok && ($i>=0))
Though, it did not give an error, and I do not have any adminok
elsewhere... so how come, that it accepted this, and the programme
failed instead...?

Probably because error display was off and you did not provide any error
handling. Mind you, not displaying errors is good on a production
machine, as it won't help any hackers by showing internals of your code.
Error handling is on...
Furthermore, any word that is not defined as a constant and used as a
value is taken as an unquoted string. So your code actually was treated as:

while(!'adminok' && ($i>=0))
But this might explain it.
Dec 17 '07 #3
Error handling is on...
>
>Furthermore, any word that is not defined as a constant and used as a
value is taken as an unquoted string. So your code actually was treated as:

while(!'adminok' && ($i>=0))

But this might explain it.
I think such an unquoted string generates a warning and not an error...

--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Dec 17 '07 #4
Though, it did not give an error, and I do not have any adminok
elsewhere...
Probably because your error level is misconfigured, which - in my opinion -
means "not E_ALL || E_STRICT".
So the warning(?) that the undefined constant was taken as string has not
been displayed.
Dec 17 '07 #5
..oO(jodleren)
>Error handling is on...
Set error_reporting to E_ALL|E_STRICT in your php.ini.

Micha
Dec 17 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Danny | last post by:
I have this bit of code: SELECT itemcode, min(Price) AS minprice FROM itemlist GROUP BY itemcode; it lists the minimum price for each itemcode group. It works fine. But when I want to see...
50
by: Tomás | last post by:
#include <string> #include <iostream> using std::cout; using std::endl; void FunctionThatModifies(std::string &a) { a = "You've been modified."; }
1
by: Venkat | last post by:
Hi, Is there any way to give feedback to the application while a stored procedure execution is in progress? I am using sql server and my application is built using c#. The stored procedure tries...
1
by: Venkat | last post by:
Hi, Is there any way to give feedback to the application while a stored procedure execution is in progress? I am using sql server and my application is built using c#. The stored procedure tries...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does simple decimal arithmetic give strange results?...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.