Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Here is how you would switch the colors up <?php print "<center><table width='300' border='0'><tr><td width='100'><center><b>User ID</b></center></td><td width='100'><center><b>Username</b></center></td><td width='100'><center><b>Gold</b></center></td></tr>"; $topplayers="SELECT * from km_users order by gold DESC Limit $start, 20"; $topplayers2=mysql_query($topplayers) or die("Could not query players"); $count = 0; while($topplayer3=mysql_fetch_array($topplayers2)) { $topplayer3[playername]=strip_tags($topplayer3[playername]); //Put actual HEX codes for the colors if ($count == 1) $color = "gold"; else if ($count == 2) $color = "silver"; else if ($count == 3) $color = "bronze"; else $color = "default"; print "<tr><td width='100' bgcolor='$color'><center>$topplayer3[iD]</center></td><td width='100'> <center>$topplayer3[playername]</center></td><td width='75'><center>$topplayer3[gold]</center></td></tr>"; $count++; } print "</table></center>"; include 'inc/footer.php'; } ?>
  2. Something like this... <?php if (1st condition){ header('Location: page.php'); } else if (2nd condition){ header('Location: page.php'); } else { header('Location: page.php'); } ?>
  3. Your $MovileLock variable could be out of scope. Post more of your code so we can see if thats the problem.
  4. Try this <?php mysql_query("UPDATE gamecard SET `Ownerid`= '$login',Upline='{$row2['Serialnum']}' WHERE Serialnum = '{$row['Serialnum']}'") or die(mysql_error()); mysql_query("UPDATE gamecard SET Downleft='{$row['Serialnum']}' WHERE Serialnum = '{$row2['Serialnum']}'") or die(mysql_error()); ?>
  5. Oops, sorry...my mistake. Take a look at these articles http://www.tonymarston.net/php-mysql/many-to-many.html http://www.tomjewett.com/dbdesign/dbdesign.php?page=manymany.php There are tons of results on Google for this.
  6. I'm pretty sure you would get that error anyways, plus you didn't add the die statement in your posted code. The error resulted from the mysql_fetch_array() which of course goes along with the query. Echo your query out to make sure the variables are coming out okay.
  7. You don't want to make a separate table specifying which field links to what in each of the other tables, that would get really confusing. Just store what you have to store to create the relationship. Here is an example TABLE customers TABLE orders TABLE items ---------------- -------------- ------------ customerID +---+ orderID +-- itemID name +-- customerID | name address itemID +-----+ price
  8. Put a die statement on the query $topics = mysql_query("SELECT * FROM `topics` WHERE `fid` = '".$id."' AND `sticky` = '1' ORDER BY `timestamp` DESC LIMIT $limit_start,$total_limit")or die(mysql_error());
  9. You just simply add it to your link <a href="test.php?page=hello"> Or you can put it in your form action. Read this to help you (read about the GET method) http://www.tizag.com/phpT/postget.php
  10. Hmmm...I don't see anything wrong with that chunk of code. You should wrap your variables in quotes within queries. $sql = "INSERT INTO stories_views VALUES ( '$user_name', '$rec_id', '$today') "; Is that all the code from that file? If not, could you post more of it?
  11. Awesome =] Don't forget to solve the topic.
  12. The first way you said function pageContent(){ global $errors; ...... }
  13. Here is a function Barand helped me out with <?php function uploadThumb($name, $filename, $new_w, $new_h, $ext) { if ($ext == 'jpg'){ $src_img = imagecreatefromjpeg($name); } else if ($ext == 'gif'){ $src_img = imagecreatefromgif($name); } else if ($ext == 'png'){ $src_img = imagecreatefrompng($name); } $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x > $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x < $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); imagetruecolortopalette($dst_img,false,256); // convert to palletted image $color_00 = imagecolorat($dst_img,0,0); // get background color at 0,0 imagecolortransparent($dst_img, $color_00); // make it transparent if ($ext == 'jpg'){ imagejpeg($dst_img,$filename); } else if ($ext == 'gif'){ imagegif($dst_img,$filename); } else if ($ext == 'png'){ imagepng($dst_img,$filename); } imagedestroy($dst_img); imagedestroy($src_img); } ?> It works pretty good. The only problem with it is if you have a pure black area on the picture, it is going to make it transparent.
  14. Set the $_GET variable in the action attribute, and then set the method to POST. <form action="admincenter.php?value=a" method="post"> <input type="text" name="var"> <input type="submit" name="submit"> </form>
  15. Your going to have to add some PHP to the form. <form action='index.php' method='post'> <select name='LANG'> <option value='EN'>English</option> <option value='CH' <?php if ($_POST['LANG'] == 'CH') echo 'selected'; ?>>Chinese</option> </select> <input type=submit name=submit value=submit> </form>
  16. The whole thing is just unappealing. The colors are all over the place, and don't go together at all. You need some sort of header banner, not just a picture of five movie covers splattered over the top. I think you need to start over from scratch. I'm not saying this to be rude, just trying to help
  17. html_entity_decode() http://us.php.net/manual/en/function.html-entity-decode.php
  18. Well...to select them from the DB, you would use a query like this SELECT * FROM news ORDER BY newsID DESC LIMIT 10 I'm assuming you know how to display all the records into an HTML table. To get the 20 words, you would use the function substr() http://us.php.net/substr Then to make the "View More" link, you would just use the uniqueID from the table in the link. You would have to setup a page that gets the uniqueID from the URL and pulls that information from the database to display the full article.
  19. Yeah, I think what Dragen said is about as close as you can get. It's nice when it keeps the indention for you, that way you don't have to press tab every time you hit return, and it keeps it super easy to keep your code indented yourself. If for some reason your code ends up messy, you can use the link in my sig called "Code Beautifier".
  20. It's going to be kinda hard to help you if you can't find the code. Sounds like you need to contact whoever programmed your site.
  21. Take a look at this post http://www.phpfreaks.com/forums/index.php/topic,119433.0.html
  22. Could you post the code? You probably just have to change the field name in the database variable.
  23. If you search through the server variable, I'm sure you can find more. <?php echo '<pre>'; print_r($_SERVER); echo '</pre>'; ?>
×
×
  • 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.