Jump to content

coding help for a banking system


heshan

Recommended Posts

HI all,

 

I have a small problem regarding my php project.

 

There is a page called open_account.php. It contains all customer data such as NIC, full_name, date of birth, gender etc. When a user fills all the fields in that form it redirects to another page called new_account.php.

There are various account types in the bank. (Ex: A,B,C) I want to do something like this. When a user selects account B it has to show an error message saying " A male person cannot open a B account". Because it only allows women to open B account.

 

At the same time when a particular user selects an account say A, a message should be appeared as "Account number 1 has been successfully created"

 

I want your suggestions regarding how can i do these thing? I have attached all the php files

Database structure

 

customer(account_number,nic, full_name, name_with_initials, phone_number, address, gender, date_of_birth)

 

 

 

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Best way to do that based on what you have said is to do the following:

 

 

  • Collate all submitted form values into an array.
  • Based on the account type chosen run a function

To do this, run a php switch() on the chosen account type and within that run a function() to determine if the gender can open the particular account.

 

 

Code samples could be provided if necessary.

 

 

George

Link to comment
Share on other sites

To make things easier when dealing with PHP, ask for all information on the same page. I have therefore created this script under that assumption. Additionally, whilst looking at your form, the gender drop down was missing the value='' information and there PHP would not necessarily receive the genders. The switch in my script is an example using two account types from your forms, you should get the drift by looking at the example and be able to add additional cases to it.

 

 




//Create Array
$info = array(
           'nic' => $_POST["nic"],
           'full_name' => $_POST["full_name"],
           'name_with_initials' => $_POST["name_with_initials"],
           'phone_number' => $_POST["phone_number"],
           'address' => $_POST["address"],
           'account' => $_POST["account"],
           'gender' => $_POST["gender"],
           'date_of_birth' => $_POST["date_of_birth"]           
           );


//Run a switch on the chosen type of account
switch($info['account']) {
   
   //Savings Investment Account - I have used this as the account a male can't open.
   case "savings_investment":
   
      //Check if female
      if($info['gender']=="female") {
      
         //Account Creation Here
         
      }
      
      //If not a female
      if($info['gender']!="female") {
      
         //Show error messages here
         echo "You do not meet the critera required to open this account.";
         
      }
   
   break;
   
   //Shakthi Account
   case "shakthi":
   
      //Repeat the above steps here if neccessary
   
   break;


   default:
   break;
   
}


 

 

You can run any check you wish in the switch cases. If you want to show the error above the form, store the PHP code responsible for dealing with the forms submission in another location on the server. You can then include the handler above the start of the <form> tag like below and then forward the form back to its current self, WITHOUT using PHP_SELF but setting the action to the filename of that page, for example, if the form is on index.php, forward the forms action to index.php, as I've done below.

 

 



<?php isset($_POST['run']) { include_once "./handlers/account_creation.php"; } ?>


<form action="index.php">


<input type="hidden" name="run" value="yes" />

</form>


 

 

I hope this has helped answer your query. Let me know ;)

 

Link to comment
Share on other sites

Thanks a lot.  :) I need more help regarding this. I have confused a bit.. :wtf:

 

I have changed my page. Now there are only 2 pages.

I have attached both pages.

 

I want something similar to what you say. That is show the error message in the same page (open_account.php)

But i have confused regarding that part. pls help me out.

 

And also, if submit button clicks a seperate message has to be appeared as " You are successfully created Account number 1"

Pls correct my coding regarding that

 

New table in my database

 

customer (account_number, nic, full_name, name_with_initials, phone_number, address, gender, date_of_birth, account_type, fd_period )

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

You haven't changed much... but I have made some changes to your script. You can use the array I created to actually do the first insert. There is no need to redeclare the variables.

 

 

See below:

 

 

 

<?php


$connect=mysql_connect('localhost','root','');
mysql_select_db('bank',$connect);
               
