Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Are you sure there is an ID with an ID of $ID? Everything else looks OK... Is this the whole script?
  2. Dear om, I wasn't saying anything towards religion... All I mean was that religion is a very sensitive subject. So, if a hacker finds your site who doesn't believe in what you do, most likely he'll try to do harm to your site.
  3. There must be an external factor. Does $_GET have a value? I just tried: setcookie("lastViewedTEST", 45,time()+3600); echo $_COOKIE["lastViewedTEST"]; ?> And it echoed out 45... Maybe you should post all the relevant code.
  4. You do something like: if (isset($_COOKIE["lastViewed"])) echo "Last product_id viewed: " . $_COOKIE["lastViewed"] . "! "; else echo "You have never viewed a product! "; ?> ?
  5. Put this at the top of your script: ini_set ("display_errors", "1"); error_reporting(E_ALL);
  6. example: cookie will expire in 1 hour: setcookie("lastViewed", $_GET['prodId'], time()+3600); Make sure you set the cookie before the tag.
  7. I wouldn't call it a 'waste of time'. 1) Someone may have a different answer then you. 2) You may have the wrong answer. 3) Even if you have the same exact answer, so what, you wasted a couple minutes, tops. Sometimes I will check to see if someone else has already posted an answer. If they do then I just CnP my response (cause sometimes it doesn't show you what the other person has posted yet) and check to see what they posted, if mine is the same as theirs I will disregard mine, if mine is different I will post. I don't really think it's that big of a deal, it's not like we're working on enterprise projects here...
  8. $string="doom"; echo encrypter($string); function encrypter($string) { $string = md5(sha1($string)); return $string; } ?>
  9. great, no prob mark as solved pls
  10. lol md5(sha1($string)); // error line close your functions!
  11. 1) Please use either the COUNT method or the mysql_num_rows method. 2) Where does $table come from? 3) Is submission_id the ACTUAL topic id and topic_id is what topic the reply is associated with? If so, you want to match the topic id with the submission_id. Your query should look like: $sql = "SELECT * FROM $table WHERE topic_id = " . $row['submission_id']; (You don't need single quotes around integers.)
  12. Try this: $comments = mysql_query($sql) or die("Error ". mysql_error(). " with query ". $sql); $row2 = mysql_fetch_array($comments); echo ""; echo ''.$row['col_1'].''; echo $row2['COUNT(replies)']; echo " "; echo date("l M dS, Y", $row['submission_date']); echo "";
  13. I like CV's suggestion. The one liners are too long, IMO.
  14. You can dump your DB in a .sql file using: -h[host] -u"username" -p"password" "dbname" > /[dir]/file_name.sql
  15. Why do you get your presents before everyone else?
  16. Can you just show the table structure? I'm not sure what exactly you mean here, anyway... Why can't you just use a simple query...? $sql = "SELECT replies FROM table WHERE topic_id = '$topic_id'"; $result = mysql_query($sql); $num_replies = mysql_num_rows($result); echo "Replies: " . $num_replies;
  17. 1) All of the values for the attributes you use (type=password, name=pword) should have " " around the values (type="password", name="pword"). 2) $_POST['username'] $_POST['pass'] $_POST['login'] are supposed to be $_POST['uname'] $_POST['pword'] $_POST['submit'] 3) You need to start debugging. A good way is to use echos in different spots in your logic to see if you get there. Make these modifications and let me know what happens.
  18. You don't need a cron job. The only time someone is going to see it is when they get to the site. So all you need to do is modify ngreenwood's code to fit your needs. Why don't you try it, and if you still can't get it to work, come back with more questions? Usually if you show some effort we're willing to help a lot more.
  19. Good point. Especially anything to do with religion...
  20. You can do: SELECT * FROM * = everything.
  21. You need to manipulate the date() function. G 24-hour format of an hour without leading zeros 0 through 23 This may be helpful as well to check to see if it's day or night: A Uppercase Ante meridiem and Post meridiem AM or PM And a numerical representation of the day of the week: w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
  22. lol missing a ')'
  23. You can start out by reading this tutorial on how to extract data from a data base, SELECT. Read further, there are examples of HTML inputs.
  24. Add this to the top of your script and see if there are any errors. You should be debugging, echoing things out to figure out what is wrong. ini_set ("display_errors", "1"); error_reporting(E_ALL); BTW, it's "piece" not "peace"...
  25. Do this: Home | Logout | Forums Character
×
×
  • 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.