How to change url in php
I want to change the URL through PHP. Show Something like I want the same thing but in PHP. How can I do it?
asked May 4, 2010 at 9:57
1 You can use the
answered May 4, 2010 at 9:59
SarfrazSarfraz 371k73 gold badges529 silver badges574 bronze badges 0 You could use the header() command:
answered May 4, 2010 at 10:00
richsagerichsage 26.7k8 gold badges57 silver badges65 bronze badges
Make sure there is nothing above the line outputted, otherwise it will fail.
TimWolla 30.9k8 gold badges64 silver badges94 bronze badges answered May 4, 2010 at 10:00
GlycerineGlycerine 6,8543 gold badges38 silver badges63 bronze badges 1
answered Sep 25, 2016 at 23:03
MysticalMystical 2,1952 gold badges21 silver badges35 bronze badges 1 Recommended Answers
Jump to Post
Jump to Post All 6 Replies
10 Years Ago
you mean there's an htaccess already and it's ruining the normal operation? because if there's no htaccess, then the path /htdocs/emp/emp.php will be viewed in http://localhost/emp/emp.php, take note of the folder "emp".
10 Years Ago
I understand that you don't have a htaccess file in your folder with the project emp and you want to redirect localhost tolook like http://localhost/emp.php.
diafol 10 Years AgoEdited 10 Years Ago by diafol because: n/a
Reply to this topic Be a part of the DaniWeb community We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge. How can I change the current URL in PHP?php if (! $_GET["name"] && $_GET["id"]) { // perform MySQL query to get name based on id header("Location: http://www.something.org/zzz"); die(); // stop execution of this page } // if we got here, $_GET["name"] is set, so do whatever this script is supposed to do. ?> NOTE: The above .
How can I change URL without reloading page in PHP?It will be helpful to understand the given script.. First of all, fire click event on the navigation link a. ... . Prevent page refreshing using e. ... . Get the Current URL by clicking a navigation link and store it in pageURL.. Change URL without reloading the page using history.pushState(null, '', pageURL). How do I get the URL of a PHP file?To get the current page URL, PHP provides a superglobal variable $_SERVER. The $_SERVER is a built-in variable of PHP, which is used to get the current page URL. It is a superglobal variable, means it is always available in all scope.
What is a PHP URL?Definition of PHP URL. Generally, the URL means Uniform Resource Locater. Likewise, URL in PHP Programming Language is also the same. URL is nothing but a website address. It helps in connecting the client and the server when browsed using a specific link.
|