WEB Internal Server Error

Discussion in 'OT Technology' started by drpepper, Oct 2, 2007.

  1. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    Im getting this error with a script im trying to install. Here is the code for the index.php. Maybe someone will see something im missing since im not very good with php coding.

    Code:
    <?php
        require_once('./page_header.php');
        $end_type = end($CONFIG['file_types']);
        $types    = '';
        foreach($CONFIG['file_types'] as $key){
            if($key == $end_type){
                $types .= 'and .'.strtoupper($key);
            }else{
                 $types .= '.'.strtoupper($key).',&nbsp;';
            }
        }
        if($_SERVER['HTTP_REFERER'] != ''){
            if($URL = parse_url($_SERVER['HTTP_REFERER'])){
                if(!preg_match("/".preg_quote($URL['host'])."/", $_SERVER['HTTP_HOST'])){
                    $nmsg = true;
                }        
            } 
        }
    ?>
    Welcome <?php echo (($nmsg == true) ? "<b>".$URL['host']."</b> visitor" : ""); ?> to <?php echo $CONFIG['site_name']; ?>, a free image upload solution. Simply browse, select, and upload!<br><br>
    <?php
        if($_GET['url_upload'] != ''){
    ?> 
    Enter an image URL to upload - <a href="index.php">Normal Upload</a><br>
    <?php
        }else{
    ?>
    Select an image file to upload - <a href="index.php?url_upload=1">URL Upload</a><br>
    <?php
        }
    ?>
    Max file size is set at: <?php echo convert_numbers(convert_size($CONFIG['max_file_size'])); ?> per file<br><br>
    <form method="post" enctype="multipart/form-data" action="upload.php">
    <?php
        if($_GET['url_upload'] != ''){
    ?>
    <input type='hidden' name='type' value='url_upload'>
    <INPUT name='userfile[]' TYPE='text' size='50'> <br>
    <INPUT name='userfile[]' TYPE='text' size='50'> <br>
    <INPUT name='userfile[]' TYPE='text' size='50'> <br>
    <INPUT name='userfile[]' TYPE='text' size='50'> <br>
    <INPUT name='userfile[]' TYPE='text' size='50'> <br>
    <?php
        }else{
    ?>
    <input type='hidden' name='type' value='direct'>
    <INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
    <INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
    <INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
    <INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
    <INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
    <?php
        }
    ?>
    <div id="morefiles"></div><br>
    <?php
        if($CONFIG['is_user'] == false){
    ?>
    Upload Type: <input type="radio" name="private" value="0" checked="checked">Public <input type="radio" name="private" value="1">Private<br><br>
    <?php
        }
    ?>
    <script type='text/javascript'>
    //<![CDATA[
    document.write('<img src="<?php echo $BUTTON['add_files']; ?>" alt="Add More Files" title="Add More Files" onClick="javascript:dispMoreFiles(\'<?php echo (($_GET['url_upload'] != '') ? 'url_upload' : ''); ?>\')"> ');
    //]]>
    </script>
    <input type="image" alt="Start Uploading" src="<?php echo $BUTTON['start_uploading']; ?>">
    </form><br><br>
    Allowed File Types: <?php echo $types; ?>
    <?php
        require_once('./page_footer.php');
    ?>
    
     
  2. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    You won't get an internal server error if there is error in your PHP code, you'll get a PHP error in the browser. Do you have access to your error logs??
     
  3. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    yes ive got access to error logs. this is what ive got.

    [Tue Oct 2 11:49:14 2007] [error] [client xx.xx.xxx.xxx] Premature end of script headers: /home/xxxxx/public_html/index.php
     
  4. JoeyJoJoJuniorShabadoo

    JoeyJoJoJuniorShabadoo Live Free or Die

    Joined:
    Nov 9, 2004
    Messages:
    4,347
    Likes Received:
    0
    Location:
    http://www.stogietime.com
    why do you do this?

    Code:
    <?php
        if($_GET['url_upload'] != ''){
    ?> 
    Enter an image URL to upload - <a href="index.php">Normal Upload</a><br>
    <?php
        }else{
    ?>
    
    why not this:
    Code:
    <?php
        if($_GET['url_upload'] != ''){
    
      echo"Enter an image URL to upload - <a href=\"index.php\">Normal Upload</a><br>";
    
        }else{
    ?>
    
    do that wherever you have it broken up like that
     
  5. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    i didnt write the script :o
     
  6. JoeyJoJoJuniorShabadoo

    JoeyJoJoJuniorShabadoo Live Free or Die

    Joined:
    Nov 9, 2004
    Messages:
    4,347
    Likes Received:
    0
    Location:
    http://www.stogietime.com
    did you just download it from somewhere?
     
  7. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    I saw this too, and then promptly left the thread. :o
     
  8. JoeyJoJoJuniorShabadoo

    JoeyJoJoJuniorShabadoo Live Free or Die

    Joined:
    Nov 9, 2004
    Messages:
    4,347
    Likes Received:
    0
    Location:
    http://www.stogietime.com
    whoever coded this is an idiot, hope they arent on these forums :run:
     
  9. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    :rofl:

    yea i just downloaded it from somwhere.
     
  10. JoeyJoJoJuniorShabadoo

    JoeyJoJoJuniorShabadoo Live Free or Die

    Joined:
    Nov 9, 2004
    Messages:
    4,347
    Likes Received:
    0
    Location:
    http://www.stogietime.com
  11. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
  12. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    does anyone have a similar script with multi image upload and shit?
     
  13. ge0

    ge0 New Member

    Joined:
    Oct 31, 2005
    Messages:
    8,398
    Likes Received:
    0
    Location:
    JERSEY
    did you instal CGI along with this upload script?

    Usually cgi si what gives the internal server error.
     
  14. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    do you mean install cgi? the script is php not cgi.
     
  15. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    interestingly enough, it works on my old dreamhost account :ugh:
     
  16. JoeyJoJoJuniorShabadoo

    JoeyJoJoJuniorShabadoo Live Free or Die

    Joined:
    Nov 9, 2004
    Messages:
    4,347
    Likes Received:
    0
    Location:
    http://www.stogietime.com
    I dont know if this would work, but try taking the php off of all the <?php tags
     
  17. Nakon

    Nakon Guest

    no, it wouldn't.
     
  18. Nakon

    Nakon Guest

    what version of PHP are you running?
     
  19. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    4.4.4
     
  20. Nakon

    Nakon Guest

    can you create this file on your server and PM it to me:

    Code:
    <?php
    
    echo phpinfo();
    
    ?>
    
    
     
  21. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    :rofl: gives me the same error :bowrofl:
     
  22. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    i think a new host is in order.
     
  23. Nakon

    Nakon Guest

    do any php pages work?
     
  24. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    yea
    they do. i had a wordpress installation on there.
     
  25. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio

Share This Page