Current location: Hot Scripts Forums » Programming Languages » PHP » Simple code yet 500 Internal Server Error, WTH


Simple code yet 500 Internal Server Error, WTH

Reply
  #1 (permalink)  
Old 02-25-10, 03:43 PM
timbaker1991's Avatar
timbaker1991 timbaker1991 is offline
Newbie Coder
 
Join Date: Dec 2009
Location: London, UK
Posts: 38
Thanks: 2
Thanked 3 Times in 3 Posts
Simple code yet 500 Internal Server Error, WTH

Hi been working on this simple code to query a database (I know - PHP forum) and for some reason it suddenly started returing a 500 internal server error and i can't figure out why.

I've re-set the scripting on the server - its only this page that does it as well so don't think its a sole server error?

Heres the code
PHP Code:

<?php

// Connects to your Database
mysql_connect("XXXXXXX") or die(mysql_error());
mysql_select_db("XXXXXX") or die(mysql_error());

//This code runs if the form has been submitted
if (isset($_POST['submit'])) {


$write=$_GET["school"];
$school="subjects_".$write;
$sub=$_GET["subject"];
$member=$_POST['member'];
$teacher=$_GET['teacher'];
$year=$_GET['year'];

mysql_query("UPDATE subjects_sixthform SET teacherfive='$member' WHERE id='$sub'");

}
else
{
header ('staff_edit_staff.php#read=sorry+there+was+an+error+please+try+again');
}
?>
And the form its coming from,
PHP Code:

<form enctype="multipart/form-data" action="excu_staff_edit.php?teacher=teacherfive&school=<?php echo $_GET[school]?>&subject=<?php echo $_GET[subject]?>&year=<?php echo $_GET[year]?>" method="POST">

    <br />
    Change to: <?php include("staff_list.php")?>
    <input type="submit" name="edit" value="Save"></form> 
    <br />
Reply With Quote
  #2 (permalink)  
Old 02-25-10, 05:10 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
header ('location:staff_edit_staff.php#read=sorry+there+w as+an+error+please+try+again');
Reply With Quote
Reply

Bookmarks

Tags
internal server error, mysql problems, php


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Affiliate tracking simple code required danielbates Script Requests 0 09-29-04 05:55 PM
.ASP code protection for distribution and Simple Programming? kcarver ASP 5 12-28-03 09:31 PM
Simple Guestbook, 500 Internal Error wake Perl 4 11-21-03 01:49 AM
looking for a simple forum php code westwood Script Requests 5 10-07-03 02:26 AM
Need a simple user code! dave111 Script Requests 1 09-07-03 09:48 AM


All times are GMT -5. The time now is 08:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.