//Create Array
$info = array(
           'nic' => $_POST["nic"],
           'full_name' => $_POST["full_name"],
           'name_with_initials' => $_POST["name_with_initials"],
           'phone_number' => $_POST["phone_number"],
           'address' => $_POST["address"],
           'gender' => $_POST["gender"],
           'date_of_birth' => $_POST["date_of_birth"],
         'account_type' => $_POST["account_type"], 
         'fd_period' => $_POST["fd_period"]          
           );


//Prepare the Insert Query
$insert_query = "INSERT INTO customer (
               nic,
               full_name,
               name_with_initials,
               phone_number,
               address,
               gender,               
               date_of_birth,
               account_type,
               fd_period
               ) 


               VALUES
               
               (
               '{$info['nic']}', 
               '{$info['full_name']}', 
               '{$info['name_with_initials']}', 
               '{$info['phone_number']}', 
               '{$info['address']}', 
               '{$info['gender']}', 
               '{$info['account_type']}', 
               '{$info['fd_period']}'
               )";




//Run a switch on the chosen type of account
switch($info['account_type']) {
   
   //Abhimani Plus Account - I have used this as the account a male can't open.
   case "abhimani_plus":
   
      //Check if female
      if($info['gender']=="female") {
      
         //Account Creation Here
         
      }
      
      //If not a female
      if($info['gender']!="female") {
      
         //Show error messages here
         echo "You do not meet the critera required to open this account.";
         
      }
   
   }


               


$r = mysql_query($insert_query);
if($r)
{


echo "A new account with number ".mysql_insert_id()." has been created successfully.";


}


?>

 

 

Save this script as account.php as before and save it in a folder on your server called handlers.

 

 

So if it was within the root of your site, it would be like this:

 

 

/public_html/handlers/account.php

 

 

I also attach the amended form:

 

 

 

<hr />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/url]">


<head>


<script src="datetimepicker_css.js">
  </script>  
  
<script LANGUAGE="JavaScript">
function fd_show(val){
if(val=="fd"){
   document.getElementById("fd_box").style.visibility = 'visible';
  }else{
   document.getElementById("fd_box").style.visibility = 'hidden';
  }
}
</script>


<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>  






<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#apDiv1 {
   position:absolute;
   width:177px;
   height:55px;
   z-index:1;
   left: 12px;
   top: 171px;
}
-->
</style>
</head>


<body>
<h2><img src="../images/image 1.jpg" alt="" width="118" height="89" /> <img src="../images/logo-default.jpg" alt="" width="350" height="89" /> <img src="../images/image 2.jpg" alt="" width="100" height="89" /></h2>
<h2> </h2>
<h2> </h2>
<h2>Accounts Opening Form </h2>
<p> </p>


<?php isset($_POST['run']) { include_once "./handlers/account.php"; } ?>


<form action="open_account.php">


