Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

php and mysql error message

Posted on 2011-02-16
4
Medium Priority
?
255 Views
Last Modified: 2012-06-27
Dear experts,
I use PHP and Mysql
I do not want my visitor to see on my page an error message like
Notice: Undefined index: name in ...
I use post method and i give action on the same page and it gives error messages..
what do you suggest?
thank you
0
Comment
Question by:Braveheartli
4 Comments
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 200 total points
ID: 34905582
Best thing to do would be to get rid of the errors. They indicate that there is someting wrong with the script. If so, it should not be online for everyone to see. You can choose not to display errors, but that doesn't mean that there is none.
0
 
LVL 4

Accepted Solution

by:
andreizz earned 1000 total points
ID: 34905590
Hello!

You are using somewhere in your code $_POST['name'] and the index name does not (yet) exist.
If you simply don't want the error to display use at the beginning of your code error_reporting(0);

You should follow the train of operations and see if and when $_POST['name'] is called because there is the problem.
0
 
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 800 total points
ID: 34905606
Edit your settings in php.ini to send errors to a log file and not to the screen. In the short term you can try adding this line to the PHP script

ini_set('display_errors', 0 );

The settings you can change in php.ini for error logging are documented here http://uk.php.net/manual/en/errorfunc.configuration.php#ini.display-errors and to set an error log see the last entery on the list http://uk.php.net/manual/en/errorfunc.configuration.php#ini.error-log

0
 
LVL 1

Author Closing Comment

by:Braveheartli
ID: 34905685
thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question