Hey friends i just wanna know how can we change the url like if i have a index page now i want to include the login page on click to a link now the url should be index.php?action=login
tarunfuture 0 Newbie Poster
Recommended Answers
Jump to PostSo what you're saying is there is only index.php and that you're changing the served content based on the url parameter 'subject'. I assume you're using include files for this?
if(isset($_GET['subject']) && file_exists('templates/' . basename($_GET['subject']).'php')){ include('templates/' . basename($_GET['subject']).'php'); }else{ include('templates/index.php'); }
Not tested.
Jump to PostCould you show the code that you're using for this and the url that's appearing?
All 7 Replies
cereal 1,524 Nearly a Senior Poster Featured Poster
tarunfuture 0 Newbie Poster
cereal 1,524 Nearly a Senior Poster Featured Poster
tarunfuture 0 Newbie Poster

diafol
tarunfuture 0 Newbie Poster

diafol
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.