Jump to content

jazz

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Posts posted by jazz

  1. Thank you for your reply. I added it but to no avail. The Expect header did indeed disapear, but nothing more changed.

     

    Here are the new headers:

    POST /test.php HTTP/1.1 Host: 85.17.135.223 Accept: */* Content-Length: 10495 Content-Type: multipart/form-data; boundary=----------------------------4047ac8569bd

     

     

  2. Hi,

     

    I am dead in the water with this. I cannot discover the problem.

     

    I am trying to upload a file with curl and also pass a text value. It refuses to work. :)

     

     

    Here 's a test form:

    http://85.17.135.223/test.php

     

    <?php
    
    if (!empty($_REQUEST)) {
    var_dump ($_REQUEST);
    }
    
    ?>
    
    <html>
    <body>
    <form>
    <input type="text" name="a" value="value1" />
    <input type="file" name="file1" />
    <input type="submit" /> 
    </form>
    </body>
    

     

    And then there 's the php script.

     

    $url = 'http://85.17.135.223/test.php';
    $file = getcwd().'/'.'step3.php';
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, array('type' => 'direct', 'file1'=>"@$file", 'a'=>'aaaaa1'));
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLINFO_HEADER_OUT, true);
    $result = curl_exec ($ch);
    echo curl_error($ch);
    $info = curl_getinfo($ch);
    var_dump($info);
    

     

    Here are the headers:

    POST /test.php HTTP/1.1 Host: 85.17.135.223 Accept: */* Content-Length: 10448 Expect: 100-continue Content-Type: multipart/form-data; boundary=----------------------------b64cdfea8248

     

     

    It does not work like it does if you do in through the browser. No script output! How can I make this work?

     

     

    Thank you!

  3. It is rather trivial. You need to make your canvas BIGGER first, THEN rotate the image and finally CROP it to the correct size to remove the white/black extra space that was added.

     

    That 's all.

     

    Also, your site has a rather huge security bug...

  4. Kalhmera,

     

    What you need to understand is that you did not tell the browser that your binary data is an image.

    Blob stores binary data. We need to let the browser know it is an image.

     

    Now, the problem is there is no html tag to do that. You have to use the standard img tag like the image was not on a database but it was a file.

    Make a script that outputs only the image for a given id (e.g. image.php?id=whatever). Do note that you will need to use the header() command to specify that you are outputting an image.

     

    Then in your main script, in the part of the table you want to display the image, instead of sending the binary data, use img src="image.php?id=..."

     

    That 's the outline, for the actual implementation, well, it's up to you. :)

  5. I'm still slightly confused.

     

    If the user logs in, and the home.php page has require_once, is that a connection? Then, if they click on another page that has require_once, is that another connection? How does that work?

     

    Also, what would my hosting provider mean by 50 simultaneous MySQL connections per user?

     

    You don't need to worry. 50 SIMULTANEOUS MySQL connections is GOOD. You 'll need to have a lot of people visiting your site to need an upgrade in hosting. :)

     

    A require_once tells you nothing about how many connections the script does to the MySQL server.

  6. If I require_once a MySQL connection script on each page of my website, does that mean a new connection is being made each time? What is the best way to minimize the amount of connections being made to the database?

     

    No. It means that whenever the code of that script is called (e.g. it contains functions) and it connects to MySQL, it connects to MySQL. :)

     

    Roughly: Calls = Total calls to the script * mysql connections that the scripts uses

  7. So my understanding is that, in answer to my question, YES post data sent from an http page to an https processing page IS encrypted; HOWEVER, that is only true if the SSL request itself was not hi-jacked before the data is sent.

     

    Technically, even if it gets hijacked through man in the middle method, it will still be encrypted. The problem is it will be encrypted by the attacker.  ;D:o

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.