Iets uit database verwijderen

Gestart doorEwan23 reacties91 weergaven

24 berichten · pagina 1 van 2

Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi,

Ik wil dingen vanuit een form in een database zetten?
Hoe doe ik dit het simpelst? Met dingen van Google kom ik er niet uit sadley
Groeten,
Ewan
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
gewoon, zo:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO naam (naam, mail, achternaam) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mail[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]anaam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Gelukt![/COLOR][COLOR= #007700];
}[/COLOR]
?>
<form name="naam" method="POST" action="#">
Naam: <input type="text" name="naam" /><br />
Mail: <input type="text" name="mail" /><br />
Achternaam: <input type="text" name="anaam" /><br />
<input type="submit" name="submit" value="Versturen" />
</form>


Dit heb ik via one2xs geschreven, en heel simpel zonder error reporting. (zoals: je hebt niks ingevuld etc.)
0
Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
                            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
                            {[/COLOR]
                                [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO nieuws (titel, categorie, banner, auteur, bericht) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]banner[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Het nieuwsbericht is gepost![/COLOR][COLOR= #007700];
                            }[/COLOR]
                        ?>
                        <form name="nieuws" method="POST" action="#">
                        Titel:<br /><input type="text" name="titel" size="30"/><br />
                        Categorie:<br /><select name="categorie"><option>Algemeen</option><option>Release</option><option>Pre-Release</option><option>Tutorial</option><option>Mojang</option><option>Update</option><option>Site</option><option>Snapshot</option></select><br />
                        Banner:<br /><input type="text" name="banner" size="30"/><br />
                        Auteur:<br /><select name="categorie"><option>---</option><option>---</option></select><br />
                        Bericht:<br /><textarea rows="7" cols="50"></textarea><br />
                        <input type="submit" value="Verstuur" />
                        </form>


Ik heb nu dit maar dat werkt niet sadley
toevoeging op 9 augustus 2012, 18:47:51:
Ah ik moest: name="submit" nog toevoegen bij de verstuur button

toevoeging op 9 augustus 2012, 18:49:27:
Nu krijg ik deze errors:

Notice: Undefined index: auteur in /home/ewan/domains/ewanoomen.nl/public_html/minecraftsite/admin/nieuws.php on line 64

Notice: Undefined index: bericht in /home/ewan/domains/ewanoomen.nl/public_html/minecraftsite/admin/nieuws.php on line 64


Terwijl die wel bestaan?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Voeg ook eens id="bericht" enz. toe.
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
                            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
                            {[/COLOR]
                                [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO nieuws (titel, categorie, banner, auteur, bericht) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]banner[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Het nieuwsbericht is gepost![/COLOR][COLOR= #007700];
                            }[/COLOR]
                        ?>
                        <form name="nieuws" method="POST" action="#">
                        Titel:<br /><input type="text" name="titel" size="30"/><br />
                        Categorie:<br /><select name="categorie"><option>Algemeen</option><option>Release</option><option>Pre-Release</option><option>Tutorial</option><option>Mojang</option><option>Update</option><option>Site</option><option>Snapshot</option></select><br />
                        Banner:<br /><input type="text" name="banner" size="30"/><br />
                        Auteur:<br /><select name="categorie" name="auteur"><option>---</option><option>---</option></select><br />
                        Bericht:<br /><textarea rows="7" cols="50" name="bericht"></textarea><br />
                        <input type="submit" name="submit" value="Verstuur" />
                        </form>


zo?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Er waar is onze foutenafhandeling ?
0
Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maartenl schreef:
Er waar is onze foutenafhandeling ?
Is er niet

toevoeging op 9 augustus 2012, 19:30:23:
Bartv schreef:
[COLOR= #0000BB]<?php[/COLOR]
                            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
                            {[/COLOR]
                                [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO nieuws (titel, categorie, banner, auteur, bericht) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]banner[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Het nieuwsbericht is gepost![/COLOR][COLOR= #007700];
                            }[/COLOR]
                        ?>
                        <form name="nieuws" method="POST" action="#">
                        Titel:<br /><input type="text" name="titel" size="30"/><br />
                        Categorie:<br /><select name="categorie"><option>Algemeen</option><option>Release</option><option>Pre-Release</option><option>Tutorial</option><option>Mojang</option><option>Update</option><option>Site</option><option>Snapshot</option></select><br />
                        Banner:<br /><input type="text" name="banner" size="30"/><br />
                        Auteur:<br /><select name="categorie" name="auteur"><option>---</option><option>---</option></select><br />
                        Bericht:<br /><textarea rows="7" cols="50" name="bericht"></textarea><br />
                        <input type="submit" name="submit" value="Verstuur" />
                        </form>
zo?

Dan heb ik deze error nog:

Notice: Undefined index: auteur in /home/ewan/domains/---/admin/nieuws.php on line 64
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
                            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
                            {[/COLOR]
                                [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO nieuws (titel, categorie, banner, auteur, bericht) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]banner[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Het nieuwsbericht is gepost![/COLOR][COLOR= #007700];
                            }[/COLOR]
                        ?>
                        <form name="nieuws" method="POST" action="#">
                        Titel:<br /><input type="text" name="titel" size="30"/><br />
                        Categorie:<br /><select name="categorie"><option>Algemeen</option><option>Release</option><option>Pre-Release</option><option>Tutorial</option><option>Mojang</option><option>Update</option><option>Site</option><option>Snapshot</option></select><br />
                        Banner:<br /><input type="text" name="banner" size="30"/><br />
                        Auteur:<br /><select name="auteur"><option>---</option><option>---</option></select><br />
                        Bericht:<br /><textarea rows="7" cols="50" name="bericht"></textarea><br />
                        <input type="submit" name="submit" value="Verstuur" />
                        </form>


zo?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
1. controle :
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"POST"[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]


2. Foutenafhandeling :

[COLOR= #0000BB]<?
$addQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"QUERY"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$addQuery[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]error[COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
// ok
0
Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bartv schreef:
[COLOR= #0000BB]<?php[/COLOR]
                            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
                            {[/COLOR]
                                [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO nieuws (titel, categorie, banner, auteur, bericht) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]banner[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Het nieuwsbericht is gepost![/COLOR][COLOR= #007700];
                            }[/COLOR]
                        ?>
                        <form name="nieuws" method="POST" action="#">
                        Titel:<br /><input type="text" name="titel" size="30"/><br />
                        Categorie:<br /><select name="categorie"><option>Algemeen</option><option>Release</option><option>Pre-Release</option><option>Tutorial</option><option>Mojang</option><option>Update</option><option>Site</option><option>Snapshot</option></select><br />
                        Banner:<br /><input type="text" name="banner" size="30"/><br />
                        Auteur:<br /><select name="auteur"><option>---</option><option>---</option></select><br />
                        Bericht:<br /><textarea rows="7" cols="50" name="bericht"></textarea><br />
                        <input type="submit" name="submit" value="Verstuur" />
                        </form>
zo?

Jup nu werkt het pompom Bedankt

toevoeging op 10 augustus 2012, 17:51:53:
Ik heb deze link: /admin/verwijder.php?db=nieuws?id=7

En dit is verwijder.php

[COLOR= #0000BB]<?php
$id[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$db[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]db[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM $db WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Item is verwijderd<br /><br /><a href="[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #DD0000]">Ga terug</a>"[/COLOR][COLOR= #007700]);[/COLOR]
?>


Hoe maak ik dit werkend?

toevoeging op 11 augustus 2012, 141957:
Bump
0
Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bump
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Volgensmij zo:

[COLOR= #0000BB]<?php
$id[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$db[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]db[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$db[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Item is verwijderd<br /><br /><a href="[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #DD0000]">Ga terug</a>"[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Fanorg schreef:
En dan nog escapen, want zo ben je vatbara voor injections
Het is een pagina waar alleen ik kan komen
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ewan schreef:
Eerdere citaten tonen
Fanorg schreef:
En dan nog escapen, want zo ben je vatbara voor injections
Het is een pagina waar alleen ik kan komen
Dan is het alsnog wel erg handig....
0
Ewan

Lid · Topicstarter

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nielsjojo schreef:
Volgensmij zo:
[COLOR= #0000BB]<?php
$id[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$db[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]db[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$db[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Item is verwijderd<br /><br /><a href="[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #DD0000]">Ga terug</a>"[/COLOR][COLOR= #007700]);[/COLOR]
?>


Nop sadley
Notice: Undefined index: id in /home/ewan/domains/ewanoomen.nl/public_html/--/verwijder.php on line 61
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren