Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Cookie problem

 
   Database Help (Home) -> PHP RSS
Next:  Help: Make a php file return a zip file?  
Author Message
nospam117

External


Since: Jan 13, 2005
Posts: 8



(Msg. 1) Posted: Mon Feb 21, 2005 2:40 pm
Post subject: Cookie problem
Archived from groups: comp>lang>php (more info?)

*This message is also posted in alt.php*

Hi.
This is a part of a form I'm using:

<?php
if($sentmessage == '3'){
echo "You have already posted 3 times!";
exit();
}else{
$num = $sentmessage + 1;
setcookie("sentmessage","$num",time()+600);
}

if ($submit) {

// process form
// I want the cookie to increase its value at this point not by updating
the page
$db=mysql_connect ("localhost", "***", "****") or die ('I cannot connect
to the database because: ' . mysql_error());
mysql_select_db ("****");

mysql_select_db("mydb",$db);
$today = date("F j, Y, G:i");
$name = html_entity_decode(strip_tags($navn));
$email = html_entity_decode(strip_tags($epost));
$phone = html_entity_decode(strip_tags($telefon));
$sn1 = html_entity_decode(strip_tags($sn1));

I need the cookie to run after submitting, or after this code:

if ($submit) {
// process form

The problem now is that the cookie is increasing the value for
one update, not by submitting.

Regards,
Reffo

 >> Stay informed about: Cookie problem 
Back to top
Login to vote
Geoff Berrow1

External


Since: Dec 24, 2003
Posts: 366



(Msg. 2) Posted: Mon Feb 21, 2005 2:40 pm
Post subject: Re: Cookie problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I noticed that Message-ID: from
Reffo contained the following:

 >*This message is also posted in alt.php*

See my reply in same.

And do not multipost. Crosspost, if you must.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs <a rel="nofollow" style='text-decoration: none;' href="http://www.ckdog.co.uk/rfdmaker/" target="_blank">http://www.ckdog.co.uk/rfdmaker/</a>

 >> Stay informed about: Cookie problem 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Simple cookie reading problem - Hi all, this is probably stupidly easy but I'm struggling. I am trying to understand why cookies only appear to be readable when a web page is retrieved by *typing the url into the browser's address box* but NOT when the same page is accessed *via a..

i can't set a cookie? Or is it a Windows problem? - This site was working: http://www.thesecondroad.org/ Now I'm told people are unable to create new accounts or log in. One theory: It seems that cookies are not being set. Our beta testers missed this bug, because the code was working at some point, an...

session cookie - Hi, What happens when the the previous session cookie is not destroyed (but session_destroy() and session_unset() have been used previously) apart from the fact that the previous session id will be used. Does this mean that the previous session only wil...

Reading a cookie - I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a switch/case to take action based on that value in the cookie. ...

Keep user logged in with cookie - I have a site that I want to keep the user logged in after they leave the site if they check the "Remember Me" box. How do I go about doing this? Lengthen the session length? Any help would be great. Thanks, Nate Baxley
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]