Jump to content

Recommended Posts

When I submit some info on a php page of mine I get an \"Internal Server Error\". I get the following message in my apache log file...

 

[Wed Oct 29 18:44:40 2003] [error] [client 127.0.0.1] Premature end of script headers: c:/php/php.exe

 

I\'ve search google for this but can\'t seem to come up with anything. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/1245-internal-server-error/
Share on other sites

  • 2 weeks later...

Still can\'t get around this problem, I\'ve tried many weird and wonderful methods to try and get around this problem but to no avail. The strange thing is this is adapted from another script which works perfectly, only the field names of text boxes and mysql fields have changed really. Here is my code for the page...

 

<html>

<?php

if($submit)  // update services details

 {

  include("includes/databaseconnection.inc"); // include file for reference to db connection

  $sql = "UPDATE services SET domainname=\'$domainname\', hostserver=\'$hostserver\',

          package=\'$package\', hostprice=\'$hostprice\', hostrenewal=\'$hostrenewal\',

          registrationprice=\'$registrationprice\', registrationrenewal=\'$registrationrenewal\',

          ftpusername=\'$ftpusername\', ftppassword=\'$ftppassword\', ftpdomain=\'$ftpdomain\',

          sitechangesareas=\'$sitechangesareas\', sitechangesrenewal=\'$sitechangesrenewal\',

          securesitesolutionsusername=\'$securesitesolutionsusername\',

          securesitesolutionspassword=\'$securesitesolutionspassword\',

          securesitesolutionsprice=\'$securesitesolutionsprice\',

          securesitesolutionsrenewal=\'$securesitesolutionsrenewal\',

          emailforwardingaddress=\'$emailforwardingaddress\',

          emailforwardingprice=\'$emailforwardingprice\',

          emailforwardingrenewal=\'$emailforwardingrenewal\',

          popid=\'$popid\', additionalpopprice=\'$additionalpopprice\',

          additionalpoprenewal=\'$additionalpoprenewal\',

          webforwardaddress=\'$webforwardaddress\',

          webforwardprice=\'$webforwardprice\', webforwardrenewal=\'$webforwardrenewal\',

          searchenginepackageprice=\'$searchenginepackageprice\',

          searchenginepackagerenewal=\'$searchenginepackagerenewal\',

          webmaintenancepackage=\'$webmaintenancepackage\',

          webmaintenancerenewal=\'$webmaintenancerenewal\',

          teleitmaintenanceprice=\'$teleitmaintenanceprice\',

          teleitmaintenancerenewal=\'$teleitmaintenancerenewal\',

          customerdomainrenewals=\'$customerdomainrenewals\' WHERE domainname=\'$domainname\'"; // sql to update contact details

  $result = mysql_query($sql) or die(mysql_error()); // execute query

  ?>

  <head>

  <title>Service details for <?php echo $domainname ?> have been ammended.</title>

  </head>

  <body bgcolor="#ffffff">

  <table border="0">

  <tr><td><img src="acs.gif"></td><td><h3>Service details for <?php echo $domainname ?> have been ammended.</h3></td></tr>

  </table>

  </body>

  </html>

  <?php

  die(); // exits the current script, or else clause is processed, is an alias for exit()

 }  // end of first if clause

