<?php
require_once "header.php";
function Adex_AcAddpchat($username,$pchat,$chatid){
if (!valid_username($username) || !user_exists($username))
{
return false;
}
// now we update the password in the database
$query = sprintf("insert into adeyemi_acpchat set name = '%s',ac_chatid = '%s'",
mysql_real_escape_string($pchat), mysql_real_escape_string($chatid));
if (mysql_query($query))
{
return false;
}else {return false;}
return false;
}
function Adex_Acpchat(){
echo '<form action="./adex_acaddpchat.php" method="post">
<input type="hidden" value="'.$_SESSION['username'].'" name="username">
pchat:<br/>
<input name="chat" type="text" maxlength="15"><br/> ';
$cchat = mysql_query("select ac_id,ac_name from adeyemi_acpchat order by ac_id, ac_name");
echo "chat category:<select name=\"chatid\">";
while($chat = mysql_fetch-array($cchat))
{
echo '<option value="$chat">$chat[1]</option>';
}
echo "</select><br/>
<input name=\"chat\" type=\"submit\" value=\"addchat\">
</form>";
}
if (isLoggedIn() == true)
{
if (isset($_POST['chat']))
{
if (Adex_AcAddpchat($_POST['username'], $_POST['chat'], $_POST['chatid']))
{
echo "chat added! <br /> <a href='./index.php'>Return to homepage</a>";
} else
{
echo "chat failed! Please try again.";
Adex_Acpchat();
}
} else
{
Adex_Acpchat();
}
} else {
// user is not loggedin
show_loginform();
}
require_once "footer.php";
?>
pls the above code did not show submit input, what rerror am i have with xhtml/php
require_once "header.php";
function Adex_AcAddpchat($username,$pchat,$chatid){
if (!valid_username($username) || !user_exists($username))
{
return false;
}
// now we update the password in the database
$query = sprintf("insert into adeyemi_acpchat set name = '%s',ac_chatid = '%s'",
mysql_real_escape_string($pchat), mysql_real_escape_string($chatid));
if (mysql_query($query))
{
return false;
}else {return false;}
return false;
}
function Adex_Acpchat(){
echo '<form action="./adex_acaddpchat.php" method="post">
<input type="hidden" value="'.$_SESSION['username'].'" name="username">
pchat:<br/>
<input name="chat" type="text" maxlength="15"><br/> ';
$cchat = mysql_query("select ac_id,ac_name from adeyemi_acpchat order by ac_id, ac_name");
echo "chat category:<select name=\"chatid\">";
while($chat = mysql_fetch-array($cchat))
{
echo '<option value="$chat">$chat[1]</option>';
}
echo "</select><br/>
<input name=\"chat\" type=\"submit\" value=\"addchat\">
</form>";
}
if (isLoggedIn() == true)
{
if (isset($_POST['chat']))
{
if (Adex_AcAddpchat($_POST['username'], $_POST['chat'], $_POST['chatid']))
{
echo "chat added! <br /> <a href='./index.php'>Return to homepage</a>";
} else
{
echo "chat failed! Please try again.";
Adex_Acpchat();
}
} else
{
Adex_Acpchat();
}
} else {
// user is not loggedin
show_loginform();
}
require_once "footer.php";
?>
pls the above code did not show submit input, what rerror am i have with xhtml/php
Comment