Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* hada tableaux */
- <?php
- include ("test.php");
- include ("config.php");
- $resultat = mysql_query("SELECT * FROM `disque`");
- $cat = $resultat;
- ?>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Name</th>
- <th>Title</th>
- <th>Genre</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $resultat = $cat;
- while ($affiche = mysql_fetch_array($resultat)) {
- ?>
- <tr>
- <td><h3><?php echo $affiche['id'];?></h3></td>
- <td ><h3><?php echo $affiche['artiste'];?></h3></td>
- <td><h3><?php echo $affiche['title'];?></h3><br></td>
- <td ><h3><?php echo $affiche['genre'];?></h3></td>
- </tr>
- <?php
- }
- mysql_close();
- ?>
- </table>
- /* hnaya la fin ta3 tableaux */
- /* hada login */
- <?php
- include ("config.php");
- if (isset($_SESSION['user']) != "") {}
- if (isset($_POST['submit'])) {
- $username = mysql_real_escape_string($_POST['username']);
- $password = mysql_real_escape_string($_POST['password']);
- $res = mysql_query("SELECT * FROM `user` WHERE `user`.`username`='$username'");
- $sadam = mysql_fetch_array($res);
- if ($sadam['password'] == md5($password)) {
- $_SESSION['user'] = $sadam['id'];
- header("Location:rayan.php");
- } else {
- echo "<script>alert('wrong details');</script>";
- }
- }
- include ("test.php");
- ?>
- <form method="post">
- <div class="container">
- <form class="form-signin">
- <h2 class="form-signin-heading">Please sign in</h2>
- <label for="user" class="sr-only">username</label>
- <input type="text" id="user" class="form-control" name="username">
- <label for="password" class="sr-only">Password</label>
- <input type="password" id="password" class="form-control" name="password">
- <button class="btn btn-lg btn-primary btn-block" type="submit" name="submit">login</button>
- </form>
- </div> <!-- /container -->
- </form>
- /* hnaya la fin ta3 login */
- /* hada l formulaire ta3 l ADD */
- <?php
- session_start();
- include_once 'config.php';
- if (!isset($_SESSION['user'])) {
- header("Location:index.php");
- }
- $res = mysql_query("SELECT * FROM `user` WHERE `user`.`id`=".$_SESSION['user']);
- $user = mysql_fetch_array($res);
- ?>
- <title>Bienvenue - <?php echo $user['username'];?></title>
- <form action="insert.php" method="post" accept-charset="utf-8">
- <label for="genre" class="sr-only">artist</label>
- <input type="artist" id="text" class="form-control" name="artist">
- <label for="title" class="sr-only">title</label>
- <input type="text" id="text" class="form-control" name="title">
- <label for="genre" class="sr-only">genre</label>
- <input type="text" id="text" class="form-control" name="genre">
- <button class="btn btn-lg btn-primary btn-block" type="submit" name="">Add</button>
- </form>
- /* hnaya la fin ta3 l formulaire */
- /* hada l insert li b3atehouli lakhar */
- <?php
- session_start();
- include_once 'config.php';
- if (!isset($_SESSION['user'])) {
- header("Location:index.php");
- }
- $res = mysql_query("SELECT * FROM `user` WHERE `user`.`id`=".$_SESSION['user']);
- $user = mysql_fetch_array($res);
- ?>
- <title>Bienvenue - <?php echo $user['username'];?></title>
- [20:26:01] fatiha belaouedj: enctype="multipart/form-data"
- [20:31:28] fatiha belaouedj: <form name="form1" method="POST" enctype="multipart/form-data" action="insert.php">
- <p>artiste : </p>
- <input width="300" type="text" name="name"/>
- </br>
- <p>title: </p>
- <input width="300" type="text" name="name"/>
- </br>
- <p>genre : </p>
- <input width="300" type="text" name="name"/>
- </br>
- <input class="active" type="submit" name="boutom" value="envoyer">
- </form>
- [20:37:19] games of life: <?php
- session_start();
- include_once 'config.php';
- if (!isset($_SESSION['user'])) {
- header("Location:index.php");
- }
- $res = mysql_query("SELECT * FROM `user` WHERE `user`.`id`=".$_SESSION['user']);
- $user = mysql_fetch_array($res);
- ?>
- [20:38:57] games of life: mani 7abaset zatla zadat tnakateli la memoire :/
- [20:41:17] fatiha belaouedj: <?php
- $con = mysql_connect("localhost", "root", "", "test");
- if (isset($_POST['boutom'])) {
- $sql = "INSERT INTO `test`.`disque` ( `id`, `artiste`, `title`, `genre`)
- VALUES
- (NULL, '".$_POST['artiste']."', '".$_POST['title']."', '".$_POST['genre']."')";
- $req = mysql_query($sql);
- if (mysql_query($con, $sql)) {
- die('Error:'.mysql_error($con));
- }
- }
- header("Location:class.php");
- mysql_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement