Hi Patnaik:
I've been pursuing this issue, still no success. I ran a PHP CodeSniffer analysis to detect incompatibilities between the index and header php files, using a plain vanilla analysis, and another with a standard to check directly for PHP compatibility. Here is the output, I hope it helps.
Best regards
Pablo
1.- phpcs header.php
FILE: /var/www/html/stocks/header.php
--------------------------------------------------------------------------------
FOUND 59 ERROR(S) AND 8 WARNING(S) AFFECTING 35 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Missing file doc comment
11 | ERROR | "include" is a statement not a function; no parentheses are
| | required
11 | ERROR | File is being unconditionally included; use "require" instead
19 | ERROR | Spaces must be used to indent lines; tabs are not allowed
19 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
21 | ERROR | Expected "if (...) {\n"; found "if(...){\n"
21 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found 0
| | spaces
22 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
26 | ERROR | You must use "/**" style comments for a function comment
26 | ERROR | Function name "add_slashes" is prefixed with a package name
| | but does not begin with a capital letter
26 | ERROR | Opening brace should be on a new line
33 | WARNING | Line exceeds 85 characters; contains 128 characters
34 | ERROR | Expected "if (...) {\n"; found "if(...){\n"
34 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found 0
| | spaces
35 | ERROR | Spaces must be used to indent lines; tabs are not allowed
35 | ERROR | Line indented incorrectly; expected at least 12 spaces, found
| | 9
36 | ERROR | Expected "} elseif (...) {\n"; found "}elseif(...){\n"
36 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found 0
| | spaces
37 | ERROR | Spaces must be used to indent lines; tabs are not allowed
37 | ERROR | Line indented incorrectly; expected at least 12 spaces, found
| | 9
39 | ERROR | Expected "} else {\n"; found "}\n else{\n"
40 | ERROR | Spaces must be used to indent lines; tabs are not allowed
40 | ERROR | Line indented incorrectly; expected at least 12 spaces, found
| | 9
45 | ERROR | Missing function doc comment
45 | ERROR | Function name "strip_slashes" is prefixed with a package name
| | but does not begin with a capital letter
45 | ERROR | Opening brace should be on a new line
57 | WARNING | Line exceeds 85 characters; contains 305 characters
58 | WARNING | Line exceeds 85 characters; contains 251 characters
61 | ERROR | Expected "if (...) {\n"; found "if (...)\n{\n"
61 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found
| | newline
63 | ERROR | Line indented incorrectly; expected 4 spaces, found 0
63 | ERROR | Expected "if (...) {\n"; found "if (...)\n {"
63 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found
| | newline
64 | ERROR | Closing brace must be on a line by itself
65 | ERROR | Line indented incorrectly; expected 4 spaces, found 2
65 | ERROR | Expected "} else {\n"; found "}\n else {"
65 | ERROR | Closing brace must be on a line by itself
66 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0
67 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0
68 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0
69 | ERROR | Line indented incorrectly; expected 4 spaces, found 0
69 | ERROR | Expected "if (...) {\n"; found "if(...)\n {"
69 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found
| | newline
70 | ERROR | Closing brace must be on a line by itself
71 | ERROR | Line indented incorrectly; expected 4 spaces, found 1
71 | ERROR | Expected "} else {\n"; found "}\n else {"
71 | ERROR | Closing brace must be on a line by itself
104 | WARNING | Line exceeds 85 characters; contains 91 characters
119 | WARNING | Line exceeds 85 characters; contains 123 characters
126 | ERROR | Expected "if (...) {\n"; found "if(...){\n"
126 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found 0
| | spaces
127 | ERROR | Line indented incorrectly; expected 4 spaces, found 1
127 | ERROR | Expected "if (...) {\n"; found "if(...){"
127 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found 0
| | spaces
127 | WARNING | Line exceeds 85 characters; contains 258 characters
134 | ERROR | Expected "foreach (...) {\n"; found "foreach (...){\n"
135 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
135 | WARNING | Line exceeds 85 characters; contains 138 characters
136 | ERROR | Line indented incorrectly; expected 4 spaces, found 1
136 | ERROR | Expected "if (...) {\n"; found "if(...){"
136 | ERROR | There must be a single space between the closing parenthesis
| | and the opening brace of a multi-line IF statement; found 0
| | spaces
136 | ERROR | Closing brace must be on a line by itself
136 | WARNING | Line exceeds 85 characters; contains 88 characters
137 | ERROR | Line indented incorrectly; expected 4 spaces, found 1
137 | ERROR | Expected "} else {\n"; found "}\n else{"
137 | ERROR | Closing brace must be on a line by itself
138 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
--------------------------------------------------------------------------------
Time: 117 ms, Memory: 2.25Mb
FILE: index.php
--------------------------------------------------------------------------------
FOUND 12 ERROR(S) AND 7 WARNING(S) AFFECTING 16 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Missing file doc comment
4 | ERROR | "include" is a statement not a function; no parentheses are
| | required
4 | ERROR | File is being unconditionally included; use "require" instead
8 | WARNING | Line exceeds 85 characters; contains 396 characters
10 | WARNING | Line exceeds 85 characters; contains 209 characters
11 | WARNING | Line exceeds 85 characters; contains 132 characters
16 | ERROR | Expected "foreach (...) {\n"; found "foreach(...){\n"
17 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
18 | WARNING | Line exceeds 85 characters; contains 208 characters
19 | WARNING | Line exceeds 85 characters; contains 153 characters
20 | WARNING | Line exceeds 85 characters; contains 139 characters
22 | WARNING | Line exceeds 85 characters; contains 163 characters
30 | ERROR | Expected "foreach (...) {\n"; found "foreach(...){\n"
31 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
31 | ERROR | No space found after comma in function call
32 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
33 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 1
39 | ERROR | "include" is a statement not a function; no parentheses are
| | required
39 | ERROR | File is being unconditionally included; use "require" instead
--------------------------------------------------------------------------------
Time: 68 ms, Memory: 1.75Mb
-------------------------------------------------
2.- phpcs --standard=PHPCompatibility header.php
FILE: /var/www/html/stocks/header.php
--------------------------------------------------------------------------------
FOUND 6 ERROR(S) AND 1 WARNING(S) AFFECTING 6 LINE(S)
--------------------------------------------------------------------------------
19 | WARNING | INI directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and
| | forbidden in PHP 5.4.
22 | ERROR | The use of function set_magic_quotes_runtime is discouraged in
| | PHP version 5.3 and forbidden in PHP version 5.4 and forbidden
| | in PHP version 5.5
56 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
57 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
58 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
58 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
59 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
--------------------------------------------------------------------------------
Time: 84 ms, Memory: 2.00Mb
FILE: index.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
32 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
32 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
| | instead.
--------------------------------------------------------------------------------
Time: 49 ms, Memory: 1.50Mb