0

I'm creating a Ticket system for my website, and viewers can view their tickets in their account page. When they click on the "ticket bar" they are redirected to a page where their ticket is displayed. Although, I'm not sure how I should create it.

If possible, I would want to have the url like ###/tickets/TICKETID. But then I wonder how I can get the ID via PHP. What to do after that, getting the information from the database, I know how to do.

I belive I can use like tickets?id=TICKETID, but I'd rather have the one with /. Keep in mind that I restructure the URL's via .htaccess:

# extention rewrite starts here (mod_rewrite) # 

RewriteEngine on

# HTML Extensions #
# do not apply to directories
RewriteCond %{REQUEST_FILENAME} !-d

# check for file in directory, with .html extensions
RewriteCond %{REQUEST_FILENAME}\.html -f

# show the page that has the .html extension
RewriteRule ^(.*)$ $1.html [NC,L]

# PHP Extensions #
# do not apply to directories
RewriteCond %{REQUEST_FILENAME} !-d

# check for file in directory, with .html extensions
RewriteCond %{REQUEST_FILENAME}\.php -f

# show the page that has the .html extension
RewriteRule ^(.*)$ $1.php [NC,L]

I've tried to just put the link as "tickets/TICKETID, then get the link by the $_GET variable, although, that doesn't seem to work. That gave a 500 Internal Server Error.

Tuggummi
  • 1
  • 2

0 Answers0