Gifari Industries - BD Cyber Security Team
Home
/
home
/
decohaslibrary
/
public_html
/
✏️
Editing: programme.php
<table width="100%" border="0" style=" padding:2px 1px 2px 1px; "> <tr> <td colspan="3" style="background-image:url(images/log.jpg);padding:10px; height:50px;"> <?php /*$con=mysqli_connect("localhost", "root", "", "registration"); if(mysqli_connect_errno()) { echo "Error in connection".mysqli_connect_errno(); } */ require 'sql.php'; if(isset($_POST['submit'])) { //$name = $_POST['name']; $image = $_FILES['image']['name']; $tmp_image = $_FILES['image']['tmp_name']; $message = $_POST['message']; //$fullmsg = $_FILES['fullmsg']['name']; //$tmp_fullmsg = $_FILES['fullmsg']['tmp_name']; $mysqli_query = "INSERT INTO programme VALUES('','','$image','$message')"; if(mysqli_query($con, $mysqli_query)) { if(move_uploaded_file($tmp_image,"./books/$image")) { echo "Uploading successifully"; } else { echo "Uploading failed"; } } } echo "</br>"; ?> <div id="BKA"> <p><a href="index.php?q=pass">Back</a></p> </div> <form method="POST" action="" enctype="multipart/form-data" > <label>Upload image:</label></br> <input type="file" name="image"/> </br> </br> <label>Write any information about your picture:</label></br> <textarea type="text" name="message" style="width:400; height:100;"> </textarea></br></br> <!--<label>Upload Message:</label></br> <input type="file" name="fullmsg"/> </br> </br> !--> <input type="submit" name="submit" value="Send"/> </form> </td> </tr> </table> <?php if(isset($_POST['delete'])) { $deleteQuery= "DELETE FROM programme WHERE id='$_POST[hidden]'"; mysqli_query($con,$deleteQuery); }; //fetch data from databases $insertQuery="SELECT * FROM programme"; $myData=mysqli_query($con,$insertQuery); echo "<table border=1 width=550px height=80px > <tr> <th>Message:</th> <th>Image:</th> <th>Action:</th> </tr> "; while($record=mysqli_fetch_array($myData)) { echo "<form action= ' ' method='POST'>"; echo "<tr>"; echo "<td>" . $record['messsage'] . " </td>"; echo "<td>" . $record['image'] . " </td>"; //echo "<td>" . $record['fullmsg'] . " </td>"; echo "<td>" . "<input type=submit name=delete value=DELETE" . " </td>"; echo "<td>" . "<input type=hidden name=hidden value=" . $record['id'] . " </td>"; echo "</tr>"; echo "</form>"; } echo "</table>"; ?> <?php include"sql.php"; $insertQuery="SELECT * FROM programme ORDER BY id ASC "; $myData=mysqli_query($con,$insertQuery); while($record=mysqli_fetch_array($myData)) { ?> <img src="books/<?php echo $record['image']; ?>" vspace="10" hspace="5" width="200" height="200" alt="Principal image" align="right"> <p> <?php echo $record['message'];?> <a href="" style="color:blue; text-decoration:none;" > <b> Read more</b></a> </p> </br> <?php } ?> </div> </td> <!--***************************--> </tr> <!--*******************************************************************************--> <!--****************************FOOTER****************************************--> <tr> <td colspan="3" style="background-image:url(images/log.jpg);padding:10px; height:50px;"> <center> <b style="color:white;"> copyright© 2016</b> </center> </td> </tr> <!--********************************************************************--> </table> </body> </html>
💾 Save
❌ Cancel