if($edit)  // edit service details

 {

  ?>

  <head>

  <title>Edit service details for <?php echo $domainname ?>.</title>

  </head>

  <body bgcolor="#ffffff">

  <table border="0">

  <tr><td><img src="acs.gif"></td><td><h3>Edit details for <?php echo $domainname ?></h3></td></tr>

  </table>

  <?php

  include("includes/databaseconnection.inc"); // include file for reference to db connection

  $sql = "SELECT * FROM services WHERE domainname = \'$domainname\'";

  $result = mysql_query($sql) or die(mysql_error());

  $myrow = mysql_fetch_array($result);

  ?>

  <form method="post" action="editcontactdetails.php">

  <table border="0">

  <tr><td>Domain name: </td><td><input type="text" name="domainname" readonly value=\'<?php echo $myrow["domainname"]?>\'></td></tr>

  <tr><td>Host Server: </td><td><input type="text" name="hostserver" value=\'<?php echo $myrow["hostserver"]?>\'></td></tr>

  <tr><td>Package: </td><td><input type="text" name="package" value=\'<?php echo $myrow["package"]?>\'></td></tr>

  <tr><td>Host Price: </td><td><input type="text" name="hostprice value=\'<?php echo $myrow["hostprice"]?>\'></td></tr>

  <tr><td>Host Renewal: </td><td><input type="text" name="hostrenewal" value=\'<?php echo $myrow["hostrenewal"]?>\'></td></tr>

  <tr><td>Registration Price: </td><td><input type="text" name="registrationprice" value=\'<?php echo $myrow["registrationprice"]?>\'></td></tr>

  <tr><td>Registration Renewal: </td><td><input type="text" name="registrationrenewal" value=\'<?php echo $myrow["registrationrenewal"]?>\'></td></tr>

  <tr><td>FTP Username: </td><td><input type="text" name="ftpusername" value=\'<?php echo $myrow["ftpusername"]?>\'></td></tr>

  <tr><td>FTP Password: </td><td><input type="text" name="ftppassword" value=\'<?php echo $myrow["ftppassword"]?>\'></td></tr>

  <tr><td>FTP Domain: </td><td><input type="text" name="ftpdomain" value=\'<?php echo $myrow["registrationprice"]?>\'></td></tr>

  <tr><td>Site Changes Areas: </td><td><input type="text" name="sitechangesareas" value=\'<?php echo $myrow["sitechangesareas"]?>\'></td></tr>

  <tr><td>Site Changes Price: </td><td><input type="text" name="sitechangesprice" value=\'<?php echo $myrow["sitechangesprice"]?>\'></td></tr>

  <tr><td>Site Changes Renewal: </td><td><input type="text" name="sitechangesrenewal" value=\'<?php echo $myrow["sitechangesrenewal"]?>\'></td></tr>

  <tr><td>Secure Site Solutions Username: </td><td><input type="text" name="securesitesolutionsusername" value=\'<?php echo $myrow["securesitesolutionsusername"]?>\'></td></tr>

  <tr><td>Secure Site Solutions Password: </td><td><input type="text" name="securesitesolutionspassword" value=\'<?php echo $myrow["securesitesolutionspassword"]?>\'></td></tr>

  <tr><td>Secure Site Solutions Price: </td><td><input type="text" name="securesitesolutionsprice" value=\'<?php echo $myrow["securesitesolutionsprice"]?>\'></td></tr>

  <tr><td>Secure Site Solutions Renewal: </td><td><input type="text" name="securesitesolutionsrenewal" value=\'<?php echo $myrow["securesitesolutionsrenewal"]?>\'></td></tr>

  <tr><td>Email Forwarding Address: </td><td><input type="text" name="emailforwardingaddress" value=\'<?php echo $myrow["emailforwardingaddress"]?>\'></td></tr>

  <tr><td>Email Forwarding Price: </td><td><input type="text" name="emailforwardingprice" value=\'<?php echo $myrow["emailforwardingprice"]?>\'></td></tr>

  <tr><td>Email Forwarding Renewal: </td><td><input type="text" name="emailforwardingrenewal" value=\'<?php echo $myrow["emailforwardingrenewal"]?>\'></td></tr>

  <tr><td>POP ID: </td><td><input type="text" name="popid" value=\'<?php echo $myrow["popid"]?>\'></td></tr>

  <tr><td>Additional POP Price: </td><td><input type="text" name="additionalpopprice" value=\'<?php echo $myrow["additionalpopprice"]?>\'></td></tr>

  <tr><td>Additional POP Renewal: </td><td><input type="text" name="additionalpoprenewal" value=\'<?php echo $myrow["additionalpoprenewal"]?>\'></td></tr>

  <tr><td>Web Forward Address: </td><td><input type="text" name="webforwardaddress" value=\'<?php echo $myrow["webforwardaddress"]?>\'></td></tr>

  <tr><td>Web Forward Price: </td><td><input type="text" name="webforwardprice" value=\'<?php echo $myrow["webforwardprice"]?>\'></td></tr>

  <tr><td>Web Forward Renewal: </td><td><input type="text" name="webforwardrenewal" value=\'<?php echo $myrow["webforwardadrenewal"]?>\'></td></tr>

  <tr><td>Search Engine Package Price: </td><td><input type="text" name="searchenginepackageprice" value=\'<?php echo $myrow["searchenginepackageprice"]?>\'></td></tr>

  <tr><td>Search Engine Package Renewal: </td><td><input type="text" name="searchenginepackagerenewal" value=\'<?php echo $myrow["searchenginepackagerenewal"]?>\'></td></tr>

  <tr><td>Web Maintenance Package: </td><td><input type="text" name="webmaintenancepackage" value=\'<?php echo $myrow["webmaintenancepackage"]?>\'></td></tr>

  <tr><td>Web Maintenance Renewal: </td><td><input type="text" name="webmaintenancerenewal" value=\'<?php echo $myrow["webmaintenancerenewal"]?>\'></td></tr>

  <tr><td>TeleIT Maintenance Price: </td><td><input type="text" name="teleitmaintenanceprice" value=\'<?php echo $myrow["teleitmaintenanceprice"]?>\'></td></tr>

  <tr><td>TeleIT Maintenance Renewal: </td><td><input type="text" name="teleitmaintenancerenewal" value=\'<?php echo $myrow["teleitmaintenancerenewal"]?>\'></td></tr>

  <tr><td>Customer Domain Renewals: </td><td><input type="text" name="customerdomainrenewals" value=\'<?php echo $myrow["customerdomainrenewals"]?>\'></td></tr>

  <tr><td></td><td><input type="submit" name="submit" value="Submit"></td></tr>

  </table>

  </form>

  </body>

  </html>

  <?php

 } // end of second if clause

