delete knop

Gestart doorRobbert21 reacties51 weergaven

22 berichten · pagina 1 van 2

Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heu,
super phper robbert heeft weer jullie hulp nodig yummienet zoals de vorige keer ben ik weer een beetje aan het klooien en de admin functie van de site aan het uitbreiden/versimpelen zodat ik niet alles via phpmyadmin hoef te regelen.

nu heb ik dit:

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../_include.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Admin[/COLOR][COLOR= #007700]);[/COLOR]
check_login[COLOR= #007700]();[/COLOR]
check_admin[COLOR= #007700]();[/COLOR]
?>
<h2>Admin Overzicht</h2>
<p>
<table width="100%">
<tr><td><strong>Site</strong></td><td width="50"><strong>delete</strong></td><td width="50"><strong>aantal kliks</strong></td><td width="100"></td></tr>
[COLOR= #0000BB]<?
$top2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `klikbottom` ORDER BY id DESC"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$top1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top1[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kliks[/COLOR][COLOR= #007700]];
}[/COLOR]
?>
</table>
</p>         
[COLOR= #0000BB]<?[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]0[/COLOR][COLOR= #007700]);[/COLOR]
?>


nu doet hij het fantastisch. (mijn kwaliteit *kuche kuche*)
maar nu wil ik graag nog een delete knop.
om er iets uit te halen.
nu is het zeg maar zo:



maar nu wil ik nog hebben:


aléén ik zou begod niet weten hoe dat werkt met MySQL.

iemand die me hiermee kan helpenhypocrite
,Robbert

ohwja: beloning 0.1 hypocrite
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
DELETE FROM klikbottom WHERE id = $id

De php moet je zelf wel kunnen toch ?
0
Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guildjuhh:
DELETE FROM klikbottom WHERE id = $id

De php moet je zelf wel kunnen toch ?

dat is dus het probleem yummie
0
Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
misschien; dit;
vervang

Quote:
echo .$top[link]...$top[kliks];

in

Quote:
echo .$top[link]...$top[kliks]...$top[delete];

ik hoop voor jou dat dit het goede is!
en laat mij het wetensmile
0
Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Admir schreef:
misschien; dit;
vervang

Quote:
echo .$top[link]...$top[kliks];

in

Quote:
echo .$top[link]...$top[kliks]...$top[delete];

ik hoop voor jou dat dit het goede is!
en laat mij het wetensmile
ja dan zet hij de rijtjes anderom neer.
maar nu wil ik nog dat er onder het rijtje delete telkens een delete knopje komt yummie
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
echo .$top[link]...$top[kliks]..Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.;

Zoiets
0
Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guildjuhh:
echo .$top[link]...$top[kliks]..Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.;

Zoiets

ja maar bij linknaardelete moet zeg maar delete.php?.[id].
0
Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guildjuhh:
echo .$top[link]...$top[kliks]..Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.;

Zoiets

ja en dat deletelinkje moet hem dan weer verwijderenhypocrite
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Admir schreef:
Guildjuhh:
echo .$top[link]...$top[kliks]..Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.;

ja maar bij linknaardelete moet zeg maar delete.php?id=.id.
0
Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
iemand nog een definitieve versie?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../_include.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Admin[/COLOR][COLOR= #007700]);[/COLOR]
check_login[COLOR= #007700]();[/COLOR]
check_admin[COLOR= #007700]();[/COLOR]
?>
<h2>Admin Overzicht</h2>
<p>
[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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]action[/COLOR][COLOR= #007700]]) &&[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]action[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]del[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700])) {[/COLOR]
mysql_qeury[COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM klikbottom WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700]);
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
?>

<table width="100%">
<tr><td><strong>Site</strong></td><td width="50"><strong>delete</strong></td><td width="50"><strong>aantal kliks</strong></td><td width="100"></td></tr>
[COLOR= #0000BB]<?
$top2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `klikbottom` ORDER BY id DESC"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$top1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top1[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kliks[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td><a href="HIERDENAAMVANDITBESTAND.php?action=delete&id=[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]"><img src="Link naar plaatje"></a></td</tr>[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>
</table>
</p>         
[COLOR= #0000BB]<?[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]0[/COLOR][COLOR= #007700]);[/COLOR]
?>


zoiets
0
Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guildjuhh:

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../_include.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Admin[/COLOR][COLOR= #007700]);[/COLOR]
check_login[COLOR= #007700]();[/COLOR]
check_admin[COLOR= #007700]();[/COLOR]
?>
<h2>Admin Overzicht</h2>
<p>
[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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]action[/COLOR][COLOR= #007700]]) &&[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]action[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]del[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700])) {[/COLOR]
mysql_qeury[COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM klikbottom WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700]);
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
?>

<table width="100%">
<tr><td><strong>Site</strong></td><td width="50"><strong>delete</strong></td><td width="50"><strong>aantal kliks</strong></td><td width="100"></td></tr>
[COLOR= #0000BB]<?
$top2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `klikbottom` ORDER BY id DESC"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$top1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top1[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kliks[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td><a href="HIERDENAAMVANDITBESTAND.php?action=delete&id=[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]"><img src="Link naar plaatje"></a></td</tr>[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>
</table>
</p>         
[COLOR= #0000BB]<?[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]0[/COLOR][COLOR= #007700]);[/COLOR]
?>


zoiets

hee,
opzich; hij werk zo half wat, alleen dat hiernaamvanbestand moet nog verandert worden, maar ik zou niet weten in wat...
moet ik daar nou een delete.php ofzeu aanmaken en daarin zitten van delete row, id from url, bla?
0
Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Quote:
hee,
opzich; hij werk zo half wat, alleen dat hiernaamvanbestand moet nog verandert worden, maar ik zou niet weten in wat...
moet ik daar nou een delete.php ofzeu aanmaken en daarin zitten van delete row, id from url, bla?

ja, of het bestand verwijder.php
0
Robbert

Lid · Topicstarter

Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
*topic bumpje + overzichtelijkheid*

if(isset($_GET[delete]))
{
    $query = DELETE FROM klikbottom WHERE id = .(int)$_GET[delete];
    $result = mysql_query($query);
}


ik dacht dat zoeiets wel moest gaan werken, maja daar ben ik te n00b voor, hoe krijg ik zoiets wel werkend?
dus dat hij links naar bijvoorbeeld naar:
delete.php?id=1
dat dan id=1 uit de url word gehaalt en word gedelete?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]delete[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/ctype_digit"]ctype_digit[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]delete[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM klikbottom WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]delete[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"ID "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]delete[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" is verwijderd."[/COLOR][COLOR= #007700];
}[/COLOR]
?>
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