Forum Moderators: phranque
$new_url = str_replace(" ", "-", $daa[id]);
?>
<a href="board/list.php?id=<?=$new_url?>" class=mm><?=$daa[id]?></a><br>
<?
}
?>
I have php script like that above.
The problem is str_replace replace space to dash but it becomes totally different page.
www.example.com/board/list.php?id=new%20url
www.example.com/board/list.php?id=new-url
I wonder the link actually goes to the first url and
url address shows second url?
I hope u understand..
If you have anotherway please let me know..
thanks
So the link is to "board/list.php?id=abc-def" and the linked text on your page is abc%20def
It links to a hyphenated query string URL, but shows the 'name' of the link with a space in it.
Is this code something you added? If so, then you may need to add a similar code snippet in the routine that GETs the user-requested query string and looks up the 'next page' in your database. This code snippet would need to reverse the function done here, by changing the hyphens back to spaces so that the correct page can be found in your database.
Also, if you need detailed help with PHP, the contributors in our PHP forum can likely give you much better help than you'll find here in the Apache server configuration forum.
Jim
Jim
$new_url = str_replace(" ", "-", $daa[id]);
?>
<a href="board/list.php?id=<?=$new_url?>" class=mm><?=$daa[id]?></a><br>
<?
}
?>
I have php script like that above.
The problem is str_replace replace space to dash but it becomes totally different page.
www.example.com/board/list.php?id=new%20url
www.example.com/board/list.php?id=new-url
I wonder the link actually goes to the first url and
url address shows second url?
I hope u understand..
Please provide me a code. I have searched for couple weeks now but I still do not solve it..
thanks