Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-13-2005, 04:40 PM   #1
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
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!
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 04:43 PM   #2
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
try this perhaps? ->
$page = $_SERVER['REQUEST_URI'];
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 04:45 PM   #3
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
thanks woj, let me give that a whirl
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 04:47 PM   #4
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Displays "/test.php" I only want it to display "test" Sorry my fault for typing it wrong above

Last edited by mkx; 08-13-2005 at 04:49 PM..
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 04:52 PM   #5
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
$page = basename($_SERVER['REQUEST_URI']); (?)
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 04:56 PM   #6
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
That displays test.php without the / so it needs to just remove the .php
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:02 PM   #7
LazyD
Confirmed User
 
Join Date: Aug 2004
Location: www.calidi.com
Posts: 102
$parts = explode(".", basename($_SERVER['REQUEST_URI']));

=> $parts[0] = test
=> $parts[1] = php
__________________
Calidi studio
http://www.calidi.com
ICQ: #18466283
LazyD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:04 PM   #8
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Quote:
Originally Posted by LazyD
$parts = explode(".", basename($_SERVER['REQUEST_URI']));

=> $parts[0] = test
=> $parts[1] = php
Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/pornpar/public_html/test.php on line 4
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:06 PM   #9
budz
Disruptive Innovator
 
budz's Avatar
 
Industry Role:
Join Date: Sep 2003
Location: Vegas
Posts: 4,230
Quote:
Originally Posted by woj
$page = basename($_SERVER['REQUEST_URI']); (?)
Quote:
Originally Posted by mkx
That displays test.php without the / so it needs to just remove the .php

PHP Code:
$page str_replace(".php"""$page); 
__________________
C:\Code\
C:\Code\Run\
budz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:06 PM   #10
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
$page = basename($_SERVER['REQUEST_URI'],'.php'); (?)
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:08 PM   #11
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Quote:
Originally Posted by woj
$page = basename($_SERVER['REQUEST_URI'],'.php'); (?)
Works perfect, thanks! One last thing, any chance that it can display "Test" instead of "test" first letter caps
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:09 PM   #12
LazyD
Confirmed User
 
Join Date: Aug 2004
Location: www.calidi.com
Posts: 102
Quote:
Originally Posted by mkx
Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/pornpar/public_html/test.php on line 4
nonono

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".
__________________
Calidi studio
http://www.calidi.com
ICQ: #18466283
LazyD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:12 PM   #13
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by mkx
Works perfect, thanks! One last thing, any chance that it can display "Test" instead of "test" first letter caps
$page = ucfirst(basename($_SERVER['REQUEST_URI'],'.php'));
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:15 PM   #14
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Quote:
Originally Posted by LazyD
nonono

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".
sorry i am a php n00b
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-13-2005, 05:16 PM   #15
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Quote:
Originally Posted by woj
$page = ucfirst(basename($_SERVER['REQUEST_URI'],'.php'));
Did I ever tell you how much I love you?

Thank you all!
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.