The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

We are trying to complete / fix the below code, We cant seem to do the following.

  • Check if 'Check_Activation' is set to 'NULL' within the Database
  • IF value is NULL direct the user to one of the forms (1,2,3)
  • And finally if the 'Check_Activation' has already been activated and isn't 'NULL' prevent user from accessing one of the 3 forms.

I know its basicly there but we can't seem to figure out the final bug.

Please have a quick look at the code below and if anyone notices anything that isn't right please advice us. [CODE] [WEBSITE]


    $username = $_POST['username'];
    $activation_code = $_POST['activation_code'];
    $activation_codeurl = $activation_code;
    $usernameurl = $username;

    $db_host = "localhost";
    $db_name = "aardvark";
    $db_use = "aardvark";
    $db_pass = "aardvark";

    $con = mysql_connect("localhost", $db_use, $db_pass);
    if (!$con){
        die('Could not connect: ' . mysql_error());
    mysql_select_db($db_name, $con);

    $checkcustomer = mysql_query("SELECT `Check_Activation` FROM `members` WHERE `Username` = '".$username."' & `Activation` = '".$activation_code."'; ");

        $array = mysql_fetch_array($checkcustomer);
        if (is_null($array['Check_Activation']))  {
                $username = substr($username, 0, 1);
                if($username == '1') { 
                } elseif($username == '2') { 
                } elseif($username == '3') { 
                header("Location:". $redirect_url);

asked 06 Feb '14, 04:22

AWK's gravatar image

accept rate: 0%

closed 06 Feb '14, 08:58

Mark%20Culp's gravatar image

Mark Culp

How is that question related to the SQL Anywhere database system?

(06 Feb '14, 05:20) Volker Barth

Agreed. This looks like this should be a PHP question... or at least direct it at a mysql or LAMP forum.

(06 Feb '14, 08:57) Mark Culp

The question has been closed for the following reason "Question is off-topic or not relevant" by Mark Culp 06 Feb '14, 08:58

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 06 Feb '14, 04:22

question was seen: 723 times

last updated: 06 Feb '14, 08:58