Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Here's a slightly different slant on the problem. You should not have a bunch of different files that only differ in the content they contain. You should have one file, then use the power of the php server side scripting language to dynamically get or produce the correct content within that one file. This will mean that your displayed output will be consistent and easier to maintain or alter. To change the layout, you only have one place that needs changing and to add or change the content, you simply add or change the data that defines the content.
  2. I would guess a 1969 to 1972 Dodge Dart Demon http://en.wikipedia.org/wiki/Dodge_Dart
  3. The database hostname on hosting is rarely localhost. It is usually something like - mysqln.yourwebhost.com The database hostname to use for your scripts is usually displayed somewhere on the control panel where you create databases/tables/users/passwords.
  4. The light-blue link session_set_cookie_params is to the php.net documentation for the function. I recommend you start there.
  5. Php code inside of a .php file, using <?php ?> tags, is secure from prying eyes. Any php code in a .php file is parsed and executed on the server when the file gets requested. You only get any output that code sends. As long as you don't echo your username or password values, no one can see them by browsing to the file. To prevent http requests to the file, to save some server resources should someone start requesting it or to protect in the rare case of php not working on the server, you can place your file outside the document root folder (closer to the disk root), place it into an existing or new folder that has had http requests disabled (there's nothing stopping you from putting your file into the same folder as the CMS's config file), or use a .htaccess file to stop http requests for that specific file no matter where it is placed. Slightly off topic, but I have seen php scripts that store database username and password information in a specifically named .xml configuration file, with not one word about securing that file from http requests. You CAN browse to a .xml file and see the contents of it. You would also not want to use file extensions like .inc, .txt (anything other than .php) to put security related php code into.
  6. session_set_cookie_params can be used to set the path. Since it is the 3rd parameter, you will need to set the first two as well - session_set_cookie_params(0,'/','.yourdomain.com');
  7. I have received your pm. There's nothing like I suspected on that page (form values='' that are coming from short <? tag statements that are not working.) Unfortunately, that page requires external Javascript files to make it fully work. I wanted to see what exact data it does submit. Is this an on-line site that I could go to and grab the necessary javascript files? That form submits to the ../library/query.php file. Is that query.php file readable php code or is it 'encrypted' and looks like a long line of numbers/letters? Actually, you can check what data it submits to the query.php file by adding the following statement immediately after the first opening <?php tag in it - echo '<pre>',print_r($_POST,true),'</pre>'; Goto the form page and enter a category that produces an error, then submit the form. When it goes to the query.php page, you should get an array of information displayed.
  8. Nope. You might be using a server module that you need to enable in the httpd.conf (or have php settings in it when php is not running as an Apache module), but .htaccess files work on windows. Have you checked the Apache error log to find out what is actually causing the 500 server error?
  9. The short-answer seems to be - after the closing } of a class function definition, don't put a closing ?> tag (or any html comments or in-line html/php.) The only thing that should be after the closing } of a class function definition are php comments, another class function definition, or the final } brace of the class definition. I'm thinking this is because you cannot break up the class definition into parts. The first closing ?> tag that is in the 'body/root' of the class definition, closes the class definition.
  10. The error seems to have something to do with all the opening and closing php tags that are at the start and end of the function definitions and at the closing } for the class definition. It's probably something like having white-space between one closing ?> tag and an opening <?php tag right before the closing } of a function and of the class definition itself. I would personally eliminate all those excessive opening and closing php tags.
  11. Edit: never mind what I posted here, let me continue to investigate...
  12. Why not? All you are trying to do is get the php code on one page to run so that you can debug it. In fact, you only need that problematic portion of the code to run. A .htaccess file has no bearing on the php code after the php code has been invoked.
  13. Theres no FROM table_name term in that query.
  14. Do you have php's error_reporting set to E_ALL and either display_errors or log_errors set to ON? The 500 http response means that nothing was output in response to the http request. If php's error_reporting is set to not report any php errors, php errors won't be reported and if display_errors is off, reported errors won't be displayed and if log_errors is off, reported errors won't be logged.
  15. Only if the value being put into the id is or contains a bunch of extra/wrong data. Go ahead and PM me with the 'view source' of the entire page the form is on. ----------------------------------------- If the part of their script doesn't function correctly for a commonly used feature, adding categories, and they aren't, can't, or won't troubleshoot the problem, I would get your money back. There are literally millions of php scripts with a form and form processing code that can correctly produce an insert or update query and execute it. This has nothing to do with your server. It can have something to do with php code that used a lazy-way feature of php that resulted in non-portable code that won't work on common server configurations. On the outside chance this is something that is php or mysql version specific, the author should be specifically telling you if that is the cause of the problem.
  16. You need to set php's error_reporting to E_ALL and display_errors to ON in your master php.ini to get php to help you. Stop and start your web server to get any changes made to your master php.ini to take effect and use a phpinfo statement to confirm that the settings got changed in case the php.ini that php is using is not the one that you changed. Just about all the variables that are inside of your various functions don't exist in the scope where you are using them.
  17. Why would you need to do that? Deleting the session variable that your code uses to indicate the logged in state is enough. Also, php cannot actually delete a cookie. All you are actually doing is setting the cookie's expire time in the past so that the browser no longer sends it to the server with the page request. The cookie is still present on the client's computer. The only actual way of deleting a cookie is to delete the cookie file by going to the computer and using the browser or the file system to delete it. To 'delete' a cookie you must use the same name, path, domain, secure, and httponly parameters in the setcookie() statement that were used when the cookie was created. Otherwise, you are actually trying to set a different cookie.
  18. The following is the UPDATE query syntax definition, with the most common usage shown in red - UPDATE [LOW_PRIORITY] [iGNORE] table_reference SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ... [WHERE where_condition] [ORDER BY ...] [LIMIT row_count]
  19. For the portion of the 'view source' you posted, is there more following that for the TITLE? It appears that the title field in the query is where the error is detected at. Also, what category and title information did you submit that resulted in that query error?
  20. You actually haven't stated what is happening when you try to log out that isn't working. What is happening and what do you expect to happen?
  21. To echo out the actual query statement, you would need to add a line of code at the point right before where the query is being executed. There are two possibilities - 1) The existing code is already forming the query statement in a php variable. In this case you will simply add an echo $some_variable_name; statement. 2) The existing code is forming the query statement inside the program statement that executes the query. Something like $result = mysql_query("the actual query statement is here..."); In this case, you can simply duplicate (copy/paste) that whole query statement into an echo statement - echo "the actual query statement is here..."; (the initial and final quotes present in the existing code need to be carried through in this code.)
  22. I'll remove that portion of the database definition for you... From a programming standpoint, their application appears to be producing an invalid query statement (it looks like a quote is missing or perhaps has been replaced with a | character - the first single-quote shown is part of the error message and it also looks like some of the submitted data is carrying some html with it - the '>' character) either due to submitting the wrong data from the form or there is something in the data that was submitted to the form processing code that it did not take into account. About the only thing that would be helpful here is if you state what values you actually tried to submit for the category and title and if you can print/echo out the actual query statement that was being executed that the error corresponds to. Edit: one of the things that might be causing this query syntax problem is if the code (in the form) is using short opening php <? tags, so that the value being submitted for a field in the query statement actually contains the tail end of some raw php code. To detect if this is the case, do a 'view source' of the form page in your browser and look for anything in the area of the category or title form fields that looks like raw php code starting with a <?, instead of a full <?php tag.
  23. For a purchased script, you need to get support from the author (your licensing agreement with the author and/or the code's copyright likely prohibits posting any of the code anyway.) If the author is stating the problem is something on the server, he needs to specifically tell you what exactly the problem is.
  24. Edit: basically says the same as what requinix posted above ^^^ The time function returns the current Unix timestamp. Time uses the computer's/server's clock and timezone setting (if you change your computer's clock or timezone setting so that they are it is wrong for your location, you will get the timestamp based on wherever that wrong time/timezone corresponds to.) Edit2: or I could just be wrong about everything I wrote here concerning changing the timezone giving a different timestamp. Only functions like date, strtotime, mktime, and a few others, actually use php's timezone setting.
  25. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=360807.0
×
×
  • 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.