Solved

php and mysql error message

Posted on 2011-02-16
4
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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.
The viewer will learn how to dynamically set the form action using jQuery.
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…

710 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