Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 10-13-2008, 08:45 PM   #1
Warrior Member
 
Join Date: May 2007
Location: , , .
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Yahoo to komrad
Default Duplicate php value

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

Please read the sig file rules
komrad is offline   Reply With Quote
Old 10-13-2008, 10:21 PM   #2
HyperActive Warrior
 
Join Date: Jul 2007
Location: , , USA.
Posts: 187
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: Duplicate php value

Check the database and see if the data is there already. If it is, then do not enter it, if it is not then enter it.

Felecan - Innovative Web Solutions For Small and Mid-size Companies!
Emilian is offline   Reply With Quote
Old 10-14-2008, 10:18 AM   #3
Advanced Warrior
War Room Member
 
Sean Kelly's Avatar
 
Join Date: Oct 2006
Location: Ireland
Posts: 750
Thanks: 5
Thanked 34 Times in 24 Posts
Contact Info
Send a message via Yahoo to Sean Kelly Send a message via Skype™ to Sean Kelly
Default Re: Duplicate php value

You can use a cookie or session variable to determine if the current page has already been submitted to decide if you should do an insert or not.

Sean

http://www.ViralPDF.com - The #1 PDF Rebrander since 2002
http://www.PdfPrinterPro.com - Create PDFs with Audio, Video and Flash inside
http://www.PdfLocker.com - Lock & Encrypt your PDFs quickly & easily
Sean Kelly is offline   Reply With Quote
Old 10-14-2008, 11:08 AM   #4
HyperActive Warrior
 
Join Date: Jul 2007
Location: , , USA.
Posts: 187
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: Duplicate php value

Cookies can be changed client side and sessions can be hijacked. If you need something solid then check on the server side and not the client side. Otherwise you will end up with duplicate values.

Felecan - Innovative Web Solutions For Small and Mid-size Companies!
Emilian is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
duplicate, php, php value

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 03:15 PM.