RE: [PHP-DB] Re: saving data
| From: | USA) | Date: | Wed, 19 Jun 2002 15:51:15 +0000 |
| Subject: | RE: [PHP-DB] Re: saving data | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19878@lists.php.net to get a copy of this message | ||
I don't see any security issues with Adam's solution that are any different than the
similar post once solution.
<>< Ryan
-----Original Message-----
From: Niklas Lampén [mailto:niklas.lists@publico.fi]
Sent: Wednesday, June 19, 2002 6:18 AM
To: Php-DB
Subject: RE: [PHP-DB] Re: saving data
This is a good solution, but keep in mind that you really have to make
sure that only allowed people can use that page. Otherwise anyone could
just write a very simple program for destroying your whole data..
Niklas
-----Original Message-----
From: Adam Royle [mailto:digitalbalance@mac.com]
Sent: 19. kesäkuuta 2002 15:08
To: Natividad Castro; php-db@lists.php.net
Subject: [PHP-DB] Re: saving data
Very interesting question. One way you could do this, is using
javascript. Basically, you have two frames - one is the form, the other
is an invisible frame. Then, create a javascript function which sends
information about what field to update (and also the value to update to)
to the invisble frame, and put this function in the onBlur bit of your
form element.
Am I making sense? Basically, what it would do is update the database
after you click out (or tab or deselect a form element)
example...
this would be the HTML (depending on form contents and database design,
you might have to include a few more javascript parameters)
<input type="hidden" name="userID" value="<?= $userID ?>">
<input type="text" name="first_name"
onBlur="updateDB(this.name,this.value,userID.value);">
and the javascript might be
function updateDB(theName, theValue, userID){
top.invisbleFrame.href =
"update.php?name="+theName+"&value="+theValue+"&userID="+userID;
}
of course if you have a complex form/or specific database thingys, this
might be more complex, but basically this shows the data transfer
between pages
and in the invisbleFrame (update.php) you might have something like
this:
<?php
dbConnect(); //obviously this is the database connection function
$sql = "UPDATE tablename SET $name = '$value' WHERE userID = $userID";\
mysql_query($sql)
?>
I hope that helps. If you need further help or explanation, ask!!!
Adam
> Hi to all,
> Is it possible to save information from a form without being
> submitted? I
> know this question might be a little extrange for some of you. The
> reason
> why I'm asking this question is because I collect information from
> different
> places where users fill out a big form, they're complaining because
> sometimes they are about to finish filling out the form when they lose
> connection
> I was wondering if there is a way to get this data temporaly and then
> when
> they reconnet to the system display all the fields with the
information
> they
> already type in.
>
> If someone has any idea, please let me know
>
> Thanks in advanced
> Nato
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/
###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php