Jump to content

p2grace

Members
  • Posts

    1,024
  • Joined

  • Last visited

    Never

Posts posted by p2grace

  1. Right - which means this query is wrong "SELECT * FROM dream WHERE dream_id=$id".

     

    echo $query; die(); copy the query into a msyql administration panel (e.g. phpmyadmin) and test the query.

     

    Could mean 1 of 2 things.  One the query is wrong, or two $id is null.

  2. It could also be a permission problem.  If apache can't write to the folder to create the directory, it'll fail.  As gizmola suggested, the best approach is to write logic for debugging to see exactly what is causing the error.  When all else fails, display php errors or view the php error log.

     

    error_reporting(E_ALL);
    ini_set('display_errors','on');
    

  3. 1.) Add a hash field to your db table (varchar 30 default null)

    1a.) If you don't already have a field that denotes the email has been verified, add that as well. (tinyint 1 default 0)

    2.) In your submission logic, add the following

     

    <?php
    $hash = rand().md5(time());
    // then add this hash to your insert query
    ?>
    

     

    3.) Use a mailer function (I prefer pear but any php mail function works)  A very simple implementation is in the link below.

     

    http://email.about.com/od/emailprogrammingtips/qt/How_to_Send_Email_from_a_PHP_Script.htm

     

    In the body of the email send a link to a script on your website to verify the email address.  (e.g. http://www.yoursite.com/verify/?h=h2k3lsjhdfkjsdlfksjdlfdksjf) where the h= is the hash from step 2.

     

    4.) Write a script at the same location as the url specified in the email that checks for the $_GET variable "h", checks to see if a record with that hash exists, and if it does mark the record is emailVerified = 1

     

    Make sense?

  4. You can do this, I have never done it myself so I cannot give you accuracy results or anything but its a good read nonetheless

    http://www.devshed.com/c/a/PHP/Email-Address-Verification-with-PHP/5/

     

    Note that this method does not prove the user is using their own email address, just that an mx record for that email address does exist.  I can help walk you through an actual email verification (versus a validation) structure.

  5. This is actually easier than it sounds.  Upon saving the record in your database, have a field called "hash" or something similar where you save an md5() of the current timestamp with some salt.  Then email the activation link to the user using the hash.

     

    e.g. the link would be something like http://www.yoursite.com/activate/?h=23kjl4jlkdslkj23kl4jlksdflkjl2. 

     

    You'd use the hash to lookup the record and mark it as a valid email.

     

    If you have further questions, be specific to which part you need help with.  Are you familiar with writing emails in php?

  6. Just create a field in the database called "deleted".  Then change your delete query to an update query to mark deleted as "1" instead of the default "0".  Then update your query to display results to only return those where deleted is equal to 0.

     

    Make sense?

×
×
  • 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.