<input type="hidden" name="run" value="yes" />
  
            
  <fieldset>
  <legend class="cap">Customer details</legend>


                       
  <table width="75%" border="0" cellspacing="0" cellpadding="5" align="center">
                 <tr>
                  <td> </td>
                  <td class="title02"> </td>
                  <td> </td>
                  <td> </td>
                 </tr>
                                          
                 <tr height="30">
                  <td width="10%"> </td>


                  <td width="25%" class="title02" align="left">NIC</td>
                  <td width="55%" class="attribute1" align="left"><label>
                    <input type="text" name="nic" id="textfield" />
                  </label></td>
                  <td width="10%"> </td>
                 </tr>
                 <tr height="30">
                  <td> </td>
                        <td width="25%" class="title02" align="left">Full name</td>
                    <td width="55%" class="attribute1" align="left"><label>
              <input type="text" name="full_name" class="attribute1" />
              </label></td>
                  <td width="10%"> </td>
                 </tr>
                 <tr height="30">
                  <td> </td>
                  <td class="title02" align="left">Name with initials</td>
                  <td class="attribute1" align="left"><input type="text" name="name_with_initials" class="attribute1" /></td>
                 </tr>
                   <tr height="30">
                  <td width="10%"> </td>


                  <td width="25%" class="title02" align="left">Phone Number</td>
                  <td width="55%" class="attribute1" align="left"><label>
                  <input type="text" name="phone_number" class="attribute1" />
                  </label></td>
                  <td width="10%"> </td>
                 </tr>
                       <tr height="30">
                  <td width="10%"> </td>


                  <td width="25%" class="title02" align="left">Address</td>
                  <td width="55%" class="attribute1" align="left"><label>
                    <textarea name="address" id="textarea" cols="45" rows="5"></textarea>
                  </label></td>
                  <td width="10%"> </td> 
    <tr height="30">
                        
                  <td> </td>
                  <td class="title02" align="left">Gender</td>
                  <td class="attribute1" align="left"><label>
                    <select name="gender" id="select">
                           <option selected="selected"></option>
                      <option value="male">Male</option>
                            <option value="female">Female</option>
                     </select>
                  </label></td>
    <tr height="30">
                  <td> </td>
                  <td class="title02" align="left">Date of birth</td>
                  <td class="attribute1" align="left"><input type="Text" id="demo3" name="date_of_birth" maxlength="25" size="25"/><img src="../images/cal.gif" onClick="javascript:NewCssCal('demo3','yyyyMMdd')" style="cursor:pointer"/> </td>
    </tr>
     
      
      <tr height="30">
        <td> </td>
        <td width="25%" class="title02" align="left">Account Type</td>
        <td width="55%" align="left" bgcolor="#FFFFFF" class="attribute1">
        <select name="account_type" onChange="fd_show(this.value)">
            <option selected="selected"></option>
            <option value="savings_investment">Savings Investment</option>
            <option value="shakthi" >Shakthi</option>
            <option value="surathal">Surathal</option>
            <option value="abhimani_plus">Abhimani Plus</option>
            <option value="yasasa">Yasasa Certificates</option>
            <option value="fd">Fixed Deposits</option>
          </select> </td>
     
      <tr height="30">
        <td colspan="4">
            <div id="fd_box" style="visibility: hidden;">
            <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
            <tr height="30">
                   
            </tr>
            <tr height="30">
              <td width="10%"> </td>
              <td width="25%" class="title02" align="left">FD period</td>
              <td width="55%" class="attribute1" align="left"><select name="fd_period">
                 <option selected="selected"></option>
                  <option value="< 1">less than 1 year</option>
                  <option value="1-3 years" >1-3 years</option>
                  <option value="> 3">more than 3 years</option>
                  <option value="il">immediate loan</option>
                </select></td>
              <td width="10%"> </td>
            </tr>
            </table>
            <>
        </td>
      </tr>
  </table>
    <p align="center"> </p>
    <p align="center">
      <input type="submit" onClick="return Validate();" name="submit" value="Submit" class="attribute1" />
        
      <input type="reset" name="reset" value="Reset" class="attribute1" />
        
      <label>
        <input type="submit" name="button2" id="button2" value="Help" />
      </label>
    </p>
  </fieldset>
  </td>
  <td width="5%"> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td align="center"> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td><font color="red" size="1" ></font></td>
    <td> </td>
  </tr>
                      
                      
                 
                      
  </table>
<p align="center">    </p>
  </fieldset>
</td>
            <td width="5%"> </td>
         </tr>


           <tr>


             <td> </td>
             <td> </td>
             <td> </td>
  </tr>
           
           
           
           <tr>
             <td> </td>
             <td align="center"> </td>
             <td> </td>
  </tr>
           <tr>
             <td> </td>
                            <td><font color=red size="1" ></font></td>
             <td> </td>
  </tr>
         </table>
    
</form>


<script language = "Javascript">
  
function Validate()
{
    if (document.form1.nic.value == '') 
    {
        alert('Please fill in nic!');
        return false;
    }
   if (document.form1.full_name.value == '') 
    {
        alert('Please fill in full name!');
        return false;
    }
    if (document.form1.name_with_initials.value == '') 
    {
       alert('Please fill in name with initials!');
       return false;
    }
   if (document.form1.phone_number.value == '') 
    {
        alert('Please fill in phone number!');
        return false;
    }
   if (document.form1.address.value == '') 
    {
        alert('Please fill in address!');
        return false;
    }
    if (document.form1.gender.value == '') 
    {
        alert('Please fill in gender!');
        return false;
    }
    if (document.form1.date_of_birth.value == '') 
    {
       alert('Please fill in date_of_birth!');
      return false;
    }
   
    
    return true;
}
</script>


          
</body>
</html>

 

 

