![]() |
Need quick php script
If url = www.mysite.com/page.php
$Page = page.php In that case I can put something like: www.mysite.com/archive/<?php echo$page;?>archive3.php Can someone do this for me quickly? In a nutshell, it is basically making a variable of the page name. (page.php) Thanks! |
try this perhaps? ->
$page = $_SERVER['REQUEST_URI']; |
thanks woj, let me give that a whirl
|
Displays "/test.php" I only want it to display "test" Sorry my fault for typing it wrong above
|
$page = basename($_SERVER['REQUEST_URI']); (?)
|
That displays test.php without the / so it needs to just remove the .php
|
$parts = explode(".", basename($_SERVER['REQUEST_URI']));
=> $parts[0] = test => $parts[1] = php |
Quote:
|
Quote:
Quote:
PHP Code:
|
$page = basename($_SERVER['REQUEST_URI'],'.php'); (?)
|
Quote:
|
Quote:
What I wanted to say is that after "exploding" the string into an array, the variable $parts[0] will contain "test" and variable $parts[1] will contain "php". |
Quote:
|
Quote:
|
Quote:
Thank you all! |
All times are GMT -7. The time now is 06:08 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123