srry van het vorige topic dat was helemaal verne*kt
maar voegtoe.php zit een fout en in script.php ik laat ze wel even zien .
--------------------------------------
voegtoe.php
--------------------------------------
<?php
include("style.css");
include("config.php");
$day = date("j");
$month = date("m");
$year = date("Y");
$space = " ";
$month = str_replace("01", "Januari", $month);
$month = str_replace("02", "Februari", $month);
$month = str_replace("03", "Maart", $month);
$month = str_replace("04", "April", $month);
$month = str_replace("05", "Mei", $month);
$month = str_replace("06", "Juni", $month);
$month = str_replace("07", "Juli", $month);
$month = str_replace("08", "Augustus", $month);
$month = str_replace("09", "September", $month);
$month = str_replace("10", "Oktober", $month);
$month = str_replace("11", "November", $month);
$month = str_replace("12", "December", $month);
$time = date("H:i:s");
$datum = $day.$space.$month.$space.$year;
if ($_POST) {
if ($_POST['titel'] == '')
{
echo "Error! Titel niet ingevuld.";
}
elseif ($_POST['auteur'] == '')
{
echo "Error! Naam niet ingevuld.";
}
elseif ($_POST['email'] == '')
{
echo "Error! Email niet ingevuld.";
}
elseif ($_POST['uitleg'] == '')
{
echo "Error! Uitleg niet ingevuld.";
}
elseif ($_POST['code'] == '')
{
echo "Error! Code niet ingevuld.";
}
else {
$sql = "INSERT INTO script (titel, cat, auteur, email, datum, ip, uitleg, code)
VALUES ('".$titel."', '".$cat."', '".$auteur."', '".$email."', '".$datum."', '".$ip."', '".addslashes($_POST['uitleg'])."', '".$code."')";
mysql_query($sql) or die ("fout in query");
echo "Script is succesvol toegevoegd.<p>";
echo "<a href=\"scripts.php\">Ga naar de index</a>";
}
}
else {
?>
<form action="voegtoe.php" method="post">
<b>Titel:</b><br>
<input type="text" name="titel">
<br>
<b>Categorie:</b><br>
<select name="cat">
<option>Kies je Categorie</option>
<option>--------------------</option>
<option value="HTML">HTML</option>
<option value="PHP">PHP</option>
<option value="PHP & MySQL">PHP & MySQL</option>
<option value="MySQL">MySQL</option>
<option value="Javascript">Javascript</option>
<option value="CSS">CSS</option>
<option value="Overige">Overige</option>
</select>
<br>
<b>Auteur:</b><br>
<input type="text" name="auteur">
<br>
<b>E-mail:</b><br>
<input type="text" name="email">
<br>
<br>
<b>Uitleg:</b>
<p>
<textarea name="uitleg" cols="90" rows="10" id="uitleg"></textarea>
<br>
<br><b>Code:</b><p>
<textarea name="code" cols="90" rows="10" id="code"></textarea>
<p><input type="submit" name="Submit" value="Toevoegen">
</form>
<?php }
?>
--------------------------------
de fout bij voegtoe.php is dat als je een script wilt toevoeg hij niet in de database komt te staan hij komt wel maar voor de helft.
en script.php
<?php
include("style.css");
include("config.php");
include("code.php");
$select = "SELECT * FROM script WHERE id = '".$_GET['id']."'";
if ($_GET['id'] == '') {
echo "Deze script bestaat niet (meer).";
}
else {
$query = mysql_query($select);
while ($row = mysql_fetch_array($query)) {
?>
<h1><?php echo "$row[titel]"; ?></h1>
<table width="400" border="0">
<tr>
<td>
<p>Gepost door: <?php echo "<b>$row[auteur]</b>"; ?><br>
Categorie: <?php echo "<b>$row[cat]</b>"; ?><br>
Datum: <?php echo "<b>$row[datum]</b>"; ?><br>
E-mail: <?php echo "<b>$row[email]</b>";?></p>
<p> </p></td>
</tr>
</table>
<table width="400" border="0">
<tr>
<td bgcolor="#f2f2f2"><div align="left"><font color="#333333">
<strong>Uitleg</strong>
</font></div></td>
</tr>
</table><br>
<?php
/* hier ook al niet
$bericht = text_chop($bericht, 40); */
echo "$row[uitleg]";?><br><br>
<table width="400" border="0">
<tr>
<td bgcolor="#f2f2f2"><div align="left"><font color="#333333"><strong>Code</strong></font></div></td>
</tr>
</table>
<br>
<table width="400" style="border: 1px solid #000000" cellpadding"0" cellspacing"0">
<tr><td><?
$code = "".$row[code]."";
regel($code); ?>
</td>
</tr>
</table>
<?
}
}
?>
hier krijg ik ook een fout chek www.amhix.no-ip.info/pchawk/v2 dan script systeem.
kan iemand helpen
531 views