![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Aug 2004
Posts: 913
|
![]() PHP Code:
Please fix this so result is only www.wojfun.com (without http://) thanks!!!
__________________
Sig for sale. ICQ: 163-545-054 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Mar 2007
Posts: 165
|
check http://php.net/parse_url
__________________
webgeek ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
$url = "http://www.site.com/blah/etc.com";
// remove the http:// $url = str_replace("http://","",$url); // split at "/" $exp = explode("/",$url); // result is everything before first / $end = $exp[0]; theres shorter ways but to show whats going on
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Nov 2004
Location: scv
Posts: 2,299
|
Edit - Nevermind.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
or you could just add this to the code you have ( last line )
$trimmed_url = str_replace("http://","",$trimmed_url);
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Aug 2004
Posts: 913
|
Perfect, thank you!!
__________________
Sig for sale. ICQ: 163-545-054 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
if you do it this way then the url can either have http:// or not it wont matter
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
MOBILE PORN: IMOBILEPORN
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
|
preg_match('!^https?://([a-zA-Z\-_\.0-9]+)!',addslashes(htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES)), $ref);
$ref[1] result in www.referringsite.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Apr 2002
Location: Houston
Posts: 5,651
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
no harm in that , people have made billions over the years reinventing the wheel over and over..
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Registered User
Join Date: Apr 2007
Posts: 13
|
I like the perl version:
Code:
print "please paypal $100"; my $deposit = <STDIN>; if ($deposit == 100) { do_work(); } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Join Date: Apr 2002
Location: Houston
Posts: 5,651
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,409
|
Code:
$full_url = "http:///www.wojfun.com/contactus_form.html"; $trimmed_url = str_replace("http://","",$full_url); |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Registered User
Join Date: Apr 2007
Posts: 13
|
Code:
$trimmed_url = preg_replace('/^http:\/\/:/', '', $full_url); $trimmed_url = preg_replace('/\/.*/', '', $trimmed_url); |
![]() |
![]() ![]() ![]() ![]() ![]() |