2017. december 30., szombat

PHP-SQL szerveren beléptetőrendszer alkalmazása

Az oldalak forrásiban vegyük észre a lényeges pontokat!
Elemezzük és értelmezzük!


Szükséges php-k;



index.php
adatlap.php
ujbejegyzes.php
torles.php
register.php
logout.php
search.php
modosit.php
fal.php
connect.php

administrator mappa
css mappa
social mappa



index.php tartalma


<?php
session_start();
ob_start();
include('connect.php');
?>
<?php
if (isset($_POST['submit']))
{
    $login=$_POST['login'];
    $jelszo=sha1($_POST['jelszo']);
    $sql="SELECT * FROM users WHERE (email='".$login."' AND jelszo='".$jelszo."');";
    $query=mysql_query($sql);
    if (mysql_num_rows($query) !==0 )
    {
        $dbrec=mysql_fetch_array($query);
        $_SESSION['login']=$dbrec['user_ID'];
        header("Location:fal.php");
    }
    else
    {
        print("<p><font color='red'>Nem megfelelő felhasználónév és/vagy jelszó.</font></p>");
    }
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="content-type" content="text/html" />
    <meta name="author" content="prometh" />
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <title>SN kezdemény</title>
</head>
<body bgcolor="#87ADD3">
 <br>
 <font size="5"<PRE>                                            <h1 align="center"> SZABÓ LÁSZLÓ ISTVÁN TANÁR ÚR HONLAPJA! </h1>     </PRE> </font>
   <PRE>                                           <font size="5"  <h2><b>E-mail címed: Jelszavad:</b>  </h2>     </font></PRE>
<div id="menu" align='center'>
    <form method="POST" action="<?php print($_SERVER['PHP_SELF']);?>">
        <input type="text" name="login"/>
        <input type="password" name="jelszo"/>
 <br>
<input type="submit" name="submit" value="Bejelentkezés"/>
    </form>
  <br> <marquee behavior="alternate">Kedves hallgatók, a belépéshez regisztráció szükséges!</marquee>
 <br>
<br>
  <a href="register.php">Regisztráció</a>
</div>
 <br>
 <p align="center"><img src="arc.jpg "><br> </p>
 <p align="center"><a href="http://szabolaszloistvan.blogspot.hu/">Szabó László István blogja</a> </p>
 <p><font color="#000000">
<p align="center">
<SCRIPT LANGUAGE="JavaScript"><!--
function initArray() {
  this.length = initArray.arguments.length
  for (var i = 0; i < this.length; i++)
  this[i+1] = initArray.arguments[i]
}

/*  Hónap névnapjainak meghatározása */
function havinev(ev,ho,nap) {
if (ho==1)
  { var napok = new initArray("ÚJÉV, Fruzsina","Ábel","Genovéva, Benjámin",
        "Titusz, Leona","Simon","Boldizsár","Attila, Ramóna","Gyöngyvér","Marcell",
        "Melánia","Ágota","ErnO","Veronika","Bódog","Lóránt, Loránd",
        "Gusztáv","Antal, Antónia","Piroska","Sára, Márió","Fábián, Sebestyén",
        "Ágnes","Vince, Artúr","Zelma, Rajmund","Timót","Pál","Vanda, Paula",
        "Angelika","Károly, Karola","Adél","Martina, Gerda","Marcella","") }
if (ho==2)
  if ((ev!=2000) && (ev!=2004) && ev!=1996)
    { var napok=new initArray("Ignác","Karolina, Aida","Balázs","Ráhel, Csenge",
        "Ágota, Ingrid","Dorottya, Dóra","Tódor, Rómeó","Aranka","Abigél, Alex","Elvira",
        "Bertold, Marietta","Lívia, Lídia","Ella, Linda","Bálint, Valentin",
        "Kolos, Georgina","Julianna, Lilla","Donát","Bernadett","Zsuzsanna",
        "Aladár, Álmos","Eleonóra","Gerzson","Alfréd",
        "Mátyás","Géza","Edina","Ákos, Bátor","Elemér","","")  }
     else
    { var napok=new initArray("Ignác","Karolina, Aida","Balázs","Ráhel, Csenge",
        "Ágota, Ingrid","Dorottya, Dóra","Tódor, Rómeó","Aranka","Abigél, Alex","Elvira",
        "Bertold, Marietta","Lívia, Lídia","Ella, Linda","Bálint, Valentin",
        "Kolos, Georgina","Julianna, Lilla","Donát","Bernadett","Zsuzsanna",
        "Aladár, Álmos","Eleonóra","Gerzson","Alfréd",
        "Szokonap","Mátyás","Géza","Edina","Ákos, Bátor","Elemér","","") }
if (ho==3)
  { var napok=new initArray("Albin","Lujza","Kornélia","Kázmér","Adorján, Adrián",
        "Leonóra, Inez","Tamás","NEMZ.NONAP, Zoltán","Franciska, Fanni","Ildikó",
        "Szilárd","Gergely","Krisztián, Ajtony","Matild","NEMZETI ÜNNEP, Kristóf",
        "Henrietta","Gertrúd, Patrik","Sándor, Ede","József, Bánk","Klaudia",
        "Benedek","Beáta, Izolda","Emoke","Gábor, Karina","Irén, Irisz",
        "Emánuel","Hajnalka","Gedeon, Johanna","Auguszta","Zalán","Árpád","" ) }
if (ho==4)
  { var napok=new initArray("Hugó","Áron","Buda, Richárd","Izidor","Vince",
        "Vilmos, Bíborka","Herman","Dénes","Erhard","Zsolt","Leó, Szaniszló","Gyula",
        "Ida","Tibor","Anasztázia, Tas","Csongor","Rudolf","Andrea, Ilma","Emma",
        "Tivadar","Konrád","Csilla, Noémi","Béla","György","Márk","Ervin",
        "Zita","Valéria","Péter","Katalin, Kitti","" )}
if (ho==5)
 { var napok=new initArray("MUNKA ÜNN.,Fülöp, Jakab","Zsigmond","Tímea, Irma",
        "Mónika, Flórián","Györgyi","Ivett, Frida","Gizella","Mihály","Gergely",
        "Ármin, Pálma","Ferenc","Pongrác","Szervác, Imola","Bonifác","Zsófia, Szonja",
        "Mózes, Botond","Paszkál","Erik, Alexandra","Ivó, Milán",
        "Bernát, Felícia","Konstantin","Júlia, Rita","Dezso","Eszter, Eliza",
        "Orbán","Fülöp, Evelin","Hella","Emil, Csanád","Magdolna",
        "Janka, Zsanett","Angéla, Petronella","" )}
if (ho==6)
  { var napok=new initArray("Tünde","Kármen, Anita","Klotild","Bulcsú","Fatime",
       "Norbert, Cintia","Róbert","Medárd","Félix","Margit, Gréta","Barnabás",
        "Villo","Antal, Anett","Vazul","Jolán, Vid","Jusztin","Laura, Alida",
        "Arnold, Levente","Gyárfás","Rafael","Alajos, Leila","Paulina",
        "Zoltán","Iván","Vilmos","János, Pál","László","Levente, Irén",
        "Péter, Pál","Pál","" ) }
if (ho==7)
  { var napok=new initArray("Tihamér, Annamária","Ottó","Kornél, Soma","Ulrik",
        "Emese, Sarolta","Csaba","Appolónia","Ellák","Lukrécia","Amália",
        "Nóra, Lili","Izabella, Dalma","Jeno","Ors, Stella","Henrik, Roland","Valter",
        "Endre, Elek","Frigyes","Emília","Illés","Dániel, Daniella",
        "Magdolna","Lenke","Kinga, Kincso","Kristóf, Jakab","Anna, Anikó",
        "Olga, Liliána","Szabolcs","Márta, Flóra","Judit, Xénia","Oszkár","" )}
if (ho==8)
  { var napok=new initArray("Boglárka","Lehel","Hermina","Domonkos, Dominika",
        "Krisztina","Berta, Bettina","Ibolya","László","Emod","Lörinc",
        "Zsuzsanna, Tiborc","Klára","Ipoly","Marcell","Mária","Ábrahám",
        "Jácint","Ilona","Huba","ALKOTMÁNY ÜNN., István","Sámuel, Hajna",
        "Menyhért, Mirjam","Bence","Bertalan","Lajos, Patrícia","Izsó",
        "Gáspár","Ágoston","Beatrix, Erna","Rózsa","Erika, Bella") }
if (ho==9)
  { var napok= new initArray("Egyed, Egon","Rebeka, Dorina","Hilda","Rozália",
        "Viktor, Lorinc","Zakariás","Regina","Mária, Adrienn","Ádám","Nikolett, Hunor",
        "Teodóra","Mária","Kornél","Szeréna, Roxána","Eniko, Melitta","Edit",
        "Zsófia","Diána","Vilhelmina","Friderika","Máté, Mirella","Móric",
        "Tekla","Gellért, Mercédesz","Eufrozina, Kende","Jusztina","Adalbert",
        "Vencel","Mihály","Jeromos","" )}
if (ho==10)

  { var napok= new initArray("Malvin","Petra","Helga","Ferenc","Aurél","Brúnó, Renáta",
       "Amália","Koppány","Dénes","Gedeon","Brigitta","Miksa","Kálmán, Ede","Helén",
        "Teréz","Gál","Hedvig","Lukács","Nándor","Vendel","Orsolya","Elod",
        "KÖZT.KIKIÁLT., Gyöngyi","Salamon","Blanka, Bianka","Dömötör",
        "Szabina","Simon, Szimonetta","Nárcisz","Alfonz","Farkas","" )}
if (ho==11)
  { var napok=new initArray("Marianna","Achilles","Gyozo","Károly","Imre","Lénárd",
        "Rezso","Zsombor akitől kaptam a névnapos kódot","Tivadar","Réka","Márton","Jónás, Renátó","Szilvia",
        "Aliz","Albert, Lipót","Ödön","Hortenzia, Gergo","Jeno","Erzsébet",
        "Jolán","Olivér","Cecília","Kelemen, Klementina","Emma","Katalin",
        "Virág","Virgil","Stefánia","Taksony","András, Andor","" )}
if (ho==12)
  { var napok=new initArray("Elza","Melinda, Vivien","Ferenc, Olívia","Borbála, Barbara",
        "Vilma","Miklós","Ambrus","Mária","Natália","Judit","Árpád","Gabriella",
        "Luca, Otília","Szilárda","Valér","Etelka, Aletta","Lázár, Olimpia",
        "Auguszta","Viola","Teofil","Tamás","Zéno","Viktória","Ádám, Éva",
        "KARÁCSONY, Eugénia","KARÁCSONY, István","János","Kamilla",
        "Tamás, Tamara","Dávid","Szilveszter","") }
   return napok[nap];
}
/* Hónap neve */
function honev(ho) {
   var month = new initArray("Január","Február","Március","Április","Május",
   "Junius","Július","Augusztus","Szeptember","Október","November","December");
   return month[ho]
   }

/* Nap neve */
function napnev(szam) {
   var napok = new initArray("Vasárnap","Hétfo","Kedd","Szerda","Csütörtök",
                             "Péntek","Szombat","Vasárnap")
   return napok[szam]
   }
  var ido = new Date()
  var ev = ido.getYear()
  var ho = ido.getMonth()+1
  var nap = ido.getDate()
  if (ev<1900) ev+=1900;
  document.writeln("Ma <b>" + ev + ". " + honev(ho) + " " + nap + ". "
    + napnev(ido.getDay()+1)
    +",<font color=red> "+havinev(ev,ho,nap)+"</font></b> napja van.")
  document.writeln("Boldog névnapot kívánok!")
//--></SCRIPT></p>





 <hr size="3" align="center" width="850">
 <p align="center"> Copyright &#169; 2015 Szabó László István  . Minden jog fenntartva.  szli@freemail.hu. </p>
</body>
</html>




ujbejegyzes.php tartalma
<?php
session_start();

ob_start();

include('connect.php');

?>

<!DOCTYPE HTML>

<html>

<head>

    <meta http-equiv="content-type" content="text/html" />

    <meta name="author" content="prometh" />

     <link rel="stylesheet" type="text/css" href="css/style.css"/>

     <script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>

    <script>

        tinymce.init({selector:'textarea'});

    </script>

    <title>Új bejegyzés írása</title>

</head>

<body><body bgcolor="#87ADD3"> <br>

 <br>

 <br>

 <br>

<br>

 <br>

 <font size="1"<PRE>                                            <h1 align="center"> ÍRD MEG AZ ÜZENETET! </h1>     </PRE> </font>

 <br>

 <br>

 <br>


 <br>

 <br>

 <br>

<br>

 <br>

<?php

if (isset($_SESSION['login']))

{

    $sql="SELECT * FROM users WHERE user_ID=".$_SESSION['login'].";";

    $query=mysql_query($sql);

    $dbrec=mysql_fetch_array($query);


    echo "<a href='adatlap.php'>Vissza</a>";

?>

<form action="<?php print($_SERVER['PHP_SELF']);?>" method="POST">

<textarea name="text"></textarea>

<input type="submit" name="submit" value="Posztold ki!"/>

</form>

<?php

if(isset($_POST['submit']))

{

    $text=$_POST['text'];

    $sql2="INSERT INTO bejegyzes VALUES (0,".$_SESSION['login'].",'{$text}', NOW());";

    //echo($sql2);

    mysql_query($sql2) or die ("SQL hiba");

    mysql_close($kapcsolat);

    header("Location: fal.php");

}


}

else

{

    print("<section>Megtekintéshez kérem jelentkezzen be a fiókjába.</section>

                <a href='index.php'>Főoldal</a>");

}

?><br>

 <br>

 <br>

 <br>

<br>

 <br>

 <br>

 <br>

 <br>

 <br>

<br>  <hr size="3" align="center" width="850">

 <p align="center"> Copyright &#169; 2015 Szabó László István Neptun kód: BRXLXS . Minden jog fenntartva.  szli@freemail.hu. </p>

</body>

</html>


register.php tartalma


<?php

session_start();

ob_start();

include('connect.php');

?>

<!DOCTYPE HTML>

<html>

<head>

    <meta http-equiv="content-type" content="text/html" />

    <meta name="author" content="prometh" />

    <link rel="stylesheet" type="text/css" href="css/style.css"/>

    <title>Regisztráció</title>

</head>

<body><body bgcolor="#87ADD3">

<br>

 <br>

 <br>

  <br>

<br>

 <font size="1"<PRE><h1 align="center"> KÉREM REGISZTRÁLJA MAGÁT! </h1>     </PRE> </font>

 <br>

 <br>



<form method="POST" action="<?php print($_SERVER['PHP_SELF']);?>" enctype="multipart/form-data">

<input type="hidden" name="MAX_FILE_SIZE" value="1048576"/>

<table>

<tr>

    <td>E-mail:</td><td><input type="text" name="email"/></td>

</tr>

<tr>

    <td>Jelszó:</td><td><input type="password" name="jelszo"/></td>

</tr>

<tr>

    <td>Vezetéknév:</td><td><input type="text" name="vezetek_nev"/></td>

</tr>

<tr>

    <td>Keresztnév:</td><td><input type="text" name="kereszt_nev"/></td>

</tr>

<tr>

    <td>Profilkép:</td><td><input type="file" name="profilkep"/></td>

</tr>

<tr>

    <td colspan="2" align="center"><input type="submit" name="submit" value="Regisztráció"/></td>

</tr>

</table>


<br>

 <br>

 <br>

  <br>

<br>

      <p align="center">  <marquee width="300" height="65" direction="up" scrollamount="1" onmouseout="this.start()" style="FILTER: Alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, StartY=30, FinishX=0, FinishY=0)" onmouseover="this.stop()"><center><font face="verdana" color="#777777">


        - Minden mező kitöltése kötelező<br />

        - Feltölthető kép csak jpg típusú <br />

        - és maximum 1 Mb méretű.<br />

        </font></center></marquee></p>



 <br>

 <br>

<br>

 <br>  <br>

 <br>

 <br>

 <br>

<br>

 <br> <hr size="3" align="center" width="850">

 <p align="center"> Copyright &#169; 2015 Szabó László István Neptun kód: BRXLXS . Minden jog fenntartva.  szli@freemail.hu. </p>




</form>

<?php

if (isset($_POST['submit']))

{

    $email=trim($_POST['email']);

    $jelszo=sha1(trim($_POST['jelszo']));

    $vezetek_nev=trim($_POST['vezetek_nev']);

    $kereszt_nev=trim($_POST['kereszt_nev']);

    $forras=$_FILES['profilkep']['tmp_name'];

    $cel="kepek/".$_FILES['profilkep']['name'];

  

    if($_FILES['profilkep']['type'] == "image/jpeg" &&

    $email !="" &&

    $jelszo!="" &&

    $vezetek_nev!="" &&

    $kereszt_nev!="")

    {

        $sql="INSERT INTO users VALUES (0,'{$email}','{$jelszo}','{$vezetek_nev}','{$kereszt_nev}','{$cel}');";

      

        $DATA=array('email','jelszo','vezetek_nev','kereszt_nev');

        foreach($DATA as $a)

        $$a=mysql_real_escape_string($kapcsolat,$$a);

      

        mysql_query($sql) or die ("SQL hiba");

        move_uploaded_file($forras,$cel);

      

        $sql2="SELECT user_ID FROM users WHERE (email='".$email."' AND jelszo='".$jelszo."');";

        $query2=mysql_query($sql2) or die ("SQL2 hiba");

        $dbrec=mysql_fetch_array($query2);

        $_SESSION['login']=$dbrec['user_ID'];

      

        mysql_close($kapcsolat);

        header("Location:adatlap.php");

    }

    else

    {

        print("<section><font color='red'>Ellenőrizze a bevitt adatokat.</font></section>");

    }

}

?>

</body>

</html>


torles.php tartalma


<?php

include('connect.php');

$mit=(int)$_GET['id'];


$sql="DELETE FROM bejegyzes WHERE bejegyzes_ID=$mit";

mysql_query($sql);

mysql_close($kapcsolat);

header("Location:fal.php");

?>



modosit.php tartalma


<?php

session_start();

ob_start();

include('connect.php');

$bejegyzes=$_GET['id'];

?>

<!DOCTYPE HTML>

<html>

<head>

    <meta http-equiv="content-type" content="text/html" />

    <meta name="author" content="prometh" />

     <link rel="stylesheet" type="text/css" href="css/style.css"/>

     <script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>

    <script>

        tinymce.init({selector:'textarea'});

    </script>

    <title>Bejegyzés módosítása</title>

</head>

<body><body bgcolor="#87ADD3"> <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

  <font size="1"<PRE>                                            <h1 align="center"> MOST ÁTSZERKESZTHETED! </h1>     </PRE> </font><br>


<?php

if (isset($_SESSION['login']))

{

    $sql="SELECT * FROM users WHERE user_ID=".$_SESSION['login'].";";

    $query=mysql_query($sql);

    $dbrec=mysql_fetch_array($query);

  

    $sql3="SELECT * FROM bejegyzes WHERE bejegyzes_ID=".$bejegyzes.";";

    //echo$sql3;

    $query3=mysql_query($sql3);

    $dbrec3=mysql_fetch_array($query3);

    echo "<a href='adatlap.php'>Vissza</a>";

?>

<form action="<?php print($_SERVER['PHP_SELF']);?>" method="POST">

<input type="hidden" name="bejegyzes_id" value="<?php print($bejegyzes);?>"/>

<textarea name="text"><?php print($dbrec3['szoveg']);?></textarea>

<input type="submit" name="submit" value="Posztold ki!"/>

</form>

<?php

if(isset($_POST['submit']))

{

    $text=$_POST['text'];

    $id=$_POST['bejegyzes_id'];

    $sql2="UPDATE bejegyzes SET szoveg='{$text}', datum=NOW() WHERE bejegyzes_ID=".$id.";";

    //echo($sql2);

    mysql_query($sql2) or die ("SQL hiba");

    mysql_close($kapcsolat);

    header("Location: fal.php");

}


}

else

{

    print("<section>Megtekintéshez kérem jelentkezzen be a fiókjába.</section>

                <a href='index.php'>Főoldal</a>");

}

?> <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

 <br>

<hr size="3" align="center" width="850">

 <p align="center"> Copyright &#169; 2015 Szabó László István Neptun kód: BRXLXS . Minden jog fenntartva.  szli@freemail.hu. </p>

</body>

</html>


logout.php tartalma


<?php

session_start();

unset($_SESSION['login']);

header("Location:index.php");

?>


fal.php tartalma


<?php

session_start();

include('connect.php');

//print_r($_SESSION);

?>

<!DOCTYPE HTML>

<html>

<head>

    <meta http-equiv="content-type" content="text/html" />

    <meta name="author" content="prometh" />

    <link rel="stylesheet" type="text/css" href="css/style.css"/>

    <title>Szabó László István</title>

</head>

<body><body bgcolor="#87ADD3">

<?php

if (isset($_SESSION['login']))

{

    //$sql="SELECT * FROM users WHERE user_ID='".$_SESSION['login']."'";

   $sql="SELECT * FROM users WHERE email='".$_SESSION['login']."'";

  

  

    $query=mysql_query($sql);

    $dbrec=mysql_fetch_array($query);

?><br>

 <br>

 <br>

<div id="menu">

    <P align="center"><a href="fal.php">Üzenőfal</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <a href="adatlap.php">Adatlap</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <a href="ujbejegyzes.php">Új bejegyzés</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <a href="logout.php">Kijelentkezés</a></P>

</div>


<?php

 $sql2="SELECT * FROM bejegyzes

        INNER JOIN users

        ON bejegyzes.user_ID = users.user_ID  

        ORDER BY datum DESC;";

    $query2=mysql_query($sql2);

    if(mysql_num_rows($query2)!==0)

    {

      

        while($dbrec2=mysql_fetch_array($query2))

        {

               print("

                        <table border='1'>

                        <tr>

                            <td><img src='".$dbrec2['kep']."' width='100px' /></td>

                            <td>".$dbrec2['vezetek_nev']."&nbsp".$dbrec2['kereszt_nev']."</td>

                            <td>".$dbrec2['datum']."</td>

                        </tr>

                        <tr>

                            <td colspan='3'>".$dbrec2['szoveg']."</td>

                        </tr>

               ");

               if($dbrec2['user_ID'] == $_SESSION['login'])

               {

                    print("

                            <tr>

                                <td colspan='3' align='right'>

                                    <a href='modosit.php?id=".$dbrec2['bejegyzes_ID']."'>Módosítás</a>

                                    <a href='torles.php?id=".$dbrec2['bejegyzes_ID']."'>Törlés</a>

                                </td>

                            </tr>

                            </table>

                    ");

               }

               else

               {

                    print("</table>");

               }

        }

    }

    else

    {

        print("<section>Még nem osztott meg semmit.</section>");

    }

?>

<?php

}

else

{

    print("<section>Megtekintéshez kérem jelentkezzen be a fiókjába.</section>

                <a href='index.php'>Főoldal</a>");

}

?>


</body>

</html>


connect.php tartalma


<?php

$kapcsolat = mysql_connect("sql4.ultraweb.hu", "felhasznaloinev", "jelszo");

if ( !mysql_select_db("felhasznaloinev",$kapcsolat) ) die ("Ilyen adatbázis nem létezik ".mysql_error());


?>



adatlap.php tartalma


<?php

session_start();

ob_start();

include('connect.php');

?>

<!DOCTYPE HTML>

<html>

<head>

    <meta http-equiv="content-type" content="text/html" />

    <meta name="author" content="prometh" />

    <link rel="stylesheet" type="text/css" href="css/style.css"/>

    <title>Felhasználó adatlap</title>

</head>


<body bgcolor="#87ADD3">

<?php

if (isset($_SESSION['login']))

{

    $sql="SELECT * FROM users WHERE user_ID='".$_SESSION['login']."'";

  

    $query=mysql_query($sql);

    $dbrec=mysql_fetch_array($query);

?>

<div id="menu">

     <P align="center"><a href="fal.php">Üzenőfal</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <a href="adatlap.php">Adatlap</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <a href="ujbejegyzes.php">Új bejegyzés</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <a href="logout.php">Kijelentkezés</a></P>

</div>

<table>

    <tr>

        <td>E-mail cím: </td><td><?php echo $dbrec['email'];?></td>

    </tr>

    <tr>

        <td>Vezetéknév: </td><td><?php echo $dbrec['vezetek_nev'];?></td>

    </tr>

    <tr>

        <td>Keresztnév: </td><td><?php echo $dbrec['kereszt_nev'];?></td>

    </tr>

    <tr>

        <td>Profilkép: </td><td><img src="<?php echo $dbrec['kep'];?>" width="100px"/></td>

    </tr>

</table>

<?php

    $sql2="SELECT * FROM bejegyzes

        INNER JOIN users

        ON bejegyzes.user_ID= users.user_ID

        WHERE bejegyzes.user_ID=".$_SESSION['login']."

        ORDER BY datum DESC;";

    $query2=mysql_query($sql2);

    if(mysql_num_rows($query2)!==0)

    {

      

        while($dbrec2=mysql_fetch_array($query2))

        {

               print("

                        <table border='1'>

                        <tr>

                            <td><img src='".$dbrec2['kep']."' width='100px' /></td>

                            <td>".$dbrec2['vezetek_nev']."&nbsp".$dbrec2['kereszt_nev']."</td>

                            <td>".$dbrec2['datum']."</td>

                        </tr>

                        <tr>

                            <td colspan='3'>".$dbrec2['szoveg']."</td>

                        </tr>

               ");

               if($dbrec2['user_ID'] == $_SESSION['login'])

               {

                    print("

                            <tr>

                                <td colspan='3' align='right'>

                                    <a href='modosit.php?id=".$dbrec2['bejegyzes_ID']."'>Módosítás</a>

                                    <a href='torles.php?id=".$dbrec2['bejegyzes_ID']."'>Törlés</a>

                                </td>

                            </tr>

                            </table>

                    ");

               }

               else

               {

                    print("</table>");

               }

        }

    }

    else

    {

        print("<section>Még nem osztott meg semmit.</section>");

    }

?>

<?php

}

else

{

    print("<section>Megtekintéshez kérem jelentkezzen be a fiókjába.</section>

                <a href='index.php'>Főoldal</a>");

}

?>

</body>

</html>


searc.php tartalma


<html>

<head>

</head>

<body>

<?php

#mysqli kapcsolódás

$dbh = mysqli_connect(bejegyzes);


if(isset($_GET['keres'])){

# az isset függvény segítségével megvizsgáljuk,hogy létezik-e a GET tömbben lévő 'keres' kulcs

$keres = $_GET['keres'];


if(!empty($keres)){

# ellenőrizzük nem-e üres a kapott változó

$keres = trim($keres); # eltávolítjuk a szóközt az elejéről és végéről


$query = mysqli_query($dbh,"SELECT * FROM `users` WHERE `username` LIKE '%$keres%' ");


if(mysqli_affected_rows($dbh) > 0){

#amennyiben van találat kiírjuk

echo 'Találatok:';

while($sor = mysqli_fetch_assoc($query)){

echo $sor['username'];

echo '<br/>';

}

}else{

echo 'Nincs találat';

}


}else{

echo 'Üres keresőmező';

# esetleg visszairányítás:

//header('Location: kereso.html');

}


}else{

echo 'Közvetlen meghívás nem engedélyezett!';

}

?>

</body>

</html>



style.css tartalma


body

{

    width:1000px;

    margin: 0 auto;

}

table

{

    margin:10px auto;

    width:50%;

}

#menu

{

    margin:5px auto;

}



profile.xml tartalma


<?xml version="1.0" encoding="utf-8"?>

<form>

    <fieldset name="user_details">

        <field name="name" type="text"

            class="inputbox"

            description="COM_ADMIN_USER_FIELD_NAME_DESC"

            label="COM_ADMIN_USER_HEADING_NAME"

            required="true"

            size="30"

        />


        <field name="username" type="text"

            class="inputbox"

            description="COM_ADMIN_USER_FIELD_USERNAME_DESC"

            label="COM_ADMIN_USER_FIELD_USERNAME_LABEL"

            required="true"

            size="30"

        />


        <field name="password" type="password"

            autocomplete="off"

            class="inputbox validate-password"

            description="COM_ADMIN_USER_FIELD_PASSWORD_DESC"

            filter="raw"

            label="JGLOBAL_PASSWORD"

            size="30"

            validate="equals"

            field="password2"

        />


        <field name="password2" type="password"

            autocomplete="off"

            class="inputbox validate-password"

            description="COM_ADMIN_USER_FIELD_PASSWORD2_DESC"

            filter="raw"

            label="COM_ADMIN_USER_FIELD_PASSWORD2_LABEL"

            size="30"

        />


        <field name="email" type="email"

            class="inputbox"

            description="COM_ADMIN_USER_FIELD_EMAIL_DESC"

            label="JGLOBAL_EMAIL"

            required="true"

            size="30"

            validate="email"

        />


        <field

            name="registerDate"

            type="calendar"

            class="readonly"

            label="COM_ADMIN_USER_FIELD_REGISTERDATE_LABEL"

            description="COM_ADMIN_USER_FIELD_REGISTERDATE_DESC"

            readonly="true"

            format="%Y-%m-%d %H:%M:%S"

            size="22"

            filter="user_utc"

        />


        <field

            name="lastvisitDate"

            type="calendar"

            class="readonly"

            label="COM_ADMIN_USER_FIELD_LASTVISIT_LABEL"

            description="COM_ADMIN_USER_FIELD_LASTVISIT_DESC"

            readonly="true"

            format="%Y-%m-%d %H:%M:%S"

            size="22"

            filter="user_utc"

        />


        <field

            name="id"

            type="text"

            class="readonly"

            label="JGLOBAL_FIELD_ID_LABEL"

            description ="JGLOBAL_FIELD_ID_DESC"

            default="0"

            readonly="true"

            filter="unset"

            />


    </fieldset>


    <fields name="params">


        <!--  Basic user account settings. -->

        <fieldset name="settings" label="COM_ADMIN_USER_SETTINGS_FIELDSET_LABEL">


            <field name="admin_style" type="templatestyle"

                client="administrator"

                description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"

                label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL"

            >

                <option value="">JOPTION_USE_DEFAULT</option>

            </field>


            <field name="admin_language" type="language"

                client="administrator"

                description="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_DESC"

                label="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_LABEL"

            >

                <option value="">JOPTION_USE_DEFAULT</option>

            </field>


            <field name="language" type="language"

                client="site"

                description="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_DESC"

                label="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_LABEL"

            >

                <option value="">JOPTION_USE_DEFAULT</option>

            </field>


            <field name="editor" type="plugins" folder="editors"

                description="COM_ADMIN_USER_FIELD_EDITOR_DESC"

                label="COM_ADMIN_USER_FIELD_EDITOR_LABEL"

            >

                <option value="">JOPTION_USE_DEFAULT</option>

            </field>


            <field name="helpsite" type="helpsite"

                label="COM_ADMIN_USER_FIELD_HELPSITE_LABEL"

                description="COM_ADMIN_USER_FIELD_HELPSITE_DESC"

            >

                <option value="">JOPTION_USE_DEFAULT</option>

            </field>


            <field name="timezone" type="timezone"

                label="COM_ADMIN_USER_FIELD_TIMEZONE_LABEL"

                description="COM_ADMIN_USER_FIELD_TIMEZONE_DESC"

            >

                <option value="">JOPTION_USE_DEFAULT</option>

            </field>

        </fieldset>

    </fields>

</form>



sysinfo.php tartalma



<?php

/**

 * @copyright    Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.

 * @license        GNU General Public License version 2 or later; see LICENSE.txt

 */


defined('_JEXEC') or die;


/**

 * @package        Joomla.Administrator

 * @subpackage    com_admin

 * @since        1.6

 */

class AdminModelSysInfo extends JModelLegacy

{

    /**

     * @var array some php settings

     */

    protected $php_settings = null;


    /**

     * @var array config values

     */

    protected $config = null;


    /**

     * @var array somme system values

     */

    protected $info = null;


    /**

     * @var string php info

     */

    protected $php_info = null;


    /**

     * @var array informations about writable state of directories

     */

    protected $directories = null;


    /**

     * @var string The current editor.

     */

    protected $editor = null;


    /**

     * Method to get the ChangeLog

     *

     * @return array some php settings

     */

    function &getPhpSettings()

    {

        if (is_null($this->php_settings))

        {

            $this->php_settings = array();

            $this->php_settings['safe_mode']            = ini_get('safe_mode') == '1';

            $this->php_settings['display_errors']        = ini_get('display_errors') == '1';

            $this->php_settings['short_open_tag']        = ini_get('short_open_tag') == '1';

            $this->php_settings['file_uploads']            = ini_get('file_uploads') == '1';

            $this->php_settings['magic_quotes_gpc']        = ini_get('magic_quotes_gpc') == '1';

            $this->php_settings['register_globals']        = ini_get('register_globals') == '1';

            $this->php_settings['output_buffering']        = (bool) ini_get('output_buffering');

            $this->php_settings['open_basedir']            = ini_get('open_basedir');

            $this->php_settings['session.save_path']    = ini_get('session.save_path');

            $this->php_settings['session.auto_start']    = ini_get('session.auto_start');

            $this->php_settings['disable_functions']    = ini_get('disable_functions');

            $this->php_settings['xml']                    = extension_loaded('xml');

            $this->php_settings['zlib']                    = extension_loaded('zlib');

            $this->php_settings['zip']                    = function_exists('zip_open') && function_exists('zip_read');

            $this->php_settings['mbstring']                = extension_loaded('mbstring');

            $this->php_settings['iconv']                = function_exists('iconv');

        }

        return $this->php_settings;

    }

    /**

     * method to get the config

     *

     * @return array config values

     */

    function &getConfig()

    {

        if (is_null($this->config))

        {

            $registry = new JRegistry(new JConfig);

            $this->config = $registry->toArray();

            $hidden = array('host', 'user', 'password', 'ftp_user', 'ftp_pass', 'smtpuser', 'smtppass');

            foreach($hidden as $key) {

                $this->config[$key] = 'xxxxxx';

            }

        }

        return $this->config;

    }

    /**

     * method to get the system information

     *

     * @return array system information values

     */

    function &getInfo()

    {

        if (is_null($this->info))

        {

            $this->info = array();

            $version = new JVersion();

            $platform = new JPlatform();

            $db = JFactory::getDBO();

            if (isset($_SERVER['SERVER_SOFTWARE'])) {

                $sf = $_SERVER['SERVER_SOFTWARE'];

            }

            else {

                $sf = getenv('SERVER_SOFTWARE');

            }

            $this->info['php']            = php_uname();

            $this->info['dbversion']    = $db->getVersion();

            $this->info['dbcollation']    = $db->getCollation();

            $this->info['phpversion']    = phpversion();

            $this->info['server']        = $sf;

            $this->info['sapi_name']    = php_sapi_name();

            $this->info['version']        = $version->getLongVersion();

            $this->info['platform']        = $platform->getLongVersion();

            $this->info['useragent']    = $_SERVER['HTTP_USER_AGENT'];

        }

        return $this->info;

    }

    /**

     * method to get the PHP info

     *

     * @return string PHP info

     */

    function &getPHPInfo()

    {

        if (is_null($this->php_info))

        {

            ob_start();

            date_default_timezone_set('UTC');

            phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);

            $phpinfo = ob_get_contents();

            ob_end_clean();

            preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);

            $output = preg_replace('#<table[^>]*>#', '<table class="adminlist">', $output[1][0]);

            $output = preg_replace('#(\w),(\w)#', '\1, \2', $output);

            $output = preg_replace('#<hr />#', '', $output);

            $output = str_replace('<div class="center">', '', $output);

            $output = preg_replace('#<tr class="h">(.*)<\/tr>#', '<thead><tr class="h">$1</tr></thead><tbody>', $output);

            $output = str_replace('</table>', '</tbody></table>', $output);

            $output = str_replace('</div>', '', $output);

            $this->php_info = $output;

        }

        return $this->php_info;

    }

    /**

     * method to get the directory states

     *

     * @return array states of directories

     */

    public function getDirectory() {

        if (is_null($this->directories))

        {

            $this->directories = array();


            $registry = JFactory::getConfig();

            jimport('joomla.filesystem.folder');

            $cparams = JComponentHelper::getParams('com_media');


            $this->_addDirectory('administrator/components', JPATH_ADMINISTRATOR.'/components');

            $this->_addDirectory('administrator/language', JPATH_ADMINISTRATOR.'/language');


            // List all admin languages

            $admin_langs = JFolder::folders(JPATH_ADMINISTRATOR.'/language');

            foreach($admin_langs as $alang) {

                $this->_addDirectory('administrator/language/' . $alang, JPATH_ADMINISTRATOR.'/language/'.$alang);

            }


            // List all manifests folders

            $manifests = JFolder::folders(JPATH_ADMINISTRATOR.'/manifests');

            foreach($manifests as $_manifest) {

                $this->_addDirectory('administrator/manifests/' . $_manifest, JPATH_ADMINISTRATOR.'/manifests/'.$_manifest);

            }


            $this->_addDirectory('administrator/modules', JPATH_ADMINISTRATOR.'/modules');

            $this->_addDirectory('administrator/templates', JPATH_THEMES);


            $this->_addDirectory('components', JPATH_SITE.'/components');


            $this->_addDirectory($cparams->get('image_path'), JPATH_SITE.'/'.$cparams->get('image_path'));


            $image_folders = JFolder::folders(JPATH_SITE.'/'.$cparams->get('image_path'));

            // List all images folders

            foreach ($image_folders as $folder) {

                $this->_addDirectory('images/' . $folder, JPATH_SITE.'/'.$cparams->get('image_path').'/'.$folder);

            }


            $this->_addDirectory('language', JPATH_SITE.'/language');

            // List all site languages

            $site_langs = JFolder::folders(JPATH_SITE . '/language');

            foreach ($site_langs as $slang) {

                $this->_addDirectory('language/' . $slang, JPATH_SITE.'/language/'.$slang);

            }


            $this->_addDirectory('libraries', JPATH_LIBRARIES);


            $this->_addDirectory('media', JPATH_SITE.'/media');

            $this->_addDirectory('modules', JPATH_SITE.'/modules');

            $this->_addDirectory('plugins', JPATH_PLUGINS);


            $plugin_groups = JFolder::folders(JPATH_PLUGINS);

            foreach ($plugin_groups as $folder) {

                $this->_addDirectory('plugins/' . $folder, JPATH_PLUGINS.'/'.$folder);

            }


            $this->_addDirectory('templates', JPATH_SITE.'/templates');

            $this->_addDirectory('configuration.php', JPATH_CONFIGURATION.'/configuration.php');

            $this->_addDirectory('cache', JPATH_SITE.'/cache', 'COM_ADMIN_CACHE_DIRECTORY');

            $this->_addDirectory('administrator/cache', JPATH_CACHE, 'COM_ADMIN_CACHE_DIRECTORY');


            $this->_addDirectory($registry->get('log_path', JPATH_ROOT . '/log'), $registry->get('log_path', JPATH_ROOT.'/log'), 'COM_ADMIN_LOG_DIRECTORY');

            $this->_addDirectory($registry->get('tmp_path', JPATH_ROOT . '/tmp'), $registry->get('tmp_path', JPATH_ROOT.'/tmp'), 'COM_ADMIN_TEMP_DIRECTORY');

        }

        return $this->directories;

    }


    private function _addDirectory($name, $path, $message = '') {

        $this->directories[$name] = array('writable' => is_writable($path), 'message' => $message);

    }


    /**

     * method to get the editor

     *

     * @return string the default editor

     *

     * has to be removed (it is present in the config...)

     */

    function &getEditor()

    {

        if (is_null($this->editor))

        {

            $config = JFactory::getConfig();

            $this->editor = $config->get('editor');

        }

        return $this->editor;

    }

}


profile.php


<?php

/**

 * @copyright    Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.

 * @license        GNU General Public License version 2 or later; see LICENSE.txt

 */


// No direct access.

defined('_JEXEC') or die;


require_once JPATH_ADMINISTRATOR.'/components/com_users/models/user.php';


/**

 * User model.

 *

 * @package        Joomla.Administrator

 * @subpackage    com_admin

 * @since        1.6

 */

class AdminModelProfile extends UsersModelUser

{

    /**

     * Method to get the record form.

     *

     * @param    array    $data        An optional array of data for the form to interogate.

     * @param    boolean    $loadData    True if the form is to load its own data (default case), false if not.

     * @return    JForm    A JForm object on success, false on failure

     * @since    1.6

     */

    public function getForm($data = array(), $loadData = true)

    {

        // Initialise variables.

        $app = JFactory::getApplication();


        // Get the form.

        $form = $this->loadForm('com_admin.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData));

        if (empty($form)) {

            return false;

        }


        // Check for username compliance and parameter set

        $usernameCompliant = true;


        if ($this->loadFormData()->username)

        {

            $username = $this->loadFormData()->username;

            $isUsernameCompliant  = !(preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $username) || strlen(utf8_decode($username)) < 2

                || trim($username) != $username);

        }


        $this->setState('user.username.compliant', $isUsernameCompliant);


        if (!JComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant)

        {

            $form->setFieldAttribute('username', 'required', 'false');

            $form->setFieldAttribute('username', 'readonly', 'true');

            $form->setFieldAttribute('username', 'description', 'COM_ADMIN_USER_FIELD_NOCHANGE_USERNAME_DESC');

        }


        return $form;

    }


    /**

     * Method to get the data that should be injected in the form.

     *

     * @return    mixed    The data for the form.

     * @since    1.6

     */

    protected function loadFormData()

    {

        // Check the session for previously entered form data.

        $data = JFactory::getApplication()->getUserState('com_users.edit.user.data', array());


        if (empty($data)) {

            $data = $this->getItem();

        }


        // TODO: Maybe this can go into the parent model somehow?

        // Get the dispatcher and load the users plugins.

        $dispatcher    = JDispatcher::getInstance();

        JPluginHelper::importPlugin('user');


        // Trigger the data preparation event.

        $results = $dispatcher->trigger('onContentPrepareData', array('com_admin.profile', $data));


        // Check for errors encountered while preparing the data.

        if (count($results) && in_array(false, $results, true)) {

            $this->setError($dispatcher->getError());

        }


        return $data;

    }


    /**

     * Method to get a single record.

     *

     * @return    mixed    Object on success, false on failure.

     * @since    1.6

     */

    public function getItem($pk = null)

    {

        $user = JFactory::getUser();


        return parent::getItem($user->get('id'));

    }


    /**

     * Method to save the form data.

     *

     * @param    array    $data    The form data.

     *

     * @return    boolean    True on success.

     * @since    1.6

     */

    public function save($data)

    {

        // Initialise variables;

        $user = JFactory::getUser();


        unset($data['id']);

        unset($data['groups']);

        unset($data['sendEmail']);

        unset($data['block']);


        // Unset the username if it should not be overwritten

        $username = $data['username'];

        $isUsernameCompliant = $this->getState('user.username.compliant');


        if (!JComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant)

        {

            unset($data['username']);

        }


        // Bind the data.

        if (!$user->bind($data)) {

            $this->setError($user->getError());

            return false;

        }


        $user->groups = null;


        // Store the data.

        if (!$user->save()) {

            $this->setError($user->getError());

            return false;

        }


        $this->setState('user.id', $user->id);


        return true;

    }

}



script.php tartalma fontos


<?php


/**

 * @package        Joomla.Administrator

 * @subpackage    com_admin

 * @copyright    Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.

 * @license        GNU General Public License version 2 or later; see LICENSE.txt

 */


// no direct access

defined('_JEXEC') or die;


jimport('joomla.database.table');


/**

 * Script file of joomla CMS

 */

class joomlaInstallerScript

{

    /**

     * method to preflight the update of Joomla!

     *

     * @param    string          $route      'update' or 'install'

     * @param    JInstallerFile  $installer  The class calling this method

     *

     * @return void

     */

    public function preflight($route, $installer)

    {

        $db = JFactory::getDbo();

        $query = $db->getQuery(true);

        $query->select('version_id');

        $query->from('#__schemas');

        $query->where('extension_id=700');

        $db->setQuery($query);

        if (!$db->loadResult())

        {

            $query = $db->getQuery(true);

            $query->insert('#__schemas');

            $query->set('extension_id=700, version_id='.$db->quote('1.6.0-2011-01-10'));

            $db->setQuery($query);

            $db->query();

        }

        return true;

    }


    /**

     * method to update Joomla!

     *

     * @param    JInstallerFile    $installer    The class calling this method

     *

     * @return void

     */

    function update($installer)

    {

        $this->deleteUnexistingFiles();

        $this->updateManifestCaches();

        $this->updateDatabase();

    }

    protected function updateDatabase()

    {

        $db = JFactory::getDbo();

        if (substr($db->name, 0, 5) == 'mysql')

        {

            $query = 'SHOW ENGINES';

            $db->setQuery($query);

            $results = $db->loadObjectList();

            if ($db->getErrorNum())

            {

                echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()).'<br />';

                return;

            }

            foreach ($results as $result)

            {

                if ($result->Support=='DEFAULT')

                {

                    $query = 'ALTER TABLE #__update_sites_extensions ENGINE = ' . $result->Engine;

                    $db->setQuery($query);

                    $db->query();

                    if ($db->getErrorNum())

                    {

                        echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()).'<br />';

                        return;

                    }

                    break;

                }

            }

        }

    }


    protected function updateManifestCaches()

    {

        // TODO Remove this for 2.5

        if (!JTable::getInstance('Extension')->load(array('element'=> 'pkg_joomla', 'type'=>'package'))) {

            // Create the package pkg_joomla

            $db = JFactory::getDbo();

            $query = $db->getQuery(true);

            $query->insert('#__extensions');

            $query->columns(array($db->quoteName('name'), $db->quoteName('type'),

                                $db->quoteName('element'), $db->quoteName('enabled'), $db->quoteName('access'),

                                $db->quoteName('protected')));

            $query->values($db->quote('joomla'). ', '. $db->quote('package').', '.$db->quote('pkg_joomla') . ', 1, 1, 1');


            $db->setQuery($query);

            $db->query();

            if ($db->getErrorNum())

            {

                echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()).'<br />';

                return;

            }

        }


        // TODO Remove this for 2.5

        $table = JTable::getInstance('Extension');

        if ($table->load(array('element'=> 'mod_online', 'type'=>'module', 'client_id'=>1))) {

            if (!file_exists(JPATH_ADMINISTRATOR . '/modules/mod_online')) {

                // Delete this extension

                if (!$table->delete()) {

                    echo $table->getError().'<br />';

                    return;

                }

            }

            else {

                // Mark this extension as unprotected

                $table->protected = 0;

                if (!$table->store()) {

                    echo $table->getError().'<br />';

                    return;

                }

            }

        }


        // TODO Remove this for 2.5

        $table = JTable::getInstance('Extension');

        if ($table->load(array('element'=> 'mod_unread', 'type'=>'module', 'client_id'=>1))) {

            if (!file_exists(JPATH_ADMINISTRATOR . '/modules/mod_unread')) {

                // Delete this extension

                if (!$table->delete()) {

                    echo $table->getError().'<br />';

                    return;

                }

            }

            else {

                // Mark this extension as unprotected

                $table->protected = 0;

                if (!$table->store()) {

                    echo $table->getError().'<br />';

                    return;

                }

            }

        }


        $extensions = array();

        // Components


        //`type`, `element`, `folder`, `client_id`

        $extensions[] = array('component', 'com_mailto', '', 0);

        $extensions[] = array('component', 'com_wrapper', '', 0);

        $extensions[] = array('component', 'com_admin', '', 1);

        $extensions[] = array('component', 'com_banners', '', 1);

        $extensions[] = array('component', 'com_cache', '', 1);

        $extensions[] = array('component', 'com_categories', '', 1);

        $extensions[] = array('component', 'com_checkin', '', 1);

        $extensions[] = array('component', 'com_contact', '', 1);

        $extensions[] = array('component', 'com_cpanel', '', 1);

        $extensions[] = array('component', 'com_installer', '', 1);

        $extensions[] = array('component', 'com_languages', '', 1);

        $extensions[] = array('component', 'com_login', '', 1);

        $extensions[] = array('component', 'com_media', '', 1);

        $extensions[] = array('component', 'com_menus', '', 1);

        $extensions[] = array('component', 'com_messages', '', 1);

        $extensions[] = array('component', 'com_modules', '', 1);

        $extensions[] = array('component', 'com_newsfeeds', '', 1);

        $extensions[] = array('component', 'com_plugins', '', 1);

        $extensions[] = array('component', 'com_search', '', 1);

        $extensions[] = array('component', 'com_templates', '', 1);

        $extensions[] = array('component', 'com_weblinks', '', 1);

        $extensions[] = array('component', 'com_content', '', 1);

        $extensions[] = array('component', 'com_config', '', 1);

        $extensions[] = array('component', 'com_redirect', '', 1);

        $extensions[] = array('component', 'com_users', '', 1);


        // Libraries

        $extensions[] = array('library', 'phpmailer', '', 0);

        $extensions[] = array('library', 'simplepie', '', 0);

        $extensions[] = array('library', 'phputf8', '', 0);

        $extensions[] = array('library', 'joomla', '', 0);

        $extensions[] = array('library', 'cms', '', 0);


        // Modules site

        // Site

        $extensions[] = array('module', 'mod_articles_archive', '', 0);

        $extensions[] = array('module', 'mod_articles_latest', '', 0);

        $extensions[] = array('module', 'mod_articles_popular', '', 0);

        $extensions[] = array('module', 'mod_banners', '', 0);

        $extensions[] = array('module', 'mod_breadcrumbs', '', 0);

        $extensions[] = array('module', 'mod_custom', '', 0);

        $extensions[] = array('module', 'mod_feed', '', 0);

        $extensions[] = array('module', 'mod_footer', '', 0);

        $extensions[] = array('module', 'mod_login', '', 0);

        $extensions[] = array('module', 'mod_menu', '', 0);

        $extensions[] = array('module', 'mod_articles_news', '', 0);

        $extensions[] = array('module', 'mod_random_image', '', 0);

        $extensions[] = array('module', 'mod_related_items', '', 0);

        $extensions[] = array('module', 'mod_search', '', 0);

        $extensions[] = array('module', 'mod_stats', '', 0);

        $extensions[] = array('module', 'mod_syndicate', '', 0);

        $extensions[] = array('module', 'mod_users_latest', '', 0);

        $extensions[] = array('module', 'mod_weblinks', '', 0);

        $extensions[] = array('module', 'mod_whosonline', '', 0);

        $extensions[] = array('module', 'mod_wrapper', '', 0);

        $extensions[] = array('module', 'mod_articles_category', '', 0);

        $extensions[] = array('module', 'mod_articles_categories', '', 0);

        $extensions[] = array('module', 'mod_languages', '', 0);


        // Administrator

        $extensions[] = array('module', 'mod_custom', '', 1);

        $extensions[] = array('module', 'mod_feed', '', 1);

        $extensions[] = array('module', 'mod_latest', '', 1);

        $extensions[] = array('module', 'mod_logged', '', 1);

        $extensions[] = array('module', 'mod_login', '', 1);

        $extensions[] = array('module', 'mod_menu', '', 1);

        $extensions[] = array('module', 'mod_popular', '', 1);

        $extensions[] = array('module', 'mod_quickicon', '', 1);

        $extensions[] = array('module', 'mod_status', '', 1);

        $extensions[] = array('module', 'mod_submenu', '', 1);

        $extensions[] = array('module', 'mod_title', '', 1);

        $extensions[] = array('module', 'mod_toolbar', '', 1);

        $extensions[] = array('module', 'mod_multilangstatus', '', 1);


        // Plug-ins

        $extensions[] = array('plugin', 'gmail', 'authentication', 0);

        $extensions[] = array('plugin', 'joomla', 'authentication', 0);

        $extensions[] = array('plugin', 'ldap', 'authentication', 0);

        $extensions[] = array('plugin', 'emailcloak', 'content', 0);

        $extensions[] = array('plugin', 'geshi', 'content', 0);

        $extensions[] = array('plugin', 'loadmodule', 'content', 0);

        $extensions[] = array('plugin', 'pagebreak', 'content', 0);

        $extensions[] = array('plugin', 'pagenavigation', 'content', 0);

        $extensions[] = array('plugin', 'vote', 'content', 0);

        $extensions[] = array('plugin', 'codemirror', 'editors', 0);

        $extensions[] = array('plugin', 'none', 'editors', 0);

        $extensions[] = array('plugin', 'tinymce', 'editors', 0);

        $extensions[] = array('plugin', 'article', 'editors-xtd', 0);

        $extensions[] = array('plugin', 'image', 'editors-xtd', 0);

        $extensions[] = array('plugin', 'pagebreak', 'editors-xtd', 0);

        $extensions[] = array('plugin', 'readmore', 'editors-xtd', 0);

        $extensions[] = array('plugin', 'categories', 'search', 0);

        $extensions[] = array('plugin', 'contacts', 'search', 0);

        $extensions[] = array('plugin', 'content', 'search', 0);

        $extensions[] = array('plugin', 'newsfeeds', 'search', 0);

        $extensions[] = array('plugin', 'weblinks', 'search', 0);

        $extensions[] = array('plugin', 'languagefilter', 'system', 0);

        $extensions[] = array('plugin', 'p3p', 'system', 0);

        $extensions[] = array('plugin', 'cache', 'system', 0);

        $extensions[] = array('plugin', 'debug', 'system', 0);

        $extensions[] = array('plugin', 'log', 'system', 0);

        $extensions[] = array('plugin', 'redirect', 'system', 0);

        $extensions[] = array('plugin', 'remember', 'system', 0);

        $extensions[] = array('plugin', 'sef', 'system', 0);

        $extensions[] = array('plugin', 'logout', 'system', 0);

        $extensions[] = array('plugin', 'contactcreator', 'user', 0);

        $extensions[] = array('plugin', 'joomla', 'user', 0);

        $extensions[] = array('plugin', 'profile', 'user', 0);

        $extensions[] = array('plugin', 'joomla', 'extension', 0);

        $extensions[] = array('plugin', 'joomla', 'content', 0);

        $extensions[] = array('plugin', 'languagecode', 'system', 0);

        $extensions[] = array('plugin', 'joomlaupdate', 'quickicon', 0);

        $extensions[] = array('plugin', 'extensionupdate', 'quickicon', 0);

        $extensions[] = array('plugin', 'recaptcha', 'captcha', 0);

        $extensions[] = array('plugin', 'eosnotify', 'quickicon', 0);


        // Templates


        $extensions[] = array('template', 'atomic', '', 0);

        $extensions[] = array('template', 'bluestork', '', 1);

        $extensions[] = array('template', 'beez_20', '', 0);

        $extensions[] = array('template', 'hathor', '', 1);

        $extensions[] = array('template', 'beez5', '', 0);


        // Languages

        $extensions[] = array('language', 'en-GB', '', 0);

        $extensions[] = array('language', 'en-GB', '', 1);


        // Files

        $extensions[] = array('file', 'joomla', '', 0);


        // Packages

        $extensions[] = array('package', 'pkg_joomla', '', 0);


        // Attempt to refresh manifest caches

        $db = JFactory::getDbo();

        $query = $db->getQuery(true);

        $query->select('*');

        $query->from('#__extensions');

        foreach ($extensions as $extension) {

            $query->where('type='.$db->quote($extension[0]).' AND element='.$db->quote($extension[1]).' AND folder='.$db->quote($extension[2]).' AND client_id='.$extension[3], 'OR');

        }

        $db->setQuery($query);

        $extensions = $db->loadObjectList();

        $installer = new JInstaller();

        // Check for a database error.

        if ($db->getErrorNum())

        {

            echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()).'<br />';

            return;

        }

        foreach ($extensions as $extension) {

            if (!$installer->refreshManifestCache($extension->extension_id)) {

                echo JText::sprintf('FILES_JOOMLA_ERROR_MANIFEST', $extension->type, $extension->element, $extension->name, $extension->client_id).'<br />';

            }

        }

    }

    public function deleteUnexistingFiles()

    {

        $files = array(

            '/includes/version.php',

            '/installation/sql/mysql/joomla_update_170to171.sql',

            '/installation/sql/mysql/joomla_update_172to173.sql',

            '/installation/sql/mysql/joomla_update_17ga.sql',

            '/libraries/cms/cmsloader.php',

            '/libraries/joomla/application/applicationexception.php',

            '/libraries/joomla/client/http.php',

            '/libraries/joomla/filter/filterinput.php',

            '/libraries/joomla/filter/filteroutput.php',

            '/libraries/joomla/form/fields/templatestyle.php',

            '/libraries/joomla/form/fields/user.php',

            '/libraries/joomla/form/fields/menu.php',

            '/libraries/joomla/form/fields/helpsite.php',

            '/libraries/joomla/form/formfield.php',

            '/libraries/joomla/form/formrule.php',

            '/libraries/joomla/utilities/garbagecron.txt',

            '/libraries/phpmailer/language/phpmailer.lang-en.php',

            '/media/system/css/modal_msie.css',

            '/media/system/images/modal/closebox.gif',

            '/administrator/components/com_admin/sql/updates/sqlsrv/2.5.2-2012-03-05.sql',

            '/administrator/components/com_admin/sql/updates/sqlsrv/2.5.3-2012-03-13.sql',

            '/administrator/components/com_admin/sql/updates/sqlsrv/index.html',

            '/administrator/components/com_users/controllers/config.php',

            '/administrator/language/en-GB/en-GB.plg_system_finder.ini',

            '/administrator/language/en-GB/en-GB.plg_system_finder.sys.ini',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js',

            '/media/editors/tinymce/jscripts/tiny_mce/tiny_mce_src.js',

            '/media/com_finder/images/calendar.png',

            '/media/com_finder/images/mime/index.html',

            '/media/com_finder/images/mime/pdf.png',

            '/media/system/js/swf-uncompressed.js',

            '/media/system/js/swf.js',

            '/media/system/js/uploader-uncompressed.js',

            '/media/system/js/uploader.js',

            '/media/system/swf/index.html',

            '/media/system/swf/uploader.swf',

        );


        // TODO There is an issue while deleting folders using the ftp mode

        $folders = array(

            '/libraries/joomlacms',

            '/media/editors/tinymce/jscripts/tiny_mce/plugins/media/img',

            '/media/plg_highlight',

            '/media/mod_finder_status',

            '/administrator/components/com_admin/sql/updates/sqlsrv',

            '/media/com_finder/images/mime',

            '/media/com_finder/images',

            '/media/system/swf/',

        );


        foreach ($files as $file) {

            if (JFile::exists(JPATH_ROOT . $file) && !JFile::delete(JPATH_ROOT . $file)) {

                echo JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $file).'<br />';

            }

        }


        foreach ($folders as $folder) {

            if (JFolder::exists(JPATH_ROOT . $folder) && !JFolder::delete(JPATH_ROOT . $folder)) {

                echo JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $folder).'<br />';

            }

        }

    }

}



Ha telepíteni kell


telepites.php:

    <?php 
    $con = mysql_connect("localhost","v630i-w660i","XYZ"); 
     
    if (!$con) 
      { 
        die('Sikertelen kapcsolódás: ' . mysql_error()); 
      } 
     
    mysql_select_db("v630i-w660i", $con); 
     
    $sql = "CREATE TABLE Adminisztratorok 
        ( 
            id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
            felhasznalonev VARCHAR(50), 
            jelszo VARCHAR(50) 
            email VARCHAR(50) 
        )"; 
     
    mysql_query($sql,$con); 
     
    $jelszo = md5('Attiss'); 
    $sql = "INSERT INTO Adminisztratorok (id, felhasznalonev, jelszo, email) VALUES 
        ( 
            '', 
            'blabla', 
            '".$jelszo."', 
            'xyz@freemail.hu' 
        )"; 
     
    mysql_query($sql,$con); 
     
    mysql_close($con); 
     
    echo  "<head>" 
          . "<title>Telepítés</title>" 
          . "<meta name=\"description\" content=\"\" />" 
          . "<meta name=\"keywords\" content=\"\" />" 
          . "<meta name=\"author\" content=\"blabla\" />" 
          . "<meta http-equiv=\"content-type\" content=\"text/html;charset=iso-8859-2\" />" 
          . "<link rel=\"stylesheet\" type=\"text/css\" href=\"../stilus.css\" />" 
          . "</head>" 
          . "<body>" 
          . "<font face=\"Verdana\" color=\"#FFFFFF\">" 
          . "<div class=\"sikeres_\"></div>" 
          . "<div class=\"sikeres\">" 
          . "<center>" 
          . "<p>" 
          . "A telepítés sikeresen lezajlott!<br />" 
          . "<a href=\"../index.php\">Adminisztrációs felület</a>" 
          . "</p>" 
          . "</center>" 
          . "</div>" 
          . "</font>" 
          . "</body>" 
          . "</html>"; 
    ?>


Még valami, a jelszó megadása kötelelző!


if (array_key_exists('belepes',$_POST['belepes'])
{
  include "config.php";
  // a jelszót megkapta-e a script?
  // a jelszó nem üres sztring, vagy csak space?
  if (array_key_exists('jelszo',$_POST) && trim($_POST['jelszo']))
    die ("A jelszó megadása kötelező.");

  $sql = @mysql_connect($dbhost,$dbuser,$dbpass);
  if (!$sql || !@mysql_select_db($dbname,$sql))
    die("Nem sikerült az adatbázishoz kapcsolódni.");

  // LIMIT 1 => 1 sort olvasunk be
  // OFFSET 3 => a 3. sortol kezdve
  $query = "SELECT `elso_oszlop` FROM `table_neve` LIMIT 1 OFFSET 3";

  $res = @mysql_query($query,$sql);
  if (!$res)
  {
    mysql_error($sql);
    mysql_close($sql);
    exit(1);
  }
  $row = mysql_fetch_row($res);
  mysql_close($sql);

  // jelszó ellenőrzés
  if ($row[0] == $_POST['jelszo'])
  {
    // átirányítás a másik oldalra:
    header("Location: vedett.php");
  }
}
else
{
?>
<form action="idenemtudommikelltalanez:<?php echo $_SERVER['PHP_SELF'];?>" method="post">
Jelszó: <br>
<input type="password" name="jelszo" />
<input type="submit" name="belepes" value="Belépés" />
</form>
<?php
}