Acc en del

Gestart doorOne2xs32 reacties61 weergaven

33 berichten · pagina 1 van 3

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik heb bijvoorbeeld dit:

[COLOR= #0000BB]<?php 
$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"UPDATE moppen SET keur=keur+[DEL=+2 OF ACC=+1?] WHERE id=[HIER ID]"[/COLOR][COLOR= #007700];[/COLOR] 
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/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] 
?>


Hoe werkt het dan dat als je ?acc=3
id veranderd naar 3 en keur +1 wordt
En als je ?del=3
id veranderd naar 3 en keur +2 wordt
?
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als je wat duidelijker bent kan ik je verder helpen. Voor dat id = 3 kan je bij je update query ipv. 3 gewoon dit doen: " . mysql_real_escape_string($_GET[del]) . "
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Sebastiaanh schreef:
Als je wat duidelijker bent kan ik je verder helpen. Voor dat id = 3 kan je bij je update query ipv. 3 gewoon dit doen: " . mysql_real_escape_string($_GET[del]) . "
Heb de code aangepast zie topic.!
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Ik snap er nog steeds echt geen drol van. Kan je duidelijker zijn? emo
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
http://thahab.nl/moppen/
maak ik een admin paneel op.
Hierop kan je accepteren of weigeren.
Is een mop nog niet gekeurd is in de tabel keur=0
als hij is geaccepteerd is de keur=1
geweigerd? keur=2

Kan iemand dat scriptje maken? Of helpen?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]actie[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]del[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE moppen SET keur="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ding[/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]
?>
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Maartenl schreef:
mysql_query("UPDATE moppen SET keur=1 WHERE id=".mysql_real_escape_string($_GET[del])."") or die (mysql_error());
Dat is alleen voor del?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je nan beter foempje met post doen daarvoor.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Kan, maar ik vind dit fijner werken.

toevoeging op 19 februari 2012, 16:02:22:
Maartenl schreef:
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dingen[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]del[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE moppen SET keur="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ding[/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]
?>
dus als je naar pagina index.php?acc=2
gaat id 2 naar keur 1
en als je index.php?del=2
gaat id 2 naar keur 2?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb hem aangepast :

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]actie[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]del[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE moppen SET keur="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ding[/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]
?>


Zo roep je aan :
?actie=del&id=1
of
?actie=add&id=1

toevoeging op 19 februari 2012, 16:02:51:
Net te laat
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Maartenl schreef:
Heb hem aangepast :

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]actie[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]del[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$waarde[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE moppen SET keur="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ding[/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]
?>
Zo roep je aan :
?actie=del&id=1
of
?actie=add&id=1

toevoeging op 19 februari 2012, 16:02:51:
Net te laat

Oke, maar ik zie geen add in het scriptje staan, klopt dat?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja, de add kan vanalles zijn.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Vriendje schreef:
Ja, de add kan vanalles zijn.
oke, bedankt!

toevoeging op 19 februari 2012, 16:04:38:
Weet iemand nog een script waarmee je admin kan beveiligen?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe bedoel je beveiligen?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Vriendje schreef:
Hoe bedoel je beveiligen?
Een wachtwoord.
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