PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
[Fri Jun 21 08:46:28 2013] [warn] [client 81.129.13.166] mod_fcgid: stderr: PHP Notice: Undefined index: sn in /var/www/vhosts/domain/httpdocs/includes/product.inc on line 244
We are getting a ton of these kinds of errors.
sn is in the product page as:
you are getting this "Undefined index" notice errors because variables are not initialized, so you need check each variable with isset or you can disable this notice errors from php.ini file
Ok - so how do I disable it, but also, how do I "initialize" it with ISSET?
Probably lazy of me, but never used that as I assumed it would just ignore it if not found.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Just keep in mind that adjusting your error_reporting settings does not make the problem go away. The code is still wrong. The difference is that now PHP won't tell you it's wrong.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
simonmlewis wrote:Funny how when using this, most of our scripts wouldn't work. But would if I did:
sn = $_REQUEST['sn'];, tho there were errors in the log. It works.
That may be because your scripts don't expect the undefined value to be ''. Perhaps you could try:
Great stuff. Just been through the whole site and updated them all (as many as I could find).
Site also now seems to be running faster, possibly as a result.
I've turned error reporting back on, so in a few hours will see what's occurred.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
I am getting an error on the second like containing "HTTPS". Any ideas why?
The site isn't using SSL, so maybe I should just change it to HTTPS, but the query looks to be checking IF it is secure.
This is the error:
[text][Mon Jul 08 09:15:04 2013] [warn] [client 173.199.114.235] mod_fcgid: stderr: PHP Notice: Undefined index: HTTPS in /var/www/vhosts/site.co.uk/httpdocs/includes/product.inc on line 231[/text]
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.