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

  • Home
  • SEARCH
  • 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 8447467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:11:01+00:00 2026-06-10T10:11:01+00:00

So I have this code: <?php if (!isset($_GET[’email’]) && !isset($_GET[‘key’])) { echo ‘NOT ALLOWED

  • 0

So I have this code:

<?php

    if (!isset($_GET['email']) && !isset($_GET['key'])) {

        echo 'NOT ALLOWED TO ACCESS PAGE';

    }

    if (isset($_GET['email']) && isset($_GET['key'])) {

        $email      = $_GET['email'];
        $regKey     = $_GET['key'];

        $query      = mysql_query("SELECT * FROM `users` WHERE `email`='$email' AND `regRandom`='$regKey'");

        if ($query == $regKey) {

            mysql_query("UPDATE `users` SET `activated`=1 WHERE `email`='$email'");

            if (mysql_query("SELECT activated FROM users WHERE activated='1'")) {

                echo file_get_contents("http://TheMegaHouse.com/pageContent/head.php");

                echo file_get_contents("http://TheMegaHouse.com/pageContent/notLoggedIn/topNavBar.php");

                echo file_get_contents("http://TheMegaHouse.com/pageContent/header.php");

                echo 'PASSED';

                footer();

            } else {

                activationFail();
            }

        } else if ($regKey !== $query) {

            echo 'FAIL';
        }


    }


?>

The thing is that in my database, the value that is in the regRandom column is in fact equal to the value in the key variable in the url but for some reason it is echoing out “FAIL” instead of “PASSED”.

Any suggestions on what I am doing wrong, a better way of doing what I want to do or any suggestions?

  • 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-10T10:11:01+00:00Added an answer on June 10, 2026 at 10:11 am

    Always read manual first:

    • http://php.net/manual/en/function.mysql-query.php

    This line of code:

    mysql_query("SELECT * FROM `users` WHERE `email`='$email' AND `regRandom`='$regKey'");
    

    Is returning you resource, instead of variable you are lookng for.

    Small fix for you:

    list($regRandom) = mysql_fetch_row(mysql_query("SELECT regRandom  FROM `users` WHERE `email`='$email' AND `regRandom`='$regKey'"));
    if ($regRandom == $regKey) {
      // magic
    

    And another two things:

    • mysql_* functions are deprecated
    • i strongly recommend you to read about SQL Injections.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code like this: <?php if(isset($global_info_results)): ?> <?php echo count($global_info_results) ?> <span>Mali Oglasi:
In my login.php page I have this: $allowed_operations = array('foo', 'lorem'); if(isset($_GET['p']) && in_array(isset($_GET['p']),
I'm getting a syntax error on this PHP code: <snip> $last = (isset($_GET['last']) &&
I have this code <?php session_start(); if (isset($_GET[cmd])) $cmd = $_GET[cmd]; else die(You should
Currently I have this code: <?php if (isset($_GET['id'])) { $itemid = $_GET['id']; $search =
I have this code to display users avatars.. <?php include(../core/config.php); if(isset($_GET['uid'])){ if(is_numeric($_GET['uid'])){ $uid =
Ok i have this code <?php include_once ('database_connection.php'); if(isset($_GET['keyword'])){ $keyword = trim($_GET['keyword']) ; $keyword
I have this PHP code to highlight the Query on search results. if (isset($_REQUEST['k'])){
I have this php code line $data['viewData']['filter'] = isset($parameters['filter']) ? $parameters['filter'] : array('filter1', 'filter2',
This is my php code <?php if(isset($_GET['name'])) { $var = $_GET['name']; $newvar =str_replace (

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.