-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
If you read the documentation for natsort(), you will find that it does not return an array. It simply sorts the array you pass it as a parameter.
-
That either means - 1) The ini_set() function is disabled on your server (you cannot turn on display_errors to find what error is occurring), 2) the mail() function is disabled on your server, or 3) Your mail server has been configured to silently accept emails that it has no intention of sending so as to not provide hackers with any server information in the form of error messages. In any of those cases, you would need to contact your web host to find out the requirements for sending email.
-
Add the following two lines of code after the line with your first opening <?php tag to see if there are any php detected errors as to why the mail() function call is failing - ini_set("display_errors", "1"); error_reporting(E_ALL);
-
Since you didn't bother to state which result you get, it's not directly possible to help. What do you see in front of you that leads you to believe that the code is not working?
-
So, what is the column definition of Credit_Card_Number? And what exactly is the symptom or error that leads you to believe that "it doesn't take." We only see the information you supply in your posts and "it doesn't take." could mean 3-6 different things, each with a different cause. You must be exact when describing problems.
-
This: 11/12 is a math expression, 11 divided by 12 This: '11/12' is a string that represents something specific to your application. Strings are enclosed in single-quotes in a query.
-
Not seeing the $_SESSION['username'] 1st time round
PFMaBiSmAd replied to freelance84's topic in PHP Coding Help
You can redirect at the server level using a .htaccess file. Also, you can - -
Calling variables from PHP files included from another domain
PFMaBiSmAd replied to Traxus's topic in PHP Coding Help
You can just use file_get_contents() to read the URL, but the remote code would need to output what you want in the format that you want. Yes you can echo raw php code, as long as it's valid code. You can also put php code into a file with an extension, such as .txt, that is not automatically parsed as php code. -
I copy/pasted your exact posted values. Best guess is this is an actual Windows generated .inf file and it contains some non-printing characters.
-
Calling variables from PHP files included from another domain
PFMaBiSmAd replied to Traxus's topic in PHP Coding Help
When you use a URL in an include, you only get the output from the remote file because it is parsed on the remote server when is it services the request for that URL. I.E. The same as if you browses to the remote file. To do what you want would require that the remote file you are requesting output (echo/print) the raw value you are expecting and your code would need to assign the value to a variable or you would need to output raw php code (with the opening and closing php tags as part of the output.) -
My code - <?php $x = parse_ini_file('config.inf'); echo "<pre>",print_r($x,true),"</pre>"; ?> Are you sure the file is named like you are using in the code and it is not actually - file.inf.txt? Are you developing and debugging your php code on a system with error_reporting set to E_ALL and display_errors set to ON so that all the errors php detects would be reported and displayed?
-
undefined function checkdnsrr()
PFMaBiSmAd replied to sfc's topic in Editor Help (PhpStorm, VS Code, etc)
What does a phpinfo(); statement show for your php version? -
I used parse_ini_file() on the data you posted and got the expected results - [signature] => $Windows NT$ [Class] => ActivityMonitor [ClassGuid] => {b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2} [Provider] => %Symc% [DriverVer] => 06/24/2009,12.8.0.10 [CatalogFile] => SymEvent.cat Perhaps if you defined: this does not work?
-
mysql_query() returns a result resource. It does not return the SELECTed value. You must fetch the value from the result set that the result resource points to. However, you cannot reliably SELECT the highest value and add one to it because if there are concurrent visitors and concurrent queries, you cannot guarantee the order in which queries execute (unless you lock the table.) You would typically either use an auto-increment column and let the database do this or you would do it using a single UPDATE query.
-
You can use ini_set() in your script to set the SMTP setting that mail() uses, though I doubt that is what your question really is about.
-
If your get_Data() function returned the value, you can call that function anywhere you need the value - function get_Data() { $License = "license.txt"; $File = fopen($License, 'r'); $Read = fread($File, 35); fclose($File); return $Read; } However, if you anticipate needing the value more than once in a script, you should store that returned value in a program variable so that you don't waste time reading it from the file each time - $key = get_Data();
-
Error extracting info from database into web form... HELP!!
PFMaBiSmAd replied to jmclocals's topic in PHP Coding Help
The edited code in your first post is not the same as originally posted and now produces a fatal parse error. It is extremely difficult to help with code that is a moving target. Good luck. -
Error extracting info from database into web form... HELP!!
PFMaBiSmAd replied to jmclocals's topic in PHP Coding Help
The posted code by itself does not produce any error. Perhaps if you post the exact error message and the context where the code is being used that does produce the error. -
Strange problem with registering session variable
PFMaBiSmAd replied to xcandiottix's topic in PHP Coding Help
The only reason there are errors now for depreciated functions and features is because - The statements in the documentation about any specific thing being depreciated in php5.3.0 is just some tech writer globally going through and adding that comment, regardless of when something was actually depreciated in favor of a different method. -
Where's the most important line of code, the include statement?
-
Strange problem with registering session variable
PFMaBiSmAd replied to xcandiottix's topic in PHP Coding Help
Actually, session_register was depreciated in php4.2 when register_globals were turned off by default. Code to cause it to produce a depreciated error was only added in php5.3. -
There isn't a computer program that can find exactly what syntax the programmer left out or put in the wrong place because that would require the program to be able to read minds to learn what the programmer intended. For example, if you left out a closing quote on a string. The computer cannot determine that you didn't want the rest of the code to be part of the string and where you intended the closing quote to go because a multi-line string is valid syntax, just like a multi-line statement is correct syntax, as are multiple statements on one line. The reason why language parsers often report a syntax error on a line following the line where the actual wrong syntax is located at is because the only thing computers can do (without mind reading ability) is detect when something is found in a location where it does not belong. Computers cannot tell what or where the programmer left something out or what or where he put something in the wrong place. Only the programmer who is writing the code can determine what he intended and where the correct syntax elements belong and it is his responsibility to learn the correct syntax in the first place and use it where he intends it to be. The analogy is writing a letter and you leave out a comma, a period, or use the wrong form of a word (homonym) that changes the meaning of what you have written. A dumb computer could proof read it but about all it could find is that you perhaps wrote a run-on sentence. It would not be able to find and fix the errors in it without knowing the meaning of what the author intended.
-
I keep getting an error when i try to send mail
PFMaBiSmAd replied to Djrikidk's topic in PHP Coding Help
The reason you are getting an error that tells you "Failed to connect to mailserver at "localhost" port 25" is because you don't have a mail server installed on your localhost computer. Even if you did install and configure a mail server on your localhost computer, you would only be able to send emails to yourself on it unless you also have a domain name and proper DNS records on a public name server that point to your localhost computer. If you are just doing this for testing your mail code, either do it on your live server or use one of the phpmailer classes that allow you to use SMTP authentication (the php mail() function does not support SMTP authentication) and use the mail server on your live host. -
Using 'LIKE' operator with mysql_real_escape_string
PFMaBiSmAd replied to mattspriggs28's topic in MySQL Help
You need to double the %% to get it to be treated as a literal % within a sprintf() - $sql = sprintf("Select * from " . TBL_PREFIX . "_operators where id = %s or company_name LIKE '%%%s%%'", -
The file would generally be referred to as the session data file. The session data file can be deleted by the session garbage collection, having nothing to do with the browser. The second code will update the last accessed time of the session data file, which will affect what session garbage collection does. ------ A session consists of two parts. The session id from the browser and the corresponding session data file on the server. As long as both pieces exist, the session will exist.