Update Help

Im having trouble it seems my code on insertss.php is not getting any of my other stuff on my text fields

First Site. Where the information is gotten from

<html>
<body>
<form method="get" action="insertss.php">
Username: <input type="text" name="user"><br/>
Password: <input type="text" name="pass"><br/>
<input type="submit" value="Non-TBC"></form>
</body>
</html>

insertss.php

<?php
if (isset($_POST["user"])) {
$u = $_POST["user"];
$p = $_POST["pass"];
}
$con = mysql_connect("localhost","root","monkey123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("realmd", $con);



$sql="UPDATE account SET tbc = '0' WHERE username = '".$u."' AND password = '".$p."'";
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "Account $u has been updated.";
echo $sql;
mysql_close($con);
?>

You need to change the method in the html form tag to POST.

That will send the values via the POST array in php.

<form method="POST".....

That should fix it.

Sponsor our Newsletter | Privacy Policy | Terms of Service