473,651 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What does a semicolon do at the beginning of a line?

Was browsing the documentation on reading a configuration file and found
this. What does a semicolon do at the beginning of a line?

; <?php DO NOT REMOVE THIS LINE
[first_section]
one = 1
five = 5
[second_section]
path = /usr/local/bin
; DO NOT REMOVE THIS LINE ?>
In order to protect your conf.php file, add these 2 lines, so it
will produce a PARSE ERROR if somebody wants to see your file !

Thanks for your help.
Jul 17 '05 #1
3 3959
Well it just parse errors.. being a config file makes me think thats why

but that isn't php code inside those tags..

"Bruce W...1" <br***@noDirect Email.com> wrote in message
news:3F******** ******@noDirect Email.com...
Was browsing the documentation on reading a configuration file and found
this. What does a semicolon do at the beginning of a line?

; <?php DO NOT REMOVE THIS LINE
[first_section]
one = 1
five = 5
[second_section]
path = /usr/local/bin
; DO NOT REMOVE THIS LINE ?>
In order to protect your conf.php file, add these 2 lines, so it
will produce a PARSE ERROR if somebody wants to see your file !

Thanks for your help.

Jul 17 '05 #2
Hi Bruce!

On Mon, 13 Oct 2003 18:31:21 -0400, "Bruce W...1"
<br***@noDirect Email.com> wrote:
Was browsing the documentation on reading a configuration file and found
this. What does a semicolon do at the beginning of a line?

; <?php DO NOT REMOVE THIS LINE
[first_section]
one = 1
five = 5
[second_section]
path = /usr/local/bin
; DO NOT REMOVE THIS LINE ?>
In order to protect your conf.php file, add these 2 lines, so it
will produce a PARSE ERROR if somebody wants to see your file !

Thanks for your help.


Well, in theory, if your webserver ius configured correctly, no one
should be able to see the source code of a PHP file, nor the output,
if it inly contains functions.

But in this case, even if someone does some kind of injection of
parameters (via register globals or whatever) the file will not show
anything, because it produces a parse error.

As the routine reading the config file is quite complex I suppose (in
relation to the config file), the security problem now lies there.

Interesting idea, because I'm not sure, if I like it.

HTH, jochen


--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #3
"Bruce W...1" <br***@noDirect Email.com> wrote in message news:<3F******* *******@noDirec tEmail.com>...
Was browsing the documentation on reading a configuration file and found
this. What does a semicolon do at the beginning of a line?

; <?php DO NOT REMOVE THIS LINE
[first_section]
one = 1
five = 5
[second_section]
path = /usr/local/bin
; DO NOT REMOVE THIS LINE ?>
In order to protect your conf.php file, add these 2 lines, so it
will produce a PARSE ERROR if somebody wants to see your file !

Thanks for your help.


Semilcon is a commenting. It is used to ingore the entire line.
And if somebody try to access your file directly
http://yourhost/conf.php the tags "<?php" and "?>" will work and php
will thrown an error
Tiago Serafim
Jul 17 '05 #4

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

Similar topics

220
18993
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
7
1282
by: Daqian Yang | last post by:
here is the code: --- #ifndef XFILE_A2_H #define XFILE_A2_H #include <iostream> #include <fstream> #include <string> using namespace std;
8
1454
by: Guybrush Threepwood | last post by:
Hi, I was always wondering if there is any difference between void someFunction(int,int) and void someFunction(int A, int B) is there?
7
23540
by: Newbie_sw2003 | last post by:
Where should I use them? I am giving you my understandings. Please correct me if I am wrong: MACRO: e.g.:#define ref-name 99 The code is substituted by the MACRO ref-name. So no overhead. Execution is faster. Where will it be stotred?(Is it in bss/stack/?) FUNCTION:
9
7713
by: Zero | last post by:
cc -c -o member.o member.c In file included from member.c:3: packet.h:55: two or more data types in declaration of `construct_request' packet.h:55: long, short, signed or unsigned invalid for `construct_request' make: *** Error 1 Here is what line 55 in packet.h is: unsigned char *construct_request(unsigned char *packet);
10
3219
by: Protoman | last post by:
Could you tell me what's wrong with this program, it doesn't compile: #include <iostream> #include <cstdlib> using namespace std; class Everything { public: static Everything* Instance()
1
2156
by: Lawrence San | last post by:
According to a JavaScript debugger (Firebug), and to a JS lint, this is fine: function recalc(){deriv = 6;} But, if I've assigned the function to a variable like this: var bells = function recalc(){deriv = 6;} .... then both the debugger and the lint report an error, saying there's
3
5891
by: Ken | last post by:
Hi all, I want to printf a sentence with a semicolon, for examples: printf(" I like C language; You like C++ language."); But C compiler alway identify the semicolon as a end of a sentence and presents an error. My question is: How to printf the semicolon ";" in C language?
25
5632
by: Peter Michaux | last post by:
Hi, I'm thinking about code minimization. I can think of a few places where whitespace matters a + ++b a++ + b a - --b a-- -b when a line ends without a semi-colon in which case the new line
0
8347
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
8275
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
8694
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8571
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
5605
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();...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
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.