hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : CGI Error
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

CGI Error

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-18-2002, 04:09 PM
AC1 AC1 is offline
Newbie
 
Join Date: Aug 2002
Location: Originally from Bolton, England. I have been working in Brussels, Belgium for the last 2.5 years.
Posts: 29

CGI Error


Hi

The code below works OK on my live unix server but not on my windows PC. I am running mysql, php and iis.

The first screen works correctly and retrieves the data from the dbase and displays it on the screen, but when I select the required option from the list and the 2nd screen is called I get the following error message:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

The rest of the screen is then blank.

Any ideas?

Cheers
Andy

<?

include("dbinfo.inc.php");

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die("unable to select database");

?>

<center><h2> IT and Computing Free Courses</h2></center>

<blockquote>
<?

// Request the text of all the subjects

$result = @mysql_query("SELECT subject_no, subject FROM subject where area_no = 1");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}

// Display the text of each subject record on a separate line

while ( $row = mysql_fetch_array($result)) {
$subject=$row["subject"];
$subject_no=$row["subject_no"];

$option_block .="<option value=$subject_no>$subject</option>";
}


//it_courses.php?subject_no=$subject_no
?>
</blockquote>

<form method="post" action="it_courses.php">
<p>Please select the required subject:<br>
<select name="subject_no">

<? echo "$option_block"; ?>

</select>
<p><input type="submit" value="Find Courses"></p>

</form>

Reply With Quote


Sponsored Links
  #2  
Old 09-18-2002, 07:43 PM
frostie frostie is offline
Disabled
 
Join Date: May 2002
Location: England
Posts: 21
Well code works out fine. What is happening is that the code is being parsed by your CGI intepreter and not your PHP intepreter and hence why it is giving an error. Becuase it cannot read what you have put. Sounds like the server config is wrong somewhere. Where exactly I cannot say.

James

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Rackspace Adds Redis as a Service with Exceptional Cloud Services Acquisition Web Hosting News 2013-04-01 10:55:48
Expired SSL Certificate Brings Down Windows Azure Cloud Web Hosting News 2013-02-25 10:38:00
Nasuni Report Measures Top Performing Cloud Storage Firms Web Hosting News 2011-12-12 16:43:37
Web Host 1&1 Experiences Server Outage Web Hosting News 2011-09-26 17:29:11
Amazon Provides Details on Dublin Data Center Outage Web Hosting News 2011-08-15 20:04:29


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?