-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Warning: mktime() expects parameter 5 to be long, string given
PFMaBiSmAd replied to sitesme's topic in PHP Coding Help
In a way that is kind of funny, because php had this brilliant idea that hiding errors was okay. Your code always contained that error because mktime() NEVER accepted week day names, but the actual error message was being hidden or was filling up your error log on the server. Php still must handle each error in your code, even if the error_reporting or display_errors settings are off. All those settings do is prevent the reporting and display of an error, but php still goes through the error response code every time your script produces an error. So, the question becomes, why is your script putting week day names in as the day of the month and what does your script expect as a result? -
Warning: mktime() expects parameter 5 to be long, string given
PFMaBiSmAd replied to sitesme's topic in PHP Coding Help
So, did you check what was actually in the 5th parameter? Maybe you are passing it a string instead of a long integer value? -
If your code previously worked, the error (and if you searched for that error you would already know) means that your query failed due to an error either with the database server, your connection to the database server, or with your table/query. For debugging purposes (remove it when you are done), to find out why your query failed, you can echo mysql_error() on the next line after the line with your mysql_query() statement.
-
in_array
-
You must specifically list which table(s) you want to delete from. There is no wildcard table reference because if the database user happened to have high enough privileges, applying a query using a wildcard table reference could easily destroy your database structure and users.
-
I'm going to guess that your include statement is failing and in php's brilliant wisdom of hiding various types of error messages, your error_reporting/display_errors settings are not set up to show you all the errors that are occurring. I recommend setting error_reporting to E_ALL and display_errors to ON in your master php.ini on your development system so that all the php detected errors will be reported and displayed.
-
Form validator still submiting entries with errors
PFMaBiSmAd replied to Mhang's topic in PHP Coding Help
Since you didn't show the compete code showing where you are using the submitted information, it will be a little hard for anyone to tell you what you did wrong. If you put your code in the if(){} logic where the echo "<h2>Validation Success!</h2>"; is at, it should have worked correctly. -
If you want a specific value AND any of the other values, you must () to indicate that's what you want - "SELECT * FROM clients WHERE staff = 0 AND (username LIKE '%" . $keyword . "%' OR company LIKE '%" . $keyword . "%' OR contact LIKE '%" . $keyword . "%' OR address LIKE '%" . $keyword . "%' OR email LIKE '%" . $keyword . "%' OR phone LIKE '%" . $keyword . "%' ORDER BY phone)"
-
http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html
-
The problem that MasterK pointed out still exists. If the $_GET variable IS set you need to set $boo to it so that the include statement that is using the $boo variable will have the correct value in it.
-
That's because you are re-executing the query inside the while() statement. You would need to execute the query before the loop and only iterate over the result set in the while() statement.
-
So, is the % character present in the echo'ed output from your php script? Because, it is likely that you flash application is treating it as a special character and not rendering it.
-
Since you didn't state what it IS doing (what error, what wrong data) no one knows where to even start looking at in all the code.
-
Data Collision when using Static Class Validation
PFMaBiSmAd replied to ponderous2k's topic in PHP Coding Help
That's correct, but any "global variables" in a script only exist within that instance of that php script. -
The code you posted does. BTW, your mail() function call is incorrect. You have an extra parameter in the list. Perhaps if you posted the actual code that has the problem and actually told us what problem you are having with it?
-
There's at least 6+ different things that could be wrong with your form or your php code. You would need to post all the form and the php code from the start of the file up through the $body .= "check1: ".$post_check1."\n"; statement for anyone to have a chance at helping you.
-
how to accept all special characters for php mysql? pls, urgent.
PFMaBiSmAd replied to angel1987's topic in MySQL Help
Are you using ENT_QUOTES as the second parameter in htmlentities()? -
how to accept all special characters for php mysql? pls, urgent.
PFMaBiSmAd replied to angel1987's topic in MySQL Help
If you use mysql_real_escape_string() on that list of characters to escape the \, the ', and the " in it (the characters that have special meaning when inside SQL string data), you can insert that list of characters into a mysql database table. However, since some of those characters also have meaning in HTML, you would need to convert them to htmlentities when you output them as data on a web page to keep from breaking the HTML on the page. What exact problem or symptom are you having. -
So, did you read what ngreenwood6 wrote in his post?
-
Those two functions can be used any place you want. The only restriction is that you cannot output any characters to the browser before you use a header() statement, so, if your require() results in some code that sends output, you must prevent the output or rearrange your code so that any header() statements come before the output. Do you have a specific problem or error that you need help with?
-
I'm tired and missing somethings or my sever is messed up?
PFMaBiSmAd replied to Rifts's topic in PHP Coding Help
require/include expects a correct file system path. You can either use an absolute file system path, a relative path (relative to the main page that was requested), or you can make use of the include_path and let php search for the file. An absolute file system path would typically use $_SERVER['DOCUMENT_ROOT'] to get the absolute path of your document_root folder, then append the path and file name of the file you want to require/include. A relative path starts with either a leading .. or ., such as ../some_folder/some_file.php Using the include_path, you just list the bare file name, such as require('some_file.php') and php will search in the include_path to find the file. The include_path setting typically has a dot . as the first entry so that the current folder will be searched first. -
That's all HTML that is output to the browser. Outputting any characters to the browser prevents the HTTP header that is need for session_start().
-
Yes, look at line 12 of header.php and find what output it is sending at or before that point and eliminate that output as it is preventing the session_start() from working. Alternatively, you can move the session_start() statement so that is occurs before you send any output to the browser.
-
Data Collision when using Static Class Validation
PFMaBiSmAd replied to ponderous2k's topic in PHP Coding Help
^^^ A php variable, an instance of a class or static class properties or methods, a static variable in a function or in a class, database connections, file handles, ... are ALL resources that are created when a .php page is executed. They are all destroyed when the server finishes processing that instance of that .php page. Otherwise, server side scripting would be impossible and you could never have more than one visitor requesting the same page at the same time. You must actually take specific steps in your scripts to get information to pass between any two page requests. For one specific visitor you must use either cookies/sessions, pass values through the URL, or pass information as POST data from a form to the next page requested. For different visitors you must store the shared information in a database or in specific shared memory (requires a shared memory driver to be installed on the server.)