<?php
include("style.css");
include("config.php");

$day = date("j");

$month = date("m");

$year = date("Y");

$space = "&nbsp;";



$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 &amp; MySQL">PHP &amp; 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 }
?>


-------------------------

kijk ik heb dus dit al ik het wil toevoeg in het scriptsysteem krijg ik sql fout dat de helft niet is toegevoeg hie ris dus de fout


$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");



<?


if (isset($_POST['Submit'])) {

if (isset($_POST['titel']) && $_POST['titel'] == '')
{
echo "Error! Titel niet ingevuld.";
}
elseif (isset($_POST['auteur']) && $_POST['auteur'] == '')
{
echo "Error! Naam niet ingevuld.";
}
elseif (isset($_POST['email']) && $_POST['email'] == '')
{
echo "Error! Email niet ingevuld.";
}
elseif (isset($_POST['uitleg']) && $_POST['uitleg'] == '')
{
echo "Error! Uitleg niet ingevuld.";
}
elseif (isset($_POST['code']) && $_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 {

?>
<?


if (isset($_POST['Submit'])) {

if (isset($_POST['titel']) && $_POST['titel'] == '')
{
echo "Error! Titel niet ingevuld.";
}
elseif (isset($_POST['auteur']) && $_POST['auteur'] == '')
{
echo "Error! Naam niet ingevuld.";
}
elseif (isset($_POST['email']) && $_POST['email'] == '')
{
echo "Error! Email niet ingevuld.";
}
elseif (isset($_POST['uitleg']) && $_POST['uitleg'] == '')
{
echo "Error! Uitleg niet ingevuld.";
}
elseif (isset($_POST['code']) && $_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 {

?>


werkt niet chek zelf ar http://amhix.no-ip.info/pchawk/v2/script%20systeem/voegtoe.php
en ik heb de andere weer er in gezet deze is iets fouts meej iemand nog een ideej je kan me ook toevoegen op msn ([email protected])
.... Waarom zeg je niet metteen dat ie em niet naar de db stuurt <_<. Zitten wij hier te kutten op die kut notices

<?
$sql = "INSERT INTO script (titel, cat, auteur, email, datum, ip, uitleg, code)
VALUES ('".$_POST['titel']."', '".$_POST['cat']."', '".$_POST['auteur']."', '".$_POST['email']."', '".$_POST['datum']."', '".$ip."', '".addslashes($_POST['uitleg'])."', '".$_POST['code']."')";
mysql_query($sql) or die (mysql_error($sql));
?>

Zoiets moet het dan worden. Maar als ik jou was zou ik eens wat turorials of zo gaan doornemen want t schiet niet echt op als je er niks van weet en je haalt maar wat scripts van internet... Elk script moet je aanpassen naar jou site anders werkt het (meestal) niet (goed).
pfffffffffffffffffffffffffffffffffffffffffff
Script is succesvol toegevoegd.
Ga naar de index


*zucht*

dat werkt dus in iedergeval wel neem ik aan. waar gaat het nu om want ik snap t niet meer. Blijft je DB leeg? of gaat het alleen om die notice dingen...
door die notice errors kan de data toch ook niet in de database worden toe gevoegd.($cat enz bestaan niet)
jewel de &cat bestaan wel maar kijk es als jij je script hebt toegevoegd leeg veld!
aah zo.. ja klopt. uuhm welke regel is nr 72? t zal die $sql wel zijn of zo. Ik zal nog eens ff kijken. ooh en wil je je script zoals het NU online staat nog eens ff posten..

tnx.

Reageren