Poste am besten dein ganzes Dokument und einen Screen von der Datenbank Struktur.
Beiträge von higoka
-
-
Welche Box? lel
-
Hab es nicht getestet, sollte aber funken.
PS: DB-Connection nicht vergessen zu includen, so wie beim letzten malPHP
Alles anzeigen<?php if (isset($_POST['submit'])) { $id = filter_var($_POST['fahrzeug'], FILTER_SANITIZE_NUMBER_INT); if (!empty($id)) { $query = mysql_query('SELECT gefahren FROM fahrtenbuch WHERE id = \'' . $id . '\' LIMIT 1'); if (mysql_num_rows($query) > 0) { $r = mysql_fetch_object($query); echo ' <div class="row text-center"> <div class="col-md-3 col-sm-6 hero-feature"> <div class="thumbnail"> <img class="img-hover" src="https://picr.ws/images/bb4bbe14b155ef7608ce87af0772ef20.png" alt=""> </div> <div class="caption"> <p><font color="#e74c3c"><b>Fahrzeugstatus</b></font></p> <p></p> <p><b>Gefahrene Kilometer:</b> ' . $r->gefahren . '</p> <p><b>Tankfüllung:</b></p> <p><b>Besatzung:</b> 1/0</p> </div> </div> </div>'; } } } ?> <div class="form-group"> <label for="select" class="col-lg-2 control-label">Fahrzeug</label> <div class="col-lg-10"> <select class="form-control" name="fahrzeug" id="select"> <!-- value ist die id vom fahrzeug, dass du in der db gespeichert hast. --> <option value="1">FL RS 3/23-1</option> <option value="2">FL RS 3/46-1</option> <option value="3">FL RS 3/45-1</option> <option value="4">FL RS 3/74-1</option> <option value="5">FL RS 3/65-1</option> <option value="6">FL RS 3/19-1</option> </select> <br> </div> </div>
-
Also ich habe mir PHP mehr oder weniger selber beigebracht.
Am Anfang habe ich mit YouTube Videos angefangen. (Dieser Kanal)
Später habe ich OOP und PDO noch dazugelernt. (Dieser Kanal)
Was auch sehr nützlich ist, ist das PHP Handbuch.Hoffe ich konnte dir ein wenig helfen.
Cheers,
Rarely -
Willkommen
-
-
Gutes Tutorial.
-
-
Nicht getestet:
PHP
Alles anzeigen<?php ini_set('date.timezone', 'Europe/Berlin'); function post($str) { return trim(filter_var($str, FILTER_SANITIZE_STRING)); } function int($int) { return trim(filter_var($int, FILTER_SANITIZE_NUMBER_INT)); } if (isset($_POST['submit'])) { $id = int($_POST["id"]); $gefahren = post($_POST["gefahren"]); $besatzung = post($_POST["besatzung"]); $schaden = post($_POST["schaden"]); $fahrzeug = post($_POST["fahrzeug"]); if (empty($id) || empty($gefahren) || empty($besatzung) || empty($schaden) || empty($fahrzeug)) { echo 'Du musst alle Felder ausfüllen.'; } else { mysql_query('INSERT INTO fahrtenbuch (id, gefahren, besatzung, schaden, fahrzeug) VALUES (\'' . $id . '\', \'' . $gefahren . '\', \'' . $besatzung . '\', \'' . $schaden . '\', \'' . $fahrzeug . '\')'); } } ?> <form class="form-horizontal" name="fahrtenbuch" method="post" action=""> <fieldset> <div class="form-group"> <label for="textArea" class="col-lg-2 control-label">Einsatz Nr.</label> <div class="col-lg-10"> <input class="form-control" name="id" id="focusedInput" type="text"> </div> </div> <br> <div class="form-group"> <label for="textArea" class="col-lg-2 control-label">Gefahrene Kilometer</label> <div class="col-lg-10"> <input class="form-control" name="gefahren" id="focusedInput" type="text"> </div> </div> <br> <div class="form-group"> <label for="textArea" class="col-lg-2 control-label">Besatzung</label> <div class="col-lg-10"> <input class="form-control" name="besatzung" id="focusedInput" type="text"> </div> </div> <br> <div class="form-group"> <label for="textArea" class="col-lg-2 control-label">Schäden</label> <div class="col-lg-10"> <input class="form-control" name="schaden" id="focusedInput" type="text"> </div> </div> <br> <div class="form-group"> <label for="select" class="col-lg-2 control-label">Fahrzeug</label> <div class="col-lg-10"> <select class="form-control" name="fahrzeug" id="select"> <option value="1">FL RS 1/10-1</option> <option value="2">FL RS 1/10-2</option> <option value="3">FL RS 1/11-1</option> <option value="4">FL RS 1/46-1</option> <option value="5">FL RS 1/33-1</option> <option value="6">FL RS 1/33-1</option> <option value="7">FL RS 1/24-1</option> <option value="8">FL RS 1/49-1</option> <option value="9">FL RS 1/52-1</option> <option value="10">FL RS 1/50-1</option> <option value="11">FL RS 1/65-1</option> <option value="12">FL RS 1/19-1</option> </select> </div> </div> <br> <div class="modal-footer"> <p><input type="submit" name="submit" value="Senden"></p> </div> </fieldset> </form>
-
-
Ich bin gerade dran ein CMS zu programmieren, danke für deinen Guide
-
Warum sagen alle "Azura" er heisst doch "Azure"?
-
Falls du Visual C++ Redistributable nicht installiert hast, mach das! Du brauchst aber genau diese Version!
http://www.microsoft.com/de-DE/download…s.aspx?id=30679Cheers,
Scrow. -
-
Azure, definitiv! Phoenix macht nur Probleme
-
style.css
CSS
Alles anzeigenbody { margin: 0; padding: 0; font-family: Arial; font-weight: 400; font-style: normal; background: url('link_zu_deinem_bg.png') no-repeat center; } header { font-size: 70pt; text-align: center; } nav { width: 100%; height: 50px; text-align: center; line-height: 50px; background: #2980b9; } nav > ul { margin: auto; padding: 0; } nav > ul > li { display: inline-block; float: none; } nav > ul > li > a { color: #fff; display: block; margin: 0 10px; padding: 0 15px; background: red; text-decoration: none; }
htmlHTML
Alles anzeigen<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Test</title> <link rel="stylesheet" href="style.css" charset="utf-8"> </head> <body> <header>Test</header> <nav> <ul> <li><a href="#">Startseite</a></li> <li><a href="#">Gruss & Wunschbox</a></li> <li><a href="#">Unser Team</a></li> </ul> </nav> <footer>Footer</footer> </body> </html>
-
Kp würde lieber Atom oder Sublime nutzen.
-
Wenn du Chrome verwendest, kannst du F12 drücken
-
Ich verwende Atom vom Github, ist kostenlos.
https://atom.io -
Mach eine <ul> für die Navigation.
z.B. so:
Code
Alles anzeigen<style> body { background: red; } ul { width: 100%; margin: 0 auto; padding: 0; } ul > li { display: inline-block; float: left; } ul > li > a { line-height: 30px; color: #fff; padding: 20px; margin: 20px; background: blue; } </style> <ul> <li><a href="#">Tab 1</a></li> <li><a href="#">Tab 2</a></li> <li><a href="#">Tab 3</a></li> </ul>