473,325 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

finding all links (like trans-sid)

Im trying to replicate the action of enable-trans-sid with a script.
e. g throw a function a html page/string and it will replace all links
- relative or absolute - with a variable at the end. either
link.html?var=$var or link.html?inpage_var=something&var=$var
depending on whether the link had a querystring on it already.

any ideas? anything already done? dont really want to reinvent the
wheel.

Im guessing preg_replace_callback is going to be used.. something like

$html = preg_replace_callback('/<(a|area|img|link|frame|iframe|input)(.*?)(src|hre f)(\s?=\s?)("|\')?([^>
\'"]+)/is','rewrite_url', $html);

function rewrite_url($html)
{
}
Jul 17 '05 #1
0 1337

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Yang | last post by:
I want to list all images from a url. here is my code snippet which finds an image from a url: $url = "http://asdf.com/"; $text = @implode("", file($url)); while (eregi("*(src)*=*(+)",...
58
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split...
6
by: John Baker | last post by:
Hi: I wish to remove a field from a record, however when I try I am told that I cant remove it until I remove links to other records, and that the links will be showin in the links will show up...
2
by: Mats-Lennart Hansson | last post by:
Hi, I want to dynamically add links into a richtextbox control. However, I actually don't want to go to a web page, I just want to catch the linkclick event and do something else. This works...
4
by: Brett | last post by:
I'd like to find URLs inside of an email message. If there is anything between the <a></a>, I'd like to also get that and associate it with the URL in the <a> tag. Content between the <a></a>...
9
by: chrisspencer02 | last post by:
I am looking for a method to extract the links embedded within the Javascript in a web page: an ActiveX component, or example code in C++/Pascal/etc. I am looking for a general solution, not one...
1
by: Cissi | last post by:
Hi! I have a problem: I have a list of links, and all the links have a savingbutton. When you press the button the link will be saved in a cookie. I'm also supposed to be able to show the saved...
8
by: oprah_chopra | last post by:
Less than 1% of my users say they can not open links like this: index.php?variable=value&variable2=value2 Is anyone aware of some firewall/security setting that would prevent people from...
1
by: RajkiranPro | last post by:
Is there a way to extract the links from a given string which is a combination of text and links.. Eg: Downloads at download.com videos at youtube.com
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.