السلام علكيم ورحمة الله وبركاته
قمت ببرمحة هذه الصفحة بسرعة التى هي عبارة عن سجل زوار على السريع
واريد ان اعمل صفحة اخرى نفسها فيها checkbox لو تم تحديده ستظهر النتيحة في الصفحة التانية ولو لم يتم الضغط علىيه ماتظهر النتائج في الصفحة
الاخرى
افصد بنتائج مدخلات الى تم ادخالها من طرق الزوار الني اريد عمل صفحة ادمن
اريد فكرة
اعمل ان الفكرة تعتمل على اضافة حقل جديد في قاعدة البينات
حقل باسم
showing
من نوع
ENUM
'0','1'
افتراضي
'0'
حتى لا يظهر البوس اذا قام الزائر بإضاقته
والصفحة التنية التي اريد تكوينها
بها زر checkbox لو تم الموافق فيه يتم تغير القيمة من 0 الى 1 وبتلي سنضع
if(==1)
ارجواا ان يتم عمل هذا برمجيااااااااااا
وشكرااااا مسبقااااااااااا
<style>
fieldset {
background-color: #D2ACE6;
border: solid 2px black;
width:800px;
margin-bottom: 10px
align:center
margin: 0 auto;
}
</style>
<?php
include_once('includes/connect.php');
$query="SELECT * FROM USERS";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
echo'<fieldset style="width:450px">';
echo '<span style="color:green"> username : </span>'.$row['user'].'<br />';
echo '<span style="color:green"> site web </span>'.'http//:'.$row['site'].'<br />';
echo '<span style="color:green"> email : </span>'.$row['email'].'<br />';
echo '<span style="color:green"> comment : </span>'.$row['comment'].'<br />';
echo '<br />';
echo'</fieldset>';
}
echo'<h3>';
echo "remplire le form ci-douss";
echo'</h3>';
?>
<head>
<title> welcom to guestbook</title>
</head>
<body bgcolor='4F2266'>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<tr>
<td class ="input">username:</td>
<td><input name="user" type="text" /><br /></td>
</tr>
<tr>
<td>site: http//:</td>
<td><input name="site" type="text" /><br /></td>
</tr>
<tr>
<td>email : </td>
<td><input name="email" type="text" /><br /></td>
</tr>
<tr>
<td valign="top">comment:</td>
<td><textarea name="comment" type="text" /></textarea> <br /></td>
</tr>
<input name="submit" type="submit" value="login" />
</form>
</body>
<?php
if(!empty ($_POST['user']) && !empty($_POST['site']) && !empty($_POST['comment']) && !empty($_POST['email']) ) {
$user=$_POST['user'];
$site=$_POST['site'];
$email=$_POST['email'];
$comment=$_POST['comment'];
$sql="INSERT INTO USERS (user,site,email,comment) VALUES('$user','$site','$email','$comment')";
$query=mysql_query($sql);
if($query==TRUE)
{
echo"your data have sent";
}
else
{
echo"Not send your data";
}
}
?>basesql
-- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le : Sam 14 Avril 2012 à 20:19 -- Version du serveur: 5.5.16 -- Version de PHP: 5.3.8 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `simple` -- -- -------------------------------------------------------- -- -- Structure de la table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` text NOT NULL, `site` text NOT NULL, `email` text NOT NULL, `comment` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=49 ; -- -- Contenu de la table `users` -- INSERT INTO `users` (`id`, `user`, `site`, `email`, `comment`) VALUES /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
connect.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<?php
$host_db='127.0.0.1';
$user_db='root';
$pass_db='';
$name_db='simple';
mysql_connect("$host_db","$user_db","$pass_db") or die('not connect');
mysql_select_db($name_db);
?>
</body>
</html>