Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. That would suggest that one or both of $_POST['start1'] and $_POST['end1'] are not set and you would need to determine why.
  2. I suggest you start with the basics. Get your login form to be displayed when someone requests the page and they are not already logged in. After you get that to work, you can work on getting the code that handles the submission of that form to work. Registration is usually handled as a separate menu item/link. You only register once, but log in many times. A visitor would not want to see the registration form every time they log in. Normally, they would only expect to see the log in form. If you post the link to the site where you got the login script you are using (or post your config.php file, less the database login details), someone might be willing to help more, but without all the code you are attempting to use on your page, no one can really do much more than point out what is wrong with the code you have posted.
  3. The reason explode produces an array is because it is easier to work with an array when you have related sets of data. $data = " your data here ..."; $description = explode('||||',$data); At this point you will have the variables: $description[0], $description[1], $description[2], ... up to $description[n] You can use array functions, such as foreach() and count() to iterate over each element of the array or get a count of how many elements there are.
  4. ^^^ There's at least two more reserved keywords being used as column names (hint: they are common words that also have meaning to a query language.)
  5. @BCAV_WEB, the posted code parses without error (assuming you have all the include/require files and they don't have any fatal parse errors in them.) The current problem is the code is logically wrong. It does not do anything when the page is requested. The solution is to 1) Define exactly what you want the page to do and what should be output when it is first requested, and 2) write the code necessary to cause that to happen (removing part of a conditional statement is not going to accomplish this step.)
  6. I'm not sure what we can do to help. Computers only do exactly what their code tells them to do. This is the else{} statement on your page that is being executed when the page is first visited - } else { // The login form wasn't filled out yet, display the login form for the user to fill in: doIndex(); } This is the extent of your doIndex() function definition - function doIndex() { /* Import the global $messages array. If any errors were detected above, they will be stored in the $messages array: */ global $messages; /* also import the $title for the page - note you can normally just declare all globals on one line - ie: global $messages, $title; */ global $title; }
  7. Simple, your code is not outputting anything. In your code, if(isset($_POST["login"])) { and if(isset($_POST["register"])) { are both false since either one of those two conditional tests will only be true if a form was submitted with those $_POST[...] variables set AND the else {} part of the first if(){} conditional only calls your doIndex(); function and your few lines of code in the doIndex() function don't do anything. Troubleshooting what your code is doing involves you playing computer and determining what execution path your code takes and what statements are actually getting executed. Your code is not execuiting any statements that do or output anything, therefore you get a blank page. I suspect that your doIndex() function was supposed to produce and output the HTML <form>...</form>
  8. LOL, ^^^ That's the most important piece of information and you didn't bother to share it until the #5th reply in the thread. Here is a hint about asking for and getting help: We are not standing right next to you. We only see the information you supply in your posts. When you don't tell us what you saw in front of you when you tried something, it takes a really long time to get a solution to your problem.
  9. So, what is your actual question, problem, or error (and an example of what you are getting vs what you expect is worth a 1000 words)?
  10. One equal sign = is an assignment operator and except when you are assigning a zero/null/false value on the right-hand side of the statement, assignment statements are always true. All your if($var = 'string') are assigning the string to the $var and testing the result of that assignment. Two equal signs == is a comparison operator.
  11. 10/15/2010 <--- That's not a mysql DATE format, so it will be a little hard and inefficient to compare date values with it. Is that really what you have stored in your date column?
  12. Also, you are using 'mysql_escape_string' in the array_map() function. You should be using mysql_real_escape_string
  13. ^^^ I recommend the same, echo your $query string to see exactly what it is.
  14. mysql_real_escape_string() returns the escaped value and it must be assigned (or used directly in place of the value) - $title = mysql_real_escape_string($title);
  15. The problem is because the string data, in this case $title, is not being escaped before being put into the query string and the single-quote (along with any null values, double-quotes, \r, \n, ...) are breaking the sql syntax and producing an error. The reason this worked before on a different server is because php through it was better to let you blindly write code that worked, instead of spending 2 minutes learning how to properly escape string data being put into a query and it attempted to escape your data for you. However, since this did not work for all character encodings, hackers were still able to inject sql. So, php has now turned off this automatic (magic_quotes_gpc) escaping and it is up to your code to escape the data being put into a query. See this link - mysql_real_escape_string for the function you need to use to escape string data being put into a query. Edit: This problem has nothing to do with the mysql version and is not directly related to the php version, except that the setting(s) to magically get php to escape external string data was turned off by default in php 5.3 and is scheduled to be completely removed in the next major release of php. It is also possible that your new web host has the setting(s) turned off even through the php version is not the latest.
  16. It's more likely that the error is occurring at a single-quote or a double-quote in the data. Could you post an actual error message and what the actual $title value was at the time.
  17. Your HTML is invalid (missing the closing single-quote on the src='....' attribute.) The browsers where your page works are ignoring the error(s) in your markup. You should always validate your markup and it should be error free before you attempt to check its operation in different browsers.
  18. Since the error message indicates you are using a mysqli_result object, the PDO information out of the phpinfo() has nothing to do with the current problem. Also, the mysqlnd (mysql Native Driver) sits between either the mysql/mysqli extension and the database itself. You should be looking (searching on the phpinfo() output page) for a reference to mysqlnd
  19. In case you haven't seen it posted in the forum, you should be learning php, developing php code, and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON (set in your master php.ini when ever possible) so that all the php errors will be reported and displayed. You will save a ton of time. There would have been errors alerting you that no connection existed.
  20. phpinfo
  21. What php version? Also -
  22. You do understand that php is a server side scripting language and an include/require statement simply reads the contents of the 'includes/prochart.php' and incorporates it into the php source code where the require_once() statement is located and outputs the resulting content to the browser. You have got some links to images, external css, or external javascript or to some other content/media in your 'includes/prochart.php' file that is not being done using https or is being done to a different URL than your page that was fetched using https.
  23. The only way you would be getting the warning as the result of anything that you included/required would be if there is content/media in the code that is not using HTTPS to fetch it or there is content/media in the code that is being fetched from a different domain than where your page resides. You would need to provide specific information about what is being included/required if you want help with the problem.
  24. The error message you posted does not match the query you posted. Any chance the code you executed is not what you think it is?
×
×
  • 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.