hello all!
i am about to tear my hair off my head…
i’m trying to do a simple php multiple login…
here is my login form :
<br>
<form name="form" method="post" action="verif_login.php">
<p align="center"><label for="name">Name:<br>
<select name="name">
<option>please select city...</option>
<option value="bane">bane</option>
<option value="bras">bras</option>
<option value="cole">cole</option>
<option value="cons">cons</option>
<option value="mili">orh1</option>
<option value="orh1">orh1</option>
<option value="orh2">orh2</option>
<option value="ploi">ploi</option>
</select>
</label>
</p>
<p align="center">
<label for="pass">Password:</label>
<br />
<input type="password" title="Enter your password" name="pass" /></p>
<p align="center"><input type="submit" name="Submit" value="Login" /></p>
</form>
which would send the data to another file that checks if the user and password match… this is the login_verif.php file:
<html>
<?php
if ($_POST["name"] = orh1 || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=orh1" </script>
<?php
}
else if ($_POST["name"] = orh2 || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=orh2" </script>
<?php
}
else if ($_POST["name"] = bane || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=bane" </script>
<?php
}
else if ($_POST["name"] = bras || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=bras" </script>
<?php
}
else if ($_POST["name"] = cole || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=cole" </script>
<?php
}
else if ($_POST["name"] = cons || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=cons" </script>
<?php
}
else if ($_POST["name"] = mili || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=mili" </script>
<?php
}
else if ($_POST["name"] = ploi || $_POST["pass"] = password) {
?> <script language="javascript">
document.location.href="admin/index.php?ville=ploi" </script>
<?php
}
else {
echo "WRONG PASSWORD";
}
?>
</html>
but that f#@!% doesn’t work…
it ignores the if thing and gets me directly to the first url mentionned…
i am just about to cry…!