<html>
<head>
<link rel="stylesheet" type="text/css" href="../sheets/pages.css">
<title>Biografie</title>
</head>
<body>
<b><div class="header">Contact Management</div></b><br>
Klik hier voor <a href="hulp.php#contact" target="_blank">hulp</a><hr><br>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" width="50%">
<b>Contact updaten:</b><br>
<?
$mysql_user = "chriz"; // je mysql login naam
$mysql_pass = "e3340"; // je mysql wachtwoord
$mysql_host = "localhost"; // de host van je mysql database (localhost is meestal wel oke)
$mysql_dbn = "celexa"; // de naam van je database
if (!@mysql_select_db($mysql_dbn, @mysql_connect($mysql_host, $mysql_user, $mysql_pass)))
{
echo "Database connectie mislukt!";
exit();
}
if ($_POST['submit'])
{
$sql = "UPDATE celexa_contact SET ";
$sql .= ", chris = '" . $_POST['toemailc'] . "'";
$sql .= ", peter = '" . $_POST['toemailp'] . "'";
$sql .= ", dirk = '" . $_POST['toemaild'] . "'";
$sql .= ", emiel = '" . $_POST['toemaile'] . "'";
$sql .= ", jancees = '" . $_POST['toemailj'] . "'";
$sql .= ", esther = '" . $_POST['toemailes'] . "'";
$sql .= ", subject = '" . $_POST['subject'] . "'";
$sql .= ", nepnaam = '" . $_POST['nepnaam'] . "'";
$sql .= ", nepmail = '" . $_POST['nepmail'] . "'";
$res = mysql_query($sql);
if ($res)
{
echo "<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">";
echo "Email Chris:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailc'] . "\">";
echo "Email Peter:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailp'] . "\">";
echo "Email Dirk:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemaild'] . "\">";
echo "Email Jan Cees:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailj'] . "\">";
echo "Email Emiel:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemaile'] . "\">";
echo "Email Esther:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailes'] . "\">";
echo "Van Naam:<input type=\"text\" name=\"nepmail\" value=\"" . $_POST['nepmail'] . "\">";
echo "Van Email:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['nepmail'] . "\">";
echo "Onderwerp:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['subject'] . "\">";
echo "<input type=\"submit\" name=\"submit\" value=\"Contact updaten\">";
echo "</form>";
}
else
echo "Contact intstellingen zijn niet geupdate. Er is iets misgegaan";
}
else
{
if ($_POST['submit'])
echo "Foutje, probeer het eens opnieuw";
echo "<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">";
echo "Email Chris:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailc'] . "\">";
echo "Email Peter:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailp'] . "\">";
echo "Email Dirk:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemaild'] . "\">";
echo "Email Jan Cees:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailj'] . "\">";
echo "Email Emiel:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemaile'] . "\">";
echo "Email Esther:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['toemailes'] . "\">";
echo "Van Naam:<input type=\"text\" name=\"nepmail\" value=\"" . $_POST['nepmail'] . "\">";
echo "Van Email:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['nepmail'] . "\">";
echo "Onderwerp:<input type=\"text\" name=\"toemail\" value=\"" . $_POST['subject'] . "\">";
echo "<input type=\"submit\" name=\"submit\" value=\"Contact updaten\">";
echo "</form>";
}
?>
</td>
<td valign="top" width="50%">
<b>Huidige instellingen:</b><br>
<?
$mysql_user = "chriz"; // je mysql login naam
$mysql_pass = "e3340"; // je mysql wachtwoord
$mysql_host = "localhost"; // de host van je mysql database (localhost is meestal wel oke)
$mysql_dbn = "celexa"; // de naam van je database
if (!@mysql_select_db($mysql_dbn, @mysql_connect($mysql_host, $mysql_user, $mysql_pass)))
{
echo "Database connectie mislukt!";
exit();
}
$sql = "SELECT chris, peter, emiel, esther, jancees, dirk, subject, nepmail, nepnaam FROM celexa_contact";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
while ($row = mysql_fetch_array($res))
{
$chris = $row['chris']);
$peter = $row['peter']);
$dirk = $row['dirk']);
$esther = $row['esther']);
$emiel = $row['emiel']);
$jancees = $row['jancees']);
$subject = $row['subject']);
$nepnaam = $row['nepnaam']);
$nepmail = $row['nepmail']);
echo "<br>Chris: " . $chris . "<br>Peter: " . $peter . "<br>dirk: " . $dirk . "<br>Jan Cees: " . $jancees . "<br>Emiel: " . $emiel . "<br>Esther: " . $esther . "";
echo "<br>Van Naam: " . $nepnaam . "<br>Van Email" . $nepmail . "<br>Onderwerp" . $subject . "";
}
}
else
echo "<br>Er zijn geen instellingen";
?>
</td>
</tr>
</table>
</body>
<html>
er zit er 1 in, rond lijn 93, dit gebied dus:
$sql = "SELECT chris, peter, emiel, esther, jancees, dirk, subject, nepmail, nepnaam FROM celexa_contact";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
while ($row = mysql_fetch_array($res))
maar ik kan m niet vinden, ik zie m over het hoofd denk ik
kan iemand m vinden, dankje
487 views