Right.... Interesting results. I have just cleared my original post because I realised that the md5('form_password') had to have " in it instead.
This now causes the script to print "sorry, they don't match"but only when the details were correct, when the details are INCORRECT, it said The user details don't match, or, you have selected the wrong clan
As normal, there is always a hitch in the script though. If the wrong clan is selected it still prints ""sorry, they don't match""
The script is shown below again
<?php
// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix
// Get the clan from the form
$clan = $_POST['clan'];
// Create a new Session Value
session_register('clan');
// Register the input with the value
$_SESSION['clan'] = $clan;
// Display the sssion information:
?>
<?php
$md5_pwl = md5("$form_password");
/* Connecting, selecting database */
$link = mysql_connect("localhost", "zingbats", "my pwl")
or die("Could not connect");
mysql_select_db("tycooneden_com") or die("Could not select database");
$query = "SELECT * FROM clan_members WHERE username = '$form_username' AND password = '$md5_pwl' AND clan = '$form_clan'";
$result = mysql_query($query) or die("Query failed");
$foo=mysql_fetch_array($result);
/* Start the clan defining */
$username=$foo['username'];
$clan=$foo['clan'];
$user_level=$foo['user_level'];
$user_password=$foo['user_password'];
$sql = mysql_query("SELECT * FROM phpbb_users WHERE username='$form_username' AND user_password='$md5_pwl'") or die("went wrong");
$login_check = mysql_num_rows($sql);
mysql_close($link);
?>
<?
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
}
?>
<?
if ($form_clan == '$clan' && $user_level == 'admin') {
include ("main.php");
} else {
print "sorry, they don't match";
}
?>
<?
} else {
print "The user details don't match, or, you have selected the wrong clan";
}
?>
Hope this helps your quest!