Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Only if the ['error'] elements (i.e. $_FILES['thumb']['error'] ) are non-zero values. If you look closely at the output from the print_r() statement, you will see that the correct variables are things like - $_FILES['thumb']['name'], $_FILES['eps1']['name'], ...
  2. You need to start by looking at what the $_FILES array actually contains and making your logic match it. Add the following php code near the start of your form processing code - echo "<pre>"; echo "FILES:"; print_r($_FILES); echo "</pre>"; You should also be learning php (or learning anything new in php), developing php code, and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you by displaying all errors it finds. Stop and start your server to get any changes made to php.ini to take effect and confirm that the actual settings get changed by using a phpinfo() statement in case the php.ini that you are changing is not the one that php is using.
  3. Someone already suggested in one of your threads how you can find parse errors on a server where you don't have access to the master php.ini -
  4. You should be learning php (or learning anything new in php), developing php code, and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you by displaying all errors it finds. Stop and start your server to get any changes made to php.ini to take effect and confirm that the actual settings get changed by using a phpinfo() statement in case the php.ini that you are changing is not the one that php is using.
  5. I don't see a single session_start() statement in any of the code that sets or references a $_SESSION variable. Without a (working) session_start() statement, $_SESSION variables are just a local array variable.
  6. The 4th and 5th parameters of setcookie are for the path and domain (actually a subdomain/hostname) that the cookie matches (the browser only sends cookies that have settings that that match the URL being requested.) Have you read the php.net documentation to see if either setting has something to do with your symptoms?
  7. You should be learning php, developing php code and debugging php code on a local development system, for a couple of reasons. Doing this on a live server wastes a huge amount of time in constantly uploading files on every alteration and until your code is complete and tested it likely contains security holes that would allow a hacker to exploit your server. You can set those two settings in a .htaccess file (when php is running as an apache module) or in a local php.ini (when php is running as a CGI application.)
  8. You need some [] as part of the name to make them arrays - http://us.php.net/manual/en/faq.html.php#faq.html.arrays
  9. You have a fatal parse error on line 6. Fatal parse errors are only displayed when you set the error_reporting/display_errors settings before your script is parsed. You need to set those two values in your master php.ini on your development system to save yourself a lot of time.
  10. $query_data = mysql_fetch_row($result); $numrows = $query_data[0]; Those two lines of code fetch the first row form the result set and assign the value from the first column in your table to $numrows. Perhaps you intended to use mysql_num_rows ?
  11. A more serous question would be why are you storing integers using a varchar data type. That increases the storage requirements, makes every query that references the value slower, and prevents direct ordering and greater-than/less-than comparisons. Integers should be stored using an INT data type.
  12. Use this - http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_convert-tz between the from_unixtime() and the date_format() functions. You could also set the mysql timezone to GMT using a query at that start of your code - SET time_zone = timezone;
  13. Have you tried downloading it or browsing to it to see what you actually get as output when you do this?
  14. The above is an invalid enctype for a form. Remove that from your form tag.
  15. The form in the code you posted is incomplete and cannot work. It would take seeing the whole actual code of your page that does not work in order to be able to help you with why your page is not working.
  16. The error has to do with a different number of columns listed in the query (which can be different from the number of actual columns in your table) and a different number of data values supplied in the query.
  17. Did you verify that the setting was changed using a phpinfo(); statement? If the setting did not change, then you either did not change the correct php.ini or you did not stop and start your web server to get any change made to the php.ini to take effect.
  18. http://us2.php.net/manual/en/ini.core.php#ini.post-max-size
  19. If that is the actual error message, without output started on line 1 of the file and there are no actual characters before the <?php tag, then you file has been saved with the UTF-8 BOM (Byte Order Mark) characters and you would need to save it without the BOM.
  20. I would recommend examining the product data from one of the major PLC manufacturers, such as Allen Bradley - http://www.ab.com/programmablecontrol/ Your primary concern will be a system that will support enough outputs. They actually make Soft PLC's, where the PLC software runs on your PC/Laptop and you interface to the I/O using Ethernet. Such a system would consist of a PC, several blocks of distributed I/O, Ethernet hub(s) and cabling, and the power supplies necessary to operate the outputs/igniters.
  21. To update the value in your database to automatically log someone out, you need to execute a query that tests the 'last active time' each logged in member and changes the 'logged in' status to FALSE in the table for any rows that have a 'last active time' farther in the past then a limit you pick. You can either execute this query using a cron job/scheduled task or if neither of those methods are available and you already have 'who's online' code that gets executed on each page visit, you can modify that code to update the 'logged in' status as one of the things it does. It should not matter if the session exists or not because you should be checking the 'logged in' status in the database table (assuming you have or want the ability for an administrator to have overriding control in case a member is spamming your web site...) A session, if it exists, should just identify the visitor, not determine if he is logged in or not.
  22. It sounds like you are using Windows Notepad to create files and your actual file name is something.php.txt. Have you changed the Windows setting that causes it to hide known file extensions?
  23. Sting data values are enclosed in single-quotes to make them strings, rather than column names or other types of identifiers.
  24. Program variables are no longer being 'magically' set from post/get/cookie/session/server/files/env variables because this allowed hackers to 'magically' set session variables to anything they wanted and a lot of sites were taken over. This feature was actually turned off by default in April of the year 2002. No new code, tutorials, books, web hosting after that point in time should have relied on this feature to magically set program variables. You need to use the correct $_POST, $_GET, $_COOKIE, $_SESSION, $_SERVER, $_FILES, or $_ENV variable where your data is actually coming from. In your case, this is from a form using the post method, so you would need to use $_POST['affid']
  25. I don't see any code in what you posted that is setting $affid. Where and what is $affid being set from?
×
×
  • 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.