Skip to main content
April 8, 2010
Question

php script needed to generate unique page

  • April 8, 2010
  • 1 reply
  • 1599 views

Thank you for your understanding, I hope I am in the right place.

I am trying to generate about 30 unique pages to be visited by recipients of a piece of mail.

I am planning to use .htaccess to redirect the visitor to the unique, shortened url.

I cannot figure out how to get this to all work together. Please help

This topic has been closed for replies.

1 reply

April 9, 2010

I think if you're a bit more specific about what you're trying to do you will get more help... your description is very vague.

April 9, 2010

I am trying to implement a personalized url (purl) to print on a mail piece. I have created a mysql database and a form that places some unique information about the visitor using php.

I have successfully linked the page to the database and I believe the scripts for mailing responses will work, based on earlier successes. I did the binding to link the correct field from the database to the url. But now what?

My problem is that I have never generated a unique page and I cannot figure out how to do that. I am thinking that I need some piece of php script to create the dynamic page.

April 9, 2010

Okay, tell me if I understand you correctly.

You've got a mail piece going out, and each person will have a different URL. So, Person A would go to: www.mydomain.com/persona; and Person B would go to www.mydomain.com/personb - is that about right?  And you want the page to display info from the DB without having to make 30 different static pages to do it?

If that's what you're doing, the way *I* would do it is like this:

I would create a subdomain for each person (to make it easy for the person) and forward it to a page that uses a $_GET parameter to call the record from the database.

For example:


I would set-up subdomains like:

JSmith.mydomain.com

and

MFarese.mydomain.com

Then, I would forward those domains to:

www.mydomain.com/mypage.php?id=1

and

www.mydomain.com/mypage.php?id=2

Then, on the page you create, you add the WHERE statement to your SQL query... you can do this in "simple" mode by adding the filter WHERE id = URL PARAMETER id.

That's it.  When the page is called with the extra "?id=1" at the end of the URL it will call the record from the DB with the ID value of 1.

Make sense?

I'm sorry if that's not what you're asking - that's what I got from your question.