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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:07:09+00:00 2026-05-26T16:07:09+00:00

HTML: <form method=post id=NewUserRegistration action=inc/q/addNewUser.php> Username: <input type=text name=userName /> <br /> Password: <input

  • 0

HTML:

            <form method="post" id="NewUserRegistration" action="inc/q/addNewUser.php">
                Username: <input type="text" name="userName" /> <br />
                Password: <input type="password" name="userPass" /> <br />
                Email: <input type="text" name="userEmail" /> <br /> 
                <input type="submit" name="submit" />
            </form>

PHP

<?php
#INSERT new (Requester)

$connect = mysql_connect("localhost", "root", "") or die ("Error , check your server connection.");
mysql_select_db("thedbname");

//Get data in local variable
if(!empty($_POST['userName']))
    $newRequesterUserName=mysql_real_escape_string($_POST['userName']);

if(!empty($_POST['userPass']))
#secure pass
$escapedInputtedPass=mysql_real_escape_string($_POST['userPass']);
$dynamSalt = mt_rand(); 
$SaltyPass = hash('sha512',$dynamSalt.$escapedInputtedPass);

if(!empty($_POST['userEmail']))
    $newRequesterEmail=mysql_real_escape_string($_POST['userEmail']); 

// check for null values
if (isset($_POST['submit'])) {
$query="INSERT INTO User (uUName, uUPass, uEmail, dynamSalt) values('$newRequesterUserName', '$SaltyPass', '$newRequesterEmail', '$dynamSalt')";
mysql_query($query)  or die(mysql_error());
    echo 'Registered!';
}

?>

No matter how many times I register successfully the uUName and uUPass insert fine into the database. But the dynamSalt always enters in with value: 32767

Why doesn’t it have the value it generates everytime this script is accessed? I tried outputting the value of $dynamSalt during the echo at the end with registered and it outputs a numerical value like 1939509953 — always 10 integers [0-9] . The database field type is INT[10] …

Anyone?

  • 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-26T16:07:10+00:00Added an answer on May 26, 2026 at 4:07 pm

    mt_rand() uses the c-library rand(), which, if uninitialized, uses the seed 1.

    Try opening and reading from /dev/urandom/ instead (c.f. http://www.php.net/manual/en/function.mt-rand.php#83655)

    It is more secure and uses the hosts internal state which is changing, so that your output does not repeat.

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

Sidebar

Related Questions

I have an HTML form: <form action='process.php' method='post'> <input type='checkbox' name='check_box_1' /> Check me!<br>
HTML <form id=contact_form action=# name= method=POST> <label for=name>NAME</label> <input type=text name=name id=name class=contact_form_input />
Is something like this possible: <form method=post action=myphp.php name=myname target=another_html/iframe_name>??? I want the php
<form action=/Villa/Add method=post> <table> <tr> <td> Name: </td> <td> <%= Html.TextBox(name) %> <%= Html.ValidationMessage(Name)
I have the following in an html form using method Post. <input type=submit title=
I've got a simple HTML form, thus: <html> <head></head> <body> <form action=upload_file.php method=post enctype=multipart/form-data>
A simple HTML form: <form enctype=application/x-www-form-urlencoded method=post action=/view/album/id/4><ol> <li class=no-padding><div class=element> <input type=hidden name=media
I am working with the following HTML form: <form method = 'POST' action =
I have an HTML post method: form method=post action=https://secure.wp3.rbsworldpay.com/wcc/purchase id=frmWorldPay How to write the
I have this as template account_form.html <form action=/contact/ method=post> {% for field in form

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.