?
Solved

Friendly URL's Problem with $PATH_INFO

Posted on 2009-04-01
4
Medium Priority
?
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 20

Assisted Solution

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

Accepted Solution

by:
prokvk earned 1200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

718 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