Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Programming help forums don't write the code for your assignments. We help you with the code you are writing. Exactly what problem, error, specific question, or point did you get stuck at when you attempted to do this?
  2. Everything that php can do is documented in there----> http://www.php.net/docs.php
  3. You cannot do this, for two reasons - 1) The link is a resource and all resources are destroyed when your script on any page ends. 2) Because the session data is serialized when it is stored when your script ends, and resources cannot be serialized, you cannot save a resource as session data between page requests. You have simply got to execute the code to create a database connection on each page request. Even if you happen to be on a server configuration where persistent database connections are supported, you must STILL execute the code to get an existing or create a new database connection on each page request.
  4. Since you haven't shown your form and how it relates to the code you have been posting, it is impossible to answer. Are you debugging this problem on a system with error_reporting set to E_ALL and display_errors set to ON so that all the errors php detects will both be reported and displayed?
  5. You already have a thread for this problem, where someone suggested the likely cause for your latest symptom and what to do about it. Continue using your original thread for this problem.
  6. For your latest symptom, would you say that it seems like if(!empty($_POST['submitFeature'])) is failing ($_POST['submitFeature'] IS empty)? If so, you are probably exceeding the post_max_size setting, in which case both the $_POST and $_FILES array will be empty. Your code should test for this condition as the first thing it checks. If both your form and your form processing code are on one page, you should actually use the following to test if the form was submitted, then test if the $_FILES array is not-empty, then put your other form processing logic - if($_SERVER['REQUEST_METHOD'] == 'POST'){
  7. There's probably a half-dozen reasons why your $pwd variable might not have the expected value in it. Have you echoed it right before the mysql_connect() statement to see what is in it? If you want someone in a forum to tell you why your $pwd variable is not working, just post your code to get a direct answer without playing a game of 20 questions. You are getting tripped up on some vary basic programming. There are litterally millions of php web sites using variables that do work. You either have a typo in the variable name or in the value you are assigning to that variable or you are clearing that variable in your code...
  8. From the documentation for the function you are using -
  9. ORDER BY name_col_1, name_col_2 (will sort by col_1 ASC, then col_2 ASC) ORDER BY name_col_2, name_col_1 (will sort by col_2 ASC, then col_1 ASC) ORDER BY name_col_1 DESC, name_col_2 (will sort by col_1 DESC, then col_2 ASC) ORDER BY name_col_1 , name_col_2 DESC (will sort by col_1 ASC, then col_2 DESC) ORDER BY name_col_1 DESC, name_col_2 DESC (will sort by col_1 DESC, then col_2 DESC)
  10. You are re-executing the query in a forever-loop because you put the code that executes the query inside of the while() condition. You would need to execute the query once, before the start of the while(){} loop, not inside of the while() condition. The while(){} loop should only iterate over the result set that the query returns.
  11. urldecode would convert it back to a literal &. Then htmlentities() would convert it to an entity that could be displayed instead of processed in html.
  12. It's fairly clear that your $pwd variable does not contain your exact password. Perhaps you have a space or a spelling error.
  13. mysql_num_rows
  14. Not this problem again. I think the problem has to do with your web server outputting a content-type header for a .php file and/or IE automatically treating .php files the way it wants instead of the way you want. Are you on an Apache web server so that you could use url rewriting to make it look like you are not using a .php file as the URL in the download link?
  15. MDanz, if you had continued this in your existing thread instead of starting a new thread, people would not need to be asking you questions about what it is you are doing and what your tables/data looks like. By starting a new thread you are throwing away the information about how you got to this point. That just wastes time and reduces the number of replies you are likely to get.
  16. Button's don't actually do anything by themselves. Use type="submit"
  17. You haven't provided any specific information as to what the field size/definition is now? What if you are already using the largest size for that field type and cannot increase it and must alter your concept of how you are storing data?
  18. If you truly looked at the examples, you would notice that if your data is numeric, you would form a comma separate list of numbers and if your data is strings, you would form a comma separated list of single-quoted strings.
  19. The From: address you use needs to be a valid mail box hosted at your sending mail server. Any user entered email address should be put in as the Reply-to: address.
  20. Examples of how to use mysql functions are in the documentation - http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function_in
  21. Your foreach() loop is overwriting your original array $value with the first value in it - Use a different variable name to prevent your code from overwriting your own data. You also should not be executing a query inside of a loop. implode your original array $value into a string and use it in the mysql IN() statement to get all the matching rows in a single query.
  22. // detect direct access to included/required file if(strtolower(basename($_SERVER["SCRIPT_NAME"])) == strtolower(basename(__FILE__))){ exit('No Direct Access'); }/code]
  23. You would find the next ID that is either greater-than or less-than the current id, LIMIT 1
  24. The only information that any site receives with a HTTP request is the information that is contained in that HTTP request, this includes - 1) The ip address (taken from the TCP/IP data packets.) 2) The URL (including any folder path, file name, or GET parameters) 3) Any headers in the http request, like cookies. 4) Any data within the request, such as POST and FILES data. If you are redirecting the visitor, then ALL this information would come from the visitor's browser anyway (a header() redirect tells the browser to request the URL in the redirect) and about the only simple/clean thing you can use is a GET parameter as part of the URL. Cookies are out because they are domain specific and javascript on one site cannot set or modify a cookie for a different domain. You could cause a form to be submitted (the action="" attribute would actually cause the new URL on the second site to be requested.) Why don't you want to use a GET parameter? Short answer: Anything you do involving a redirect is through the browser and if your goal is keeping the value of the variable out of the hands of the visitor, no there is no way if you are doing this through the browser.
  25. Now that you know there is an SQL syntax error in the query, you would need to examine the actual query that is being formed in order to determine why a -20 is being put into it in order to fix it (it's likely in a pagination LIMIT clause...)
×
×
  • 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.