Jump to content

Recommended Posts

That's not something you could do with a session. All the person would need to do is drop the session id and get a new session and they could vote again.

 

To do what you state would require that you remember the last time they voted using a database of some kind (mysql, flat-file...)

Link to comment
https://forums.phpfreaks.com/topic/181458-creating-a-session/#findComment-957226
Share on other sites

That's not something you could do with a session. All the person would need to do is drop the session id and get a new session and they could vote again.

 

To do what you state would require that you remember the last time they voted using a database of some kind (mysql, flat-file...)

 

I can do that, but my question is, how? I have more then one voting things. http://www.webmasters.webatu.com - How do I store IP's in just one row?...

Link to comment
https://forums.phpfreaks.com/topic/181458-creating-a-session/#findComment-957229
Share on other sites

That's not something you could do with a session. All the person would need to do is drop the session id and get a new session and they could vote again.

 

To do what you state would require that you remember the last time they voted using a database of some kind (mysql, flat-file...)

 

I can do that, but my question is, how? I have more then one voting things. http://www.webmasters.webatu.com - How do I store IP's in just one row?...

 

You wouldn't use 1 row. For each poll store an id identifying which poll was voted on, another id identifying the user and a timestamp to see when they last voted.

Link to comment
https://forums.phpfreaks.com/topic/181458-creating-a-session/#findComment-957234
Share on other sites

I SERIOUSLY don't understand what you mean...any examples you could give me?

 

Here is my vote.php page:

 

<?php

require("style.css");

$dbhost = 
$dbuser =
$dbpassword = 
$db = 
$ip = $_SERVER['REMOTE_ADDR'];
$pname = $_GET[project];

//connecting to the database
$connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!");
mysql_select_db("$db") or die("Database fail!");

$query = mysql_query("SELECT * FROM info WHERE pname='$pname'");

$numrows = mysql_num_rows($query);

if ($numrows!=1)
   die("<content>Project does not exist!</content>");

$points = mysql_query("UPDATE info SET numbers  = numbers + 1 WHERE pname='$pname'");
echo "Voted for $pname! <br /><br />";

?>

Forum BBCode: <br /><br /><textarea rows="10" cols="32">[url=http://"http://www.webmasters.webatu.com/vote.php?project=<?php echo $pname; ?>"][img=http://www.webmasters.webatu.com/testing.php?pname=<?php echo $pname; ?>][/url]</textarea>

Link to comment
https://forums.phpfreaks.com/topic/181458-creating-a-session/#findComment-957235
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.