Save this script as open_account.php and save it where you want it to be. It must be one folder above the handlers folder.

 

 

For example, if this file was in the root:

 

 

/public_html/open_account.php

 

 

Then, using the form, try to open a abhimani_plus, saying you're a male. It should then display an error above the form.

 

 

 

 

 

Link to comment
Share on other sites

It generates an error message like " ( ! ) Parse error: syntax error, unexpected '{' in C:\wamp\www\MySite\php files\open_account.php on line 62"

 

Line 62 - <?php isset($_POST['run']) { include_once "./handlers/account.php"; } ?>

 

 

I have saved my open_account.php file in this folder.                  C/wamp/www/MySite/php files/open_account.php

 

I have saved my account.php file in this folder.                            C/wamp/www/MySite/php files/handlers/account.php

 

Link to comment
Share on other sites

The form does not working... :(

 

The form values are not go into the database. When clicks on submit button nothing will happen. Just reload the same page.

I have created some validations also....But it also does not work..

 

Pls help me out. I haven't change my coding. Same as above

Link to comment
Share on other sites

@ George,

 

Thanks a lot friend... :D Now it's working. I had missed some quotations in the form.

 

I have another small issue. After displaying the message "Account number 1 has been created successfully" when i click on the refresh button another account number is automatically created. How can i solve this problem?

Link to comment
Share on other sites

  • 2 weeks later...

I have made some changes to my codings. I have highlighted the changes. But it still gives me an error message like this. CN nyone help me out with this problem?

 

Notice: A session had already been started - ignoring session_start() in C:\wamp\www\MySite\php files\handlers\account.php on line 14

 

Notice: Undefined index: form_secret in C:\wamp\www\MySite\php files\handlers\account.php on line 16

 

open_account.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

[b]<?php
session_start();
$secret=md5(uniqid(rand(), true));
$_SESSION['FORM_SECRET']=$secret;
?>[/b]

<script src="datetimepicker_css.js">
  </script>  
<script LANGUAGE="JavaScript">
function fd_show(val){
if(val=="fd"){
   document.getElementById("fd_box").style.visibility = 'visible';
  }else{
   document.getElementById("fd_box").style.visibility = 'hidden';
  }
}
</script>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#apDiv1 {
   position:absolute;
   width:177px;
   height:55px;
   z-index:1;
   left: 12px;
   top: 171px;
}
-->
</style>
</head>
<body>
<h2><img src="../images/image 1.jpg" alt="" width="118" height="89" /> <img src="../images/logo-default.jpg" alt="" width="350" height="89" /> <img src="../images/image 2.jpg" alt="" width="100" height="89" /></h2>
<h2> </h2>
<h2> </h2>
<h2>Accounts Opening Form </h2>
<p> </p>
<?php if(isset($_POST['run'])){include_once "./handlers/account.php";} ?>
<form action="open_account.php" name="form1" method="post">
<input type="hidden" name="run" value="yes" />

