Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Location
    Lincoln, Lincolnshire
    Posts
    2,662
    Tokens
    98
    Habbo
    Carlsta

    Latest Awards:

    Default Run Lottery Fault

    When the Lottery is run using the following code it doesnt do anything. The owner can't find any errors in it so i thought i would post it for you lot.

    PHP Code:
    <html>
    <head>
    <title>Home</title>
    <link href="housekeeping.css" rel="stylesheet" type="text/css">
    </head>
    <body bgcolor="#ffffff" class='content'>
    <b>Run Lottery</b><br><Br>
    </body>
    </html>
    <?
    ob_start
    ();
    include(
    "config.php");  
    if(
    $logged[username] && $logged[username] == $owner1 || $logged[username] == $webman || $logged[username] == $owner2 || $logged[username] == $siteman || $logged[username] == $comman || $logged[username] == $comman2){
    $admin 'System';
    $today date('Ymd'); 

    $totaltickets mysql_query("select * from `lottery`") or die(mysql_error());    
    $totaltickets mysql_num_rows($totaltickets); 

    srand((double)microtime()*1000000);  
    $random rand(1,$totaltickets); 

    $getprize mysql_query("select * from `lottery`") or die(mysql_error());   
    $getnum mysql_num_rows($getprize); 

    $prize $getnum 5
    $getwinner mysql_query("select * from `lottery` where `id` = '".$random."'") or die(mysql_error());   
    $w mysql_fetch_array($getwinner); 
    $winner $w[owner];  

    $add mysql_query("SELECT * FROM `users` WHERE `username` = '".$winner."'") or die(mysql_error());  
    $add mysql_fetch_array($add) or die(mysql_error());  
    $points $add['points'] + $prize
    $update mysql_query("UPDATE `users` SET `points` = '".$points."' WHERE `username` = '".$winner."'") or die(mysql_error());  

    $send mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,    
    `touser` , `from` , `unread` ,    
    `date` ) VALUES ('Lottery Winner Announcement', 'YOU WON THE LOTTERY!<br><br>Total Prize: 
    $prize', '$winner',    
    'Lottery Bot', 'unread', NOW())"
    ); 

    $sendd mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,    
    `touser` , `from` , `unread` ,    
    `date` ) VALUES ('Lottery Winner', '
    $winner won the lottery this week.<br><br>Total Prize: $prize', '$admin',    
    'Lottery Bot', 'unread', NOW())"
    ) or die(mysql_error());   

    $submit mysql_query("INSERT INTO `lottery_winners` (winner, amount) VALUES ('$winner', '$prize')") or die(mysql_error());  

    $reset mysql_query("TRUNCATE `lottery`"); 
    echo(
    "<p>The Lottery has been Run!!!<br><Br>The Winner Was: <b>$winner</b></p>");

    $date =  date("j F  G : i");
    $log mysql_query("INSERT INTO `logs` (`id` , `description`, `user`, `date` ) VALUES (NULL , 'Ran the Lottery', '$logged[username]', '$date')");

    if(
    $getprize && $getnum && $getwinner && $add && $update && $send && $sendd && $submit && $reset && log){
    echo(
    "Done");
    }else{
    echo(
    "Error");
    }
    }
    ?>
    » Carlsta «
    » Currently Got 1571 Reputation Points «



  2. #2
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    well i cant see anything rong but as its techtuts try going to http://techtuts.com and find the lottery script. i think theres somethiong else you need to add to it
    Looking for a good desiner to design a social networking template.

    PM me.

  3. #3
    Join Date
    Oct 2004
    Location
    Lincoln, Lincolnshire
    Posts
    2,662
    Tokens
    98
    Habbo
    Carlsta

    Latest Awards:

    Default

    Techtuts is down!
    » Carlsta «
    » Currently Got 1571 Reputation Points «



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •