Solved

Friendly URL's Problem with $PATH_INFO

Posted on 2009-04-01
4
486 Views
Last Modified: 2013-12-12
Hi,

I'm trying to setup friendly url's using this guide -> http://www.sitepoint.com/article/search-engine-friendly-urls/

The problem i'm having is that i'm using the code below where the explode $PATH_INFO code should create an array with the text to search with, but $PATH_INFO doesn't seem to display anything in the echo test and it doesn't send anything in the query, returning a blank set of results.

The link i'm using to access is http://cawsearch.com/svr2009/url_view_caw.php/1069 which should pass the 1069 as $var_array[1] which i was wanting to use as my search.

Can anyone see what i'm doing wrong that could have caused this?
$var_array = explode("/",$PATH_INFO);
 

$test=$var_array[1];
 

echo "$test<br>

$PATH_INFO<br>

$var_array[0]<br>

$var_array[1]<br>";
 

$result = mysql_query("SELECT * FROM database WHERE id = '$test' ");

Open in new window

0
Comment
Question by:m0tSiE
4 Comments
 
LVL 20

Assisted Solution

by:Gawai
Gawai earned 200 total points
ID: 24040394
0
 
LVL 5

Accepted Solution

by:
prokvk earned 300 total points
ID: 24042465
If you want to make friendly url's go definately for apache's mod_rewrite. It's designed for such things, there's no reason to use such "scripts".
0
 

Author Closing Comment

by:m0tSiE
ID: 31565301
THANKS!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Build JSON from table records 17 40
PHP string issue 5 17
regex expression 9 21
Adding through query php 9 8
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now