Jump to content

peipst9lker

Members
  • Posts

    81
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Germany

peipst9lker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Just use a random token which is saved in a database and only valid for like 24hours or something. Why would you use an encryption (sha1) ? There are no sensitive data inside which need to be encrypted. This confirmation code is only to proof that the email recievant is valid.
  2. You can use mktime() and date() to get the last monday and then convert it into datetime format. Here's a little snippet for datetime conversion, the rest is for you because I don't have much time right now. function strToDateTime($input) { return preg_replace('/^(\d{2}).(\d{2}).(\d{4}) (\d{2})\d{2})\d{2})$/', '$3-$2-$1 $4:$5:$6', $input); } Edit: Forgot to mention, you can use > and < operators in datetime where-clauses.
  3. The function escapes characters like ' and " to prevent MySQL Injections which is a sort of attack to gain access to your database without permission. $query = "SELECT * FROM table WHERE name = '".mysql_real_escape_string($userinput)."'";
  4. Why are recursive functions horrible? Used properly they're extremely powerful!
  5. Yep go back to school Have you checked the output ? Take care that SimpleXML can't handle XML with namespaces!
  6. Probably overkill but yeah... function containsInteger($input) { return (boolean)preg_match("/[0-9]/", $input); }
  7. 1. Use $_POST['searchtype'] instead of $HTTP_POST_VARS['searchtype']; 2. Your mysq_pconnect() has wrong syntax check here for right syntax.
  8. Eclipse with PHP Development Tools (I'm using Linux)
  9. Replace $fruits with your array. $totals = array(); foreach ($fruits as $fruit) foreach ($fruit as $type => $val) { if (isset($totals[$type])) $totals[$type] += (int)$val; else $totals[$type] = (int)$val; }
  10. 1. In your delete_post page you have to initialize $post_id, place above query execution. $post_id = (int)$_GET['post_id']; 2. Check with mysql_error() or any other method like mysql_affected_rows() to validate query execution.
  11. Keep in mind any user can modify POST and GET data easily.
  12. Keep in mind that AJAX is just 7 years old (developed 2005)
×
×
  • 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.