Jump to content

halfpint

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

halfpint's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi This is from a game script where users can display there own banners The banners are dispalying the correct width but the height does not display correcty. Its like the banner is only 20 pix high when it should be displayed as 120 pix high This is the code from the page that lets users add thier own banners Could anybody tell me if there is something wrong with the code which is causing the banners to not display corectly Thanks <tr><td class="mainTxt"> <form name="form1" method="POST" onsubmit="submitDis('submit')"><table> <tr><td valign="top" width=100><br> <input type="button" value=" Bold "onClick="document.form1.info.value += ' [b] TEKST [/b]'"> <input type="button" value=" Underline "onClick="document.form1.info.value += ' [u] TEKST [/u]'"> <input type="button" value=" Itallic "onClick="document.form1.info.value += ' [i] TEKST [/i]'"> </td> <td><textarea name="info" cols=70 rows=16>{$clan->info}</textarea></td></tr> <tr><td width=100>Gang Image: </td> <td><input type="text" size="70" name="avatarc" value="{$clan->avatarc}"> <br>Width: 600 pixels - Hight: 120 pixels <td></tr> <tr><td></td> <td align="left"><input type="submit" value="Update"></td></tr> </table></td></tr>
  2. Hi I purchased this game script and I cannot get any support from the website or the guy that wrote the script. You basicaly build up towns and fight other players. I have a problem when somebody tries to edit thier profile or change their email ect.. in the game It says it has succesfully updated but when you return to your own town the actual background graphics goes black and any jpgs do not show up The game looks like this before you change anything in the profile But as soon as you change anything in the profile the game shows up like this The actual code for the change profile is this and I dont know if it is this that is causing the problem. Could somebody please have a look at the code to see if it is this that is causing the problem thanks <?php /*** Battle Towns | Play Battle Towns A Free Strategy War Game ***/include "antet.php"; include "func.php"; if (isset($_SESSION["user"][1], $_POST["pass"])) if ($_SESSION["user"][2]==md5($_POST["pass"])) { $ar=array("\'", "\""); $_GET["email"]=str_replace($ar, "", $_GET["email"]); profile($_SESSION["user"][1], $_POST["email"], $_POST["desc"], $_POST["sitter"], $_POST["grpath"], $_POST["lang"]); $_SESSION["user"][3]=$_POST["email"]; $_SESSION["user"][9]=$_POST["desc"]; $_SESSION["user"][12]=$_POST["sitter"]; $_SESSION["user"][13]=$_POST["grpath"]; $_SESSION["user"][16]=$_POST["lang"]; } else msg($lang['accessDenied']); else msg($lang['insufData']); ?>
  3. Escape all the quotes highlighted in blue. Do not escape the quotes in red. TO escape you place a backslash in front of the quote like so \" or \' Ok thank you once again for your help
  4. Is this correct, sorry Im a bit dumbfounded on this one print "<img src=http://$site_url/avatars/non.gif width="80" height="80">"; should be print "<img src=http://$site_url/avatars/non.gif width="80" height="80">/";
  5. Hi ok thanks for your help, I did not write this script I purchased it and when I try and get help from the person I bought it from they just dont reply. I am not a php coder I only know tiny bits which I have picked up over time. Thanks again for your help I will go over it and look for the quotes within the strings as you mentioned above.
  6. yes it is on another page which links to the top page which I posted above <div align=left><?php $getinfo = mysql_query("SELECT username,email,gameplays,avatar,comments,location,gender,favgame,joined,im,status,id FROM users WHERE username='$_REQUEST[user]'") or die(mysql_error()); $get = @mysql_fetch_array($getinfo); if(@mysql_num_rows($getinfo) == '0') { ?> <h1>No User To View Profile</h1> <br> <br> <?php }else{ ?> <?php echo"$top_games";?> <?php echo"$latest_games";?> <?php echo"$affiliates";?> <br> <h1> <?=$_REQUEST[user]?> 's Profile</h1> <br> <br> <?php if($get[avatar] == '') { print "<img src=http://$site_url/avatars/non.gif width="80" height="80">"; }else{ print "<img src=$get[avatar] width="80" height="80">"; } ?> <br> <br> <strong> <?php if($get[status] == '0') { print "<font color=red>I am currently offline</font>"; }elseif($get[status] == '1'){ print "<font color=green>I am currently online</font>"; } ?> </strong><br> <strong>Total Plays:</strong> </h3> <?=$get[gameplays]?> <br> <br> <strong>Location:</strong> </h3> <?=$get[location]?> <br> <br> <strong>IM:</strong> </h3> <?=$get[im]?> <br> <br> <strong>Gender:</strong> </h3> <?=$get[gender]?> <br> <br> <strong>Favorite Game:</strong> </h3> <?=$get[favgame]?> <br> <br> <strong>Date Joined:</strong> <?=$get[joined]?> <br> <br> <strong>Comments:</strong> <?php $comments = stripslashes($get[comments]); print wordwrap($comments); ?><br> <br> <a href="page.php?page=pms&compose=1&to=<?=$_REQUEST[user]?>">Send this user a PM</a><br> <br> <br> <br> <center> <?php if ($adult ==1 || $porn_setting==1){ include("cache/ad-1-468x60.php"); } else{ include("cache/ad-0-468x60.php"); } ?> </center> <?php $query4 = "SELECT gid,gname FROM favoritegames WHERE uid='$_REQUEST[user]'"; $result4 = mysql_query($query4) or die(mysql_error()); if(@mysql_num_rows($result4) == '0') { }else{ ?> <h1>My Favorite Games:</h1> <?php while (list ($id, $name) = mysql_fetch_row($result4)) { echo "<br><a href=./play.php?action=play&id=$id>$name</a>"; } } ?> <?php } ?> <br><br><br><br><br><br><br><br><br><br> </div>
  7. Oh no now I am getting this parse error from a page that links to the top code (Parse error: syntax error, unexpected T_LNUMBER on line 20) I have no idea what it means as on line 20 there is a space <br>
  8. Hi thanks so this echo "<a href=\"page.php?page=memberlist&p=$a"> $a </a>"; should be cho "<a href=\"page.php?page=memberlist&p=$a\"> $a </a>";
  9. Hi I have been trying to fix this for about a week now but I keep getting silly parse errors after I have fixed one it gives me another parse error on a different line. Could somebody please be so kind and go through it and fix the parse errors I now have a parse error on line 58. I am at my wits end with this now lol Thanks <h1>Member List</h1> <table class="text01" border="0" cellspacing="0" cellpadding="0" width=100%> <tr> <th>Status</th> <th>Name</th> <th>Date Joined </th> <th>Plays </th> <th>PM</th> </tr> <br> <?php $limit = 50; $q = mysql_query("SELECT username FROM users WHERE gameplays > 0"); $total_items = mysql_num_rows($q); $total_pages = ceil($total_items / $limit); $page = $_REQUEST['p']; if((!$page) || (is_numeric($page) == false) || ($page < 0) || ($page > $total_items)) { $page = 1; //default } $set_limit = $page * $limit - ($limit); $timestamp = time(); $timeout = $timestamp-300; // Fix members online $delete = mysql_query("UPDATE users SET status='0' WHERE timestamp<$timeout"); $getinfo = mysql_query("SELECT username,joined,gameplays,status FROM users WHERE gameplays > 0 LIMIT $set_limit, $limit") or die(mysql_error()); while($row = mysql_fetch_array($getinfo)) { ?> <tr> <th ><strong> <?php if($row[status] == '0') { print "<font color=red>Offline</font>"; }elseif($row[status] == '1'){ print "<font color=green>Online</font>"; } ?> </strong></th> <th ><a href="profile-<?=$row[username]?>.html"> <?=$row[username]?> </a></th> <th ><?=$row[joined]?></th> <th ><?=$row[gameplays]?></th> <th ><a href="page.php?page=pms&compose=1&to=<?=$row[username]?>">PM Me</a><br></th> </tr> <tr> <th colspan="5"> <?php } $prev_page = $page - 1; if($prev_page >= 1) { echo "<a href=\"page.php?page=memberlist&p=$prev_page\">< Prev></a>"; } for($a = 1; $a <= $total_pages; $a++) { if($a == $page) { echo("<b> $a</b> | "); //no link } else { echo "<a href=\"page.php?page=memberlist&p=$a"> $a </a>"; } } $next_page = $page + 1; if($next_page <= $total_pages) { echo "<a href=\"page.php?page=memberlist&p=$next_page"><Next></a>"; } ?> </table> <br><br><br><br><br><br><br><br><br><br>
  10. Hi can anyone see where the error is in this bit of code as it keeps comming up with a parse error on this line echo("<a href="page.php?page=memberlist&p=$prev_page">< Prev</a>"); thanks in advance
  11. REMEMBER TO SANITIZE YOUR INCOMING VARIABLES! Please read about mysql_real_escape_string http://us2.php.net/mysql_real_escape_string Hi thanks I have now got it working with the help of some other webmasters The code that worked was this <? include 'header.php'; if($_POST['form_type'] == 'avatarquote') { $avatar = $_POST["avatar"]; $quote = $_POST["quote"]; $result= mysql_query("UPDATE `grpgusers` SET `avatar`='".$avatar."', `quote`='".$quote."' WHERE `id`='".$user_class->id."'"); echo 'Your preferences have been saved.'; die(); } elseif($_POST['form_type'] == 'bannersig') { $banner = $_POST["banner"]; $sig = $_POST["sig"]; $result= mysql_query("UPDATE `grpgusers` SET `banner`='".$banner."', `sig`='".$sig."' WHERE `id`='".$user_class->id."'"); echo 'Your preferences have been saved.'; die(); } I have also been talking to another guy who is helping me to stop users from injecting code in to mysql Thanks for all your help Im a happy bunny now..lol
×
×
  • 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.