voting system syntax error.

Results 1 to 8 of 8
  1. #1
    Banned coolgirlpwns is offline
    BannedRank
    May 2010 Join Date
    BrazilLocation
    513Posts

    voting system syntax error.

    Last edited by coolgirlpwns; 21-08-12 at 04:19 PM.


  2. #2
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: voting system syntax error.

    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

  3. #3
    Banned coolgirlpwns is offline
    BannedRank
    May 2010 Join Date
    BrazilLocation
    513Posts

    Re: voting system syntax error.

    Quote Originally Posted by das7002 View Post
    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
    This will run the page right? cause its how it adds the cubi =)

    ---------- Post added at 03:13 PM ---------- Previous post was at 02:46 PM ----------

    hmm coming up with more syntax errors... Can you show me exactly where to put it? im not familiar with php D=

  4. #4
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: voting system syntax error.

    Quote Originally Posted by coolgirlpwns View Post
    This will run the page right? cause its how it adds the cubi =)

    ---------- Post added at 03:13 PM ---------- Previous post was at 02:46 PM ----------

    hmm coming up with more syntax errors... Can you show me exactly where to put it? im not familiar with php D=
    PHP 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();
    ?>
    Something like that, and when did you become a mod

  5. #5
    Banned coolgirlpwns is offline
    BannedRank
    May 2010 Join Date
    BrazilLocation
    513Posts

    Re: voting system syntax error.

    Quote Originally Posted by das7002 View Post
    PHP 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();
    ?>
    Something like that, and when did you become a mod

    This morning because i have skills! haha =)

  6. #6
    [B]aSH nofxpunkerbrian is offline
    MemberRank
    Apr 2009 Join Date
    1,151Posts

    Re: voting system syntax error.

    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.

  7. #7
    Banned coolgirlpwns is offline
    BannedRank
    May 2010 Join Date
    BrazilLocation
    513Posts

    Re: voting system syntax error.

    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?

  8. #8
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: voting system syntax error.

    Quote Originally Posted by coolgirlpwns View Post
    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.



Advertisement