Carrear
Erfahrenes Mitglied
Then soll nur stellvertretend für die Befehle sein die in der If Abfrage stehen (in deinem Fall die MySQL Connect Befehle).
Nimm mal diesen Quellcode.
Nimm mal diesen Quellcode.
PHP:
<?php
$FilePointer = fopen("../Admin/counter/index.txt", "r+");
$Counter = fread($FilePointer, filesize("../Admin/counter/index.txt"));
$Counter++;
rewind($FilePointer);
fwrite($FilePointer, $Counter);
fclose($FilePointer);
?>
<html>
<head>
<link rel="SHORTCUT ICON" href="favicon.ico"/>
<link href="../css-js/index.css" rel="stylesheet" type="text/css" media="all" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>...::: V.I.F. meets LECTROTECH :::... ...:::;;; Update <?php if(isset($_GET['id'])) {
$id = $_GET['id'];
@MYSQL_CONNECT("localhost","***","****");
@mysql_select_db("usr_web56_2");
$query = "select DJName from User where id=$id";
$result = @MYSQL_QUERY($query);
$DJName = @MYSQL_RESULT($result,0,"DJName");
echo $DJName;
};?> ;;;:::...</title>
<style type="text/css">
.lectrotechrechts{
background-image: url(../Pics/lectrotech-rechts.jpg);
background-position: center;
background-repeat: no-repeat;
}
.viflinks{
background-image: url(../Pics/vif-links.jpg);
background-position: center;
background-repeat: no-repeat;}
</style>
</head>
<body>
<table width="100%" height="100%" border="0">
<tr>
<td align="center" valign="middle" class="viflinks"></td>
<td width="680" align="center" valign="middle">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tdtop" align="center" valign="middle" height="75">
<?php
//btn´s head
$DatabaseHost = "localhost";
$DatabaseUser = "***";
$DatabasePassword = "***";
$Database = "usr_web56_2";
$TableAktivierung = "LectrotechVIFQuelltext";
$DatabasePointer = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword);
mysql_select_db($Database, $DatabasePointer);
$sql = "SELECT * FROM $TableAktivierung";
$ausgabe=mysql_query($sql);
while ($TableAktivierung = mysql_fetch_object ($ausgabe))
{ echo($TableAktivierung->head); }?></td>
</tr>
<tr>
<td class="tdmain" align="center" valign="middle">
<?php
$DatabaseHost = "localhost";
$DatabaseUser = "****";
$DatabasePassword = "*****";
$Database = "usr_web56_2";
$TableAktivierung = "User";
if($_REQUEST['Send'])
{
$DatabasePointer = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword);
mysql_select_db($Database, $DatabasePointer);
$Erstellt = date("Y-m-d H:i:s");
$Aktivierungscode = rand(1, 99999999);
$mp3file = ("coming soon");
$query = 'UPDATE
User
SET
`User` = "'.$_REQUEST['User'].'",
`Passwort` = "'.$_REQUEST['Passwort'].'",
`DJName` = "'.$_REQUEST['DJName'].'",
`Vorname` = "'.$_REQUEST['Vorname'].'",
`Nachname` = "'.$_REQUEST['Nachname'].'",
`Act` = "'.$_REQUEST['Act'].'",
`Style` = "'.$_REQUEST['Style'].'",
`DJseit` = "'.$_REQUEST['DJseit'].'",
`HomeTown` = "'.$_REQUEST['HomeTown'].'",
`Beschreibung` = "'.$_REQUEST['Beschreibung'].'",
`Reference` = "'.$_REQUEST['Reference'].'",
`LetzterLogin` = "'.NOW.'",
`Aktivierungscode` = "'.$Aktivierungscode.'",
`Erstellt` = "'.$Erstellt.'",
`EMail` = "'.$_REQUEST['EMail'].'",
`Geburtstagjahr` = "'.$_REQUEST['jahr'].'",
`Geburtstagmonat` = "'.$_REQUEST['monat'].'",
`Geburtstagtag` = "'.$_REQUEST['tag'].'"
WHERE
`id` = "'.$id.'"';
$result = mysql_query($query) or die(mysql_error());
echo '<p>Daten erfolgreich geändert.</p>';
}
else
{
?>
<br><br>
<form action="<?php echo$_SERVER['PHP_SELF']; ?>" method="post">
<table width="583" border="0">
<tr>
<td height="30"><b>DJ Name:</b></td>
<td><input name="DJName" type="text" id="DJName" value="<?php if($id) {
@MYSQL_CONNECT("localhost","***","*****");
@mysql_select_db("usr_web56_2");
$query = "select DJName from User where id=$id";
$result = @MYSQL_QUERY($query);
$DJName = @MYSQL_RESULT($result,0,"DJName");
echo $DJName;
};?>" maxlength="50"></td>
<td></td>
<td><b>DJ seit:</b></td>
<td><input name="DJseit" type="text" id="DJseit" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","***");
@mysql_select_db("usr_web56_2");
$query = "select DJseit from User where id=$id";
$result = @MYSQL_QUERY($query);
$DJseit = @MYSQL_RESULT($result,0,"DJseit");
echo $DJseit;};?>" maxlength="50"></td>
</tr>
<tr>
<td height="30"><b>Act:</b></td>
<td>
<input type="text" name="Style" id="Style" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Act from User where id=$id";
$result = @MYSQL_QUERY($query);
$Act = @MYSQL_RESULT($result,0,"Act");
echo $Act;};?>"><br>
<font size="1px">Bsp.: DJ,Live-Act & Producer</font></td>
<td></td>
<td>Gebutstag:</td>
<td><select name="tag" id="tag">
<option selected="selected" value="keine angaben"><?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Geburtstagtag from User where id=$id";
$result = @MYSQL_QUERY($query);
$Geburtstagtag = @MYSQL_RESULT($result,0,"Geburtstagtag");
echo $Geburtstagtag;};?></option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="monat" id="monat">
<option selected="selected" value="keine angaben"><?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Geburtstagmonat from User where id=$id";
$result = @MYSQL_QUERY($query);
$Geburtstagmonat = @MYSQL_RESULT($result,0,"Geburtstagmonat");
echo $Geburtstagmonat;};?></option>
<option value="01">Januar</option>
<option value="02">Februar</option>
<option value="03">März</option>
<option value="04">April</option>
<option value="05">Mai</option>
<option value="06">Juni</option>
<option value="07">Juli</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">Oktober</option>
<option value="11">November</option>
<option value="12">Dezember</option>
</select>
<select name="jahr" id="jahr">
<option selected="selected" value="keine angaben"><?php if($id) {
@MYSQL_CONNECT("localhost","***","****");
@mysql_select_db("usr_web56_2");
$query = "select Geburtstagjahr from User where id=$id";
$result = @MYSQL_QUERY($query);
$Geburtstagjahr = @MYSQL_RESULT($result,0,"Geburtstagjahr");
echo $Geburtstagjahr;};?></option>
<option value="1984">1993</option>
<option value="1983">1992</option>
<option value="1982">1991</option>
<option value="1981">1990</option>
<option value="1980">1989</option>
<option value="1988">1988</option>
<option value="1987">1987</option>
<option value="1986">1986</option>
<option value="1985">1985</option>
<option value="1984">1984</option>
<option value="1983">1983</option>
<option value="1982">1982</option>
<option value="1981">1981</option>
<option value="1980">1980</option>
<option value="1979">1979</option>
<option value="1978">1978</option>
<option value="1977">1977</option>
<option value="1976">1976</option>
<option value="1975">1975</option>
<option value="1974">1974</option>
<option value="1973">1973</option>
<option value="1972">1972</option>
<option value="1971">1971</option>
<option value="1970">1970</option>
<option value="1969">1969</option>
<option value="1968">1968</option>
<option value="1967">1967</option>
<option value="1966">1966</option>
<option value="1965">1965</option>
<option value="1964">1964</option>
<option value="1963">1963</option>
<option value="1962">1962</option>
<option value="1961">1961</option>
<option value="1960">1960</option>
<option value="1959">1959</option>
<option value="1985">1958</option>
<option value="1957">1957</option>
<option value="1956">1956</option>
</select>
</td>
</tr>
<tr>
<td height="30"><b>Style:</b></td>
<td><input name="Style" type="text" id="Style" maxlength="50" value="<?php if($id) {
@MYSQL_CONNECT("localhost","***","****");
@mysql_select_db("usr_web56_2");
$query = "select Style from User where id=$id";
$result = @MYSQL_QUERY($query);
$Style = @MYSQL_RESULT($result,0,"Style");
echo $Style;};?>"></td>
<td></td>
<td><b>EMail</b></td>
<td><input maxlength="255" name="EMail" type="text" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select EMail from User where id=$id";
$result = @MYSQL_QUERY($query);
$EMail = @MYSQL_RESULT($result,0,"EMail");
echo $EMail;};?>"></td>
</tr>
<tr>
<td height="30"><b>Home Town:</b></td>
<td><input name="HomeTown" type="text" id="HomeTown" maxlength="50" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select HomeTown from User where id=$id";
$result = @MYSQL_QUERY($query);
$HomeTown = @MYSQL_RESULT($result,0,"HomeTown");
echo $HomeTown;};?>"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="30"><b>Vorname:</b></td>
<td><input name="Vorname" type="text" id="Vorname" maxlength="50" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Vorname from User where id=$id";
$result = @MYSQL_QUERY($query);
$Vorname = @MYSQL_RESULT($result,0,"Vorname");
echo $Vorname;
};?>"></td>
<td></td>
<td><b>Nachname:</b></td>
<td><input name="Nachname" type="text" id="Nachname" maxlength="50" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Nachname from User where id=$id";
$result = @MYSQL_QUERY($query);
$Nachname = @MYSQL_RESULT($result,0,"Nachname");
echo $Nachname;
};?>"></td>
</tr>
<tr>
<td height="10"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="30"><b>Username:</b></td>
<td><input name="User" type="text" id="User" maxlength="50" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select User from User where id=$id";
$result = @MYSQL_QUERY($query);
$User = @MYSQL_RESULT($result,0,"User");
echo $User;
};?>"></td>
<td></td>
<td><b>Passwort:</b></td>
<td><input name="Passwort" type="password" id="Passwort" maxlength="40" value="<?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Passwort from User where id=$id";
$result = @MYSQL_QUERY($query);
$Passwort = @MYSQL_RESULT($result,0,"Passwort");
echo $Passwort;
};?>"></td>
</tr>
<tr>
<td height="10"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="80" valign="top"><b><br>Beschreibung:</b></td>
<td><textarea name="Beschreibung" type="text" id="Beschreibung" rows="8" cols="25"><?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Beschreibung from User where id=$id";
$result = @MYSQL_QUERY($query);
$Beschreibung = @MYSQL_RESULT($result,0,"Beschreibung");
echo $Beschreibung;};?>
</textarea></td>
<td></td>
<td valign="top"><b><br>Referenz:</b></td>
<td><textarea name="Reference" type="text" id="Reference" rows="8" cols="25"><?php if($id) {
@MYSQL_CONNECT("localhost","****","****");
@mysql_select_db("usr_web56_2");
$query = "select Reference from User where id=$id";
$result = @MYSQL_QUERY($query);
$Reference = @MYSQL_RESULT($result,0,"Reference");
echo $Reference;};?></textarea></td>
</tr>
<tr>
<td height="10"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="30"></td>
<td align="center" colspan="2"><input name="clear"type="reset" value="Löschen"></td>
<td></td>
<td align="center" colspan="2"><input name="Send" type="submit" value="Speichern"></td>
<td></td>
</tr>
</table>
</form>
<?php
}
?></td>
</tr>
<tr>
<td class="tdbottom" align="center" valign="middle" height="65">
<?php
//btn´s head
$DatabaseHost = "localhost";
$DatabaseUser = "****";
$DatabasePassword = "****";
$Database = "usr_web56_2";
$TableAktivierung = "LectrotechVIFQuelltext";
$DatabasePointer = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword);
mysql_select_db($Database, $DatabasePointer);
$sql = "SELECT * FROM $TableAktivierung";
$ausgabe=mysql_query($sql);
while ($TableAktivierung = mysql_fetch_object ($ausgabe))
{ echo($TableAktivierung->bottom); }?></td>
</tr>
</table>
</tr></table></td></td>
<td align="center" valign="middle" class="lectrotechrechts"></td>
</td>
</tr>
</table>
</body>
</html>
Zuletzt bearbeitet: