Hi I have the following code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration Form</title>
<script type="text/javascript">
function validateForm() {
var x = document.forms["myForm"]["uname"].value;
var y = document.forms["myForm"]["pass"].value;
if (x == null || x == "") {
alert("UserName must be filled out");
return false;
}
if (y == null || y == "") {
alert("Password must be filled out");
return false;
}
}
</script>
</head>
<body>
<h2> Register new GreenHouse </h2>
<div>
<form id="login" name= "myForm" method="put" action="" onsubmit="return validateForm()">
<fieldset id="inputs">
<input name="uname" id="username" type="text" placeholder="Username" autofocus required>
<input name="pass" id="password" type="password" placeholder="Password" required>
</fieldset>
<fieldset id="actions">
<input type="submit" id="submit" value="Log in">
</fieldset>
</form>
</div>
</body>
</html>
I want to be able to use values of username and password and create a new account at another website (such as yahoo or google). I am not quite sure how to start doing this. The basic idea when someone fill in the text-boxes a new account with the same userID and password (as they put in) will be created for them. I would be glad if someone could show me the way or show me a tutorial about this.
There are ethical and possibly legal (as well as technical) issues surrounding the creation of a user account on Google or Yahoo in the manner you suggest. The user should just create the account directly.
You can move forward, though, by tidying up your Javascript as follows 🙂
EDIT (in light of your comment):
If you own the second website, then the ethical and legal issues disappear. If both sites are hosted on the same server and you have direct access to the database, it really doesn’t matter which website the account is created through.