else // select service details to edit by domain name

 {

  include("includes/databaseconnection.inc"); // include file for reference to db connection

  $sql = "SELECT domainname FROM services";

  $result = mysql_query($sql) or die(mysql_error());

  ?>

  <head>

  <title>Select services to edit by domain name.</title>

  </head>

  <body bgcolor="#ffffff">

  <table border="0">

  <tr><td><img src="acs.gif"></td><td><h3>Select service details to edit by domain name</h3></td></tr>

  </table>

  <form method="post" action="editservicedetails.php">

  <select name="domainname"> <!-- option specifies domain name to be used in the above query -->

  <?php

  while($myrow = mysql_fetch_array($result))

    {

     echo "<option>";

     echo $myrow["domainname"]; // the domain names are entered via this loop

     echo "</option>";

    }

  mysql_free_result($result);

  ?>

  </select>

  <input type="submit" name="edit" value="Submit">

  </form>

  </body>

  </html>

  <?php

 } // end of else clause

  ?>

 

The error seems to occur on or before the

if($edit)

clause. Any help with this would be very much appreciated. (Apologies for the large code posting.)

Link to comment
https://forums.phpfreaks.com/topic/1245-internal-server-error/#findComment-4361
Share on other sites

  • 2 weeks later...

Ok sorted this, a bit embarrassed to admit this...... but all the problem was was my links some pages where acsservicesomething.php when they should have been acsservicessomething.php, oh the joy of programming!! Guess I was too tired. Never saw this mentioned though in all the stuff I found on the error. Just thought I\'d wrap it up. Thanks to all who offered advice.

Link to comment
https://forums.phpfreaks.com/topic/1245-internal-server-error/#findComment-4590
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.