I'm having a problem with my script this error is evident in several modules since it uses the same script. I cant find any errors. The problem is the form and database insert the information when its a word, etc, but when I place multiple words in the textbox it never submits.

Another problem is the autoindex automatically jumps to 247**** the maximum whever a record is inserted.

function content() {
include("header.php");
tabletop();
is_admin1();            //To Declare whether the user is an administrator
global $http;
    echo "<center><b><font size=\"3\" class=\"title\"><a href=\"index.php?index=adm&admin=viewadminmenu\">Administrative Control Panel</a></b></center>\n";
    echo "<CENTER><table cellpadding=\"2\" cellspacing=\"3\" border=\"1\" width=\"100%\"><tr>\n"
	."<td><b><font size=\"1\" class=\"content\">Title</b></td><td align=\"center\"><b><font size=\"1\" class=\"content\">Functions</b></td></tr>\n";
    $result_content = mysql_query("select * from page order by id")
	or die ("Could not select the list");
    while($mypages = mysql_fetch_array($result_content)) {
	echo "<tr><td width=\"100%\" valign=\"top\"><font size=\"1\" class=\"content\"><a href=\"index.php?index=c&page=$mypages[page]\">$mypages[title]</a></td><td align=\"center\"><font size=\"1\" class=\"content\">[ <a href=\"index.php?index=adm&admin=content_edit&id=$mypages[0]\">Edit</a> | <a href=\"index.php?action=content_delete&id=$mypages[ID]\">Delete</a> ]</td></tr>";
    }
    echo "</table><BR>\n"
	."<center><b><font class=\"title\" size=\"2\">Add A New Page</b></center><br><br>\n"
	."<form action=\"index.php\" method=\"post\">\n"
	."<input type=\"hidden\" name=\"index\" value=\"adm\">\n"
	."<input type=\"hidden\" name=\"admin\" value=\"content_save\">\n"
	."<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Title :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"title\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Page Name :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"page\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Keywords</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"keywords\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Description :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"description\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
        ." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Topic :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><select name=\"topic\">\n";
$result = mysql_query ("SELECT * FROM topics");
while ($select = mysql_fetch_array($result)) {
    echo "<option value=\"$select[0]\">$select[1]</option>\n";
}
    echo "  </select></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Page Text :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><textarea name=\"text\" cols=\"30\" rows=\"10\" style=\"border:#000000 1px solid; font-size: 11px;background-image: url([url]http://[/url]$http/images/forms/bg.gif); background-repeat: no-repeat;\"></textarea></td>\n"
	." </tr>\n"
	."</table>\n"
	."<input type=\"submit\" value=\"Post\">\n"
	."</form>\n";
tablebottom();
include("footer.php");
mysql_free_result ($result);
}

function content_edit($id) {
include("header.php");
tabletop();
is_admin1();                   //To Declare whether the user is an administrator
global $id, $http;
    echo "<center><b><font size=\"3\" class=\"title\"><a href=\"index.php?index=adm&admin=viewadminmenu\">Administrative Control Panel</a></b></center>\n";
$result_content_edit = mysql_query("select * from page WHERE id='$id'");
    while ($mypages = mysql_fetch_array($result_content_edit)) {
    echo "<center><b><font class=\"title\" size=\"2\">Add A New Page</b></center><br><br>\n"
	."<form action=\"index.php\" method=\"post\">\n"
	."<input type=\"hidden\" name=\"index\" value=\"adm\">\n"
	."<input type=\"hidden\" name=\"admin\" value=\"content_save_edit\">\n"
	."<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Title :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"title\" value=\"$mypages[title]\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Page Name :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"page\" value=\"$mypages[page]\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Keywords</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"keywords\" value=\"$mypages[keywords]\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Description :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><input type=\"text\" name=\"description\" value=\"$mypages[5]\" style=\"border:#000000 1px solid;background-image: url([url]http://[/url]$http/images/forms/formbg.gif); background-repeat: no-repeat;\"></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Topic :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><font size=\"1\" class=\"content\"><select name=\"topic\">\n";
$result = mysql_query ("SELECT * FROM topics");
while ($select = mysql_fetch_array($result)) {
    echo "<option value=\"$select[0]\">$select[1]</option>\n";
}
    echo "  </select></td>\n"
	." </tr>\n"
	." <tr>\n"
	."  <td width=\"25%\" valign=\"top\"><font size=\"1\" class=\"content\">Page Text :</td>\n"
	."  <td width=\"75%\" valign=\"top\"><textarea name=\"text\" cols=\"30\" rows=\"10\" style=\"border:#000000 1px solid; font-size: 11px;background-image: url([url]http://[/url]$http/images/forms/bg.gif); background-repeat: no-repeat;\">$mypages[body]</textarea></td>\n"
	." </tr>\n"
	."</table>\n"
	."<input type=\"hidden\" name=\"id\" value=\"$id\">"
	."<input type=\"submit\" value=\"Save Changes\">\n"
	."</form>\n";
}
tablebottom();
include("footer.php");
mysql_free_result ($result);
}

function content_save($title, $text, $page, $keywords, $description, $topic) {
include("header.php");
tabletop();
global $title, $text, $page, $keywords, $description, $topic, $http;
    mysql_query("insert into page values (NULL, '$page', '$title', '$text', '$keywords', '$description', '$topic')");
        echo "<meta http-equiv=\"refresh\" content=\"1;URL=index.php?index=adm&admin=content\">\n";
tablebottom();
include("footer.php");
}

function content_save_edit($id, $title, $body, $page, $keywords, $description, $topic) {
include("header.php");
tabletop();
global $id, $title, $body, $page, $keywords, $description, $topic, $http;
    mysql_query("update page set id='$id', page='$page', title='$title', body='$body', keywords='$keywords', description='$decsription', topic='$topic' where id='$id'");
        echo "<meta http-equiv=\"refresh\" content=\"1;URL=index.php?index=adm&admin=content\">\n";
tablebottom();
include("footer.php");
}

function content_delete($id, $ok=0) {
is_admin1();           //To Declare whether the user is an administrator
global $http;
    if ($ok==1) {
        mysql_query("delete from page where id='$id'");
        Header("Location: index.php?admin=content");
    } else {
include("header.php");
tabletop();
	$result = mysql_query("select title from page where id='$id'");
	list($title) = mysql_fetch_row($result);
	echo "<center><b>Delete Content: $title</b><br><br>"
	    ."Are you sure you want to delete : $title?<br><br>"
	    ."[ <a href=\"index.php?index=adm&admin=content\">No</a> | <a href=\"index.php?index=adm&admin=content_delete&amp;id=$id&amp;ok=1\">Yes</a> ]</center>";
    }
tablebottom();
include("footer.php");
}

    Originally posted by jpmoriarty
    which errors are you getting? and where?

    They werent specific errors not like displayed as text. The error was it never was placed into the database.

      Whenever I get an error like that I echo out the sql queries and then put them into phpMyAdmin and find out what the error is, for example

      <?
      require "dbconnectfile.class.php";
      $sql = "select * from table";
      $sql .= " where something=something";
      
      $test=$db->query($sql);
      //..stuff with query
      
      if ($test)
      {
        //something
      }
      else
      {
         echo $sql."<br>";
         //error("Problem with ...");
      }
      ?>
      
        Write a Reply...