Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Trying to find a simple PHP ReST Tutorial

$
0
0

I'm quite good at PHP but I thought it was time to learn this ReST thing people are talking about. As of right now I've got a web application written entirely in PHP and has a MySQL database full of......let's say users. Anyone logged in can browse a list of the other users (users.php) and can then visit that user's profile (user.php). There are no security limitations for the sake of our example. Right now when the user clicks another user, it brings them to a URL (http://www.example.com/user.php?user=123) and the page (user.php) makes a call to the model which checks the database for a user with ID 123, then returns any information for that user.

 

I'm wondering if it would be more professional to have the user go to a more friendly URL (http://www.example.com/users/bob) which would load user.php with all the information about Bob (only a single Bob in the database). Is it reasonable to switch from my way to this ReST way? Can someone point me (or provide) a tutorial for the simplest example you can imagine? I would just need it to get to the SQL call, I can do all the database authentication and calling myself, I just want to know how everything is set up and I can build on it from there. I can't find anything this simple online, they're all too complicated with extra features I don't want. Thanks.


Viewing all articles
Browse latest Browse all 13200

Trending Articles