LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2011, 11:27 AM   #1
noony123
Member
 
Registered: Oct 2010
Posts: 167

Rep: Reputation: 0
Dynamic url generation !


Hi all.

Please dont mind if i ask something stupid, but i have recently started PHP and mysql and so far i am loving it. I have read that the best way to learn any scripting/programming language is to read others code and get involve in a project. I am planning to develop a ticketing system for my intranet environment, meaning it will only be available to certain specific personnel to generate tickets, just like a helpdesk system. So a thought came in my mind, that, if a ticket is generated, a email should be sent to the relevant personnel pointing to that ticket. Now what i mean by this is, like if i have posted a query on LQ.org, a email notification is sent with a dynamic url pointing to my post if someone answers it. How its done ? I mean is it done by PHP engine or apache ?

The research that i have done, i think its done by apache but still if someone can highlight how its done :-)
 
Old 07-18-2011, 12:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well the information is pinned by the underlying database, so the url is just generally a few fields relative to the post joined together in a string. It's totally and utterly arbitrary data, it's up to you what to make sense of it in code.
 
Old 07-18-2011, 12:14 PM   #3
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Great question! Thanks.

Okay. Well, it's pretty simple. You have a page to complete by the user. Be that a message in a forum, a help-desk question, a reservation. Since the user has logged in, the ID is available (as session parameter, perhaps), so after completing the fill-out (an HTML <form></form> tag of course) the whole thing is sent of to a database along with the ID.
It's up to you what the structure of the database is.
The system would then use the ID to fetch the mailaddress (verified at enroll, of course) from the table of users and would create an address with this unique code and mail this. The URL always would point to a PHP page that takes the ID (as a GET parameter) and uses that to fetch the required item (reply, follow-up,...) from the database...

Pretty simple.

Hope to have helped a bit

Thor
By the way : this is the way I'd do it...you options are completely valid as well...my way is not the way, but a way...

Last edited by ButterflyMelissa; 07-18-2011 at 12:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[PHP] dynamic or static content generation ANU Programming 5 05-12-2011 11:01 AM
Apache redirect dynamic url eteck Linux - Server 7 07-07-2010 10:48 PM
dynamic/static url via htaccess eteck Linux - Server 3 07-07-2010 05:33 AM
drop down box elements - dynamic generation kshkid Programming 6 02-17-2008 08:03 AM
perl CGI + dynamic table generation kurrupt Programming 8 09-27-2006 10:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration