Jump to content

Petrucho

Members
  • Posts

    41
  • Joined

  • Last visited

Posts posted by Petrucho

  1. Problem fixed!

    Ingolme, dsonesuk - thank you both for the kind assistance! :good:

     

    I used netBeans as my editor and only for this example, I've tried Notepad.

     

    As I said, I have no code in the test.php file. only the 3 lines of code I wrote which are the opening php tag, closing tag and in the middle, the session_start(); function.

     

    After googling about BOM, I've decided to install Notepad++ (version 6.9.2) which gives you the option of saving the file without the BOM.

     

    Problem got fixed.

     

    For someone who bumped into this thread in the future:

    It seems the only problem was indeed, the BOM as Ingolme has explained.

    Notepad++ gives you the option to save without BOM. (under Encoding->Encode in UTF-8 without BOM)

    In addition, not just that the BOM character sent to the output, but also could cause (at least to Google Chrome) a not welcoming space at the top of the page.

     

    First time I'm experiencing this. also the first time I'm using JetBrains for php coding.

     

     

    Thanks again!

  2. the only lines of code in the .php file I've created are:

    <?php
    session_start();
    ?>
    

    No, this file is not included.

     

    I've created this file, just to check if I still get the warning, and yes, I do.

     

    It doesn't make any sense and that's why I came here.

    What else could send something to the buffer? maybe settings of the server? php.ini configuration?

     

    I can't find any solution and yes, I think, something's adding the <br /> prior to the session_start(); which makes it impossible to send any headers.

     

    Edit:

     

    Maybe this would help;

     

    Link to test.php: link

     

    Code of test.php as mentioned above (on this comment)

  3. I guess this is the source of the problem. the escaped <br />

     

    As I mentioned earlier, I opened a new .php file (using Windows Notepad [saved in UTF8]) and written nothing but the session_start();

     

    It's really confusing :umnik2:

  4. Hi,

     

    I had to use Session cookies for a little web application I'm working on, but I can't find solution to the problem mentioned above.

     

    I get the warning:

     

     

     

    Warning: session_start(): Cannot send session cookie - headers already sent by (...)

     

    This warning points to line 1.

     

    I've tried to create a new .php file, with the following code:

    <?php
    session_start();
    ?>
    

    Only 3 lines of code, using nothing but Windows Notepad and I still get the same warning.

     

    I've tried to find solutions but couldn't find any in here, nor in Google.

     

    The only explanation I could think of, is a server problem who send headers in each call. It doesn't make any sense though.

     

    Someone ever experienced this?

    Any thoughts of how to fix this?

     

     

    Thanks in advance,

    Petrucho.

  5. It has to be something with your php version or configuration.

     

    I have just tried the code on my server.

    output:

     

     

     

    Welcome petruchoCONTENT_TYPE: application/x-www-form-urlencoded
    DATA:NULL
    array(3) {
    ["name"]=>
    string(8) "petrucho"
    ["email"]=>
    string(18) "petrucho@gmail.com"
    ["submit"]=>
    string(6) "Submit"
    }

    Your email address is: petrucho@gmail.com

     

     

    Try the function phpinfo();

    • Like 1
  6. "TEXT and CHAR or nchar that will typically be converted to plain text so you can only store text like strings.

    BLOB and BINARY which mean you can store binary data such as images simply store bytes."

    Here

  7. I'm not sure why you need it, but, time() return how many seconds have passed since January 1 1970 00:00:00 GMT.

    If you want to know how many days have passed since a particular time() you saved before, then you should subtract the time() you saved earlier, from the the time() now.

     

    Then a little math:

    60 seconds = 1 minute

    60 minutes = 1 hour

    24 hours = 1 day

  8. I guess now you understand the problem.

     

    What are you expecting $imgs to hold? where you initialize this variable??

  9. Seems something wrong with the argument you send for your first foreach.

     

    try to use

    <?phpdie(var_dump($imgs));?>

    before the foreach(); and post here the output it returns

  10. Try to add to insertJobs.php at line 1, the code below

    <? die($_POST[clientid]) ?>

    I guess it will be helpful to debug and find where is the problem, first of all, by checking your passed variables.

    It seems you don't send any var named "clientid". your SELECT name is "name".

  11. If your only purpose is to implement a "header"-file in multiple pages, I would suggest you to read:

     

    1. http://www.php.net/manual/en/language.basic-syntax.phptags.php
    2. http://il1.php.net/manual/en/function.include.php

    All you need to know:

    • your server have to support PHP!
    • In each page you choose to use php-script, you have to save the file as ".php"

    All you need to do:

    open php-script tag, add the include statement, close your php-script tag.

    3 lined of simple code and you're done.

     

    No need to cover all the php documentation, for just "including" a single file in few pages.

  12. I have "Checkbox" input with multiple values.

    <input type="checkbox" name="drug" value="1" /><input type="checkbox" name="drug" value="2" /><input type="checkbox" name="drug" value="3" />

    I want to run through this array and alert() all the values.

    I'm guessing I should use Jquery's .each() command but I'm not sure how to use it.

     

    the problem is, I don't understand how to use it so I can get the key and it's value.

    $.each($("input[name='drug']"),function(i,v){   alert(i+": "+v);});

    What am I missing in the main idea?

×
×
  • Create New...