Solved

php and mysql error message

Posted on 2011-02-16
4
249 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 50 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 250 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 200 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

821 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