Jump to content

Drag00n

Members
  • Posts

    10
  • Joined

  • Last visited

Drag00n's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php $res = mysql_query("SELECT * FROM `events` WHERE `to` = '".$_SESSION['userid']."' LIMIT 5"); while($myrow = mysql_fetch_array($res)) { echo "<center><table><tr>"; echo '<th>'.$myrow['text'].'</th><br /><td>'.date(F." ".d.", ".Y." ".g.":".i.":".sa,$myrow['timesent']).'</td></tr></table>'; } ?> Thats my code and everything works but as soon as i add DESC before limit 5 i get a Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in/home/pkmnx10m/public_html/rpg/_header.php on line 8. How do i fix this?
  2. Sorry about that but can you help me
  3. <?php @session_save_path("/home/pokemons/tmp"); @session_start(); /****************************************************** ------------------Required Configuration--------------- Please edit the following variables so the members area can work correctly. ******************************************************/ if (!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) { //die('We are updating PokemonSoulless RPG Please Stand By.'); } //We log to the DataBase $connection = @mysql_pconnect('localhost', 'pokemons_rpg', 'pUxA6HuS6E6RU2e'); if (!$connection) { include '_header.php'; echo '<div class="error">Error connecting to the database!</div>'; include '_footer.php'; die(); } $dbSelected = mysql_select_db('pokemons_rpg'); if (!$dbSelected) { include '_header.php'; echo '<div class="error">Error connecting to the database!</div>'; include '_footer.php'; die(); } //Webmaster Email $mail_webmaster = 'example@example.com'; //Top site root URL $url_root = '[url="http://www.example.com/%27;"]http://www.example.com/';[/url] $admin='danchy13'; /****************************************************** -----------------Optional Configuration---------------- ******************************************************/ //Home page file name $url_home = 'membersarea.php'; //Design Name $design = 'default'; // asdd stuffz $filename = end( explode('/', $_SERVER["SCRIPT_NAME"]) ); if ($filename != 'battle.php') { unset($_SESSION['battle']); } if (isset($_SESSION['userid'])) { $uid = (int) $_SESSION['userid']; $time = time(); $id = (int) $_SESSION['username']; mysql_query("UPDATE `users` SET `lastseen`='{$time}' WHERE `id`='{$uid}' LIMIT 1"); } // basic check for sql injection if ( stripos($_SERVER['QUERY_STRING'], 'UNION') !== false || stripos($_SERVER['QUERY_STRING'], 'SELECT') !== false || stripos($_SERVER['QUERY_STRING'], 'SCRIPT') !== false ) { $fh = @fopen('sqli_attempts.txt', 'a') or die(); fwrite($fh, $_SERVER['REMOTE_ADDR'] . ' ' . $_SERVER['SCRIPT_NAME'] . ' ' . $_SERVER['QUERY_STRING']); fclose($fh); } if (!function_exists('stripslashes_deep')) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value) ; return $value; } } // stop magic quotes if (get_magic_quotes_gpc()) { $_POST = stripslashes_deep($_POST); $_GET = stripslashes_deep($_GET); } ?>
  4. Basically I downloaded this source codes and I tried adding my own session so if the users are logged in they don't have to type a nick. However its not working. $_session['username'] stores the loggedin persons name. <?php session_start(); include 'config.php'; if(isset($_POST['submit'])) { $con = mysql_connect("localhost","monsters_ck","6789king"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("monsters_ck", $con); $message=$_POST['message'];$sender= $_SESSION['username']; mysql_query("INSERT INTO message(message, sender)VALUES('$message', '$sender')"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22>"]http://www.w3.org/TR...nsitional.dtd">[/url] <html xmlns="[url="http://www.w3.org/1999/xhtml%22>"]http://www.w3.org/1999/xhtml">[/url] <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple Chat</title> <script language="javascript" src="jquery-1.2.6.min.js"></script> <script language="javascript" src="jquery.timers-1.0.0.js"></script> <script type="text/javascript"> $(document).ready(function(){ var j = jQuery.noConflict(); j(document).ready(function() { j(".refresh").everyTime(1000,function(i){ j.ajax({ url: "Chat/refresh.php", cache: false, success: function(html){ j(".refresh").html(html); } }) }) }); j(document).ready(function() { j('#post_button').click(function() { $text = $('#post_text').val(); j.ajax({ type: "POST", cache: false, url: "Chat/save.php", data: "text="+$text, success: function(data) { alert('data has been stored to database'); } }); }); }); j('.refresh').css({color:"green"}); }); </script> <style type="text/css"> .refresh { border: 1px solid #3366FF; border-left: 4px solid #3366FF; color: green; font-family: tahoma; font-size: 12px; height: 225px; overflow: auto; width: 400px; padding:10px; background-color:#FFFFFF; } #post_button{ border: 1px solid #3366FF; background-color:#3366FF; width: 100px; color:#FFFFFF; font-weight: bold; margin-left: -105px; padding-top: 4px; padding-bottom: 4px; cursor:pointer; } #textb{ border: 1px solid #3366FF; border-left: 4px solid #3366FF; width: 320px; margin-top: 10px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; width: 415px; } #texta{ border: 1px solid #3366FF; border-left: 4px solid #3366FF; width: 410px; margin-bottom: 10px; padding:5px; } p{ border-top: 1px solid #EEEEEE; margin-top: 0px; margin-bottom: 5px; padding-top: 5px; } span{ font-weight: bold; color: #3B5998; } </style> </head> <body> <form method="POST" name="" action=""> <input name="sender" type="text" id="texta" value="<?php echo $uid ?>"/> <div class="refresh"> <?php $con = mysql_connect("localhost","monsters_ck","6789king"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("monsters_ck", $con); $result = mysql_query("SELECT * FROM message ORDER BY id DESC"); while($row = mysql_fetch_array($result)) { echo '<p>'.'<span>'.$row['sender'].'</span>'. ' ' . $row['message'].'</p>'; } mysql_close($con); ?> </div> <input name="message" type="text" id="textb"/> <input name="submit" type="submit" value="Chat" id="post_button" /> </form> </body> </html>
  5. I can't seem to message anyone the error The following errors were found Array This personal message has not been sent keeps coming. Help please.
  6. Drag00n

    Help

    This error keeps coming Parse error: syntax error, unexpected ';' in /home/a3504700/public_html/changeavatar.php on line 11 <?php include("leftnavigation.php"); $user = $info['username']; $userid = $info['id']; $password2 = $info['password']; ?> <center><?php if(isset($_POST['update'])) { $enteredpass = md5($_POST['password']; if($password2==$enteredpass) { $avatar = $_POST['avatar']; $update = mysql_query("UPDATE users SET avatar = '$avatar' WHERE id = $userid"); echo "Your avatar was updated succesfully"; } else { echo "Enter correct password"; } } else { echo "Here you can change the avatar. Enter.current password for verification."; } ?> <form method=post> Choose your avatar <br><?php echo '<img id=avatarchange src=images/trainers/000.png />'; ?> <?php echo '<select name=avatar id= Avatar onchange=changeAvi()>'; $sql6=mysql_query("SELECT * FROM avatars"); while ($row6=mysql_fetch_array($sql6)){ echo "<option value='".$row6['Image']."'>".$row6['Name']."</option>"; } echo '</select>'; ?> <script type="text/javascript"> function changeAvi(){ var image = document.getElementById('avatarchange'); var dropd = document.getElementById('Avatar'); image.src = dropd.value; }; </script> Enter Current Password :<br /><input type="password" name="password" maxlength="40"> <input type=submit name=update > </form> <script type="text/javascript"> function changeAvi(){ var image = document.getElementById('avatarchange'); var dropd = document.getElementById('Avatar'); image.src = dropd.value; }; </script> <?php include("rightnavigation.php"); ?>
×
×
  • 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.