-3
<?php
if (isset($_POST['submit']))
{   
    $username=$_POST['username'];

    $url=$_POST['url'];
    $bank=$_POST['bank'];
    $namarekening=$_POST['namarekening'];
    $norekening=$_POST['norekening'];
    $nohape=$_POST['nohape'];
    $email=$_POST['email'];
    $anda=$_POST['anda'];

    mysql_query("insert into users  (username,email,namarekening,norekening,nohape,anda,url,bank)
    values('$username','$email','$namarekening','$norekening','$nohape','$anda','$url','$bank')
    ")or die(mysql_error());
    ?>
    <script>alert('Successfully Registered!'); window.location = 'pesarta.php';</script>"
    <?php
}   
?>

This is my code, any idea what should i do, i make table with 3 column, No.,URL, and the other one is Status. i want if they send, it automatically fill up the Status table with pending..

Ian
  • 24,116
  • 22
  • 58
  • 96
dem
  • 9
  • 3
  • 1
    [Your script is at risk for SQL Injection Attacks.](http://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) – Jay Blanchard Dec 17 '15 at 14:19
  • 1
    Please [stop using `mysql_*` functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php). [These extensions](http://php.net/manual/en/migration70.removed-exts-sapis.php) have been removed in PHP 7. Learn about [prepared](http://en.wikipedia.org/wiki/Prepared_statement) statements for [PDO](http://php.net/manual/en/pdo.prepared-statements.php) and [MySQLi](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php) and consider using PDO, [it's really pretty easy](http://jayblanchard.net/demystifying_php_pdo.html). – Jay Blanchard Dec 17 '15 at 14:19

1 Answers1

-1

in your mysql table (users) set a default value pending for field status

Rajveer gangwar
  • 715
  • 4
  • 14