Re: [PHP] Re: Submitting variables via /'s

2001-10-05 Thread Ashley M. Kirchner

John A. Grant wrote:

 Why?  What's wrong with ?var1=1var2=2

Where did you hear me say there was something wrong with it?  It's a
personal choice.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Submitting variables via /'s

2001-10-05 Thread Andrew Hill

Note, this is not currently possible under the CGI, only as a module.

Best regards,
Andrew Hill

 -Original Message-
 From: John A. Grant [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 05, 2001 4:04 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Submitting variables via /'s
 
 
 Ashley M. Kirchner [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  I want to move away from
  file.php?var1=1var2=2var3=3
  ...and go to
  file.php/1/2/3
 [...]
 
 Why?  What's wrong with ?var1=1var2=2
 
 --
 John A. Grant  * I speak only for myself *  (remove 'z' to reply)
 Radiation Geophysics, Geological Survey of Canada, Ottawa
 If you followup, please do NOT e-mail me a copy: I will read it here
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Submitting variables via /'s

2001-10-05 Thread Chris Hobbs

Joao Prado Maia wrote:

Ashley M. Kirchner [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I want to move away from
file.php?var1=1var2=2var3=3
...and go to
file.php/1/2/3
 
 That is actually a good idea to build dynamic web sites and be still
 search engine friendly. You can take http://faqts.com as an example. Go
 over Google.com and search for 'faqts' and you will see that Google
 crawled the whole site structure because of how carefully the links were
 laid out.
 
 The same thing wouldn't happen (in most cases I guess) with a site of the
 '?var=2var2=4' method of doing links.


Exactly why I switched our site from '/index.php?page=1' to 
'index.php/1' - google and other search engines love following my links 
now :)

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Submitting variables via /'s

2001-10-05 Thread Ashley M. Kirchner

Matthew Walker wrote:

 So, can someone give me the spot to look in the documentation to find
 out how to make this switch?

Rasmus explained it earlier to me:

Nothing to it.  All you really need to know is that $PATH_INFO will contain
/1/2/3 simply pick out what you need using something like:

  list($arg1,$arg2,$arg3) = explode('/',$PATH_INFO);

There is nothing to change configuration-wise in either PHP or Apache.

What you can do is get a bit fancier and get rid of the .php from the URL
and use:

  http://domain.com/blah/1/2/3

In your Apache config you would use:

  Location /blah
  ForceType application/x-httpd-php
  /Location

And then you would simply name your PHP script 'blah' and stick it in your
document root directory.  But this is not needed if you are happy with:

  http://domain.com/blah.php/1/2/3

Here the .php extension tells Apache that blah.php is a PHP script that
should be executed.


--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Submitting variables via /'s

2001-10-05 Thread Steve Werby

Matthew Walker [EMAIL PROTECTED] wrote:
 So, can someone give me the spot to look in the documentation to find
 out how to make this switch?

There are multiple solutions.  In a nutshell here's what I do.  I add
directives to the VirtualHost block for the site which point web requests
for certain pages to a master script that generates a number of pages with
similar database-driven content.  Here's one such line.  Any file beginning
with photo_gallery_, followed by 1 or more digits and ending in .html is
handled by template_1.php.

AliasMatch ^/photo_gallery_[[:digit:]]{1,}.html$ template_1.php

For this particular site, template_1.php actually handles nearly all of the
web requests for the site.  It consists of HTML code generating the basic
physical appearance of the site, then calls other scripts to generate the
HTML head section, breadcrumb trail, etc. and uses an include() statement
to load the appropriate PHP script that generates the bulk of the page's
content.  In this case that script is inc_page_news.php.

In inc_page_news.php the following code extracts the page number:

ereg( '/news_([[:digit:]]{1,}).html', $SCRIPT_NAME, $regs );

if ( ! empty( $regs[1] ) )
{
// Set page number.
$page = $regs[1];
}

Then a database query is performed to extract and build the page content.  I
wrote about the topic a while back on this list.  If you're interested see:

http://marc.theaimsgroup.com/?l=php-generalm=98618455619989w=2

A few months ago I wrote a script that controls ~40 product pages on each of
about 35 sites using PHP/MySQL and Apache mod_rewrite.  Prior to that the
pages were static and changes were done manually which was an extremely long
process for those involved (imagine changing layouts and fonts on 1,000+
static pages with no CSS).  Now changes can be made across all sites,
products or combinations thereof in seconds.  Sites, products, images, meta
tags, image tags, etc. are now entirely administered through a web interface
I built.  Using AliasMatch in Apache as I described above all product pages
are handled by a single PHP script which parses the URL for the site name
and product name and pulls data from a number of tables and handles a few
special cases programmatically, then generates the page.  Here are a couple
of the URLs.  You'll notice they aren't the prettiest of pages, but the goal
was to drive traffic to the sites from search engines, convert a high % of
visitors to sales and allow the site to be administered by a non-programmer
and implement changes rapidly.

http://www.3rackbids.com/products/pallet_rack.html
http://www.3-materialhandlingequipment-bids.com/products/pallet_rack.html

If you want to browse a couple of my side projects you'll see I implement
the same practices there too.

http://www.sexcriminals.com/ (not an adult content site)
http://www.tysonchandler.com/

HTH,

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]