Php errors on my site
Posted by: romtec123 (---.hsd1.ca.comcast.net)
Date: July 17, 2015 09:16PM

Hello, On any advanced php document that i host, i get errors like this: [puu.sh]
Can anyone help me, they started when i updated it.




Wamp color is green
OS is win server 2012
WAMP 2.5 64 bit
Apache 2.4.9
MySQL 5.6.17
PHP: 5.5.12



Edited 1 time(s). Last edit at 07/17/2015 09:18PM by romtec123.

Options: ReplyQuote
Re: Php errors on my site
Posted by: Otomatic (Moderator)
Date: July 17, 2015 09:21PM

Hi,
What are the lines 10 to 12?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Php errors on my site
Posted by: romtec123 (---.hsd1.ca.comcast.net)
Date: July 18, 2015 03:19AM

Here it is:[puu.sh]

Options: ReplyQuote
Re: Php errors on my site
Posted by: Otomatic (Moderator)
Date: July 18, 2015 09:27AM

Hi,

For text, it makes copy/paste in text mode, not images.
Nothing infuriates me longer than having to go load an image to read text.

Yours errors:
You MUST ALWAYS put quotes for text array index's.
$_SERVER['HTTP_HOST']

See [php.net]
Array do's and don'ts
Why is $foo[bar] wrong?

Always use quotes around a string literal array index. For example, $foo['bar'] is correct, while $foo[bar] is not. But why? It is common to encounter this kind of syntax in old scripts:
<?php
$foo[bar] = 'enemy';
echo $foo[bar];
// etc
?>

This is wrong, but it works. The reason is that this code has an undefined constant (bar) rather than a string ('bar' - notice the quotes). PHP may in the future define constants which, unfortunately for such code, have the same name. It works because PHP automatically converts a bare string (an unquoted string which does not correspond to any known symbol) into a string which contains the bare string. For instance, if there is no defined constant named bar, then PHP will substitute in the string 'bar' and use that.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.