OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 24 Dec 2005 10:47:53 -0000 Issue 3868

php-general-digest-helplists.php.net
Date: Sat Dec 24 2005 - 04:47:53 CST


php-general Digest 24 Dec 2005 10:47:53 -0000 Issue 3868

Topics (messages 227861 through 227865):

Re: PHP Frameworks
        227861 by: Richard K. Miller
        227865 by: Alessandro Rossini

Can the URL be controlled for more user-friendly readability?
        227862 by: Dave M G
        227863 by: Shawn McKenzie
        227864 by: Ed Lazor

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


I haven't tried them yet, but I've been tagging all the PHP
frameworks I come across:

http://del.icio.us/rkm28/php+framework

The first one I want to try is PHP on Trax (http://
www.phpontrax.com/). It was used to build the KatrinaHousing.org
site that was used to provide housing for victims right after the
hurricane.

Richard

---
Richard K. Miller
www.richardkmiller.com

On Dec 23, 2005, at 12:57 PM, Shawn McKenzie wrote:

> Is there a good recent article on PHP Frameworks, or do people here
> has
> a predominant one that outshines the others?
>
> I'm looking for something that is easy to use, fast and stable.
>
> Thanks!
> -Shawn
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Friday 23 December 2005 20:57, Shawn McKenzie wrote:
> Is there a good recent article on PHP Frameworks, or do people here has
> a predominant one that outshines the others?

There are a lot of PHP frameworks available, some more mature than others but
not yet a predominant one. Anyway if you're going to develop with PHP5 I
recommend you ZNF: http://znf.zeronotice.com

Best regards.
--
Alessandro 'Aronnax' Rossini
----------------------------
web -> www.aronnax.it
e-mail -> aronnaxopenlug.org
ZeroNotice IT Solutions -> www.zeronotice.com

attached mail follows:


PHP General,

        I have a PHP/MySQL web site where there are profiles for performers at
a comedy show. The profiles are accessed by passing a variable to the
PHP script via URL, which can then look up the right performer data in
the database.
        The resulting URL looks like this:
        http://www.tokyocomedy.com/people.php?person=6
        However, having "?person=6" in the URL is not only ugly, but it makes
it hard for people to remember URLs and for the performers to use them
when sending out information about themselves.
        It would be much nicer to have the url look more like this:
        http://www.tokyocomedy.com/firstname-lastname
        Or something like that.

        But I can't figure out if there is a way to control the way the URL
reads after the performer has been looked up. And, even if I could,
would the system be able to retrieve performer data if someone typed the
name directly into the URL.

        Obviously, I'm still a bit of a beginner with PHP. I may have
approached this issue from the wrong starting point, so please let me
know if I'm missing something fundamental.

        Thank you for any advice you may have.

--
Dave M G

attached mail follows:


So if you are using Apache as your webserver you can use mod_rewrite to
rewrite the URL to something else.

So for example, create a rewrite rule to rewrite firstname_lastname to
people.php?fn=firstname&ln=lastname

RewriteRule ^([^-]+)\-([^-]+)\.html$ people.php?fn=$1&ln=$2 [L,NC,NS]

Next, the PHP page will have to do something to make it friendlier and
expect the person's name and not a number, then lookup the number so it
can be used in a query etc.

So for a URL like this: http://www.tokyocomedy.com/firstname-lastname.html

It will appear to your page as this: people.php?fn=firstname&ln=lastname

So, at the top of your page or wherever you would normally look up the
record for person=6:

$result = yoursqlfunc("SELECT person FROM sometable WHERE
firstname='$_GET[fn]' AND lastname='$_GET[ln]'");

Then use your SQL function to get person from $result.

Then you should have person=6 and continue as normal.

-Shawn

Dave M G wrote:
> PHP General,
>
> I have a PHP/MySQL web site where there are profiles for performers at
> a comedy show. The profiles are accessed by passing a variable to the
> PHP script via URL, which can then look up the right performer data in
> the database.
> The resulting URL looks like this:
> http://www.tokyocomedy.com/people.php?person=6
> However, having "?person=6" in the URL is not only ugly, but it makes
> it hard for people to remember URLs and for the performers to use them
> when sending out information about themselves.
> It would be much nicer to have the url look more like this:
> http://www.tokyocomedy.com/firstname-lastname
> Or something like that.
>
> But I can't figure out if there is a way to control the way the URL
> reads after the performer has been looked up. And, even if I could,
> would the system be able to retrieve performer data if someone typed the
> name directly into the URL.
>
> Obviously, I'm still a bit of a beginner with PHP. I may have
> approached this issue from the wrong starting point, so please let me
> know if I'm missing something fundamental.
>
> Thank you for any advice you may have.
>
> --
> Dave M G

attached mail follows:


Make sure to parse the input, instead of using $_GET... it's too easy for hackers to embed stuff...
   
  

Shawn McKenzie <nospammckenzies.net> wrote:
    $result = yoursqlfunc("SELECT person FROM sometable WHERE
firstname='$_GET[fn]' AND lastname='$_GET[ln]'");