PHP Code:
<?php require "global_settings.php"; ?>
<title><?php echo $sitetitle; ?></title>
<center><style type="text/css">
a:link {
color:#24374C;
text-decoration:bold;
}
a:visited {
color:#24374C;
text-decoration:bold;
}
a:active {
outline: none;
color:#24374C;
text-decoration:bold;
}
body {background-color:#b0c4de}
div.box {
width:250px;
padding:10px;
border:3px double #000000;
margin:10px;
background-color:#74AFF2;
}
p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}
div.menu-blue {
BORDER-RIGHT: #333366 1px solid;
BORDER-LEFT: #6699cc 1px solid;
BORDER-TOP: #6699cc 1px solid;
BORDER-BOTTOM: #333366 1px solid;
FONT-WEIGHT: normal;
FONT-SIZE: 2px;
COLOR: #ffffff;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
BACKGROUND-COLOR: #23559C;
TEXT-DECORATION: none;
font-stretch : condensed;
}
.menu-top {
BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; FONT-SIZE: 2px; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none;
font-stretch : condensed
}
</style>
<center>
<div class='menu-blue'>
<div align="center">
<table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C">
<tr>
<td style="background-color:#FFFFFF">
<div align="center">
<table border="0">
</form>
</table>
<?php
$con = mysql_connect("$dbhost", "$dbuser", "$dbpassword") or die(mysql_errno());
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
$_POST = array_map('stripslashes', $_POST);
}
$name = $_POST['name'];
$message = $_POST['message'];
//getting the data if the user is banned or not
$get = mysql_query("SELECT * FROM users");
while ($row = mysql_fetch_assoc($get))
{
// get data
$ban_check = $row['banned'];
if ($ban_check ==1) {
echo "Your account has been disabled. You are no longer allowed to post.";
}
else {
if (!$name) {
echo "<div class='box'><b><span style='color:red'>You must be logged in to post!</span></b></div>";
}
else
{
//connect
$connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!");
mysql_select_db("$db") or die("Database fail!");
//write
$write = mysql_query("INSERT INTO posts VALUES ('','$name','$message')") or die(mysql_error());
$postcount = mysql_query("UPDATE users SET post_count = post_count + 1 WHERE username='$name'");
echo "<div class='box'><font face='arial'><b><span style='color:green'>Posted! Your name was:</span> $name</b> - Your message was....
<b>$message - <a href='bbdemo.php'>View it!</a></b>";
}
}
}
?>
Error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a5488351/public_html/post.php on line 86
php code to accept and delete incoming data
Using following HTML Code please show me how to write PHP code to accept and delete the incoming data entered through the form below. from the following MySQL database and table.Database = hrmsTable =
date("now") prints out wrong date ?
Hi GuysAnyone know why and how I can fix it ?
problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according to the menu click as home, products etc. div is populating itz contents with html pages for these
Share admin accross websites
I'm using .net memberships and roles in one of my sites, but I need to be able to share logins and passwords for admins accross multiple sites that use a custom database for security. How would I go
Why do I get this error?
Error:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/runevid/public_html/Quests/finished_tutorial.php on line
Need help urgant
why down my code ony return one item instead of all the items selected. $arr =
$_FILES array
Ok,I just started experimenting with PHP today. My goal right now is to have people be able to upload files to my website, but I am starting at square one. I can make a .php print out the name of
PHP form help required
Hi all! Apologies in advance for having to message the forum for help. I know you must get a lot of questions. I've tried everything I can think of & haven't had any luck so this is my last
email form (cannot find the problem)
Hello there. I've been having trouble with an email form. Can't find the problem really. I've tested so many times, tried different ifs to see where the problem comes from. It turned out its alway the
Module pool selction screen parameters combination logic
Hi floks,