Jump to content

p2grace

Members
  • Posts

    1,024
  • Joined

  • Last visited

    Never

Everything posted by p2grace

  1. Not knowing exactly how your code is structured, you best bet is to probably save the data into session variables, and then call the session variables in your mailer.
  2. What does the url look like when the array is empty. Can you post the entire url so we can check if the $_GET variables are being set correctly?
  3. Try clicking one of the links... the array should be filled with the data provided through the $_GET vars.
  4. Can you post the latest version of your code?
  5. Replace all instances of $_GET['dream_id'] with $_GET['id'].
  6. What does it do when you click the link.
  7. Change this: echo "<a href=\"{$_SERVER['PHP_SELF']}?action=show&id=$id\">Back</a>"; to echo "<a href=\"{$_SERVER['PHP_SELF']}?action=show&id=$id\">Back</a>";
  8. Is the echo actually displaying $id, or the value of the variable $id. It shouldn't be showing $id obviously, it should should the value.
  9. Try changing your query to: $query = "SELECT * FROM `dream` WHERE `dream_id` = '$id'";
  10. 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.
  11. Is the query working? Instead of doing if (mysql_num_rows ($result) == 0) { do if (!$result || mysql_num_rows ($result) == 0) { // this will trigger if there was an error in the sql query or if there weren't any results }
  12. 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');
  13. One method would be to use a cookie that expires in 24 hours, that stores the # of times each ad was displayed.
  14. Because the only way the user can verify their email address is by clicking on the unique link from their email inbox. The other way only validates the mx record exists, but it doesn't ensure the user is using their own email address. The method I just outlined forces the user to go to their own email inbox and click the unique link, thereby proving the email address is theirs.
  15. One such method would be to send it to a link that is not protected by the session security, but that link creates the session variables, and then redirects to the form that is secured by the session. The other method would be to adjust your security that checks for sessions and creates an exception. Although I would suggest the first route.
  16. 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?
  17. I would actually create 3 database tables, using 1-to-many relationships. 1 db table for businesses 1 db table for supply which has a businessID 1 db table for demand which has a businessID Make sense?
  18. 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.
  19. 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?
  20. 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?
  21. Unless you're required to use a database, I wouldn't necessarily recommend it. This whole thing could be done through javascript and setInterval(). You wouldn't ever need to refresh if you only used javascript.
  22. Also, as MadTechie mentioned you don't need to specify the date since it's automatic, however in the situation when it isn't, you can use the mysql NOW() function instead of specifying the date from a php variable. Check out php.net info on date() for more info on format strings. http://us3.php.net/manual/en/function.date.php
  23. You'd put it anywhere you want php to check if the session is inactive and redirect.
  24. This wouldn't be difficult to build quick. Just go find a csv or a table of countries, and one of states. Import them into a mysql database. Then write a quick php class that generates the select boxes.
  25. Add this to the top of your header include: if(!isset($_SESSION['somevar'])){ header("Location: path/to/login.php"); }
×
×
  • 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.