Click here to Skip to main content
10,500,000 members (69,166 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP
Hello! I've seen pages like http://www.example.com/index.php/page/2/
and I want how know how to handle/process the "/page/2/" inside index.php and once I get and process the string I want to show the coresponding page to the user. Any ideas?
Posted 18-Apr-11 4:54am
Edited 30-Aug-12 13:54pm
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Probabaly you mean URL mod_rewrite. For PHP you can do that with apache mod rewrite. See: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The above link is broken and your question is not very clear. If you want to know how to create a website then try researching ASP.NET or similar.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi! I've found what I wanted with the print_r function.
For the ones who have my problem:

1.To make page like that imagine that www.example.com is our server
and www.example.com/index.php/page/2 is the desired page

2.In www.example.com/index.php get the value of $_SERVER['PATH_INFO'] which
will look like /page/2

3.Process the string(example: from "/page/2" tranform to "page2.html")

4.Load the actual page with include(for php page) or loadHTMLFile(for html page)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 210
1 Frankie-C 155
2 Raje_ 155
3 OriginalGriff 147
4 Maciej Los 110
0 Sergey Alexandrovich Kryukov 8,489
1 OriginalGriff 7,943
2 Sascha Lefèvre 3,114
3 Maciej Los 2,581
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 29 Dec 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100