Re: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-19 Thread Ethan Whitt
I pasted your example in and it doesn't work for me (again, newbie). I will play with it and see if I can get it working. My main goal is to have Ruby-like URL's vs ?var=3425. Is this possible with .php (without mod_rewrite / something in the http server?) Thanks, Ethan On Wed, Jun 18,

RE: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-19 Thread Bob
but on a personal level I think it's one of the better MVCs about. Bob. -Original Message- From: Ethan Whitt Sent: 19 June 2008 17:19 To: Nathan Nobbe Cc: php-general@lists.php.net Subject: Re: [PHP] Newbie Question: How to pass URL info to .php script ? I pasted your example

Re: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-19 Thread Jignesh Thummar
Ethan, you can try this: $url = www.test.com/article/3435; echo basename($url); another solution is that you can use explode() function to seprate your url from '/' or you can use regex to parse your url - Jignesh On Thu, Jun 19, 2008 at 8:18 AM, Ethan Whitt [EMAIL PROTECTED] wrote: I pasted

Re: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-19 Thread Nathan Nobbe
On Thu, Jun 19, 2008 at 1:28 AM, Bob [EMAIL PROTECTED] wrote: Have you tried CodeIgniter http://www.codeigniter.com? Not as restrictive as many MVC frameworks and very easy to work with. What you wish to achieve can be done with one line. $myvar = $this-uri-segment(2); right, and if you

Re: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-19 Thread Nathan Nobbe
On Thu, Jun 19, 2008 at 1:18 AM, Ethan Whitt [EMAIL PROTECTED] wrote: I pasted your example in and it doesn't work for me (again, newbie). I will play with it and see if I can get it working. My main goal is to have Ruby-like URL's vs ?var=3425. Is this possible with .php (without

Re: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-19 Thread Chris Scott
You could just use an apache (or other web server) alias: www.test.com/article - www.test.com/article.php where article.php uses: ?php $uri_vars = explode('/', $_SERVER['PATH_INFO']); foreach ($uri_vars as $var) if ($var != ) echo $var . br; ?

[PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-18 Thread Ethan Whitt
Not sure how to achieve this. How can I grab a portion of a URl to send to a .php script in this fashion? www.test.com/article/3435 - Grab the 3435 to process in a script? Thanks in advance! Ethan

Re: [PHP] Newbie Question: How to pass URL info to .php script ?

2008-06-18 Thread Nathan Nobbe
On Wed, Jun 18, 2008 at 10:45 PM, Ethan Whitt [EMAIL PROTECTED] wrote: Not sure how to achieve this. How can I grab a portion of a URl to send to a .php script in this fashion? www.test.com/article/3435 - Grab the 3435 to process in a script? take a look at the $_SERVER superglobal