Jump to content

Add page title to url


bruisr

Recommended Posts

Hello - I have a search page that displays urls to a details page. Currently, the url looks like this: ".com/loc_details.php?loc_id=38" but I would like it to have the contents of the 'loc_name' field display after the id. Here is how it's being called in the code:

$output .= "<td><a href='loc_details.php?loc_id={$row['loc_id']}'>{$row['loc_name']}</a></td>\n";

 

The only thing I can think of to compare it to would be the pretty links that Wordpress offers.

The website for reference is www.giantstridedives.com/locations, so you can see it in action.

 

Thanks for any help!

Link to comment
Share on other sites

OK, I figured out how to add it.

$output .= "<td><a href='loc_details.php?loc_id={$row['loc_id']}&{$row['loc_name']}'>{$row['loc_name']}</a></td>\n";

 

Now I'm running into 2 other issues.

[*]If there is a single quote in the name, such as Devil's Eye, it cuts out just before the single quote.

[*]The spaces are displayed as %20.

 

Are there ways around this with php?

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.