I am messing around with the new Parse.com php SDK and like always a little confussed with their docs. They say to add a new user you can use code like this:
$user = new ParseUser();
$user->set("username", "my name");
$user->set("password", "my pass");
$user->set("email", "[email protected]");
// other fields can be set just like with ParseObject
$user->set("phone", "415-392-0202");
try {
$user->signUp();
// Hooray! Let them use the app now.
} catch (ParseException $ex) {
// Show the error message somewhere and let the user try again.
echo "Error: " . $ex->getCode() . " " . $ex->getMessage();
}
Which I understand whats going on here but that is a hard coded way to set a user. If I want a signup form how do incorperate that into their code? I was thinking of you can just do:
<form action="" method="post">
<p><input id="email" name="email" type="text" placeholder="Email"></p>
<p><input id="password" name="password" type="password" placeholder="Password">
</form>
<? php
$email = $_POST['email'];
?>
the just pass the email for example like $user->set("email", $email);. Would that work and be best practice??