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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:10:59+00:00 2026-06-15T15:10:59+00:00

I have an issue with a some of the jQuery notifications I have created

  • 0

I have an issue with a some of the jQuery notifications I have created to trigger based on information echo’d from a PHP file after a user submits a sign up HTML form via AJAX. The notifications for errors work, but not for a successful post to the database. I know that the success notification should show because the data is validated and written to the database and AJAX post is successful. However the success notification does not want to work. What could be the reason for this technicality?

I have the following set up:

signup.html (contains the following ajax within the page*):

function registerUser(formKey) {
$.ajax({
    type:"POST",
    url:"engine/new_user.php",
    data: $("#"+formKey).serialize(),
    cache:false,
    success: function(data) {

        if(data == -3){
            $("html, body").animate({ scrollTop: 0 }, 600);
            $("#user-exists-notification").fadeIn(1000);
            }
        if(data == -4){
            $("#account-created").fadeIn(1000);
            }
        if(data == -1){
            $("html, body").animate({ scrollTop: 0 }, 600);
            $("#fields-complete-notification").delay(1000).fadeIn(1000);
            }
        if(data == -2){
            $("html, body").animate({ scrollTop: 0 }, 600);
            $("#pw-confirm-notification").delay(1000).fadeIn(1000);
            }
    },
    error: function(data) {

    }
});
}

new_user.php

 require("register-classes.php");

 $register=new Register($_POST['fname'], $_POST['lname'], $_POST['email'], $_POST['sex'], $_POST['birthdate'], $_POST['phone'], $_POST['country'], $_POST['alias'], $_POST['handle'], $_POST["password"], $_POST["cpassword"], $_POST['network']);

if($register->checkFields()== false){

     echo -1;

 } else if($register->confirmPasswords()== false){

     echo -2;
 }else if($register->registerUser()!=false){


     echo -4;
 } else if($register->registerUser()==false){
     echo -3;
 }


and register-classes.php (which contains classes for processing sign up form)

    class Register {

        public function __construct($fname, $lname, $mail, $sex,
        $birthday, $phonenumber, $regCountry, $alias, $username,
        $password, $conf_password, $network_site) {

            //Copy Constructor
            $this->site=$network_site;
            $this->firstname=$fname;
            $this->lastname=$lname;
            $this->email=$mail;
            $this->sex=$sex;
            $this->birthdate=$birthday;
            $this->phone=$phonenumber;
            $this->country=$regCountry;
            $this->displayname=$alias;
            $this->handle=$username;
            $this->salt="a2cflux9e8g7ds6ggty589498j8jko007876j89j8j7";
            $this->password=crypt($this->salt.$password);
            $this->joindate=date("Y-m-d H:i:s");
            $this->confirm_password1=$password;
            $this->confirm_password2=$conf_password;

        }

        public function registerUser(){

            $database=new Database();
            $database->getConnection();
            $database->startConnection();

            //Check database to insure user and email address is not already in the system.                     
            $checkUsers= mysql_query("SELECT network_users.network_id
            FROM network_users, network_profile
            WHERE network_users.handle = '$this->handle'
            OR network_profile.email = '$this->email'");

            $numRecords= mysql_num_rows($checkUsers);

            if($numRecords == 0){

                $addUser= mysql_query("INSERT INTO network_users(handle, password, date_created, parent_network, site_created, active, account_type, del)
                values('$this->handle', '$this->password', '$this->joindate',' fenetwork', 'network', 'active', 'standard', 'F')") or die(mysql_error());

                $networkId=mysql_insert_id();

                $addProfile= mysql_query("INSERT INTO network_profile(network_id, first_name, last_name, email, sex, birthdate, phone, country, display_name, del)
                values('$networkId', '$this->firstname', '$this->lastname', '$this->email','$this->sex', '$this->birthdate', '$this->phone', '$this->country', '$this->displayname', 'F')") or die(mysql_error());

                $this->addUser;
                $this->addProfile;

                            return true;

            }
            else{

                return false;
            }
        }

        public function checkFields(){
            if(($this->firstname)!="" && ($this->lastname)!="" && ($this->email)!="" && ($this->sex)!="" && 
                ($this->birthdate)!="" &&($this->country)!="" && ($this->handle)!="" && ($this->password)!=""){

                return true;     
            } else {

                return false;
            }

        }

        public function confirmPasswords(){

            if($this->confirm_password1==$this->confirm_password2){

                return true;
            } else {

                return false;
            }
        }

        private $site, $firstname, $lastname, $email,
        $sex, $birthdate, $phone, $country, $displayname, 
        $handle, $password, $salt, $joindate, $confirm_password1, $confirm_password2;

        protected $addUser, $addProfile;

    }
  • 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-15T15:11:00+00:00Added an answer on June 15, 2026 at 3:11 pm

    I found the issue. The issue was due to printf() functions that were apart of a few class members in the database class. They were causing an interruption with the function completing and returning the boolean value true or false in registerUser();

    Thank you all for your help and assistance. I would give up a vote up, but I don’t have enough reputation points. haha.

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

Sidebar

Related Questions

I have some issue with jquery. i have some tags after each ul li
I have a weird issue. I have some icons that are being built based
I have created a menu with some Jquery effects and it is working well
I am having an issue with some Jquery script that I have and I
I have a simple javascript (JQuery based) method that does some css magic to
I have some strange issue using jQuery Validation plugin. Firs of all here is
Here's a live demo of the issue on JS Fiddle. I have some jquery
I have some jquery to hide the submit button when the user clicks to
I have an issue with some HTML displayed in Drupal, but I am not
I have an issue while storing some special character values into db. For e.g.

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.