Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. I think I would ban people who use AOL just on principle....
  2. An example: http://www.codewalkers.com/c/a/Display-Tutorials/Writing-a-Template-System-in-PHP/ If you are really looking at a large scale site, I would use a framework of some sort...makes life somewhat easier. I like zend framework personnally. http://framework.zend.com
  3. You can't use a time in a for loop...it just gets cast as an int, which loses meaning for time related functionality...
  4. Depends on how the values are stored in the database. If every page view == an insert to the table, then your query won't work. If every page view increments a "views" counter in the database (i.e. each page has a single row in the database which has a counter), then my query won't work.
  5. http://www.php.net/function.mail, example 4 shows how to send html email. phpMailer is an excellent mailing class, with the ability to send html email: http://phpmailer.codeworxtech.com/
  6. SELECT article_name, COUNT(*) FROM article_referred_table GROUP BY article_name ORDER BY COUNT(*) DESC LIMIT 1 Change the limit clause to see the top X referred articles
  7. So, you didn't set the include path using the code I provided? And it's still not working.....
  8. $dg1 is a resource, so it being equal to "Resource id #4" is normal. $dg12 is the number of rows returned..."1" means one row was returned. You didn't get a value returned back for $dtime because mysql is returning the column name back with the name "DATE_FORMAT....". Either use a numeric index on your result... while ($row = mysql_fetch_array($dg1)) { $dtime = $row[0]; } Or, since you have one row, with one column, use mysql_result: $dtime = mysql_result($result, 0); Or assign the result column to a different name in the SQL query: SELECT DATE_FORMAT(dtime, '%m/%d/%y') AS dtime FROM dlg WHERE lname = '$lname'
  9. First, by "it returned zero" do you mean it returned zero rows, or it failed? Second, your query is probably wrong...you have it enclosed in single quotes, which means it will not do variable substitution... change $dql = mysql_query('SELECT DATE_FORMAT(dtime, "%m/%d/%y") FROM dlg WHERE lname = "$lname"'); to $dql = mysql_query("SELECT DATE_FORMAT(dtime, '%m/%d/%y') FROM dlg WHERE lname = '$lname'"); Notice I changed double quotes to single, and single to double.
  10. what is the data type of the field?
  11. What is the name of the "submit" button on the form? For example: <input type="submit" name="this_is_what_I_want" value="Submit" /> That value is what shoule be in your if statement...in this example: if (isset($_POST['this_is_what_I_want'])) { ... }
  12. Reference this post: http://www.phpfreaks.com/forums/index.php/topic,193668.msg871472.html#msg871472
  13. Use MySQL's DATE_FORMAT function. The php date function expects a unix timestamp (seconds since epoc). However, MySQL is outputting a string representation of the date. You can either change the format in MySQL (using the DATE_FORMAT function), or you can use MySQL's UNIX_TIMESTAMP function to convert it to that format and then format the final in php. I recommend the former: SELECT DATE_FORMAT(dtime, "%m/%d/%y %g:%i %A") FROM table_name I'm not 100% sure that the format string is correct however (I didn't look up the format). http://www.mysql.com/date_format
  14. Gonna have to agree with dptr...check the number of results returned: //START PAGE HTML HEADERS echo "<html><head>"; echo mysql_num_results($results); //STAR WHILE LOOP TO CYCLE THROUGH ALL THE RESULTS FROM THE QUERY.
  15. your include path isn't set correctly...where is the zend library installed at? set_include_path("/full/path/to/zend/directory" . PATH_SEPARATOR . get_include_path());
  16. that still spits a blank page with no errors.. Use the display_startup_errors from my post above
  17. // show normal errors ini_set("display_errors", 1); // show syntax errors ini_set("display_startup_errors", 1); // show all errors error_reporting(E_ALL | E_STRICT);
  18. Just as your provider states, you need to provide the additional parameter to the mail function: @mail ( $cgi->getValue ( "adminemailaddress" ), $yoursubject, $emailtext, "From: " . $cgi->getValue ( "email" ), "-fyourmail@yourdomain.whatever" ); If the author hasn't heard of it before tell him/her to go read the manual: http://www.php.net/function.mail, example 3. The options that can be provided in this manner are found in the sendmail man page: http://www.sendmail.org/~ca/email/man/sendmail.html (or "man sendmail" from the command line) In particular, the "-f" states:
  19. A for loop is easier: for ($i = 1; $i <= 10; $i++) { echo $_POST['name' . $i]; } However, it is probably even easier to use a different method of gathering the data: <INPUT type=checkbox value=Yes name="userdata[1][checkbox]"> <INPUT size=42 name="userdata[1][name]"> <INPUT size=42 name="userdata[1][phone]"> <INPUT size=42 name="userdata[1][address]"> <INPUT type=checkbox value=Yes name="userdata[2][checkbox]"> <INPUT size=42 name="userdata[2][name]"> <INPUT size=42 name="userdata[2][phone]"> <INPUT size=42 name="userdata[2][address]"> <INPUT type=checkbox value=Yes name="userdata[3][checkbox]"> <INPUT size=42 name="userdata[3][name]"> <INPUT size=42 name="userdata[3][phone]"> <INPUT size=42 name="userdata[3][address]"> You would end up with a multidimenstional array in post: foreach ($_POST['userdata'] as $number => $data) { echo $data['name']; }
  20. Does it have a different domain name? For instance, the main site is "mainsite.com" and the sub site is "subsite.mainsite.com". If so, php, and apache, treat them as totally different sites. Each one will have a different session id for the same user.
  21. Exactly...it doesn't matter (for the most part) the hash or encryption if the password is weak to begin with. On a side note, md5 is a 128 bit hash, which means there is 2^128 number of values. According to the calculator on my Fedora 8 laptop, that comes to ~ 3.4*10^38 combinations. MySQL's largest integer data type is BIGINT, which according to their documentation, and unsigned BIGINT has a max value of 18446744073709551615. If you divide the first number (2^128) by the second, you get 18446744073709551617. This means it would take 18,446,744,073,709,551,617 mysql tables, all with a BIGINT primary key, to find every hash possible. Terabytes is still a very small percentage.
  22. $parents_str is probably empty, which means your query has "WHERE forum_id IN ()", which will generate an SQL error. Echo out the query to check.
  23. Since md5 is so easily challenged, what strings generated these hashes? 1f9788313e0a9e5180a2705dda8e27e2 cd8dd7ce5892f48289825ee3db970c49
×
×
  • 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.