you got it wrong. I mean i got the website everything to work, but then for the register, I can't make it to connect to the database, like after click submit/create account. It wont go into the database, all it appear is username, password. it won't appear actual username and password that you filled in. That's why I'm asking if i did something wrong or code it wrong.
Then try to change this
Code:
$sql = "INSERT INTO `accounts` (`Username`, `Password`) VALUES ('$username', '$pass')";
To
Code:
$sql = "INSERT INTO `accounts` (`Username`, `Password`) VALUES ('{$username}', '{$pass}')";
If its just adding plain text values into your database its definitely something with the values you insert in your database.
If this ain’t working, you will need to debug it, we really can’t help you any better then this, php documentations will definitely help you.
Okay thanks i got it to work on the php side, but then now is a new question.
How do I create a form for HTML and linked it with php. like instead ofhave a new page wit no background on the php side, I want it to be able to just successful registered on the html side.
Okay thanks i got it to work on the php side, but then now is a new question.
How do I create a form for HTML and linked it with php. like instead ofhave a new page wit no background on the php side, I want it to be able to just successful registered on the html side.
<script src="http://code.jquery.com/jquery-lastest.js"></script>
<script src="js/submit.js"></script>
<font size="5" color="#99cc33"><b>Create an Account </b></font>
<br />
<form id="myForm" method="post">
<br />
Username :<br />
<input name="account" type="text" class="input" id="account" value="" onclick="if (account.value == 'Account Name...') { account.value='' }" onfocus="account.id='focused'" onblur="account.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Password :<br />
<input name="password" type="password" class="input" id="password" value="" onclick="if (password.value == 'Password...') { password.value='' }" onfocus="password.id='focused'" onblur="password.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Re-type Password :<br />
<input name="passwordchk" type="password" class="input" id="passwordchk" value="" onclick="if (passwordchk.value == 'password...') { passwordchk.value='' }" onfocus="passwordchk.id='focused'" onblur="passwordchk.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Email :<br />
<input name="email" type="text" class="input" id="email" value="" onclick="if (email.value == 'Email...') { email.value='' }" onfocus="email.id='focused'" onblur="email.id='unfocused'" style="margin-bottom: 7px;" maxlength="41"/>
<br />
Security Question :<br />
<select name="secquestion" class="input" id="secquestion" style="margin-bottom:7px;">
<option value="" selected="selected">-Select Secret Question-</option>
<option value="What is the first name of your favorite uncle?" >What is the first name of your favorite uncle?</option>
<option value="Where did you meet your spouse?" >Where did you meet your spouse?</option>
<option value="What is your oldest cousins name?" >What is your oldest cousins name?</option>
<option value="What is your youngest childs nickname?" >What is your youngest childs nickname?</option>
<option value="What is your oldest childs nickname?" >What is your oldest childs nickname?</option>
<option value="What is the first name of your oldest niece?" >What is the first name of your oldest niece?</option>
<option value="What is the first name of your oldest nephew?" >What is the first name of your oldest nephew?</option>
<option value="What is the first name of your favorite aunt?" >What is the first name of your favorite aunt?</option>
<option value="Where did you spend your honeymoon?" >Where did you spend your honeymoon?</option>
</select>
<br />
Answer :<br />
<input name="answer" type="text" class="input" id="answer" value="" onclick="if (answer.value == 'Answer...') { answer.value='' }" onfocus="answer.id='focused'" onblur="answer.id='unfocused'" style="margin-bottom: 7px;" maxlength="22"/>
<br />
<input name="register" type="submit" class="enter" id="register" onclick="action()" value="Submit" />
<script>
function action() {
//Your code here
}
</script>
</form>
<div id="result">
</div>
Okay thanks i got it to work on the php side, but then now is a new question.
How do I create a form for HTML and linked it with php. like instead ofhave a new page wit no background on the php side, I want it to be able to just successful registered on the html side.
<script src="http://code.jquery.com/jquery-lastest.js"></script>
<script src="js/submit.js"></script>
<font size="5" color="#99cc33"><b>Create an Account </b></font>
<br />
<form id="myForm" method="post">
<br />
Username :<br />
<input name="account" type="text" class="input" id="account" value="" onclick="if (account.value == 'Account Name...') { account.value='' }" onfocus="account.id='focused'" onblur="account.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Password :<br />
<input name="password" type="password" class="input" id="password" value="" onclick="if (password.value == 'Password...') { password.value='' }" onfocus="password.id='focused'" onblur="password.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Re-type Password :<br />
<input name="passwordchk" type="password" class="input" id="passwordchk" value="" onclick="if (passwordchk.value == 'password...') { passwordchk.value='' }" onfocus="passwordchk.id='focused'" onblur="passwordchk.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Email :<br />
<input name="email" type="text" class="input" id="email" value="" onclick="if (email.value == 'Email...') { email.value='' }" onfocus="email.id='focused'" onblur="email.id='unfocused'" style="margin-bottom: 7px;" maxlength="41"/>
<br />
Security Question :<br />
<select name="secquestion" class="input" id="secquestion" style="margin-bottom:7px;">
<option value="" selected="selected">-Select Secret Question-</option>
<option value="What is the first name of your favorite uncle?" >What is the first name of your favorite uncle?</option>
<option value="Where did you meet your spouse?" >Where did you meet your spouse?</option>
<option value="What is your oldest cousins name?" >What is your oldest cousins name?</option>
<option value="What is your youngest childs nickname?" >What is your youngest childs nickname?</option>
<option value="What is your oldest childs nickname?" >What is your oldest childs nickname?</option>
<option value="What is the first name of your oldest niece?" >What is the first name of your oldest niece?</option>
<option value="What is the first name of your oldest nephew?" >What is the first name of your oldest nephew?</option>
<option value="What is the first name of your favorite aunt?" >What is the first name of your favorite aunt?</option>
<option value="Where did you spend your honeymoon?" >Where did you spend your honeymoon?</option>
</select>
<br />
Answer :<br />
<input name="answer" type="text" class="input" id="answer" value="" onclick="if (answer.value == 'Answer...') { answer.value='' }" onfocus="answer.id='focused'" onblur="answer.id='unfocused'" style="margin-bottom: 7px;" maxlength="22"/>
<br />
<input name="register" type="submit" class="enter" id="register" onclick="action()" value="Submit" />
<script>
function action() {
//Your code here
}
</script>
</form>
<div id="result">
</div>
Okay thanks i got it to work on the php side, but then now is a new question.
How do I create a form for HTML and linked it with php. like instead ofhave a new page wit no background on the php side, I want it to be able to just successful registered on the html side.
<script src="http://code.jquery.com/jquery-lastest.js"></script>
<script src="js/submit.js"></script>
<font size="5" color="#99cc33"><b>Create an Account </b></font>
<br />
<form id="myForm" method="post">
<br />
Username :<br />
<input name="account" type="text" class="input" id="account" value="" onclick="if (account.value == 'Account Name...') { account.value='' }" onfocus="account.id='focused'" onblur="account.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Password :<br />
<input name="password" type="password" class="input" id="password" value="" onclick="if (password.value == 'Password...') { password.value='' }" onfocus="password.id='focused'" onblur="password.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Re-type Password :<br />
<input name="passwordchk" type="password" class="input" id="passwordchk" value="" onclick="if (passwordchk.value == 'password...') { passwordchk.value='' }" onfocus="passwordchk.id='focused'" onblur="passwordchk.id='unfocused'" style="margin-bottom: 7px;" maxlength="23"/>
<br />
Email :<br />
<input name="email" type="text" class="input" id="email" value="" onclick="if (email.value == 'Email...') { email.value='' }" onfocus="email.id='focused'" onblur="email.id='unfocused'" style="margin-bottom: 7px;" maxlength="41"/>
<br />
Security Question :<br />
<select name="secquestion" class="input" id="secquestion" style="margin-bottom:7px;">
<option value="" selected="selected">-Select Secret Question-</option>
<option value="What is the first name of your favorite uncle?" >What is the first name of your favorite uncle?</option>
<option value="Where did you meet your spouse?" >Where did you meet your spouse?</option>
<option value="What is your oldest cousins name?" >What is your oldest cousins name?</option>
<option value="What is your youngest childs nickname?" >What is your youngest childs nickname?</option>
<option value="What is your oldest childs nickname?" >What is your oldest childs nickname?</option>
<option value="What is the first name of your oldest niece?" >What is the first name of your oldest niece?</option>
<option value="What is the first name of your oldest nephew?" >What is the first name of your oldest nephew?</option>
<option value="What is the first name of your favorite aunt?" >What is the first name of your favorite aunt?</option>
<option value="Where did you spend your honeymoon?" >Where did you spend your honeymoon?</option>
</select>
<br />
Answer :<br />
<input name="answer" type="text" class="input" id="answer" value="" onclick="if (answer.value == 'Answer...') { answer.value='' }" onfocus="answer.id='focused'" onblur="answer.id='unfocused'" style="margin-bottom: 7px;" maxlength="22"/>
<br />
<input name="register" type="submit" class="enter" id="register" onclick="action()" value="Submit" />
<script>
function action() {
//Your code here
}
</script>
</form>
<div id="result">
</div>
<script>
$(document).ready(function () {
$('.register').click(function (e) {
e.preventDefault();
var account = $('#account').val();
var password = $('#password').val();
var email = $('#email').val();
var secquestion = $('#secquestion').val();
var answer = $('#answer').val();
({
type: "GET",
url: "register.php",
data: { "account": account, "password": password, "email": email, "secquestion": secquestion, "answer": answer },
success: function (data) {
$('.result').html(data);
$('#myForm')[0].reset();
}
});
});
});
</script>
so please tell me if i did anything wrong here...
Dude, trust me. You're sharing vulnerable code that you want to use on production. Learn how to use mysqli and prepared statements so at least lammers wont mysql inject your website.
This way you can re-use your JS without having to have it specific.
Sure i won’t even do it like this myself since i’m using frameworks, most of it is already built in and its a fast way to set up secure websites if you know how it works..
Anyway i guess thats a bit to hard for him as he is not even able to make this basic register form working 😅. Just trying to help him out a little bit instead of making it harder for him to understand.
Well yeah, but I did make it work, just that it pop up a new window with no background etc. So now I need it to just stay in the same page. Hopefully u get what I mean. And yes, im still learning, better than not learning xD
Quote:
Originally Posted by bashondegek
Sure i won’t even do it like this myself since i’m using frameworks, most of it is already built in and its a fast way to set up secure websites if you know how it works..
Anyway i guess thats a bit to hard for him as he is not even able to make this basic register form working 😅. Just trying to help him out a little bit instead of making it harder for him to understand.
Well yeah, but I did make it work, just that it pop up a new window with no background etc. So now I need it to just stay in the same page. Hopefully u get what I mean. And yes, im still learning, better than not learning xD
I understand that, but what Turk and Pitinho are saying is true.
The code that i shared i just basic, it will work, but there are really better ways.
Anyway, it can stay in the same page using Ajax.
If you use the Code turk shared and put that in your JS, and change your button to something like this;
Code:
<button type="submit">Register now</button>
you are already doing a bit better.
Do you have any other problems? Or did you make it to work?
Thanks so much for helping me everyone, very appreciates. Sorry for being a noob(which I am, lol) and an idiots who know nothing but trying hardest to learn xD. I figured I just need to change from .html to .php, since in some way my website work either .html or .php .
6607 Source for testing purposes 07/11/2020 - CO2 PServer Guides & Releases - 10 Replies Hello, I found a 6607 source online which is mostly functional and I'll give it out here for people who want to use it for testing purposes!
DISCLAIMER: I do not encourage you to use this in a live server!!! There are many shortcomings to this source, which if you were to fix it would possibly work. I shared this just for testing purposes and for people who are looking for high sources to build on/rebuild
Problems:
1. !!! PASSWORDS ARE UNENCRYPTED ON THE vikings.sql file. You should...
Fiesta Register Script V2.0 - OdinRegister Script 02/18/2013 - Fiesta Online - 6 Replies Hey,
hab das alte Fiesta Register Script V1.1 wiedergefunden und hab mir gedacht ich schreibs mal passend für JokerServer die mit OdinFiles laufen um.
Das einzige was ihr machen müsst ist die index.php mit euren SQL Daten zu füttern, ihr könnt diese mit einfachen TextEditor programmen wie notepad.exe (Editor) oder wordpad öffnen.
EDIT1: da war n kleiner fehler der bei über 10 Accs immer alles mit nEMID 2 erstellt hat, fixed. Neue version im Anhang.
V14 Register Script für Gms [Homepage Script] 05/21/2011 - Flyff Private Server - 10 Replies Naja, Meine frage wär wie man nen V14 Register Page macht wo man wenn man registriert sofort Gm ist =D.
PS: für ein ein Test Server ;3
Trafalgar†Law ~
[SCRIPT]Register Script !! 05/10/2010 - Metin2 PServer Guides & Strategies - 13 Replies Hey ich wollte euch mal ein Register Script geben hab ein header und background genzu gefügt.
Es ist Das stinck normale China Register Script von mir Übersetzt.
Vllt wollen es ja paar von euch haben.
Bild:
http://img4.imageshack.us/img4/8392/92840753.jpg