-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Yes, you have an error in your program logic. If you want specific help with what your code is doing, you would need to post enough of your code that demonstrates and duplicates the problem so that someone could tell you what is wrong with your code.
-
Did you ever set the error_reporting/display_errors settings like someone suggested so that php would help you?
-
You need to make your own folder within your account's folder tree and set your session.save_path setting to point to your own folder so that you session data files will be stored in your own folder. You need set the session.save_path before every session_start() statement, so it is best if you do this in a .htaccess file (when php is running as an Apache Module) or in a local php.ini (when php is running as a CGI application) or in your script.
-
^^^ The first die() statement actually means that the field(s) were left blank and the code should display that message and then redisplay the form. The message should be corrected. Also, by using die() for the above and using die() when the query does find a matching row, you are preventing the form from being redisplayed so that the user could enter the correct information.
-
Checking user level now not showing value in fields.
PFMaBiSmAd replied to mnewberry's topic in PHP Coding Help
Programming and solving problems in programming involves a lot of inference and flexibility in thinking. Just because someone got a specific error number when they were doing something in programming does not mean that a 'searched for' answer has anything to do with the problem. Due to the general purpose nature of computers and programming, there is NOT always a fixed one-to-one problem/answer relationship in programming. Depending on the situation, one problem can cause different symptoms and one specific symptom can be cause by many different things. When you don't have specific knowledge about what someone is asking and don't take into account the situation, it is generally best to not repeat information you find on the Internet. -
Strange Sort by Date and time problem
PFMaBiSmAd replied to alexsmith2709's topic in PHP Coding Help
User a different alias name in - AS datetime When you use an alias name that is the same as a column name, the alias data value is used where you reference that name in the query instead of the actual column. Your query is ORDERing BY the formatted datetime instead of the actual datetime. DATE and DATETIME data types can be ordered correctly. Your formated datetime cannot. -
Your main_interface.php code is NOT secure because if someone ignores the header() redirect, they can access your 'protected' pages the same as if that code wasn't even there. You need an exit; statement after the header(); statement to prevent the remainder of the code on the page from running.
-
Check out the DROP COLUMN syntax at this link - http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
-
Also, session_register() was depreciated almost 9 years ago and won't work on a majority of php installations today and is going to be removed in the next major php version release. You should be setting and referencing $_SESSION variables and you will need a session_start() statement in your code before you output anything to the browser.
-
Your header() redirect is probably failing due to your script outputting some blank lines at the start of your file before the <?php tag. Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that all the php detected errors will be reported and displayed? You will save a TON of time.
-
A DELETE query will delete a ROW from your table. If you want to remove an actual column from your whole table, you would use an ALTER TABLE query. If you want to clear the value in a column in one or more rows in your table, you would use an UPDATE query. What exactly are you trying to accomplish?
-
MOVED: How does one "close" out a topic that he posted?
PFMaBiSmAd posted a topic in Javascript Help
This topic has been moved to PHPFreaks.com Questions, Comments, & Suggestions. http://www.phpfreaks.com/forums/index.php?topic=328486.0 -
Checking user level now not showing value in fields.
PFMaBiSmAd replied to mnewberry's topic in PHP Coding Help
@mnewberry, you should be 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 php detected errors will be reported and displayed. Setthing those two values in your code won't show fatal parse errors. There would likely be an error, warning, or notice that would help pin down why your page is not doing what you expect. I have read your description of the problem more than once, and I don't have any idea what you are describing. What exactly are you getting for output and what exactly is missing? -
Checking user level now not showing value in fields.
PFMaBiSmAd replied to mnewberry's topic in PHP Coding Help
@sunfighter, a http 500 error means that the web page did not return a complete response. In the case of a web page produced by php, it generally means that there was a fatal parse or fatal runtime error. Without the php closing }, the code contains a php syntax error and produces a fatal parse error. When the php error_reporting/display_errors settings set such that php errors are not displayed, you get a http 500 error. -
That would be a logical problem with your code and you would need to post your code if you want specific help with it.
-
Start a session name from a result from a login
PFMaBiSmAd replied to Russia's topic in PHP Coding Help
Before you can perform database operations on your data in your application, you must learn how to execute a query and retrieve the data from that query. Here's a basic SELECT query example (if you only expect one row, you don't need to use a loop when fetching the data from the result resource) - http://w3schools.com/php/php_mysql_select.asp -
It's more likely that your HTML is invalid somewhere and is not showing you the whole value. Have you looked directly in your database table using your favorite database management tool (i.e. phpmyadmin) so that you know what exactly is being stored in the table?
-
Start a session name from a result from a login
PFMaBiSmAd replied to Russia's topic in PHP Coding Help
$result['user_id'] doesn't exist. $result is the result resource from the query. You would need to fetch the row from the result resource before you could reference a column in that row. -
why wont the data added to the database.
PFMaBiSmAd replied to xxreenaxx1's topic in PHP Coding Help
The {} are not necessary in this case, but don't hurt anything. -
$_FILES is empty, and $_SERVER['CONTENT_LENGTH'] is empty
PFMaBiSmAd replied to Ionisis's topic in Applications
I would try using a different name for the field in - name="multimedia[]". Your server or the php compiled for your server (I tested using FF4.0 under XP and with Apache (latest 2.2)/php (latest 5.3) running as an Apache Module under XP) could be doing something unique for an array with that name. Also, without your whole form, it's kind of hard for anyone to eliminate that as the source of the problem. -
If you use mysql_error() in your or die(...) statement, php/mysql will tell you why the function is failing - or die("Could not select examples" . mysql_error());
-
If you want a count of the files that were uploaded, you would need to examine the ['error'] element - http://us.php.net/manual/en/features.file-upload.errors.php A 0 value indicates a file was successfully uploaded. A 4 indicates the file field was left empty. Any other number indicates an error with the uploaded file.
-
See this post - http://www.phpfreaks.com/forums/index.php?topic=328359.msg1545502#msg1545502
-
$_SESSION['imagegallery'] is an array of arrays. You can use array functions to iterate over it and get the key/inner array - foreach($_SESSION['imagegallery'] as $key=>$array){ echo "Key: $key, ID: {$array['id']}, URL: {$array['url']}, TNURL: {$array['tnurl']}, Caption: {$array['caption']}<br />"; }