Het is db error, show me je db eens?
Vragen topic van mij
Oh ik snap hem, MAAR hoe zet je er de datum van vandaag in?
toevoeging op 10 februari 2012, 16:58:55:
Want null kan niet
toevoeging op 10 februari 2012, 17:00:15:
Heb t al
Doormiddel van:
NOW()
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO scriptszien VALUES (
NULL,
"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$uFetche[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]",
"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]snaam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]",
"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sbericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]",
NULL
);
"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="succes">Je script staat nu op de site! <a href="index.php">Klik hier</a></div>[/COLOR][COLOR= #007700];
}[/COLOR]
?> toevoeging op 10 februari 2012, 16:58:55:
Want null kan niet
toevoeging op 10 februari 2012, 17:00:15:
Heb t al

Doormiddel van:
NOW()
Deze dingen vind je dus ook gewoon op google. Het kost ons meer moeite om reacties te posten en je vragen te lezen als het op te zoeken op google
En ik zie dat je met bovenstaande query gevoelig bent voor SQL-injection.
[COLOR= #0000BB]<?php
$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM nieuws"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$reactie_sql[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<i>Door:</i> [/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vanwie[/COLOR][COLOR= #007700]],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<i>Datum:</i> [/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]date[/COLOR][COLOR= #007700]],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<i>Bericht:</i><br> [/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]news_bericht[/COLOR][COLOR= #007700]],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br>[/COLOR][COLOR= #007700];
}[/COLOR]
?> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/uploaden/domains/manxi.nl/public_html/pages/nieuws.php on line 4
[COLOR= #0000BB]<?php
$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM nieuws"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<i>Door:</i> [/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vanwie[/COLOR][COLOR= #007700]],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<i>Datum:</i> [/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]date[/COLOR][COLOR= #007700]],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<i>Bericht:</i><br> [/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]news_bericht[/COLOR][COLOR= #007700]],[/COLOR] ENT_QUOTES[COLOR= #007700]);[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br>[/COLOR][COLOR= #007700];
}[/COLOR]
?> Kun je even zeggen wat er verandert is?
toevoeging op 15 februari 2012, 13:26:05:
Laatmaar
toevoeging op 15 februari 2012, 13:28:59:
Weet iemand een script dat als je een ip invult dat jij de site ook gewoon ziet maar met een link en mensen die die ip niet hebben gewoon de site zien zonder link?
toevoeging op 15 februari 2012, 13:26:05:
Laatmaar
toevoeging op 15 februari 2012, 13:28:59:
Weet iemand een script dat als je een ip invult dat jij de site ook gewoon ziet maar met een link en mensen die die ip niet hebben gewoon de site zien zonder link?
Een bansysteem?
Nee...
Er showt een linkje in het menu als die ip correct is, mensen die dat ip niet hebben krijgen ook de site maar dan zonder dat admin linkje,,
Er showt een linkje in het menu als die ip correct is, mensen die dat ip niet hebben krijgen ook de site maar dan zonder dat admin linkje,,
Wat dacht je van google?
If ($_SERVER[REMOTE_ADDR] == ip) {
echo link;
}
If ($_SERVER[REMOTE_ADDR] == ip) {
echo link;
}
Hoe voeg je meerdere ips toe?
een array ervan maken:
[COLOR= #0000BB]<?php
$allowed_ips[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]123.123.123.123[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]12.12.12.12[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]],[/COLOR][COLOR= #0000BB]$allowed_ips[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]link[/COLOR][COLOR= #007700];
}[/COLOR]
?> Ik weet echt niet meer hoe ik dit kan oplossen, ik heb vanalles geprobeert maar het lukt me niet, ik heb op php.net gekeken maar kon niks vinden
Ik weet dat het aan SET titel= enz ligt
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near aan=, bericht= at line 1
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE nieuws SET titel="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", aan="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", bericht="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
?> Ik weet dat het aan SET titel= enz ligt
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near aan=, bericht= at line 1
Je opent hem zo: ". en sluit hem zo: ."
Maak dit er van:
Maak dit er van:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE nieuws SET titel="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", aan="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", bericht="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
?> Bedankt
Als ik dat heb, dan doe ik f5 en dan staat er ineens niks meer in db??
Hoe los je dat op?
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/** Ophalen van de nieuwsberichten **/[/COLOR]
[COLOR= #0000BB]$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM nieuws ORDER BY id"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$uresult[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a hef="?p=newschange&id=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$uresult[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$uresult[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</a><br />[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]/** Einde van ophalen **/[/COLOR]
[COLOR= #0000BB]$uuQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM nieuws WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$uuresult[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uuQuery[/COLOR][COLOR= #007700]);[/COLOR]
?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE nieuws SET titel="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", aan="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", bericht="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
?>
<form method="post" action="?p=newschange&id=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR] ?>">
Titel: <input type="text" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uresult[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]];[/COLOR] ?>" name="titel" /><br />
Aan/Uit <input type="text" value="Aan/uit" name="aan" /><br />
Bericht <br /><textarea name="bericht" style="width: 500px; height: 150px;"></textarea><br />
<input type="submit" name="submit" value="Verander" />
</form> Als ik dat heb, dan doe ik f5 en dan staat er ineens niks meer in db??
Hoe los je dat op?