SmItH197 / SteamAuthentication

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

stuck on /?login #63

Closed MikeDevresse closed 9 years ago

MikeDevresse commented 9 years ago

Hi, I put a login button in the index.php but it's doing nothing and get stuck on /?login. It work on the example.php but not on the index.php

SmItH197 commented 9 years ago

could you post the code your using in your index.php?

MikeDevresse commented 9 years ago

simply

<?php
if(!isset($_SESSION['steamid'])) {

steamlogin(); //login button

}  else {

include ('steamauth/userInfo.php'); //To access the $steamprofile array
//Protected content

logoutbutton(); //Logout Button
}     
?>
SmItH197 commented 9 years ago

Put

require ('steamauth/steamauth.php'); 

after <?php

MikeDevresse commented 9 years ago

It's at the very top of my page right avec the DOCTYPE

SmItH197 commented 9 years ago

Could you post the very top of your file?

MikeDevresse commented 9 years ago

<!DOCTYPE HTML> <?php require ('steamauth/steamauth.php');

You would uncomment the line beneath to make it refresh the data every time the page is loaded

// $_SESSION['steam_uptodate'] = false;

?>

SmItH197 commented 9 years ago

try removing <!DOCTYPE HTML>

MikeDevresse commented 9 years ago

still not working

SmItH197 commented 9 years ago

where does it get stuck? Before are after you login on the steam website?

MikeDevresse commented 9 years ago

before

SmItH197 commented 9 years ago

could you post you entire file? If example.php works then it suggests that there is something wrong with the file. Do you get any error messages or does it just hang?

MikeDevresse commented 9 years ago

in a pastebin ?

SmItH197 commented 9 years ago

or here

MikeDevresse commented 9 years ago
<?php
    require ('steamauth/steamauth.php');  

    # You would uncomment the line beneath to make it refresh the data every time the page is loaded
    // $_SESSION['steam_uptodate'] = false;
?>
<html>
    <head>
        <title>United Gaming</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <!--[if lte IE 8]><script src="js/html5shiv.js"></script><![endif]-->
        <script src="/js/jquery.min.js"></script>
        <script src="/js/skel.min.js"></script>
        <script src="/js/skel-layers.min.js"></script>
        <script src="/js/init.js"></script>
        <noscript>
            <link rel="stylesheet" href="css/skel.css" />
            <link rel="stylesheet" href="css/style.css" />
            <link rel="stylesheet" href="css/style-xlarge.css" />
        </noscript>
    </head>
    <body class="landing">

        <!-- Header -->
            <header id="header" class="alt">
                <h1><strong><a href="">United Gaming</a></strong></h1>
                <nav id="nav">
                    <ul>
                        <li><a href="index.php">Accueil</a></li>
                        <li><a href="/sourceban">Sourceban</a></li>
                        <li><a href="/forum">Forum</a></li>
                        <li><a href="/vip">VIP</a></li>
                    </ul>
                </nav>
            </header>

        <!-- Banner -->
            <section id="banner">
                </br></br></br></br></br><h2>United Gaming</h2></br></br></br></br></br></br>
            </section>
            <!-- Two -->
                <section id="one" class="wrapper style2 special">
                    <div class="container">
                    <header class="major">
                        <h2>VIP</h2>
                        <p>Découvrer nos avantages VIP !<p>
                    </header>
                        <h4>Avantages :</h4>
                        <ul>
                            <li>Slots réservés.</li>
                            <li>Tag VIP dans le chat.</li>
                        </ul>
                        <?php
                        if(!isset($_SESSION['steamid'])) {

                            steamlogin(); //login button

                        }  else {

                            include ('steamauth/userInfo.php'); //To access the $steamprofile array
                            //Protected content

                            logoutbutton(); //Logout Button
                        }     
                        ?>
                    </div>
                </section>

        <!-- Footer -->
            <footer id="footer">
                <div class="container">
                    <ul class="icons">
                        <li><a href="http://twitter.com/UnitedGamingFR" class="icon fa-twitter"></a></li>
                    </ul>
                    <ul class="copyright">
                        <li>&copy; United Gaming</li>
                    </ul>
                </div>
            </footer>

    </body>
</html>
SmItH197 commented 9 years ago

weird, it works for me on my localhost. What host do you use?

MikeDevresse commented 9 years ago

pulseheberg.com

MikeDevresse commented 9 years ago

well it's in the directory /vip/ and it's working on my localhost too

edit : When I try to rename it, it doesn't change anything

edit2 : is my config wrong ? $steamauth['apikey'] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // Your Steam WebAPI-Key found at http://steamcommunity.com/dev/apikey $steamauth['domainname'] = "http://united-gaming.fr/"; // The main URL of your website displayed in the login page $steamauth['buttonstyle'] = "large_no"; // Style of the login button [small|large_no|large] $steamauth['logoutpage'] = "index.php"; // Page to redirect to after a successfull logout (from the directory the SteamAuth-folder is located in) - NO slash at the beginning! $steamauth['loginpage'] = "pay.php"; // Page to redirect to after a successfull login (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!

edit3 : include of example.php do the same thing

edit4 : commenting everything else do anything

MikeDevresse commented 9 years ago

Well apparently it works now don't know what I changed but thanks for the help