Ticket systeem maken.

Gestart doorMilan11 reacties52 weergaven

12 berichten · pagina 1 van 1

Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik wil dus een ticket systeem maken, kan ik dit het beste zo doen?
MySQL:
Tabel:
tickets
Kolommen:
gebruikersnaam bericht status
0
Berichten
1.160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
id gebruikersid/gebruikersnaam bericht status aangemaakt reactie=ja/nee
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik die het zo:
Tabel:
tickets
Kolommen:
gebruikersnaam titel bericht status reactie
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oké, de eerste vraag. Elk ticket heeft een id, hoe zorg ik ervoor als je dus bijv admin_ticketbekijken.php hebt, en je wilt ticket id 255 bekijken, hoe doe je dat dan? bijv: admi_ticketbekijken.php?ticketid=255, dat dan ticket met het id 255 uit de database wordt gehaald en wordt weergeven?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mysql_query("SELECT * FROM `tickets` WHERE `id` = " . mysql_real_escape_string($_GET[id]) . "");
0
Berichten
1.160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Pchooligan:

mysql_query("SELECT * FROM `tickets` WHERE `id` = " . htmlentities($_GET[id]) . "");


mysql_real_escape_string?
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik bedoel de hele code =)
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ordian schreef:
Pchooligan:
mysql_query("SELECT * FROM `tickets` WHERE `id` = " . htmlentities($_GET[id]) . "");


mysql_real_escape_string?

Ja, dom van me, ik heb het even aangepast

Manatwar:
Ik bedoel de hele code =)

We kunnen niet alles voor je maken, je zal toch ook echt iets zelf moeten doen
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kijk, k heb nu dit:

[COLOR= #0000BB]<?    $sel[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT titel FROM tickets WHERE status=1"[/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]
    [COLOR= #0000BB]$list[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sel[/COLOR][COLOR= #007700]);[/COLOR]
    ?>
    <a href=admin_bekijkticket.php?t=[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR] ?>>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]$GET[[/COLOR]titel[COLOR= #DD0000]][/COLOR][COLOR= #007700];[/COLOR] ?></a>


Hoe zorg ik er nu voor dat als de link bijv. admin_ticketbekijken.php?t=255 is, dat hij dan ticket 255 op de pagina weergeeft?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?
    $sel[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT titel FROM tickets WHERE id="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" AND status=1"[/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]
    [COLOR= #0000BB]$list[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sel[/COLOR][COLOR= #007700]);[/COLOR]
    ?>
    <a href=admin_bekijkticket.php?t=[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR] ?>>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]];[/COLOR] ?></a>


Zoiets als goed begrijp wat je bedoeld
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik ga eens kijken of het werkt en hoe je het gedaan hebt =)
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zag net een fout dus die heb ik even aangepast
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