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 6373955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:25:44+00:00 2026-05-25T01:25:44+00:00

After form submission browser shows just blank page. Nothing else. I’ve enabled error reporting.

  • 0

After form submission browser shows just blank page. Nothing else. I’ve enabled error reporting. No error in php logs. Also tried (as you see) echo $sql; die();. Still no result. How to fix it? What’s wrong with my code? My php code (which processes signup form data) looks like that

<?php
require '../includes/db.php';
require '../includes/ipurl.php';
require '../includes/common.php';
$page = 'signup';
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit( );
}


if ($_POST['submit'] == 'Tamam') {
    $err = array( );
    foreach ($_POST as $key => $value) {
        $data[$key] = filter($value);
    }
    if (empty($data['fname']) || strlen($data['fname']) < 2 || empty($data['mname']) || strlen($data['mname']) < 2 || empty($data['lname']) || strlen($data['lname']) < 2) {
        $err[ ] = 1;
    }

    if (!isUserID($data['login'])) {
        $err[ ] = 2;
    }

    if (!isEmail($data['email'])) {
        $err[ ] = 3;
    }

    if (!checkPwd($data['pwd'], $data['pwd2'])) {
        $err[ ] = 4;
    }

    $pwd = PwdHash($data['pwd']);

    $host       = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path       = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');

    $activ_code = rand(1000, 9999);

    $email = $data['email'];
    $login = $data['login'];
    $dob   = date('Y-m-d', strtotime($data['dob']));
    $age   = date("Y") - date('Y', strtotime($data['dob']));
    $type  = $data['type'];


    $rs_duplicate = $db->query("select count(*) as total from users where email='$email' OR login='$login'") or die($db->error);
    list($total) = $rs_duplicate->fetch_row();

    if ($total > 0) {
        $err[ ] = 5;
    }

    if (isset($type)) {
        if ($type == 1) {
            $region     = $data['region'];
            $school     = $data['school'];
            $class      = $data['class'];
            $group      = 0;
            $subject    = 0;
            $university = 0;
            $profession = 0;
        }
        if ($type == 2) {
            $group      = $data['group'];
            $region     = $data['region'];
            $school     = $data['school'];
            $class      = $data['class'];
            $subject    = 0;
            $university = 0;
            $profession = 0;

        }
        if ($type == 3) {
            $group      = 0;
            $region     = 0;
            $school     = 0;
            $class      = 0;
            $subject    = 0;
            $university = $data['university'];
            $profession = $data['profession'];
        }
        if ($type == 4) {
            $group      = 0;
            $region     = 0;
            $school     = 0;
            $class      = 0;
            $university = 0;
            $profession = 0;
            $subject    = $data['subject'];
        }
    }
    if (!isset($type)) {
        $err[ ] = 9;
    }
    if (empty($err)) {
        $sql = "INSERT INTO users
(level,fname, mname, lname, dob, age, reg_date, phone, email, login, pwd, type, `group`, region, school, class, ip, subject, ban, university, profession, activation_code) 
VALUES 
('1','$data[fname]', '$data[mname]', '$data[lname]', '$dob', '$age', now(), '$data[phone]', '$email', '$login', '$pwd', '$type', '$group', '$region', '$school', '$class',  '$ip', '$subject', NULL, '$university', '$profession', '$activ_code')";
        echo $sql; die();
        $result = $db->query($sql) or die(printf("Bazaya daxiletmə zamanı səhv: %s\n", $db->error));
        $id     = $db->insert_id;
        $md5_id = md5($id);
        $db->query("update users set md5_id='$md5_id' where id='$id'") or die(printf("Bazaya daxiletmə zamanı səhv: %s\n", $db->error));
        include "../includes/success.php";
    }

} else if (!empty($err)) {
    include "../includes/error.php";
}
?>

By the way function filter from common.php sanitizing all posts

function filter($data) {
    $data = trim(htmlentities(strip_tags($data)));

    if (get_magic_quotes_gpc())
        $data = stripslashes($data);

    $data = mysql_real_escape_string($data);

    return $data;
}
  • 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-05-25T01:25:44+00:00Added an answer on May 25, 2026 at 1:25 am

    I think your check for a non-empty error array should be moved up a step to right after where you check for if there are any errors.

        ...
        if (empty($err)) {
            $sql = "INSERT INTO users
    (level,fname, mname, lname, dob, age, reg_date, phone, email, login, pwd, type, `group`, region, school, class, ip, subject, ban, university, profession, activation_code) 
    VALUES 
    ('1','$data[fname]', '$data[mname]', '$data[lname]', '$dob', '$age', now(), '$data[phone]', '$email', '$login', '$pwd', '$type', '$group', '$region', '$school', '$class',  '$ip', '$subject', NULL, '$university', '$profession', '$activ_code')";
            echo $sql; die();
            $result = $db->query($sql) or die(printf("Bazaya daxiletmə zamanı səhv: %s\n", $db->error));
            $id     = $db->insert_id;
            $md5_id = md5($id);
            $db->query("update users set md5_id='$md5_id' where id='$id'") or die(printf("Bazaya daxiletmə zamanı səhv: %s\n", $db->error));
            include "../includes/success.php";
        } else if (!empty($err)) {
            include "../includes/error.php";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to stop the submission of a form,after submit button has been
Is there any way to disable entire form using jQuery after submission?
Whats the normal procedure of clearing a form after POST? Just loop through the
How to add an error message to Zend Form element after the form was
I have a page with a form where I'm trying to prevent duplicate submission,
I'm having problems accessing the posted values after a form submission with Drupal 7.
I'm working on a web form where I wish to (after form submission) highlight
Why can't htmlspecialchars() continually encode characters after each form submission? Take a look at
I'm trying to insert a link after form elements to clear them. This demo
After my form.Form validates the user input values I pass them to a separate

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.