Probleme mit chmod und unlink und Login-Formular
| Beiträge: 81 Registriert: Sep 2010
| 25.04.2011, 13:05
Hi Flashhilfe,
Im Grunde habe ich zwei Probleme, dass Erste geht um chmod und unlink, ich möchte die Rechte eines Dokuments auf 777 setzen und danach löschen, hier der Quellcode:
PHP:1 2 3 4 5 6 7
|
[ Quellcode der Datei ]
chmod("./example.php", 0777);
unlink("./example.php");
[ Quellcode der Datei ]
|
Dann kommt diese Fehlermeldung:
Warning: chmod() [function.chmod]: Operation not permitted in /is/htdocs/wp10566749_44VU8X7TT5/kazaku/beta/example.php on line 220
Warning: unlink(./example.php) [function.unlink]: Permission denied in /is/htdocs/wp10566749_44VU8X7TT5/kazaku/beta/example.php on line 221
Und mein zweites Problem handelt sich um mein Login-Formular, es funktioniert zwar, aber nur bei einigen Hostern, anstatt zur Administration weiterzuleiten, kommt bei diesen Hostern die Fehlermeldung.
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
<?php
session_start();
echo "<!DOCTYPE html>rn"
. "<html dir="ltr" lang="de">rn"
. "<head>rn";
// MySQL connect
require("./contents/mysql_connect.php");
// HTTP settings
$domain = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
$query_string = $_SERVER['QUERY_STRING'];
$uri = "".$domain."".$request_uri."";
mysql_connect($mysql['server'], $mysql['user'], $mysql['password']);
mysql_select_db($mysql['database']);
if(empty($query_string))
{
$title_end = "Login";
}
elseif(!empty($query_string))
{
$title_end = "Fehler";
}
else
{
$title_end = "Fehler";
}
$result = mysql_query("SELECT user FROM kazaku_user WHERE id = 1");
$view = mysql_fetch_object($result);
echo "t<title>".$view->user." - $title_end</title>rn";
unset($title_end);
unset($result);
unset($view);
mysql_real_escape_string($mysql['server']);
mysql_close();
// Head settings
require("./contents/head.php");
echo "</head>rn";
// Background settings
require("./contents/background_settings.php");
echo "<body style="background-color:".$view->background.";">rn";
unset($result);
unset($view);
echo "t<div id="wrapper">rn"
. "tt<div id="header">rn"
. "ttt<!-- Header-Section -->rn";
// Header settings
require("./contents/header_settings.php"); echo "rn";
echo "tt</div>rn";
// Display settings
require("./contents/display_settings.php");
echo "tt<div style="display:$view_banner;$banner_margin_top" id="banner">rn"
. "ttt<!-- Banner-Section -->rn";
// Banner settings
require("./contents/banner_settings.php"); echo "rn";
echo "tt</div>rn"
. "tt<div style="display:$view_headline;$headline_margin_top" id="headline">rn"
. "ttt<!-- Headline-Section -->rn";
unset($view_banner);
unset($view_headline);
// Headline settings
require("./contents/headline_settings.php"); echo "rn";
echo "tt</div>rn"
. "tt<div id="navigation">rn"
. "ttt<!-- Navigation-Section -->rn";
// Navigation settings
require("./contents/nav_settings.php");
echo "tt</div>rn"
. "tt<div id="content">rn"
. "ttt<div style="width:100%;" id="main">rn"
. "tttt<!-- Main-Section -->rn";
// Main settings
echo "tttt<h1>Login</h1>rn"
. "tttt<form name="login" method="post">rn"
. "tttt<p>Benutzername:<input class ="button" type="text" name="username" maxlength="20" /></p>rn"
. "tttt<p>Passwort:<input class ="button" type="password" name="password" maxlength="20" /></p>rn"
. "tttt<p><input class ="button" type="submit" name="login" value="Einloggen" /></p>rn"
. "tttt</form>rn";
mysql_connect($mysql['server'], $mysql['user'], $mysql['password']);
mysql_select_db($mysql['database']);
if(isset($_POST['login']) === TRUE)
{
$username = $_POST['username'];
$query = "SELECT user, password FROM kazaku_user WHERE user LIKE '$username' LIMIT 1";
$result = mysql_query($query);
$view = mysql_fetch_object($result);
if($view->password == $password)
{
$_SESSION["username"] = $username;
echo "tttt<meta http-equiv="refresh" content="0; url=./administration.php">rn";
unset($username);
unset($query);
unset($result);
unset($view);
}
else
{
echo "tttt<p $error>Benutzername und/oder Passwort waren falsch, <a href="./login.php" title="Erneut einloggen">erneut einloggen</a> oder <a href="./" title= "Zur Startseite">zur Startseite</a> zurückkehren.</p>rn";
}
}
mysql_real_escape_string($mysql['server']);
mysql_close();
echo "ttt</div>rn"
. "tt</div>rn"
. "tt<div id="footer">rn"
. "ttt<!-- Footer-Section -->rn";
// Footer settings
require("./contents/footer_settings.php"); echo "rn";
echo "tt</div>rn"
. "tt<p id="placeholder"><!-- Placeholder --></p>rn"
. "t</div>rn"
. "</body>rn"
. "</html>";
?>
|
Gruß,
Paddy | Geändert von Paddy95 am 25.04.11 um 13:06 Uhr | |
| | Beiträge: 81 Registriert: Sep 2010
Themenautor/in
| 26.04.2011, 19:16
Das Löschen der Datei funktioniert bei mein lokalen Webspace, nur halt nicht auf mein Webspace von Host Europe, muss ich da irgendwas in PHP ergänzen?
Das zweite Problem ist unverändert :(
Wüsste wirklich nicht, woran es liegt, das mein Login nur bei manchen Hostern funktioniert. | | | Beiträge: 3000 Wohnort: Köln Registriert: Oct 2007
| 27.04.2011, 00:31
|
|