Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Well I figured that much since they're posting in a PHP forum. Thanks!
  2. Yep, that's what I was hinting at the "validating the data." part. Of course, it's a little difficult to tell what type of validation is needed with the code provided.
  3. Out of curiosity, what kind of code is this?
  4. mysql_real_escape_string() is what you want to use before utilizing variables to interacte with a database: http://php.net/manual/en/function.mysql-real-escape-string.php That and validating the data.
  5. Have you tried any of the tutorials found through Google? http://www.google.com/search?q=php+downloading+images+as+zip There are a couple that look promising.
  6. Should be mysql_num_rows() http://php.net/manual/en/function.mysql-num-rows.php
  7. Do you run the code that removes the cookies before the header() redirect? Never mind, apparently I needed to re-familiarize myself with header()
  8. If it's all about retrieving a lost password, it would be more secure to just reset the password for visitors. What happens if someone gets ahold of the database?
  9. For the password in the database, is it stored as a md5 hash...or plain text?
  10. It sounds like you could use a LEFT JOIN which is used to get data from multiple tables with one query. This should hopefully help: http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php
  11. No problem As a side note, is there a reason you're using a close tag for images? echo "<img src='avatars/$avatar'></img><a href='$site/profile?id=$getid'></a><b> on $date</b><br />"; Unless I'm missing something, the image tag doesn't have a close tag. Since it looks like you're using XHTML, it would be closed as follows: echo "<img src='avatars/$avatar' /><a href='$site/profile?id=$getid'></a><b> on $date</b><br />";
  12. Since you already have the avatar saved to it's own variable ($avatar), you just need to remove line 277: $avatar = $row['avatar']; //<-- remove this line
  13. Ahhh...I think the issue is due to the fact that you're reading the data from two seperate tables: <?php //... $query = mysql_query("SELECT * FROM users WHERE id='$getid'"); //... $query = mysql_query("SELECT * FROM profile_comments WHERE profile_id='$getid' ORDER BY id DESC LIMIT $start, $perpage"); //... ?> "avatar" most likely doesn't exist in the second table.
  14. After line 277, did you try something like: <?php //... $avatar = $row['avatar']; print '(' . $row['avatar'] . ')'; //... ?> Does it display the various avatars filenames as expected? Since you have a while loop, I would imagine that you're dealing with multiple rows. Do some filenames display; while others do not? This might provide a clue to where the image data is being lost...
  15. You're using the $Result before it exists: <?php $accountStatus = Result['user']; $Result = mysql_fetch_assoc($checkActiveQuery); ?> ...plus you're missing a $...should be: <?php $Result = mysql_fetch_assoc($checkActiveQuery); $accountStatus = $Result['user']; ?>
  16. The initial error ("Notice: Undefined index: avatar...") suggests that "avatar" doesn't exist in the database table. You should double check to make sure they match exactly.
  17. @PFMaBiSmAd - you beat me to it; I was going to something very similar. Your code is more complete though.
  18. The comment was based on the following:
  19. All the more reason for the rest of us to argue the nitty-gritty details. @TheFilmGod - no matter which option is chosen, it's still a good idea to validate the input...even with drop downs. Someone could bypass the drop-downs, turn off JavaScript, etc. in an attempt to inject bad stuff.
  20. That's not quite what the OP was asking. It works for the specific value mentioned, but it doesn't work if the input is "726" for example. Instead, you could try something like: <?php function whatever($input){ //INITIALIZE VARIABLES $num_array = array(); //BREAK APART THE INPUT STRING for($i=0; $i<strlen($input); $i++) { $num_array[] = substr($input, $i, 1); } //SORT THE ARRAY AND RETURN THE RESULTS sort($num_array); return implode($num_array); } echo whatever($_GET['input']); ?>
  21. I concur with TeNDoLLA. Radio buttons already do what you want without having to depend on JavaScript.
  22. You'll need to wrap the multidimensional array in curly quotes: <?php echo '<a href="script.php?'."{event=$dr[$ii][event_name]}&town=$location".'">'.$dr[$ii]['event_name'].'</a>'; ?> Or you could move the array outside of the double-quoted string: <?php echo '<a href="script.php?event=' . $dr[$ii]['event_name'] . '&town=' . $location . '">' . $dr[$ii]['event_name'] . '</a>'; ?>
  23. The border under the "table" selector adds a border around the table, while the border under the "td" and "th" selector adds a border around the individual cells. If you're looking for an affect which is similar to the border attribute for the <table> tag, you'll need both. Note that I just noticed that the following may need to be modified: table.fleets th, td { padding: 5px 15px; min-width: 110px; border: 1px solid #303030; } Right now it applies the padding, min-width, and border to all table cells. If you only want the styles applied to the "fleets" tables, you'll need to change the selector to: table.fleets th, table.fleets td {
  24. Of course you'll want to add some kind of label to indicate where to enter the day/month/year. Some format their dates as DD-MM-YYYY, while others may use MM-DD-YYYY.
  25. You'll need to add the border declaration to the table's column selector: table.fleets th, td { padding: 5px 15px; min-width: 110px; border: 1px solid #303030; }
×
×
  • 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.