index.php
CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <!DOCTYPE html>
- <html>
- <head>
- </head>
- <body>
- <form name="answers" action="getinfo.php" method="POST">
- <p>Ваше имя: <input type="text" name="uname"/>
- </p>
- <p>Ваше e-mail: <input type="text" name="mail"/>
- </p>
- <p>Введите сообщение</p>
- <textarea cols="40" rows="10" name="coment">
- </textarea>
- </p>
- <input type="submit" value="Оставить отзыв"/>
- </form>
- <?php
- $host='localhost';
- $user='root';
- $pwd='';
- $conn=mysql_connect($host, $user, $pwd) or die (mysql_error());
- mysql_select_db('gbook') or die (mysql_error());
- $result=mysql_query("SELECT * FROM msgs") or die (mysql_error());
- mysql_close($conn);
- while($rand=mysql_fetch_assoc($result)){
- echo "<div style='border:1px solid grey; width:300px; margin:10px;'>
- <div style='background-color:grey; color:white; text-align:center; width:300px; height:20px;'>$rand[name]</div>
- <div>$rand[msg]
- <a href='getinfo.php?del=$rand[id]'>Удалить</a>
- </div>
- </div>";
- }
- ?>
- </body>
- </html>