473,788 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1167
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...@kra tz.maardanzonde rditstuk.nlwrot e:
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(!'admino k' && ($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
1537
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 the last name of the person who bought this item, it give me that aggregate error saying the lastname is not part of the aggregate function.
50
2763
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
394
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 to delete around 200K records and there is no way to give the progress of the deletion to the user. Some times i get time out error as it takes much time. Is there any way to give feedback as well to keep alive the stored procedure execution...
1
2509
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 to delete around 200K records and there is no way to give the progress of the deletion to the user. Some times i get time out error as it takes much time. Is there any way to give feedback as well to keep alive the stored procedure execution...
3
1996
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does simple decimal arithmetic give strange results? ----------------------------------------------------------------------- For example, 5*1.015 does not give exactly 5.075 and 0.06+0.01 does not give exactly 0.07 in javascript. Javascript numbers are represented in binary as IEEE-754 (IEC 559) Doubles, with a resolution of 53 bits, giving an...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.