Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ?php
- $dbHost = 'localhost';
- $dbUsername = 'root';
- $dbPassword = '';
- $dbName = 'mydb';
- //Create connection and select DB
- $db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);
- $db->set_charset("utf8");
- $nev = $_GET['Nev'];
- $nev = "%".$nev."%";
- $stmt = $db->prepare("select * from Legitarsasag where Nev LIKE ?");
- $stmt->bind_param('s',$nev);
- $stmt->execute();
- $result = $stmt->get_result();
- if (isset($_GET['frissites'])) //Ha megnyomták a frissités gombot
- {
- //Adatok kinyerése a formokból
- $ID = $_GET['frissites'];
- $uj_nev = $_GET['nev'];
- $anyaorszag = $_GET['anyaorszag'];
- $alapitasev = $_GET['alapitasev'];
- //Adatbázisba felvitel
- $stmt = $db->prepare("Update Jarat set Nev=? , Anyaorszag=?, AlapitasEv=? where ID LIKE ?");
- $stmt->bind_param('sssi',$uj_nev,$anyaorszag,$alapitasev,$ID);
- $stmt->execute();
- header("Location: features.php");
- }
- ?>
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="UTF-8">
- <link rel="stylesheet" href="css/style.css" type="text/css">
- </head>
- <body>
- <div id="header">
- <div>
- <div class="logo">
- <a href="index.php"></a>
- </div>
- <ul id="navigation">
- <li>
- <a href="index.php">Home</a>
- </li>
- <li class="active">
- <a href="features.php">Search/Update</a>
- </li>
- <li>
- <a href="news.php">Browse</a>
- </li>
- <li>
- <a href="about.php">New line</a>
- </li>
- </ul>
- </div>
- </div>
- <div id="contents">
- <div class="clearfix">
- <style>
- label{display:inline-block;width:100px;margin-bottom:20px;}
- </style>
- <h1>Please provide new data for the airline company</h1>
- <?php $row=$result->fetch_array(MYSQLI_ASSOC)?>
- <form method="post" action="features.php">
- <label>Airline Name </label>
- <input type="text" name="nev" value="<?php echo $row['Nev']?>" />
- <br />
- <label>Country of origin </label>
- <input type="text" name="anyaorszag" value="<?php echo $row['Anyaorszag']?>" />
- <br />
- <label>Founded </label>
- <input type="text" name="alapitasev" value="<?php echo $row['AlapitasEv']?>" />
- <br />
- </table>
- <br />
- <button type="submit" name='frissites' value="<?php echo $row['ID']; ?>">Submit New Airline Company Data</button>
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement