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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:55:41+00:00 2026-06-07T14:55:41+00:00

This is an adaption of a much longer question, because I pinpointed the question

  • 0

This is an adaption of a much longer question, because I pinpointed the question to be more direct without so much information. I’m using This to dynamically load pages in my div tag, but certain things stop working when loaded. Specifically some jquery stuff. The registration does not check the username ect when loaded in this div, and I can’t figure out why. If code is needed to be posted I can do so, but I think it may simply lie in the way the pages are loaded, just not sure which or why. Here is the link to my test page to see what I’m talking about. Hover over login then click “register”. it will load the form but it doesn’t check the username with the jquery and such I have. Here is the single registration page that works just fine by itself, and this shows what I’m trying to do as well. Fiddle with javascript/jquery and html. I left some PHP in just in case it’s doing something funky, and left out the css because its for the message box, and that doesn’t effect this, and will still show up for tests without it.

This is the PHP that process the registration:

<?php
//have to use &_POST instead of vars for regular vars because of bug
//hash the password
$hash = hash('sha256', $_POST['pass1']);

//creates a 3 character sequence, hash pass again
function createSalt(){    
    $string = md5(uniqid(rand(), true));    
    return substr($string, 0, 3);
}
$salt = createSalt();
$hash = hash('sha256', $salt . $hash);

//check registration code
require('config/config.php');
//match the id with the registration code to update the correct row
$result = mysql_query("SELECT id FROM user WHERE regcode=
'". mysql_real_escape_string($_POST['regcode']) ."'") or die('Unable to query!');
$row = mysql_fetch_array($result);
if ($row['id'] != "") {
    $updateid = $row['id'];
} else {
    die("No matching registration code!");
}

//check if id is blank, means registration is blank
if (isset($updateid)) {
//update into database
$result = mysql_query("UPDATE user SET username='". mysql_real_escape_string($_POST['username']) ."', 
        password='". $hash ."', salt='". $salt ."', 
        email='". mysql_real_escape_string($_POST['email']) ."', 
        firstname='". mysql_real_escape_string($_POST['firstname']) ."', 
        lastname='". mysql_real_escape_string($_POST['lastname']) ."', 
        regcode='', joined=NOW(), lastlogin=NOW(), active='yes' 
        WHERE id='". $updateid ."'") or die(mysql_error());

//echo $query.",".$_POST['username'].",".$hash.",".$_POST['email'].",".$_POST['firstname'].",
//    ".$_POST['lastname'].",".$_POST['regcode'].",". $updateid ."";
//mysql_close();
echo 'yes';
} else {
echo 'noregcode'; 
}
?>

P.S. Please ignore outdated PHP. While it is bad, I just haven’t fixed it yet and know I will have to soon.

  • 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-07T14:55:42+00:00Added an answer on June 7, 2026 at 2:55 pm

    The reason it doesn’t work is that that code you’re using simply does nothing to make it work. The code stuffs the response into a DOM element but doesn’t try to run the scripts. A simple update to the innerHTML property of an element doesn’t cause embedded scripts to be run.

    You could modify that script if you want, but since you tagged this question with jQuery I would urge you in the strongest possible terms to dump that script and do this with jQuery, which (if you do it right) will do the work necessary to cause embedded scripts to be run.

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

Sidebar

Related Questions

Hi This is an adaption of a previous question posted here. XSLT - Find
this is my first question in here, and I would like to ask if
This question is directly related to this SO question I posed about 15 minutes
This question is kind of a follow up to this question I asked a
This code won't compile because there is an illegal reference to a static field.
This should not be so complicated: I am using Easiest Tooltip and Image Preview
This is a question purely to satisfy my own curiosity. Here in Norway it's
This is effectively how i'm using _mssql. Everything works fine, even after i use
For a custom requirement to display dynamically generated records with client-side paging, I'm using
I knew how to do this but forgot again... Quite irritating, because I'm working

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.