Hi,

I m using first time url rewriting concept..

i m getting some errors when i used different symbols in url..
$title="sachin's best shots KKR : MI ? ";

here when i use normal text (with out any symbols) ..this is working fine..but, when i use (?,",',:)...page can not be displayed..getting error...

please check the below code...

php code @ link

index-id-<?php echo $tr_id; ?>-name-<?php echo urlencode($title); ?>.htm

.htaccess

RewriteRule index-id-(.*)-name-(.*)\.htm$ index.php?id=$1

plz tell me wat i need to do...
i m struggling 4 last couple of days...

Recommended Answers

All 2 Replies

Hi liamfriel,


i m phasing problen only when i used ( :, ? , !, | )...these type of symbols...there is no problem when i used (', ")...

plz look into the code...
Code:

$url=urlencode($tr_topic);

<a href="index-id-<?php echo $tr_id; ?>-name-<?php echo htmlentities($url); ?>.htm"> xxxxxxxxxxx </a>

Thanks...

Google chrome error:

HTTP - 404 Page Not Found
Sorry, the page you were looking for cannot be found.

I have been reading that some browsers retain the HTML entities of encoded chars try:

htmlentities() or htmlspecialchars().

before encoding.

http://php.net/manual/en/function.urlencode.php

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.