PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 6th, 2011, 04:21 AM
v3inTe v3inTe is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 1 v3inTe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 13 sec
Reputation Power: 0
Vote once with Status: ON / OFF feature

Good day,
im using this code posted somewhere on other forum,.

PHP Code:
<?php 
mysql_connect
("localhost""root""password"); 
mysql_select_db("webcodez"); 
?> 
<form action="<?=$_SERVER['PHP_SELF'];?>" method="post">  
<input type="submit" name="submit" value="dai to4ka" class="bt_register" />  
</form>  
<?php  
$id 
= (int)$_GET['id'];  
if(
$_POST['submit']=='dai to4ka')  
{  
$timeout=10//60*60*24 seconds = 1 day  
$time=time();  
$out=$time-$timeout;  
$ip=$_SERVER['REMOTE_ADDR'];  
$check_double=mysql_query("SELECT * FROM ips WHERE ip='$ip' AND time>$out")or die(mysql_error());  

if(
mysql_num_rows($check_double)>0){  
echo 
"one time pls ";  
}  
else{  
echo 
"success"
$vote=mysql_query("INSERT INTO ips(ip,time) VALUES('$ip','$time')");  
//$query = mysql_query(" UPDATE `tz_members` SET point = point + 1 WHERE id = $id;") or die(mysql_error());  
}  

}


It works fine, but i want to add a STATUS: ON / OFF

if the status is ON then the user can vote..
otherwise, if status is OFF, the user can't vote at all + error message saying "Voting is off, you can't vote at this moment"

btw, changing of status can only be access by the admin side..
Thank you so much..

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Vote once with Status: ON / OFF feature


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap