url
Moderator: General Moderators
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
<script language="JavaScript">
document.write('The URL is' + window.location.href);
</script>
window.location.search actually only returns the url parameters.
document.write('The URL is' + window.location.href);
</script>
window.location.search actually only returns the url parameters.
Last edited by microthick on Mon Dec 29, 2003 6:12 pm, edited 2 times in total.
I take it you want this done in PHP?
Code: Select all
<?php
$page = $_SERVER["PHP_SELF"];
$uri = $_SERVER["REQUEST_URI"];
echo "{$page}<hr />{$uri}";
?>-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
I've never used REQUEST_URI. Does it return the whole url, including url parameters?Gen-ik wrote:I take it you want this done in PHP?
Code: Select all
<?php $page = $_SERVER["PHP_SELF"]; $uri = $_SERVER["REQUEST_URI"]; echo "{$page}<hr />{$uri}"; ?>
Yep it sure doesmicrothick wrote:I've never used REQUEST_URI. Does it return the whole url, including url parameters?Gen-ik wrote:I take it you want this done in PHP?
Code: Select all
<?php $page = $_SERVER["PHP_SELF"]; $uri = $_SERVER["REQUEST_URI"]; echo "{$page}<hr />{$uri}"; ?>
If you run the following script:
You'll discover a few more that work similar.
Code: Select all
<?php
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany
Hey Nay, now you've disappointed me!
Read this uri-clarification, there are URN's too! Great!
I'm waiting for the URQ's....
Read this uri-clarification, there are URN's too! Great!
I'm waiting for the URQ's....