<[b]input type="hidden" name="form_secret" id="form_secret" 
value="<?php echo $_SESSION['FORM_SECRET'];?>" />[/b]

  <fieldset>
  <legend class="cap">Customer details</legend>
  <table width="75%" border="0" cellspacing="0" cellpadding="5" align="center">
                 <tr>
                  <td> </td>
                  <td class="title02"> </td>
                  <td> </td>
                  <td> </td>
                 </tr>
                                          
                 <tr height="30">
                  <td width="10%"> </td>


                  <td width="25%" class="title02" align="left">NIC</td>
                  <td width="55%" class="attribute1" align="left"><label>
                    <input type="text" name="nic" id="textfield" />
                  </label></td>
                  <td width="10%"> </td>
                 </tr>
                 <tr height="30">
                  <td> </td>
                        <td width="25%" class="title02" align="left">Full name</td>
                    <td width="55%" class="attribute1" align="left"><label>
              <input type="text" name="full_name" class="attribute1" />
              </label></td>
                  <td width="10%"> </td>
                 </tr>
                 <tr height="30">
                  <td> </td>
                  <td class="title02" align="left">Name with initials</td>
                  <td class="attribute1" align="left"><input type="text" name="name_with_initials" class="attribute1" /></td>
                 </tr>
                   <tr height="30">
                  <td width="10%"> </td>


                  <td width="25%" class="title02" align="left">Phone Number</td>
                  <td width="55%" class="attribute1" align="left"><label>
                  <input type="text" name="phone_number" class="attribute1" />
                  </label></td>
                  <td width="10%"> </td>
                 </tr>
                       <tr height="30">
                  <td width="10%"> </td>


                  <td width="25%" class="title02" align="left">Address</td>
                  <td width="55%" class="attribute1" align="left"><label>
                    <textarea name="address" id="textarea" cols="45" rows="5"></textarea>
                  </label></td>
                  <td width="10%"> </td> 
    <tr height="30">
                        
                  <td> </td>
                  <td class="title02" align="left">Gender</td>
                  <td class="attribute1" align="left"><label>
                    <select name="gender" id="select">
                           <option selected="selected"></option>
                      <option value="male">Male</option>
                            <option value="female">Female</option>
                     </select>
                  </label></td>
    <tr height="30">
                  <td> </td>
                  <td class="title02" align="left">Date of birth</td>
                  <td class="attribute1" align="left"><input type="Text" id="demo3" name="date_of_birth" maxlength="25" size="25"/><img src="../images/cal.gif" onClick="javascript:NewCssCal('demo3','yyyyMMdd')" style="cursor:pointer"/> </td>
    </tr>
     
      
      <tr height="30">
        <td> </td>
        <td width="25%" class="title02" align="left">Account Type</td>
        <td width="55%" align="left" bgcolor="#FFFFFF" class="attribute1">
        <select name="account_type" onChange="fd_show(this.value)">
            <option selected="selected"></option>
            <option value="savings_investment">Savings Investment</option>
            <option value="shakthi" >Shakthi</option>
            <option value="surathal">Surathal</option>
            <option value="abhimani_plus">Abhimani Plus</option>
            <option value="yasasa">Yasasa Certificates</option>
            <option value="fd">Fixed Deposits</option>
          </select> </td>
     
      <tr height="30">
        <td colspan="4">
            <div id="fd_box" style="visibility: hidden;">
            <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
            <tr height="30">
                   
            </tr>
            <tr height="30">
              <td width="10%"> </td>
              <td width="25%" class="title02" align="left">FD period</td>
              <td width="55%" class="attribute1" align="left"><select name="fd_period">
                 <option selected="selected"></option>
                  <option value="< 1">less than 1 year</option>
                  <option value="1-3 years" >1-3 years</option>
                  <option value="> 3">more than 3 years</option>
                  <option value="il">immediate loan</option>
                </select></td>
              <td width="10%"> </td>
            </tr>
            </table>
            </td>
      </tr>
  </table>
    <p align="center"> </p>
    <p align="center">
      <input type="submit" onClick="return Validate();" name="submit" value="Submit" class="attribute1" />
        
      <input type="reset" name="reset" value="Reset" class="attribute1" />
        
      <label>
        <input type="submit" name="button2" id="button2" value="Help" />
      </label>
    </p>
  </fieldset>
  </td>
  <td width="5%"> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td align="center"> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td><font color="red" size="1" ></font></td>
    <td> </td>
  </tr>
               
  </table>
<p align="center">    </p>
  </fieldset>
</td>
            <td width="5%"> </td>
         </tr>


           <tr>


             <td> </td>
             <td> </td>
             <td> </td>
  </tr>
           
           
           
           <tr>
             <td> </td>
             <td align="center"> </td>
             <td> </td>
  </tr>
           <tr>
             <td> </td>
                            <td><font color=red size="1" ></font></td>
             <td> </td>
  </tr>
         </table>
    
