[FX.php List] Problem with creating duplicate records

Jerry Do jhdo at central.uh.edu
Fri Jul 21 20:09:52 MDT 2006


Thank you for all response.

Here is the source for formA.php:
....
<body>
<form method ="post" action ="formA_response.php"s>
Name:<input type ="text" name ="name" value =""size ="20">
<br>
Age: <input type ="text" name="age" value ="" size ="5">
<br>
<input type ="submit" name ="submit" value="submit">
</form>
......

Source for formA_response.php:

<?php
include_once('FX/FX.php');
include_once('FX/server_data.php');

$name = $_POST['name'];
$age = $_POST['age'];

$newuser = new FX($serverIP,$webCompanionPort);
$newuser -> SetDBData('users.fp7','accounts');
$newuser ->SetDBPassword ($webPW, $webUN);
$newuser-> AddDBParam('name',$name);
$newuser -> AddDBParam('age',$age);

$createnewuserResult =$newuser ->FMNew();

?>

I took out most of the junk so it's easier to see.


I will try Bob Patin's method to see what happen.

Thanks
Jerry,


On 7/21/06 5:48 PM, "Gjermund Gusland Thorsen" <ggt667 at gmail.com> wrote:

> Would be nice to see your source if I am to come up with ideas on "how
> to prevent user reload the page ..."
> 
> ggt667
> 
> On 7/21/06, Jerry Do <jhdo at central.uh.edu> wrote:
>> Hello all,
>> 
>> I am new to fx.php and php.  I have problem users create duplicate records
>> by reload the response page.
>> For example:
>> I have a form name "formA" and the ACTION ="formA_response.php".
>> When the user click submit, the form will send all the information to
>> formA_response.php.
>> The formA_response.php page is the page to create new record.  I noticed
>> that if a user reload formA_response.php,  new record will be created.  Is
>> there a good method to prevent the user reload the page or going to that
>> page?
>> I am thinking that I might send to a page that will create the record then
>> close that page after the record created.  However, I am not sure it will
>> work or how to do write it yet.
>> 
>> Any input is welcome.
>> 
>> Thank you in advance,
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list