Undefined variable, Undefined offset, etc


#1

So I was working on a html loading screen for a game and some feature wasn’t working when i was using php(building the site from ground up), The site was working perfectly before hand so I didn’t think much of anything. I then tried changing file permissions to see if that would fix anything and it didn’t, its what caused all these errors to pop up, The perms I changed were from the owner to read write end exec, to allow group aswell do the same. would love some help if possible thanks!

for example:

Notice: Undefined variable: communityid in /storage/ssd3/808/312808/public_html/multiload/index.php on line 14

Notice: Undefined variable: communityid in /storage/ssd3/808/312808/public_html/multiload/index.php on line 16

Notice: Undefined offset: 0 in /storage/ssd3/808/312808/public_html/multiload/index.php on line 31

Notice: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' in /storage/ssd3/808/312808/public_html/multiload/index.php on line 12

Notice: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /storage/ssd3/808/312808/public_html/multiload/index.php on line 12

Notice: Undefined variable: communityid in /storage/ssd3/808/312808/public_html/multiload/index.php on line 14

Notice: Undefined variable: communityid in /storage/ssd3/808/312808/public_html/multiload/index.php on line 16


Warning: include(../inc/php/api.php): failed to open stream: No such file or directory in /storage/ssd3/808/312808/public_html/multiload/admin/success.php on line 19

Warning: include(): Failed opening '../inc/php/api.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd3/808/312808/public_html/multiload/admin/success.php on line 19

Warning: include(inc/php/disables.php): failed to open stream: No such file or directory in /storage/ssd3/808/312808/public_html/multiload/admin/success.php on line 22

Warning: include(): Failed opening 'inc/php/disables.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd3/808/312808/public_html/multiload/admin/success.php on line 22

Notice: Undefined index: login in /storage/ssd3/808/312808/public_html/multiload/admin/util.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd3/808/312808/public_html/multiload/admin/util.php:2) in /storage/ssd3/808/312808/public_html/multiload/admin/util.php on line 7

#2

This is the website url btw http://mysticseagull.000webhostapp.com/multiload/


#3

Hi @MysticSeagull!

The function probably modified the /public_html/.htaccess and added a default directive to display all PHP errors/notices.

You can suppress the errors notices by setting display_errors to 0

However, if you want to correct everything in a professional manner, you should modify your script and code it in such a way your errors will not appear anymore :wink:


Warning: Cannot modify header information - headers already sent by [ ... ]

This error can be corrected by adding in a new line php_value output_buffering on to your /public_html/.htaccess


#4

I tried so far and it now says Application error. https://mysticseagull.000webhostapp.com/multiload/
unless I entered it wrong.
http://prntscr.com/ihigh7 @teodor


#5

I have corrected it. You had to input the parameter of output_buffering as well :wink:

Press CTRL+F5 for a full webpage refresh.


#6

it still didnt fix for me, can u try one more time :wink: heh :sweat_smile:

Also so my vars for a web api wont break anymore correct?


#7

it still didnt fix for me, can u try one more time :wink: heh :sweat_smile:

Done.

Also so my vars for a web api wont break anymore correct?

No, they shouldn’t.