Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:07:19+00:00 2026-06-06T00:07:19+00:00

I am trying to integrate a simple login for my site with php. i

  • 0

I am trying to integrate a simple login for my site with php. i found a script here http://www.phpfreecode.com/php-Login-system.htm got everything set up but this php code is cause the page not to load at all

<?php
 if (isset($_COOKIE['user'])) {
 echo "You are logged in: $_COOKIE['user'] Enjoy.";
 } else{ 
 echo "You are not logged in. <a href='register.php'>Register here</a>";
 ?>

I get a server error “The website encountered an error while retrieving (my website) It may be down for maintenance or configured incorrectly” i have php configured on my server, i know this because i have other php files that work on the website. what am i doing wrong? also if someone knows of a better login system im open for suggestions. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:07:21+00:00Added an answer on June 6, 2026 at 12:07 am

    The error with this piece of code you have suppled, is the $_COOKIE array not being seperated by curly brackets or broken out of the string.

    <?php
    if (isset($_COOKIE['user'])) {
        echo "You are logged in: {$_COOKIE['user']} Enjoy.";
    } else{
        echo "You are not logged in. <a href='register.php'>Register here</a>";
    }
    ?>
    

    or better yet:

    <?php
    if (isset($_COOKIE['user'])) {
        echo "You are logged in: ".htmlentities($_COOKIE['user'])." Enjoy.";
    } else{
        echo "You are not logged in. <a href='register.php'>Register here</a>";
    }
    ?>
    

    Also that script is vulnerable to sql injection username: whatever' OR 'X'='X & is using the soon tobe deprecated mysql_* functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have provided the test website link below: http://www.naughtyfancydress.com/html/outfit.html I am trying to integrate
I'm trying to figure out how should I integrate facebook login system in my
I'm trying to integrate a simple Rails app with a BPEL process but it's
I have been trying to integrate my very simple voice recorder app with the
Trying to choose a PHP open source CMS into which I will integrate an
i am trying to integrate spring security with struts1.2 (using LDAP) in a simple
I'm trying to integrate paperclip into a simple comment thread so users can attach
I am trying to integrate CKEditor in Netbeans to my simple web application. I
I have a simple Java application and I'm trying to integrate Hibernate in Spring
I have been stumped trying to figure out how to integrate a simple for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.