Posted by Jonathan N. Little on 12/05/06 19:34
payperclick.brandon@gmail.com wrote:
> Thanks for the reply's so far. I am still not any closer to
> accomplishing what I want to do. let me try and simplify what I am
> asking and see if someone can give me code snippets to accomplish the
> task.
>
> Assume I have a CSV or Excel or Txt file called sample.csv(or .xls or
> .txt - whatever works easiest - really trying to avoid using a database
> - but if that is tons easier I am open to learning) with the following
> data.
>
> ID Name
> 1 AAA Product
> 2 BBB Product
> 3 CCC Product
>
> Now I want to create a URL that has the ID in the URL -
> Example.com/id=1
>
> 2 questions -
>
> 1. What is the proper formatting of that URL? (I am pretty sure I need
> a ? somewhere in the URL.) (example.com/index.html?id=1 would that
> work?)
>
> 2. If all I wanted to do was have the page say? Thanks for visiting our
> %Name% page. How would I tell the browser to go to the file, lookup th
> id provided in the URL and then dynamically populate the %Name% field?
>
> Thanks for any help you can provide.
>
Depends on your server and the cgi script. If you have an Apache server
and are allowed mod_rewrite processing you could give the appearance of
a static URL:
www.example.com/products/1
gets converted to the real URL:
www.example.com/products.php?id=1
with a .htaccess:
RewriteEngine On
#Products parse
RewriteRule ^products/([\d]*) products.php?id=$1 [L]
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|