| | |
php value problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello all,
I'm a learning php this year but i encounters some problems.
One of them is about php value. The problem is how do i do to prevent a php file from resending the same values into the database whenever the page is refreshed?
Anyone help?
Thanks,
Asep
I'm a learning php this year but i encounters some problems.
One of them is about php value. The problem is how do i do to prevent a php file from resending the same values into the database whenever the page is refreshed?
Anyone help?
Thanks,
Asep
The only way that I know of doing this is redirecting after the post. For such a reason I usually process my posts on a separate file and then redirect back.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
or check for main fields of that post form...then i can be prevented...
for example...
and for empty fields doing client side validation is better...
for example...
php Syntax (Toggle Plain Text)
$seq="select count(*) as cnt from tablename where username='".$_POST['username']."'"; sres=mysql_query($seq); $srow=mysql_fetch_assoc($sres); if($srow['cnt']>0) { $errmsg="User with this Username already existed."; } else { //do your insert operations.. }
Last edited by Shanti Chepuru; Oct 14th, 2008 at 1:14 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
![]() |
Similar Threads
- PHP and JAVA vs .NET (IT Professionals' Lounge)
- Learning PHP but problem with script (PHP)
- Problems using a php generator (PHP)
- emails sent to bulk folder....(Is this a php problem?) (PHP)
- I think this is a php problem? (PHP)
- Large Array Problem (PHP)
Other Threads in the PHP Forum
- Previous Thread: Checkboxes
- Next Thread: Functions to validate e-mail, name and phone number
Views: 469 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax alexa apache api array beginner beneath binary broadband broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion redirect regex remote script search select server sessions sms smtp soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube






