Jump to content

Whats wrong? The form seems to not like the validation


TeddyKiller

Recommended Posts

Here is the php for the form.

 echo '<form action="" method="post">
<input type="hidden" name="id" value="'.$rw['id'].'" />
<input type="submit" name="accept" value="Accept!" />
<input style="margin-left:30px;" type="submit" name="decline" value="Decline!" /></form>';

 

Here is what I'm using to validate the form.

  if(isset($_POST['accept'])){
      if(isset($_POST['id'])){
          $id = $_POST['id'];
          $query = mysql_query("UPDATE `friend_requests` SET `status`='2' WHERE `request_to`='$user->id' AND `request_by`='$id'");
          $query = mysql_query("INSERT INTO `friends` (user_id, friend_id) VALUES ('$user->id', '$id'");
          $query = mysql_query("INSERT INTO `friends` (user_id, friend_id) VALUES ('$id', '$user->id'");
      }
  }
  if(isset($_POST['decline'])){
      if(isset($_POST['id'])){
          $id = $_POST['id'];
          $query = mysql_query("UPDATE `friend_requests` SET `status`='1' WHERE `request_to`='$user->id' AND `request_by`='$id'");
      }
  }

It's not really validation.. but yeah.

 

I've checked the queries for errors and it doesn't do them. I assume it's not knowing what the $_POST's are. Though there is no reason for it to not know what it is?

 

Whats the problem?

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.