Solved

php and mysql error message

Posted on 2011-02-16
4
247 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Creating and Managing Databases with phpMyAdmin in cPanel.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

760 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now