Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Then what is it? It shouldn't matter what order they appear in. If you go by the example provided by the manual, then error_reporting is executed first. http://www.php.net/error_reporting Both are correct. http://us3.php.net/manual/en/ref.errorfunc.php#errorfunc.constants.errorlevels.e-all
  2. are all of the subfolders and files also owned by the Apache user and have permissions of at least 0700? Even though the root htdocs folder is permissioned correctly, a subfolder may not be.
  3. error_reporting(E_ALL); ini_set("display_errors", 1);
  4. Do these two variables: $this->img["width_thumb"],$this->img["height_thumb"] have values?
  5. As hostfreak referenced, the magic-quotes-gpc directive is turned on. You can either turn it off, or use stripslashes on your variable to remove them. http://www.php.net/stripslashes
  6. They are all a result of the first error...it's not finding the file you are trying to manipulate.
  7. What errors are you getting, if any? Is part of the script executing properly and only the DB part failing? Is the file uploading at all? What are you trying to insert into the DB? The file, or the file's location? What is the field type that you are inserting into? If you are inserting the image, it has to be BLOB, other wise a character type. You need to provide us more information than "Why isn't it working?".
  8. .htaccess and .htpasswd has nothing to do with php, that authentication process is controlled by Apache.
  9. From a non-windows server I don't think it's possible. From windows, you should be able to use the excel odbc driver and COM objects to access the sheets and data. If you aren't familiar with VB, now's a good time...php examples are nearly impossible to find, but you can find quite a few written in VB/C#, and once you are using COM, the commands are nearly the same...just issuing them is different. ASP.NET example: http://www.aspfree.com/c/a/ASP.NET-Code/Read-Excel-files-from-ASPNET/ You may also be able to create an Excel COM object, open the .xls file, then save it in XML format...then you could use something like this: http://www-128.ibm.com/developerworks/opensource/library/os-phpexcel/ It's not easy, but it is possible, and frequently the process is fragile and will break without much rhyme or reason.
  10. You have to escape from single quotes when you want the value of a variable to be included... <?php $table = 'CREATE TABLE `' . $var . '` (' . ' `id` INT(15) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' `pics` TEXT NOT NULL, ' . ' `thumbs` TEXT NOT NULL' . ' )' . ' ENGINE = myisam'; ?> With that said, as was stated above, there is always a better way of doing something than creating a table based on user input. Not only does it open up gaping security holes, but it clutters your database.
  11. foreach ($format_arrays as $value) { echo "<option Value=\"{$value}\""; if ($value == $format) { echo 'checked="checked"'; } echo ">{$value}</option>"; }
  12. You can create sub arrays of $_POST and $_GET using the array brackets on the end of your variable names... <input type="checkbox" name="checkboxes[]" value="value1"> Value1 <input type="checkbox" name="checkboxes[]" value="value2"> Value2 <input type="checkbox" name="checkboxes[]" value="value3"> Value3 <input type="checkbox" name="checkboxes[]" value="value4"> Value4 Which will result in $_POST['checkboxes'] being an array that has values equal to the checked boxes.
  13. Download the package from here: http://pear.php.net/package/HTML_Progress2/download You are looking at the documentation for the package, rather than the package itself. All of the files are tarred and gzipped in the package you get from the above page.
  14. You have to have a mail server configured in php.ini, I think it's the SMTP directive. There is no sendmail on windows, so the mail function doesn't just work like with unix. If you control the windows server, you should be able to setup a mail host on that server...I'm not so sure about security and all that, as I'm not a windows admin. You may also want to look into using something like phpMailer, or at least reusing some of their code so you can specify the mail server from your script. http://www.php.net/mail#ini.smtp
  15. I don't think you understand...when the expire time for the cookie is set to 0, the browser will destroy it when closed. This is true for ANY cookie, not just the one set by the session handler. I will THROW the manual at you until you understand that the default behavior is to set the expire to 0 so that the session cookie is destroyed when the user closes their browser.
  16. PHP's session cookies are destroyed with the user closes the browser. It can be done with any cookie by setting the lifetime to 0. http://us3.php.net/manual/en/ref.session.php#ini.session.cookie-lifetime
  17. When the browser is closed, the cookie that is used for the session is automatically destroyed by the browser. The session data isn't removed by the server until the timeout expires, but because the cookie is destroyed by the user's browser, they are no longer associated with that session.
  18. http://www.stroz.us/php/index.php?option=com_smf&Itemid=40&topic=97.0
  19. If you are using a windows server with an odbc connection set up to the spreadsheet, then there is no reason you couldn't. Use the odbc functions to access th data. http://www.php.net/odbc
  20. <?php //select our start date/time...this is a constant to base our //future dates off of. $start_date = mktime(12, 0, 0, 8, 11, 2007); //now... $current_date = time(); //find the difference in seconds $difference = $current_date - $start_date; //find the difference in days $days_difference = floor($difference / 86400); if ($days_difference % 14 == 0) { echo "Today is a day that is 2 weeks from the last day"; } else if ($days_difference % 14 >= 1) { echo "There are " . (14 - ($days_difference % 14)) . " days until the next same day"; } ?>
  21. When you have print statements that span multiple lines, such as: #print " User unknown"; you must comment out all of the associated lines...not just the line where the print command is. You can fix it one of two ways.... #print "User unknown"; or #print " #User unknown";
  22. http://www.stroz.us/php/index.php?option=com_smf&Itemid=40&topic=98.0
  23. Just issue a query to the db... DELETE FROM lunch_orders WHERE order_time < DATE_SUB(NOW(), INTERVAL 2 HOUR) ...would delete orders more than two hours old.
×
×
  • 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.