How to use different Urls and get information from them

Asked

Viewed 113 times

2

I have a database with the following

ID Nome
1  A
2  B
3  C

I wish that when accessing www.example.com/perfil.php take all information and print on screen, but when accessing www.example.com/2/B or www.example.com/1/A take only this information and print on screen.

1 answer

0

A very complete explanation can be found here

http://www.vivaolinux.com.br/artigo/Apache-22-Introducao-ao-modulo-mod-rewrite?pagina=1

Correcting your question as I understand it you do not need to pass the two values only one would be enough. For example. www.site.com/2 -> Return all user information named B or www.site.com/B would also retrieve information from the same correct user?

Because if a number is passed you would do a search based on Identifier and if an Alpha is passed( letters and numbers) you would recover the profile by username.

Google Rewrite_mod search which is an apache module.

  • For example, if I go www.site.com/profile.php will print "1 A", I want you to do the same process but the url would be www.site.com/1/A, and that url would be different for each different data.

  • Then you need to do a url mapping for it to be transferred to the necessary file;

  • Could you give me a piece on that ??

  • In the article I passed above has all the explanation you need to use.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.