Click here to Skip to main content
12,359,458 members (47,835 online)
Rate this:
 
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 3:54am
Updated 30-Aug-12 12: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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 29 Dec 2013
Copyright © CodeProject, 1999-2016
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