Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. The 5th parameter is a command line argument that is passed to the mail server when mail() is calling the mail server's binary/executable. If you are actually using SMTP, it doesn't mean anything. If you were using php's error_reporting/display_errors settings, php would probably help you by displaying any errors that the mail() function gets back from your sending mail server.
  2. A) Not many sending mail servers will send an email when the From: address is not a valid mail address hosted at the sending mail server because it does not satisfy the relaying restrictions, assuming that the To: address is also not hosted at the sending mail server (sending it to yourself) as that would satisfy most relaying restrictions in itself. B) Not very many of the major ISP's receiving mail servers will accept an email where the domain in the From: address does not correspond to the sending mail server, either directly as best as can be determined by the dns zone records at the sending mail server or where there is an SPF dns zone record at the domain in the from address that says the sending mail server is authorized to send email for that domain. Are you even sure that the code where your mail() is at is being executed and are there any php errors, with error_reporting set to at lest E_ALL and display_errors set to ON, that would help determine if your sending mail server is even accepting the email to send it?
  3. Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that all the errors php detects will be reported and displayed? You will save a TON of time.
  4. Your query is failing due to one of about a dozen possible reasons. Use mysql_error() to find out why - $Result = mysql_query($Sql, $Link) or die(mysql_error());
  5. The - separator expects dd [.\t-] mm [.-] YY http://www.php.net/manual/en/datetime.formats.date.php
  6. Your code never runs when there is a fatal parse error and those two lines of code are never executed.
  7. ^^^ That's invalid php and produces a fatal parse error. Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that all the errors php detects will be reported and displayed? You will save a TON of time.
  8. Are you actually browsing to your file using a URL - http://localhost/your_file.php OR are you directly browsing to it using a file path - C:\some_path_on_your_computer\your_file.php? The symptom is that of a .php file being directly browsed to instead of being invoked through a web server. For the case where it does not work, what does a 'view source' in your browser show?
  9. In your error checking (1), error reporting/logging (2), and error recovery logic (3), you should - 1) Always check if something worked or failed, 2a) When something fails, output a user message (i.e. the action you tried on this page cannot be performed due to a server error...), 2b) When something fails, log all the relevant information about the error so that you know what is happening and you can find and fix the problem. 3) Recover from the error gracefully by not executing follow-on code that is dependent on the result of something that has already failed so that you don't produce a string of follow-on errors or send output to the web page that is broken... For the example code that you posted with the "connection failed." logic. Suppose that something happens out of your control, such as your database server is failing intermittently or you are exceeding the number of allowed connections to your database server. You would want to 1) check if your database connection worked or failed, 2a) Display some message to your visitor so that he is not faced with a blank page, 2b) log everything about the error, and 3) recover from the error by displaying the remainder of your page correctly but not executing all the code that was dependent on that database connection.
  10. I'm going to guess that since you echoed $query2, that you probably found what was causing the problem when you looked at what the actual query was?
  11. Probably because your table is actually named: tblgerechten
  12. Use mysql_error() to find out why your query failed. Change your code to the following - mysql_query($query, $connectie) or die('Error, insert query failed ' . mysql_error());
  13. Are you actually executing the query using mysql_query() and why do you have an or die() on the end of your $query = "..." string assignment statement?
  14. The code you posted doesn't produce a php parse error. In fact, the code you posted doesn't even have 118 lines. We can only help you when you post the actual code that produces the error. When posting code, please put it inside the forum's ... tags.
  15. Just display the text as text, but the actual text you use is determined solely on the server based on which checkbox was checked. You have got all the different possible text stored in a database table or somewhere now?
  16. When you don't post the actual code/html/data that exhibits the problem, no one here can help you. The user can modify anything and everything you pass through a form. You cannot trust any input that comes from the user. What exactly are you trying to accomplish?
  17. Why are you defining the function inside of the loop? You should put function definitions near the start of your code and then call the function where you need it.
  18. Well written and tested code doesn't produce php errors when it runs and you shouldn't put code onto a live server until it has been completely tested.
  19. If your mysqli code previously worked, but does not now, it is likely that you accidentally typed a non-printing or a foreign language character as part of the function name. I recommend completely retyping that line. If your mysqli code never worked, then by turning on the error_reporting/display_errors settings, you have exposed an error that was always present.
  20. Multiple textarea's with a array name works (just tested), so there must be something going on in your actual code, either in the form or in the form processing.
  21. You have a new-line character after the closing ?> tag in dbinfo.inc.php. Remove everything in dbinfo.inc.php that is after the closing ?> tag.
  22. You would need to use a $_SESSION variable - Page where object is created - <?php // the class definition must exist before the session_start() so that the object can be recreated session_start(); $_SESSION['obj'] = new $MyObject(); Page that references the object - <?php // the class definition must exist before the session_start() so that the object can be recreated session_start(); echo $_SESSION['obj']->some_property; echo $_SESSION['obj']->some_method();
  23. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=325818.0
  24. See this - http://www.phpfreaks.com/forums/index.php?topic=325648.0
  25. You are missing the ; on the end of both of the following two lines of code. You also have the single and double quotes reversed around the $Runs and $Overs variables. Since you are dealing with numbers, there's no need for the single quotes anyway AND it is much simpler and less error prone to NOT use string concatenation (the dot . ) with php variables - $query="UPDATE batting SET runs = $Runs + runs WHERE batsman = '$Batsman'"; $query2="UPDATE bowling SET overs = $Overs + overs WHERE batsman = '$Batsman'"; You should also validate or cast to an integer your $Runs and $Overs variables to prevent sql injection. You also need to escape the $Batsman variable to prevent sql injection (see the mysql_real_escape_string() function.)
×
×
  • 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.