Solved

php and mysql error message

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 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

19 Experts available now in Live!

Get 1:1 Help Now