• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Seite nur für eingeloggte User sichtbar

maria1

Mitglied
Hy,

Hab ein kleines Problem.
Die seite soll nur für eingeloggte user sichtbar sein.
Ich habe aber auch zugriff wenn ich ausgeloggt bin...

PHP:
<?php include('header.php');
include ('mysql.php'); 
if($_SESSION['username'])
 


 


echo " 
<!--Welcome, ".$_SESSION['username']."! <a href='logout.php'>Logout</a><br />-->
<div id='usercontrolsprofile'>
<div id='login'>
<ul>
<li><a href='editprofile.php'>Profil bearbeiten</a></li>
<li ><a href='tauschen.php'>Tauschen</a></li> 
<li ><a href='myobjects.php'>Meine Objekte</a></li> 
<li><a href=''>Hilfe</a></li>
</ul>
</div>
</div>
 ";

 
 


$query = "SELECT * FROM artikel WHERE id='$_GET[id]'";  
 
$result = mysql_query($query);  
  while ($row = mysql_fetch_array($result)) 



 
 echo"

$row[bezeichnung] bearbeiten<br />
<form action='editobjectnow.php?id=$_GET[id]' method='POST'>
Bezeichnung: <input type='text' name='bezeichnung' value='$row[bezeichnung]' /><br />
Zustand: <input type='text' name='zustand' value='$row[zustand]' /><br />
Kategorie: <input type='text' name='kategorie' value='$row[kategorie]' /><br />
Tauschpreis: <input type='text' name='tauschpreis' value='$row[tauschpreis]' /><br />
Beschreibung: <input type='text' name='beschreibung' value='$row[beschreibung]' /><br />

<input type='submit' name='submit' value='Eintragen'>
</form>
 "; 






else 
echo" 
<form action='login.php' method='POST'> 
Username: <input name='username' type='text' size='15'  maxlength='15' /><br /> 
Password: <input name='password' type='password' size='15'  maxlength='15'/><br /> 
<input type='submit' value='Login'> 
 
</form>";






include('footer.php');


?>

session_start(); wird im header aufgerufen...

EDIT: falsche datei gepostet habs richtiggestellt..
 
Zuletzt bearbeitet:
Ajax Popup in PHP

Hy,

Neue Frage..

Wie kann ich ein Ajax Popup in eine echo ausführen ?
PHP:
echo" <input type='submit' value=' Fire! ' onClick='document.getElementById('mypopup').style.display='block'> 
 <div id='mypopup' name='mypopup' style='position: absolute; width: 250px; height: 200px; display: none; background: #ddd; border: 1px solid #000; right: 0px; top: 500px'>

<p>My content that will be displayed in the popup</p>

</div> 
";

funktioniert nicht, da es so sein sollte
PHP:
onClick='document.getElementById("mypopup").style.display="block">
 
Stichwort Kontextwechsel.

- Artikel:Kontextwechsel

PHP:
echo "<input type='submit' value=' Fire! ' onClick='document.getElementById(\"mypopup\").style.display=\"block\"'> 
 <div id='mypopup' name='mypopup' style='position: absolute; width: 250px; height: 200px; display: none; background: #ddd; border: 1px solid #000; right: 0px; top: 500px'>

<p>My content that will be displayed in the popup</p>

</div>";
 
Zurück
Oben