Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to change urls.. and ones which are local to a url...
Old 05-01-2008, 04:27 PM How to change urls.. and ones which are local to a url...
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Hello.

Okay so im playing with a thing whcih is basically acting like a proxy.

It gets page, using file_get_contents() uses str_replace to change the urls inlinks and srcs to http://mysite/script.php?proxy=Actual URL of link.

and simply adds the bit before proxy=

but when you get urls which are just page.php how can i do it?

i tried some really messed up attempt at regex which was something like

value="[a-z!http]


:s

im confuddled how could i be done?

Thanks,
Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 05-01-2008, 04:37 PM Re: How to change urls.. and ones which are local to a url...
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
Wouldn't you just have to scan to see what the base URL and directories are for that current page and then prepend them to page.php? So, for instance, you're viewing www.google.com/adsense/millions and you have a link on there for page.php, you would scan for and add www.google.com/adsense/ before page.php.
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 05-02-2008, 10:47 AM Re: How to change urls.. and ones which are local to a url...
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
I agree with VirtuosiMedia on this one. You just need to consider the domain that you're accessing and then append the relative link to the domain folder so that you're essentially making an absolute link out of a relative one.

For a good start, you may want to see this forum post, as it has some good ideas.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Reply     « Reply to How to change urls.. and ones which are local to a url...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.14721 seconds with 12 queries