mercredi 27 juillet 2016

account system w/ js, html & php

I need help to make a account system in php! It will create a new document for each user with some data in it, here is what I tried:

PHP:

//> Profile Creation <//
if($_CREATEPROFILE) {
$uname = $_CREATEPROFILE['uname'];
$pword = $_CREATEPROFILE['pword'];
$email = $_CREATEPROFILE['email'];

$path = 'profiles/' + $uname + ".txt";

if(file_exists('profiles/' + $uname)) {
    //Run If Profile Already Created
    echo("<script>cantCreate();</script>");
} else {
    //Profile Creation
    $handle = fopen("profiles/" + $uname,"a");

}
}

    //> Profile Logging In <//
    if($_LOGIN) {

}

HTML:

<form action="" method="CREATEPROFILE">
    <input type="text" id="uname" name="uname" placeholder="Username">
    <input type="text" id="pword" name="pword" placeholder="Password">
    <input type="text" id="email" name="email" placeholder="EMail">

    <center><div id="accountStatus-Signup" class="accountStatus-Signup">You Have Not Done A Account Scan Yet!</div></center>

    <input type="submit" id="submit" name="submit" value="Sign Up">
</form>

Javascript:

<script>
function cantCreate() {
document.getElementById("accountStatus-Signup").innerHTML = "<h2 style=\"color: red;\">Sorry! But That Username Is Unadvaible!";
}
</script>

Please explain to me my errors! Thanks for helping me!




Aucun commentaire:

Enregistrer un commentaire