SmItH197 / SteamAuthentication

A simple PHP Authentication that enables steam users to log into their steam account to access content!
MIT License
446 stars 147 forks source link

Undefined offset 0 #250

Closed ProfessorBoogie closed 5 years ago

ProfessorBoogie commented 5 years ago

For some reason everytime i load on to my website i am given these errors: githubyeet

the file 1.php is my index.php.

here are my lines of code: image Someone please help me

RedSparr0w commented 5 years ago

It looks like you are trying to include/require userInfo.php before the user is logged in.

Edit: Also on another note, It seems you aren't loading steamauth.php at the top of your file, otherwise you shouldn't be getting that first error.

ProfessorBoogie commented 5 years ago

It looks like you are trying to include/require userInfo.php before the user is logged in.

Edit: Also on another note, It seems you aren't loading steamauth.php at the top of your file, otherwise you shouldn't be getting that first error.

How would i go about fixing that in the code?

RedSparr0w commented 5 years ago

Check if the user is logged in before including the file.

Checkout the demo.php file for more info.

ProfessorBoogie commented 5 years ago

Check if the user is logged in before including the file.

Checkout the demo.php file for more info.

I had done this, it still doesnt work.

<!DOCTYPE html>

<?

require 'steamauth/steamauth.php';
require 'steamauth/userInfo.php';

{
    $id = $_SESSION['steamid'];  
}

?>

RedSparr0w commented 5 years ago

Edit: Removed Info

Gambling sites are not supported by this library, which your site is one of, based on that code.

I nor Steam condone the use of this library for the purpose of gambling sites. Any sites that use this library for this purpose violates their API agreement and will receive notices from Steam to cease operations.

Read more here: http://store.steampowered.com/news/22883/

By downloading this library you agree that you will not use it for any gambling or illegal activity.

https://github.com/SmItH197/SteamAuthentication#gambling-sites