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

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default 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.
    Bruce W...1 Guest

  2. Similar Questions and Discussions

    1. semicolon requested
      Can someone help me on this. I'm trying to insert data into 2 tables using cf defined statements from the insert form wizard. When I run the code in...
    2. vi, adding words to the beginning of each line
      in vi-ing a file, i have a list of lines and they have different alphabets when they begin a new line. now i wanted to add this "more" to the...
    3. behavior of semicolon on return line
      Does the semicolon behave any differently for a return test statement? Example, sub validate { return shift =~ /^*\.+$/ } or sub validate
    4. Add text to beginning every line
      Hi Hope someone can help with this. I used to be able to do it, but now have forgotten. I want to prepend some text to every line in a file. The...
    5. Write line at beginning of file?
      Eric Pement <pemente@northpark.edu> wrote: What version of perl are you referring to?
  3. #2

    Default Re: What does a semicolon do at the beginning of a line?

    Hi Bruce!

    On Mon, 13 Oct 2003 18:31:21 -0400, "Bruce W...1"
    <bruce@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.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

  4. #3

    Default Re: What does a semicolon do at the beginning of a line?

    "Bruce W...1" <bruce@noDirectEmail.com> wrote in message news:<3F8B27B9.319CEC8@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
    [url]http://yourhost/conf.php[/url] the tags "<?php" and "?>" will work and php
    will thrown an error


    Tiago Serafim
    Tiago Serafim Guest

  5. #4

    Default Re: What does a semicolon do at the beginning of a line?

    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" <bruce@noDirectEmail.com> wrote in message
    news:3F8B27B9.319CEC8@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.

    Michael Willcocks Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139