Jump to content

BlueSkyIS

Members
  • Posts

    4,268
  • Joined

  • Last visited

Everything posted by BlueSkyIS

  1. i don't like messing with all those details of mime types, etc. i suggest that you use an existing email class to make things simpler. i use rmail. if you follow the example scripts included in the download, it is very easy to set HTML, add attachments, etc. http://www.phpguru.org/downloads/Rmail/Rmail%20for%20PHP/ I understand that your question relates to HTML and not attachments, but rmail does a great job of making HTML emails simple whether you add attachments or not.
  2. one possibility is readfile(), which can pass a file to the browser without exposing the path to the actual file. http://php.net/manual/en/function.readfile.php
  3. sessions. hidden fields can be manipulated MUCH easier than session data. you'll be using sessions to track the user through multi pages anyway, so you can keep their info in session variables OR store to database in case they leave without completing portions.
  4. Not exactly. The point is primarily avoiding bogus data. It is very easy to turn off javascript and enter anything (or nothing) and submit a form. spam bots don't even use javascript, so they will send you as much email as you can handle without thinking about any browser-based validation.
  5. only way to tell is to view the HTML source and compare before and after; validate the HTML of both, and see what changed from one to the other.
  6. flush may or may not work for you. http://php.net/manual/en/function.flush.php
  7. do you have session_start() at the top of the code?
  8. STR_PAD_LEFT is a constant. if you put quotes around it, it becomes something different. remove the quotes // FIXED $lvs_result = str_pad( 1 , 4 , 0 , STR_PAD_LEFT);
  9. if you store the value as datetime, you can reliably pull it from the database and use date() function to put the Z wherever you need it by escaping it with a backslash: \Z
  10. mysql stress is the least of the worries. but, sorry i don't know how to make it work. maybe this bump will help.
  11. if (stristr($title, ':')) { continue; // go to next element }
  12. yeah, only beginner developers here. teeheeee :-P with the method you describe, using php.ini and .htacess, there is then the assumption that php.ini will be parsed and used. that is a very poor assumption, as many hosts will ignore php.ini, or require that PHP ini settings be placed into .htaccess, and then the .htaccess php settings that work in one .htaccess may crash on another server. the method described above is used very often for product installations.
  13. my post was an example. you still need to add the loop within that loop. another example: while ($row_subsections = mysql_fetch_assoc($subsections)) { // do something with $row_subsections }
  14. i think you need to start with some basic tutorials that show you how to get information from form fields, specifically from select's. http://www.tizag.com/phpT/forms.php and if you aren't seeing any notices or warnings when you run your code (as you should be seeing), you should add this at the top of the PHP: error_reporting(E_ALL); ini_set("display_errors", -1);
  15. as you did with mysql_select_db, user mysql_error() to see if the query works.
  16. if you wrap it in a function, $username is only available within the function. i would not wrap it in a function.
  17. that is actually updating the .htaccess file so that users will be prompted for password. no one will be able to visit the site without providing user name and password.
  18. without seeing the entire error, i assume it's on these lines: $fieldID = (int)$_POST['name']; $value = (int)$_POST['value']; and means that neither $_POST['name'] nor $_POST['value'] are defined.
  19. you need to echo the return value. echo sec2hms($sec);
  20. using example of one of the fields, username, this is what i do: <?php // initialize all form vars to ''. $username = ''; // Handle post, if any if ($_SERVER['REQUEST_METHOD'] == "POST") { // update the values of all form variables $username = isset($_POST['username'])?$_POST['username']:''; // form submission code here, etc. } // Make values safe to display in HTML, after using stripslashes() IF NECESSARY $username = htmlspecialchars($username, ENT_QUOTES); // LATER, in the HTML form, set the value <input type='text' name='username' value='<?php echo $username; ?>'>
  21. in your code all do loops should be while loops while ($row_subsections = mysql_fetch_assoc($subsections)) { // do something with $row_subsections } otherwise, $row_subsections is not set to anything the first time through. i thought it odd, which is why i guessed dreamweaver did it. i leave dreamweaver as soon as design is finished.
  22. i don't see where $_SESSION['userpass'] is ever set in login.php, therefore it is not set in any other pages.
  23. you can use PHP anywhere you would use HTML. so there is no problem using php in the <head>
  24. error on line 26 due to failure to execute SQL a couple lines before. follow the same process: add or die(mysql_error()); $sql = mysql_query("SELECT * FROM forum_posts WHERE type='a' AND section_id='$sid' ORDER BY date_time DESC LIMIT 25") or die(mysql_error());
×
×
  • 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.