Deleting (crud)

please i was learning on the delete part, and i deleted about 2 subjects i had created, then i tried to creat another one , and the create file refused to open on ( The requested URL /~mgltd/easy/new_subject.php was not found on this server.)could it be linked to the deleted file

That… was a very long runon sentence that made little sense. Slow down, explain what you’re talking about, and probably need to show us the code you used.

i was learning on how to do crud,
after the create, read, and update
all my file was alright and opening,
but when i finished the delete
i tried to create another subject but the server could not find the file

So…
What line are you executing that caused this error?

really , when i try to open the page(new_user.php), thats when the error come up, but this page was working perfectly alright


<?php require_once("include/connection.php"); ?>
<?php require_once("include/functions.php"); ?>
<?php
find_selectedpage();   
?>
<?php include("include/header.php"); ?>
<div id="navigation">
<?php echo navigation($select_subject, $select_page); ?>
</div> <!--end of navigation div -->

<div id="bodycontent">
<h2>Add Subject</h2>
<form action="create_subject.php" method="post">
<p>Subject name:
<input type="text" name="menu_name" value="" id="menu_name" />
</p>
<p>Position:
<select name="position">
<?php
$subject_set = get_all_subjects();
$subject_count = mysql_num_rows($subject_set);
//$count+1 bcos we are adding a subject
for($count=1; $count <= $subject_count+1; $count++) {
   echo "<option value=\\"{$count}\\">{$count}</options>";
   }
?>
   </select>
   </p>
   <p>Visible:
   <input type="radio" name="visible" value="0" /> No
   &nbsp;
   <input type="radio" name="visible" value="1" /> yes
   </p>
   <input type="submit" value="Add Subject" />
   </form>
   <br />
   <a href="contents.php">Cancel</a>
</div>
<?php require("include/footer.php"); ?>

Well it might have something to do with the fact that your form is calling create_subject.php and your error says new_subject.php… I dont see anything there that calls for new_subject.php…

below is my create file, thanks


<?php require_once("include/connection.php"); ?>
<?php require_once("include/functions.php"); ?>
<?php
$errors = array();
// form validation
$required_fields = array('menu_name', 'position', 'visible');
foreach($required_fields as $fieldname){
if (!isset($_POST[$fieldname]) || empty($_POST[$fieldname])) {
     $errors[] = $fieldname;
     }
     }
     $fields_with_lenghts = array('menu_name' => 30);
     foreach($fields_with_lenghts as $fieldname => $maxlength ) {
     if(strlen(trim(mysql_prep($_POST[$fieldname]))) > $maxlength) {
     $errors[] = $fieldname;}
     }
     if(!empty($errors)) {
      redirect_to("new_subject.php");
      }
     ?>
<?php
	$menu_name = mysql_prep($_POST['menu_name']);
	$position = mysql_prep($_POST['position']);
	$visible = mysql_prep($_POST['visible']);
?>
<?php
$query = "INSERT INTO subjects (
			menu_name, position, visible
			) VALUES (
			'{$menu_name}', {$position}, {$visible}
			)";
			$result = mysql_query($query, $connection);
			if ($result){
			//success!
			header("Location: contents.php");
			exit;
			} else{
			//display error.
			echo "<p>Subject creation failed.</p>";
			echo "<p>" . mysql_error() . "</p>";
			}
			?>

<?php
  mysql_close($connection);?>

<form action="[COLOR="red"][B]create_subject.php[/B][/COLOR]" method="post">

The requested URL /~mgltd/easy/new_subject.php was not found on this server

The error and the code you posted are not connected. The error is caused by another script. Search in your scripts for ‘new_subject.php’ and change it into create_subject.php’

ok, thanks i will do that