fout in id ophalen
By: pages.php | Date: Mar 8 2010 13:32 | Format: PHP | Expires: never | Size: 2.64 KB | Hits: 1212
- <?php
- include("db.php");
- include("content_functions.php");
- //variabelen declareren en content ophalen
- $a = $_GET["a"];
- $id = $_GET["id"];
- $idr = $_GET["idr"];
- $idb = $_GET["idb"];
- //content ophalen met controle menu links, items boven of items rechts. Items rechts is $idr, items boven is $idb menu links is $id
- if($idr == ""){
- $sql = "SELECT * FROM contents where id='".$_GET["id"]."'";
- $content = $row['content'];
- $title = $row['title'];
- //controleren of de gebruiker is ingelogd
- $insert = "<a href='index.php?id=$id&a=insert'>Nieuwe pagina</a>";
- $delete = '<a href="index.php?id=' . $id . '&a=delete" onclick="return confirm('Weet u zeker dat deze pagina verwijderd mag worden?')">Verwijder deze pagina</a>';
- $aanpassen = "<a href='index.php?id=$id&a=edit'>Aanpassen</a>";
- }else{
- $delete = "";
- $aanpassen = "";
- $insert = "";
- }//als menu rechts wordt geklikt
- }elseif($id == ""){
- $sql = "SELECT * FROM content_rechts where idr='".$_GET["idr"]."'";
- $content = $row['content'];
- $title = $row['title'];
- //controleren of de gebruiker is ingelogd
- $aanpassen = "<a href='index.php?idr=$idr&a=edit'>Aanpassen</a>";
- }else{
- $delete = "";
- $aanpassen = "";
- $insert = "";
- //menu boven
- }}elseif($id and $idr == ""){
- $sql = "SELECT * FROM content_boven where idb='".$_GET["idb"]."'";
- $content = $row['content'];
- $title = $row['title'];
- //controleren of de gebruiker is ingelogd
- $aanpassen = "<a href='index.php?idb=$idb&a=edit'>Aanpassen</a>";
- }else{
- $delete = "";
- $aanpassen = "";
- $insert = "";
- }}
- if ($_GET["a"] == "" or $_GET["a"] == "edit" or $_GET["a"] == "delete" or $_GET["a"] == "insert"){
- //inhoud tabel maken
- echo "<table align='center' width='705' border='0'>
- <tr>
- <th align='center'>$title</th>
- </tr>";
- echo "<tr>";
- echo "<td align='center'>" . $aanpassen . " " . $delete . " " . $insert . "</td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>" . $content . "</td>";
- echo "</tr>";
- echo "</table>";
- echo "<br>";
- }
- //functies aanroepen
- if ($_GET["a"] == "edit"){
- edit($content, $a, $id, $idr);
- }else if ($_GET["a"] == "delete"){
- delete($content, $a, $id);
- }else if ($_GET["a"] == "insert"){
- insert($content, $a, $id);
- }
- ?>
Latest pastes
7 hours ago
3 days ago
4 days ago
4 days ago
6 days ago