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
Eat, Sleep, Code

Posts: 5,888
Name: Dan
Location: Swindon
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
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
When You Register, These Ads Go Away!
     
Old 05-01-2008, 04:37 PM Re: How to change urls.. and ones which are local to a url...
VirtuosiMedia's Avatar
Webmaster Talker

Posts: 603
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...
nickohrn's Avatar
Weightlifting CS Student

Posts: 505
Name: Nick Ohrn
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.
__________________
Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
nickohrn is offline
Reply With Quote
View Public Profile Visit nickohrn's homepage!
 
Reply     « Reply to How to change urls.. and ones which are local to a url...
 

Thread Tools

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

vB 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 0.12899 seconds with 13 queries