ZeKeE
03.04.2005, 13:50
hallo ihr Liebe Community könntet ihr einen armen alten sekar helfen :D
nene spass beiseite .
Ich habe vpr einiger zeit ein Voting editor mit php gemahct.
hier der Code:
<html>
<head>
<title>
Umfrage erstellen
</title>
</head>
<body>
<?php
error_reporting(0);
$submit = $_GET["submit"];
$frage = $_GET["frage"];
$antwort1 = $_GET["antwort1"];
$antwort2 = $_GET["antwort2"];
$antwort3 = $_GET["antwort3"];
// Das Formular wurde noch nicht gesendet
if (!$submit)
{
?>
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<td>
<form action="editor_voting.php" method="get">
<table cellspacing="5">
<tr>
<td><div>Umfrage-Titel</div></td>
<td>
<input type="Text" name="frage" size="26" />
</td>
</tr>
<tr>
<td><div>Antwort 1</div></td>
<td>
<input type="Text" name="antwort1" size="26" />
</td>
</tr>
<tr>
<td><div>Antwort 2</div></td>
<td>
<input type="Text" name="antwort2" size="26" />
</td>
</tr>
<tr>
<td><div>Antwort 3</div></td>
<td>
<input type="Text" name="antwort3" size="26" />
</td>
</tr>
<td align="right" colspan="2">
<input type="submit" name="submit"
value="Umfrage erstellen" />
</td>
</table>
</form>
</td>
</tr>
</table>
<?php
}
// Das Formular wurde gesendet
else
{
// Verbindung zur Datenbank herstellen
include("include.php");
$connection = mysql_connect($server, $user, $passwort)
or die ("Konnte keine Verbindung zur Datenbank herstellen!")
$query = "INSERT INTO $tabelle (frage, antwort1, antwort2, antwort3)
VALUES ('$frage' , '$antwort1', '$antwort2', '&antwort3')";
$result = mysql_db_query($datenbank, $query, &connection) or die
("Fehler")
// Überprüfung, ob der Eintrag erfolgreich war
if ($result)
{
echo 'Die Umfrage wurde eingegeben.
<a href="voting.php">jezt ansehen</a>' ;
}
else
{
echo 'Fehler! <a href="editor_voting.php">Bitte neu eingeben</a>';
}
// Verbindung zur Datenbank schließen
mysql_close($connection);
}
?>
</body>
</html>
ja alles shcön und gut alles hat auch im editor gecklapt doch dan als iche s hochgeladen habe und es testen wollte kamm aufeinmal das:
Parse error: parse error, unexpected T_VARIABLE in /usr/export/www/vhosts/funnetwork/hosting/sekar/My SQL und meine PHP Daten/editor_voting.php on line 69
was zum henker ist der fehler?
bitte um echte mega brontale hilfe .
mfg Sekar
nene spass beiseite .
Ich habe vpr einiger zeit ein Voting editor mit php gemahct.
hier der Code:
<html>
<head>
<title>
Umfrage erstellen
</title>
</head>
<body>
<?php
error_reporting(0);
$submit = $_GET["submit"];
$frage = $_GET["frage"];
$antwort1 = $_GET["antwort1"];
$antwort2 = $_GET["antwort2"];
$antwort3 = $_GET["antwort3"];
// Das Formular wurde noch nicht gesendet
if (!$submit)
{
?>
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<td>
<form action="editor_voting.php" method="get">
<table cellspacing="5">
<tr>
<td><div>Umfrage-Titel</div></td>
<td>
<input type="Text" name="frage" size="26" />
</td>
</tr>
<tr>
<td><div>Antwort 1</div></td>
<td>
<input type="Text" name="antwort1" size="26" />
</td>
</tr>
<tr>
<td><div>Antwort 2</div></td>
<td>
<input type="Text" name="antwort2" size="26" />
</td>
</tr>
<tr>
<td><div>Antwort 3</div></td>
<td>
<input type="Text" name="antwort3" size="26" />
</td>
</tr>
<td align="right" colspan="2">
<input type="submit" name="submit"
value="Umfrage erstellen" />
</td>
</table>
</form>
</td>
</tr>
</table>
<?php
}
// Das Formular wurde gesendet
else
{
// Verbindung zur Datenbank herstellen
include("include.php");
$connection = mysql_connect($server, $user, $passwort)
or die ("Konnte keine Verbindung zur Datenbank herstellen!")
$query = "INSERT INTO $tabelle (frage, antwort1, antwort2, antwort3)
VALUES ('$frage' , '$antwort1', '$antwort2', '&antwort3')";
$result = mysql_db_query($datenbank, $query, &connection) or die
("Fehler")
// Überprüfung, ob der Eintrag erfolgreich war
if ($result)
{
echo 'Die Umfrage wurde eingegeben.
<a href="voting.php">jezt ansehen</a>' ;
}
else
{
echo 'Fehler! <a href="editor_voting.php">Bitte neu eingeben</a>';
}
// Verbindung zur Datenbank schließen
mysql_close($connection);
}
?>
</body>
</html>
ja alles shcön und gut alles hat auch im editor gecklapt doch dan als iche s hochgeladen habe und es testen wollte kamm aufeinmal das:
Parse error: parse error, unexpected T_VARIABLE in /usr/export/www/vhosts/funnetwork/hosting/sekar/My SQL und meine PHP Daten/editor_voting.php on line 69
was zum henker ist der fehler?
bitte um echte mega brontale hilfe .
mfg Sekar