Hov, det gik lidt stærkt, jeg havde faktisk givet klassen et navn
Og lavet det Nogenlunde som du har beskrevet, bare uden public function __construct(){}
---
Hmm, Per, det giver lidt problemer..
Her er min originale index fil...:
- <?
-
- session_start();
-
- $titlen = "Not ready yet...";
-
-
- if($_GET['logout']=="true"){
-
- session_destroy();
-
- header("Location: /index.php?");
-
- }
-
-
- if(isset($_POST['user']) && isset($_POST['pass'])){
-
- $con = mysql_connect("localhost", "username", "password");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
-
- mysql_select_db("somedatabase", $con);
-
- $result = mysql_query("SELECT * FROM users WHERE nick='". strip_tags($_POST['user']) ."' AND password='". md5($_POST['pass']) ."' LIMIT 1");
-
- $row = mysql_fetch_array($result);
-
- if($row['id']!=""){
- $_SESSION['login']="true";
- $_SESSION['id']=$row['id'];
- $_SESSION['user']=$row['nick'];
- $_SESSION['pass']=$row['password'];
- $_SESSION['email']=$row['email'];
- $_SESSION['www']=$row['www'];
- $_SESSION['ip']=$row['ip'];
- $_SESSION['location']=$row['location'];
- $_SESSION['fuldenavn']=$row['fuldenavn'];
- $_SESSION['adresse']=$row['adresse'];
- $_SESSION['postnr']=$row['postnr'];
- $_SESSION['bynavn']=$row['by'];
- }
-
- }
-
- function datetime($datetime){
-
- $exp = explode(" ", $datetime);
- $time = $exp['1'];
- $date = explode("-", $exp['0']);
-
- if($datetime=="0000-00-00 00:00:00"){
- return "Wating to be Read!";
- } else {
- return $time .' '. $date['2'] .'/'. $date['1'] .'-'. $date['0'];
- }
-
- }
-
-
- // START CLASSES->
-
- class htmlen {
-
- public function __construct(){
- include("function_createuser.php");
- include("function_login_form.php");
- include("function_html.php");
- include("function_special_tags.php");
- include("function_kontakt_formen.php");
-
- include("function_msg_inbox.php");
- include("function_msg_outbox.php");
- include("function_msg_write.php");
- include("function_msg_read.php");
-
- include("function_links.php");
- include("function_velkommen.php");
- }
-
- }
-
- // END CLASSES!
-
- $page = strip_tags($_GET['page']);
-
- if($page==""){
- $page = "php/frontpage.php";
- } else {
- $page = "php/". $page .".php";
- }
-
-
-
- // new classes start
-
- $html = new htmlen();
-
- // new classes end
-
- if($_SESSION['login']=="true"){
- print $html->starthtml($titlen, "false");
- } else {
- if(strip_tags($_GET['page'])=="msg"){
- print $html->starthtml($titlen, "true");
- } else {
- print $html->starthtml($titlen, "false");
- }
- }
-
- print '
- <center>
- <table class="maintable" height="90%" width="98%" cellspacing="5">
- <tr>
- <td class="head">'. $titlen .'</td>
- </tr>
- <tr>
- <td class="links">';
-
- $html->loggedinlinks($_SESSION['id']);
-
- print '
- </td>
- </tr>
- <tr>
- <td class="content">';
-
- include $page;
-
- print '</td>
- </tr>
- <tr>
- <td class="ownby">Ejes af '. $titlen .' 2010-'. date("Y") .'</td>
- </tr>
- </table>
- </center>';
-
- print $html->sluthtml();
-
- ?>
Indlæg senest redigeret d. 07.04.2011 19:19 af Bruger #15611