Apr 20, 2008

PHP Form Processing

PHP Form Processing


Function value=" . $function1 . "";
echo "

You Submitted:

";
  else  //add URL
  {
    $mainsection="links";
    $query1="select * from " . $mainsection . " order by id";
    $result = mysql_db_query($dbname, $query1) or die("Failed Query of " . $query1);
    $i1=1;
    $i2=0;
    while($thisrow=mysql_fetch_row($result))  //get one row
    {
      if ($i1<$thisrow[$idn])
      {
        if ($i2==0) $i2=$i1;
      }
      $i1++;
    }
    if ($i2==0) $i2=$i1;  //$i2 is now the lowest value for id.
    $i1=0;
  // Search for the current url
    $query2="select * from " . $mainsection . " as t1 where t1.url = \"" . $url . "\"";  //Look for the link in the current system -140
    $result = mysql_db_query($dbname, $query2) or die("Failed Query of " . $query2);
    if ($thisrow=mysql_fetch_row($result))  // If already in system
    {
      if (($category==$thisrow[$cat1n]) or ($category==$thisrow[$cat2n]) or ($category==$thisrow[$cat3n]) or ($category==$thisrow[$cat4n]))  //in requested category
      {
        echo "

The URL is already listed in the requested category.
";

echo "URL name: " . $url . "
";

if ($thisrow[$approv]==0) echo "Please be patient, it is not yet approved for main viewing.
";

if ($thisrow[$activen]==0) echo "It is shown as inactive, please send us an e-mail if it is active.
";

echo "Thank you for your interest.

";
      }
      else  //not in the requested category  //421
      {
        echo "

The URL is already listed in another category.
";

echo "URL name: " . $url . "
";

if ($thisrow[$approv]==0) echo "Please be patient, it is not yet approved for main viewing.
";

if ($thisrow[$activen]==0) echo "It is shown as inactive, please send us an e-mail if it is active.
";

echo "Thank you for your interest.

";
      }
    }
    else //not in system
    {
      $i1=1;
      $id=$i2;
//      $query1="insert into " . $mainsection . " (url, sitetitle, description, gifurl, cat1, email, creator, id, entdate, sitetype) values (\"" . $url . "\",\"" . $title . "\",\"" . $description . "\",\"" . $gifurl . "\",\"" . $category . "\",\"" . $email . "\",\"" . $uname . "\"," . $i2 . ", CURDATE())";  //163
      $query1="insert into " . $mainsection . " (url, sitetitle, description, gifurl, cat1, email, creator, id, entdate, sitetype) values (\"" . $url . "\",\"" . $title . "\",\"" . $description . "\",\"" . $gifurl . "\",\"" . $category . "\",\"" . $email . "\",\"" . $uname . "\"," . $i2 . ", CURDATE()," . $stype . ")";  //163
      mysql_db_query($dbname, $query1) or die("Failed Query of " . $query1);
      echo "URL: " . $url . "

";
      echo "Title: " . $title . "

";
      echo "Description: " . $description . "

";
      echo "Gif URL: " . $gifurl . "

";
      echo "User Name: " . $uname . "

";
      echo "E-mail address: " . $email . "



";
      echo "The changes will be final when they are approved by our staff.
";
    }  //389
  }  //end add URL

No comments:

Post a Comment

Popular Posts