Hello guyz,
I have created a security on a page like there are several password issued to the users like on join us page if the person click on it the prompt box and user enters the password users are on that page and password is wrong it redirects to homepage.
I have created this in php but the prompt box is always created in javascript how can i combine them.
<?php
error_reporting(0);
if(isset($_POST['submit'])) {
$password1 = array("alcd", "abcd", "abx");
$password = $_POST['password'];
if(in_array($password, $password1)) {
header("Location: home.php");
exit;
} else {
header("Location: incorrect.php");
}
}
?>
<form name="submition" action="sinlge_form.php" method="post">
Password : <input type="password" name="password" value="" /><br />
<input type="submit" name="submit" value="submit" />
</form>
and here is the code i created for prompt box
<script type="text/javascript">
nam=window.prompt("Enter Your name:","Name plz");
window.alert("Welcome " + nam);
</script>
but don't know how to combine both of them
Thank You