Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions config.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
mysql_connect("localhost", "DB-USERNAME", "DB_PASSWORD") or die("Fehler bei der Verbindung mit der Datenbank.");
mysql_select_db("netorial");
error_reporting(E_ERROR | E_WARNING | E_PARSE);
define('DB_HOST', 'Database Host (e.g. localhost)');
define('DB_NAME', 'Database Name (e.g. netorial)');
define('DB_USERNAME', 'Database Username (e.g. root)');
define('DB_PASS', 'Database Password (e.g. pass)');


mysql_connect(DB_HOST, DB_USERNAME, DB_PASS) or die("Fehler bei der Verbindung mit der Datenbank.");
mysql_select_db(DB_NAME);
?>
6 changes: 3 additions & 3 deletions creat_page.php → create_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
exit;
}
//Seite anlegen
if($_POST['creat'])
if($_POST['create'])
{
//Eingaben absichern, auf SQL-Injection
$name = mysql_real_escape_string($_POST['name']);
Expand All @@ -31,7 +31,7 @@
<div id="logo"></div>
<div id="sub-navi"><?php echo $friendship_request; ?><a href="profile.php?p=<?php echo $userProfile['id']; ?>">Mein Profil</a></div>
<div id="content">
<div id="navi"><a href="creat_page.php">Seite anlegen</a></div>
<div id="navi"><a href="create_page.php">Seite anlegen</a></div>
<div id="main-content">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Name:<br>
Expand All @@ -40,7 +40,7 @@
<textarea name="ueber" style="width:100%; height:75px;"></textarea><br>
Website:<br>
<input type="text" name="ws" style="width:100%;"/>
<input type="submit" name="creat" value=" Seite erstellen "/>
<input type="submit" name="create" value=" Seite erstellen "/>
</form>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion home.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<p style="clear:both;"></p>
<div id="content">
<div id="navi">
<a href="creat_page.php">Seite anlegen</a><br/>
<a href="create_page.php">Seite anlegen</a><br/>
<a href="newGroup.php">Neue Gruppe</a>
</div>
<div id="main-content">
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
session_start();
require_once('config.php');
if(isset($_SESSION['userid']))
{
//Weiterleitung
Expand Down
3 changes: 1 addition & 2 deletions login.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
session_start();
//Datenbankverbindung
mysql_connect("localhost", "root", "") or die("Fehler bei der Verbindung mit der Datenbank.");
mysql_select_db("netorial");
require_once('config.php');
//Loginprozess
$email = $_POST['email'];
$password = $_POST['password'];
Expand Down
6 changes: 3 additions & 3 deletions newGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
exit;
}
//Seite anlegen
if($_POST['creat'])
if($_POST['create'])
{
//Eingaben absichern, auf SQL-Injection
$name = mysql_real_escape_string($_POST['name']);
Expand All @@ -27,12 +27,12 @@
<div id="logo"></div>
<div id="sub-navi"><?php echo $friendship_request; ?><a href="profile.php?p=<?php echo $userProfile['id']; ?>">Mein Profil</a></div>
<div id="content">
<div id="navi"><a href="creat_page.php">Seite anlegen</a></div>
<div id="navi"><a href="create_page.php">Seite anlegen</a></div>
<div id="main-content">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Name:<br>
<input type="text" name="name" style="width:100%;"/><br>
<input type="submit" name="creat" value="Erstellen"/>
<input type="submit" name="create" value="Erstellen"/>
</div>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions reg.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
$email = htmlentities($email);
$password = md5($password);
//Verbindung mit Datenbank
mysql_connect("localhost", "root", "") or die("Fehler bei der Verbindung mit der Datenbank.");
mysql_select_db("netorial");
require_once('config.php');
//�berpr�fen, ob E-Mail schon vorhanden
$selectEMail = mysql_query("SELECT * FROM user WHERE email = '{$email}'");
if(mysql_num_rows($selectEMail) == 0)
Expand Down