hi i have this code and would it be possible in adding it to the “SHOW THE FORM HERE” bit in the below code :
[code=php]<?php
ob_start();
// allows you to use cookies
include(“config.php”);
$profile = mysql_query(“SELECT * from users where username = ‘$logged[username]'”);
$profile = mysql_fetch_array($profile);
//gets the config page
if ($_POST[create]) {
// the above line checks to see if the html form has been submitted
$alliancename = $_POST[alliance];
//the above lines set variables with the user submitted information
if($alliancename==NULL) {
//checks to make sure no fields were left blank
echo “A field was left blank.”;
}else{
$checkname = mysql_query(“SELECT alliancename FROM users WHERE alliancename=’$alliancename'”);
$checkname= mysql_num_rows($checkname);
if ($checkname>0) {
// oops…someone has already got that name as there clan!
echo “The clan name is already in use”;
}else{
// noone is using that email or username! We continue…
$alliancename = htmlspecialchars($alliancename);
$update = mysql_query(“Update users set alliancename = ‘$alliancename’ where username = ‘$logged[username]'”)
or die(mysql_error());
// inserts the information into the database.
echo “You have created the alliance $alliancename <BR />”;
echo “Go<BR /><a href=”main.php”>Back to game</a><BR />”;
}
}
}
else
{
// the form has not been submitted…so now we display it.
echo (”
<center>
<form method=”POST”>
Your Clans Name: <input type=”text” size=”15″ maxlength=”25″ name=”alliance”><br />
<input name=”create” type=”submit” value=”Create”>
</form>
</center>
“);
}
?>
and whant it so the code above can be put in where the “SHOW THE FORM HERE” is below:
[code=php]if($logged[alliancename] != 0) {
// incorrect
echo “You are in the alliance $alliancename”;
}else{
// Correct
echo “SHOW THE FORM HERE”;
}
any help is so helpfull to me