Last edited by coolgirlpwns; 21-08-12 at 04:19 PM.
add a session_start(); at the top
and an ob_end_flush(); at the bottom
And then put the header("Location: whereyouwantittogo.com"); right before the end flush and tada it works
Something like that, and when did you become a modPHP Code:<?php
session_start();
require_once("conn.php");//ÒýÓÃÊý¾Ý¿âÁ´½ÓÎļþ
$name = $_POST['login'];//GET·½·¨ÎªURL²ÎÊý´«µÝ
$date=date("Y-m-d H:i:s");
$sql = "insert into usecashnow(userid, zoneid, sn, aid, point, cash, status, creatime) values ('$name', '1', '0', '1', '0', '20000', '1', '$date')";
mysql_query($sql);//½èSQLÓï¾ä²åÈëÊý¾Ý
mysql_close();//¹Ø±ÕMySQLÁ¬½Ó
//echo "done";
header("Location: whereyouwantittogo.com");
ob_end_flush();
?>![]()
I can say theres ALOT of issues with your script one big one is data checking, you do none of it, the kid who is doing it could simply put any name in and recieve it, also you have nothing limiting your cubi you gain this is also a bad thing and can corrupt the db and make a HUGE log issue with mysql db so things you need to do is:
- Create a log table saying which accounts have voted and when
Include: (UID, accountname, IP, date)
- Create a cron which runs every 10 minutes using lynx or any other unix web browser out there which opens a .php file and simply checks if the dates are higher than the current date + X hours if it is then delete the record so the user can vote again.
- Your data checking should result in doing the following:
Check if account exists
Check if Information is correct
Check to see if person has already voted by account and by IP.
if you require more help with the scripting I may write an example up for you but php knowledge should be a number 1 priority when it comes to opening you server.
Last edited by nofxpunkerbrian; 12-09-10 at 10:02 AM.
wow that sounds really complicated x.x , My friend actually is the one who made our php registration page and im giving a go at the vote page, but i guess im doing it all wrong =(
Can you show me that example?
I highly recommend that you read through this and try to understand it all, php is really easy to pick up on and you can do a lot with it all, I could also code what Bash said to do but... imo you should learn how to do it yourself as it is quite important to know.