PHP interesse |
|
Even kijken...
Hier:
else {
$dd = '';
$q = sprintf("SELECT * FROM members WHERE login = '".$_POST['aan']."'");
$db->query($q);
$db->next_record();
if(empty($db->f('ID'))) {
$dd = "<dd>- $_POST['aan'] bestaat niet.</dd>"; }
if(empty($_POST['subject'])) {
$dd .= "<dd>- Onderwerp is leeg.</dd>"; }
if(empty($_POST['Bericht'])) {
$dd .= "<dd>- Geen bericht ingevuld.</dd>"; }
if(empty($dd)) {
$idt = $db->f('ID');
$q = sprintf("INSERT INTO privebericht SET onderwerp = '%s', Bericht = '%s', van = '%s', aan = '%s', datum = NOW()",
$_POST['subject'], $_POST['Bericht'], $_SESSION['login'], $idt);
$db->query($q);
}
else { ?>
<tr><td colspan="3"><fieldset><legend>Bericht posten.</legend><dl style="color: #DC143C; font-weight: bold;"><?=$dd; ?></dl></fieldset></td></tr>
<tr><td><form action="<?=$_SERVER['PHP_SELF'];?>" method="post" name="myForm">
Aan:</td><td colspan="2"><input type="text" name="aan" id="aan" value="<?=$_POST['aan']; ?>" /></td></tr>
<tr><td>Subject:</td><td colspan="2"><input type="text" name="subject" id="subject" value="<?=$_POST['subject']; ?>" /></td></tr>
<tr><td>Bericht:</td><td colspan="2"><textarea rows="10" cols="50" name="Bericht" id="Bericht" onKeyDown="textCounter(document.myForm.Bericht,document.myForm.remLen1,200)"
onKeyUp="textCounter(document.myForm.Bericht,document.myForm.remLen1,200)"><?=$_POST['Bericht']; ?></textarea></td></tr><tr><td colspan="3" align="right"><input readonly type="text" name="remLen1" size="3" maxlength="3" value="200"></td></tr>
<tr><td></td><td><button type="submit" name="Submit">Verstuur</button></td><td><button type="reset">Reset</button></form></td></tr>
<?php }
}
else { $dd = ''; $q = sprintf("SELECT * FROM members WHERE login = '".$_POST['aan']."'"); $db->query($q); $db->next_record(); if(empty($db->f('ID'))) { $dd = "<dd>- $_POST['aan'] bestaat niet.</dd>"; } if(empty($_POST['subject'])) { $dd .= "<dd>- Onderwerp is leeg.</dd>"; } if(empty($_POST['Bericht'])) { $dd .= "<dd>- Geen bericht ingevuld.</dd>"; } if(empty($dd)) { $idt = $db->f('ID'); $q = sprintf("INSERT INTO privebericht SET onderwerp = '%s', Bericht = '%s', van = '%s', aan = '%s', datum = NOW()", $_POST['subject'], $_POST['Bericht'], $_SESSION['login'], $idt); $db->query($q); } else { ?> <tr><td colspan="3"><fieldset><legend>Bericht posten.</legend><dl style="color: #DC143C; font-weight: bold;"><?=$dd; ?></dl></fieldset></td></tr> <tr><td><form action="<?=$_SERVER['PHP_SELF'];?>" method="post" name="myForm"> Aan:</td><td colspan="2"><input type="text" name="aan" id="aan" value="<?=$_POST['aan']; ?>" /></td></tr> <tr><td>Subject:</td><td colspan="2"><input type="text" name="subject" id="subject" value="<?=$_POST['subject']; ?>" /></td></tr> <tr><td>Bericht:</td><td colspan="2"><textarea rows="10" cols="50" name="Bericht" id="Bericht" onKeyDown="textCounter(document.myForm.Bericht,document.myForm.remLen1,200)" onKeyUp="textCounter(document.myForm.Bericht,document.myForm.remLen1,200)"><?=$_POST['Bericht']; ?></textarea></td></tr><tr><td colspan="3" align="right"><input readonly type="text" name="remLen1" size="3" maxlength="3" value="200"></td></tr> <tr><td></td><td><button type="submit" name="Submit">Verstuur</button></td><td><button type="reset">Reset</button></form></td></tr> <?php } }
$db->query is wel logisch toch?
$db->next_record ook toch? |