adam291086 Posted December 20, 2007 Share Posted December 20, 2007 I am setting up the urls on my site. But two of the links need to stay as http://www.ryedalerumble.com/riders.php. When i test the links everything work ok until the user goes to the riders.php page. When they try and navigate away the url goes to www.ryedalerumble.com/riders.php?page=index instead of www.ryedalerumble.com?page=index.php. Heres the code echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('Entry Form').'">Entry Page</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('Useful information').'">Useful Information</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('Faq').'">FAQ</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('index').'">Latest</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('index').'">Gallery</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('index').'">Results</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('index').'">Comments</a></li> '; echo ' <li><a href="http://ryedalerumble.co.uk/riders.php">Riders</a></li> '; echo ' <li><a href="http://ryedalerumble.co.uk/view_all_news.php">View all news articles</a></li> '; echo '<li><a href="http://ryedalerumble.co.uk?page='.urlencode('Contact_Us').'">Contact Us</a></li> '; Quote Link to comment https://forums.phpfreaks.com/topic/82501-solved-urlencode-help/ Share on other sites More sharing options...
trq Posted December 20, 2007 Share Posted December 20, 2007 Your missong the / echo '<li><a href="http://ryedalerumble.co.uk/?page='.urlencode('Faq').'">FAQ</a></li> '; Also... Why are you using urlencode on strings that don't contain any special chars? Why are you hardcoding the domain name into all your scripts? Quote Link to comment https://forums.phpfreaks.com/topic/82501-solved-urlencode-help/#findComment-419378 Share on other sites More sharing options...
adam291086 Posted December 20, 2007 Author Share Posted December 20, 2007 thanks that works now one more problem. I have some links that i want to keep redundant. So if you click on it the page goes know where. How would i do that. I have tried using # but the site still changes the page echo '<li><a href="/?page='.urlencode('#').'" class="parent">Routes</a></li> '; Quote Link to comment https://forums.phpfreaks.com/topic/82501-solved-urlencode-help/#findComment-419384 Share on other sites More sharing options...
trq Posted December 20, 2007 Share Posted December 20, 2007 echo '<li><a href="#" class="parent">Routes</a></li>'; And once again, you don't need urlencode! Quote Link to comment https://forums.phpfreaks.com/topic/82501-solved-urlencode-help/#findComment-419387 Share on other sites More sharing options...
littledragon Posted December 20, 2007 Share Posted December 20, 2007 adam291086, you really don't need to urlencode those variables. The only characters to get encoded would be the spaces in 'Entry Form', which would become Entry%20Form, something you can write yourself. thorpe is right, no need to hard code here echo '<li><a href="/?page=Entry%20Form">Entry Page</a></li> '; the empty anchor link you want is <a href="#"> Quote Link to comment https://forums.phpfreaks.com/topic/82501-solved-urlencode-help/#findComment-419388 Share on other sites More sharing options...
adam291086 Posted December 20, 2007 Author Share Posted December 20, 2007 sorry i didn't read all of thorpes post and i didn't realise you didn't need the urlencode bit. Thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/82501-solved-urlencode-help/#findComment-419393 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.