</form>


<script language = "Javascript">
  
function Validate()
{
    if (document.form1.nic.value == '') 
    {
        alert('Please fill in nic!');
        return false;
    }
   if (document.form1.full_name.value == '') 
    {
        alert('Please fill in full name!');
        return false;
    }
    if (document.form1.name_with_initials.value == '') 
    {
       alert('Please fill in name with initials!');
       return false;
    }
   if (document.form1.phone_number.value == '') 
    {
        alert('Please fill in phone number!');
        return false;
    }
   if (document.form1.address.value == '') 
    {
        alert('Please fill in address!');
        return false;
    }
    if (document.form1.gender.value == '') 
    {
        alert('Please fill in gender!');
        return false;
    }
    if (document.form1.date_of_birth.value == '') 
    {
       alert('Please fill in date_of_birth!');
      return false;
    }
if (document.form1.account_type.value == '') 
    {
       alert('Please fill in type of account!');
      return false;
    }
   
    return true;
}
</script>
     
</body>
</html>

 

account.php

 

<form id="form1" name="form1" method="post" action="">
  <label>
  <input type="submit" name="button" id="button" value="Home" />
  </label>
</form>
<p>   </p>
<p>


<?php
$connect=mysql_connect('localhost','root','');
mysql_select_db('bank',$connect);

[b]session_start();
//Retrieve the value of the hidden field
$form_secret=$_POST['form_secret'];
if(isset($_SESSION['FORM_SECRET'])) {
if(strcasecmp($form_secret,$_SESSION['FORM_SECRET'])===0) {[/b]


	/*Put your form submission code here
	After processing the form data,
	unset the secret key from the session
	*/

	//Create Array
$info = array(
           'nic' => $_POST["nic"],
           'full_name' => $_POST["full_name"],
           'name_with_initials' => $_POST["name_with_initials"],
           'phone_number' => $_POST["phone_number"],
           'address' => $_POST["address"],
           'gender' => $_POST["gender"],
           'date_of_birth' => $_POST["date_of_birth"],
	   'account_type' => $_POST["account_type"],
	   'fd_period' => $_POST["fd_period"]
                    
           );
//Prepare the Insert Query
$insert_query  = "INSERT INTO account_details (
               nic,
               full_name,
               name_with_initials,
               phone_number,
               address,
               gender,               
               date_of_birth
		   ) 
               VALUES
               (
               '$info[nic]', 
               '$info[full_name]', 
               '$info[name_with_initials]', 
               '$info[phone_number]', 
               '$info[address]', 
               '$info[gender]', 
		   '$info[date_of_birth]'
		         
               )";
		   
   
		   
             	   
//Run a switch on the chosen type of account
if($info['account_type'] == "abhimani_plus") {
      if($info['gender']!="female") {
         //Show error messages here
         echo "You do not meet the critera required to open this account.";exit;
      }
   }
//Account Creation Here
$r = mysql_query ($insert_query);
if($r) {
echo "A new account with number ".mysql_insert_id()." has been created successfully.";die();
}


$atype = mysql_real_escape_string($_POST['account_type']); //assuming this is a string
$fdper = mysql_real_escape_string($_POST['fd_period']); //assuming this is a string
$anum = intval($_POST['account_number']); //assuming this is an integer

$query = "UPDATE account SET `account_type` = '$atype', `fd_period` = '$fdper' WHERE `account_number`= '$anum'";

//$query= "UPDATE account `".$_POST['account_type']."` , '"$_POST['fd_period']."' WHERE `account_number`='".$_POST['account_number']."'";
mysql_query($query) or die(mysql_error());



[b]unset($_SESSION['FORM_SECRET']);
}else {
	//Invalid secret key
}
}else {
//Secret key missing
echo 'Form data has already been processed!';
}[/b]

?>
</p>
<p> </p>
<p> </p>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.