473,385 Members | 1,720 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,385 software developers and data experts.

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 3939
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***@noDirectEmail.com> wrote in message
news:3F**************@noDirectEmail.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***@noDirectEmail.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***@noDirectEmail.com> wrote in message news:<3F**************@noDirectEmail.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
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...
7
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
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
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....
9
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...
10
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
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 =...
3
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...
25
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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...

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.