Jump to content

Bauer418

Members
  • Posts

    206
  • Joined

  • Last visited

    Never

Everything posted by Bauer418

  1. I get what you want to do, I'm asking what the script currently does. What is the first day in that loop? Does the array start with yesterday or today? Or neither?
  2. Could I possibly see a bit more of your code? This must be being used in a loop.
  3. Code for every day starting when? Yesterday? Today? What day does $weather_chile->forcast[0] refer to?
  4. $_GET is a superglobal and is already used in the global spec in a function, class, or anywhere else. <?php include ("init.php"); function user_activation () { $password = $_GET['hash']; $timestamp = base64_decode($_GET['timestamp']); $query = mysql_query("UPDATE users SET status=1 WHERE (password = '$password') AND (timestamp = '$timestamp')") or die (mysql_error()); return mysql_affected_rows($query) >= 1; } if (user_activation ()) { echo 'Your account has been activated.'; } else { echo 'Your account has been already activated.'; } ?>
  5. If no results were returned but you didn't get an error, that's just because nothing matched the query, which is something that'll be really tough for us to help you out with.
  6. Because you are not the owner of the lib files. Did you create them/upload them?
  7. Well your code makes no sense to me. You're pulling the first entry from the links table (rather than linking through), and you don't have a where clause or anything. But from the second table, you're pulling everything, and you're checking each one of them against the first link. That's what your code does. Additionally, let's say that they do match on the first iteration (i.e. the first result returned from the second table matches the result from the first table) all of the other 3 selections will be marked "selected" as well, because you don't clear the $selected variable at the end of each loop. If the selected variable is set on the first iteration, it'll remain set on the second, third, fourth, and so on. Add an unset($selected) or $selected = '' to the end of the loop, and explain the first part of the code to me, and maybe we can shed some light on this.
  8. md5 is not almost impossible to break, especially with technology these days. Running a simple md5 on a user's password without some sort of salt or some other encryption is hardly considered secure anymore. While it used to be an acceptable technique, it no longer is. Especially considering that md5 does incur collisions from time to time in which two entirely different strings end up with the same hashed value. I was simply pointing out what I have read and used in my own applications, not to be condescending or anything else. Anyway, back on subject, I don't think I quite grasp your problem, can you describe in more detail?
  9. This is extremely vague, and I don't know how to help you currently, but "embedding" a dialog on a login page sounds like HTML/Javascript to me, not PHP.
  10. <?php $new_part_id = 'mycolumn'; $update_user_part = mysql_query("UPDATE user_parts SET `" . $new_part_id . "`='1' WHERE userid='" . $user_id . "'") or die(mysql_error()); ?>
  11. You're not using the function properly, this is what you want: <?php class AppointmentsService { public function getAppointments() { $query = "SELECT subject FROM appointments"; $result = mysql_query($query); $appointments_array = array(); while($row = mysql_fetch_assoc($result)) { $appointments_array [] = $row; } return $appointments_array; } } $myTest = new AppointmentsService; $appointments = $myTest->getAppointments(); print_r($appointments); ?>
  12. Quote from PHP.net Unfortunate. Is there a file manager available in your control panel where you can chown the file?
  13. Well, first of all, why are you using elseif (...) when you could just use else? Second of all, it's probably not smart to use the hash of a user's password as a validation method, even if it's only going to be shown to the user. The way I do it when I need an email activation, is that I have a separate table called verifications, which contains the following columns: verification_id VARCHAR(64) verification_user_id INTEGER verification_email VARCHAR(225) verification_time DATETIME When a user registers, a new row is created. verification_id is a randomly generated, 64 character string sort of like a password hash, but it's completely unrelated to the password. user_id is their user_id in my users table. verification_email is the email address that needs to be verified, and verification_time is the time that the verification request was initiated. The link for the user then looks something like: index.php?act=home.verify&k={64 byte string}&u={user_id}&e={email} And it goes to the table to match their data together. It also checks to see how old the verification is (it won't allow requests from over 24 hours ago to be validated).
  14. Glad to help. Currently, there's no topic solved button...I think they're working on getting a new one put in.
  15. That specifies what type of file handle should be created.
  16. The .htaccess file serves a very similar purpose, and adding handlers usually can be done through .htaccess, not sure why it isn't working in your case.
  17. Then the chances of you being able to change what extensions are loaded as PHP is very slim. You'll probably need to go change your filenames around.
  18. Change this line: $user= mysql_query("SELECT * FROM `users` WHERE `username`='$username' AND `password`='$password'"); To this: $user= mysql_query("SELECT * FROM `users` WHERE `username`='$username' AND `password`='$password'") or die(mysql_error());
  19. Yahoo uses an SSL encrypted SMTP server, don't they? In order words, port 25 isn't correct (you need the SSL SMTP port) and PHPMailer won't be able to do it for you without some modifications. Search google for using PHPMailer on an SSL server.
  20. Is this being hosted by someone, or are you hosting this yourself?
  21. Poorly formatted code. You shouldn't have HTML outputting before or even during form processing. Read about it in the sticky posted in this forum.
  22. Take the "WHERE PartNum..." off of the end of the insert statement and you should be good.
  23. Change the first $description in that line to something else, such as $str. You'll also need to change references to it later on. You're overwriting the array you want to search with the variable $description. If that doesn't make sense, then once again, take this function: <?php function longest_string($array_src) { $longest_key = false; $longest_len = 0; foreach ($array_src as $k=>$v) { $current_len = strlen($v); if ($current_len > $longest_len) { $key = $k; $longest_len = $current_len; } } return $key; } ?> And call it like longest_string($description[4]) and it will return the key with the longest string.
  24. Why not put a button next to Post and Preview on the posting page that says "Post & Mark Solved" for all of the people that like posting "Thanks" responses and stuff.
×
×
  • 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.