Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Insert title here</title>
- </head>
- <body>
- <form action="Bank_log.php" method="post">
- you Number:<input type="text" name="acc"><br>
- Pin :<input type="number" name="pin">
- <input type="submit" name="check" value="check">
- </form>
- </body>
- </html>
- login php
- <?php
- $username="root";
- $password="";
- $database="bankdb";
- $first=$_POST["acc"];
- $pa=$_POST["pin"];
- session_start();
- $_SESSION['myValue']=$first;
- $con = mysql_connect("localhost",$username,$password);
- mysql_select_db("bankdb",$con);
- $query = "select * from bank1";
- $result=mysql_query($query);
- $f=1;
- while($row = mysql_fetch_array($result))
- {
- if($row['acc'] == $first && $row['pin'] == $pa)
- {
- $f=0;
- header("location:Bank_Wit.html");
- }
- }
- if($f==1)
- {
- echo "login incorrect";
- }
- mysql_close();
- ?>
- operation html
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <form action="Bank_updat.php" method="post">
- <select name="sel">
- <option>Withdraw</option>
- <option>Deposit</option>
- </select>
- Enter ur amount:<input type="text" name="amt">
- <input type="submit" name="sub" value="update">
- </form>
- </body>
- </html>
- update php
- <?php
- $username="root";
- $password="";
- $database="bankdb";
- $wit=$_POST["sel"];
- $amt=$_POST["amt"];
- $con = mysql_connect("localhost",$username,$password);
- mysql_select_db("bankdb",$con);
- session_start();
- $a= $_SESSION['myValue'];
- $query = "select * from bank1";
- $result=mysql_query($query);
- $am=0;
- $f=1;
- while($row = mysql_fetch_array($result))
- {
- if($row['acc']==$a)
- {
- if ($wit=="Withdraw" )
- {
- $am=$row['amt']-$amt;
- echo"record updated";
- }
- if ($wit=="Deposit")
- {
- $am=$row['amt']+$amt;
- echo "record add";
- }
- }
- }
- $query="update bank1 set amt='$am' where acc='$a' ";
- $result=mysql_query($query);
- mysql_close();
- ?>
Add Comment
Please, Sign In to add comment