Parse String For Urls, But Not Html Links
I've got this function to convert any urls into the proper links for my CMS. However, if I want to put in my own link <a href="http://www.domain.com">A link to domain.com</a> (rather than the basic url www.domain.com), this function really stuff's it up. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Convert Dynamic Php Urls To Html Urls
tell me or give me an online tool which can help me to convert php dynamic urls to html urls to make a google friendly site.I dont have apache server on my computer and I dont want to use it.Wihtout apache server is it possible? And I amusing windows server and not Linux.
View Replies !
Converting Bad Urls To Links
here is a sample string PHP Code: $bob = "Here is a bunch of text.  and now there is some link here www. boblikes cheese.com and cheese is good for you"; and the same for email addresses PHP Code: $bob = "Here is a bunch of text.  and now there is some mailto here bob@ cheesypoofs.com and cheese is good for you"; i need to remove them spaces in the url and make it a link. cannot seem to get it to work they way i want to. everything i've done just blows up in my face.
View Replies !
Search Engine Friendly URLs.. Problem With Links
I am working on generating search engine friendly URLs for my website and I was using the $PATH_INFO method. Anyone who interested in learning, this is the article I followed. But I’m really new to this concept and I have some question which I really think you guys can help me with. now I don’t have to pass ID`s as query string (eg: http://www.mydomain.com/show.php?id=1), because now links are shown as folders.(Eg:http://www.mydomain.com/show.php/1) But guys that’s when my problem comes in. when I implement this technique to my site all the images, css will disappear. All my images and css links doesn’t have absolute urls. For example all the images are in my root "images" folder so the src attribute will have only images/filename. Code:
View Replies !
How To Automatically Make URLs Posted In A Forum Active Links?
I've been working on modifying a forum script for some time now and its almost ready to go. You can test it at http://www.designlaunchpad.com/forum if you like. The one additional feature I want to implement is the automatic creation of a link when someone posts a URL in their message. Most forums have this, is it that tough to add in? I'm pretty comfortable editing PHP and understanding what is happening where but I suck at authoring it. I checked the manual at php.net and tried searching this forum and google but keep running into dead ends. So can someone offer me some suggestions or point me toward some help?
View Replies !
Searching External URLs For A String
I'm looking to use php to search an external HTML page for a certain string that will occur the same way across many pages. Is there a built-in function that I can use to search an external HTML page for a string and store it in a variable?
View Replies !
Parse Part Of String (mid String Function ?)
Can someone tell me how to parse part of a string? I can use the following: <?php $text = $_SERVER['PHP_SELF']; //$PHP_SELF //(document.url); echo $text; ?> to get this result: "Your currently at /test.php " I just want to get "test.php " without the dash. I also need to parse out parts of other strings. I know how to use Mid(), Left(), and Right() in VB, but no clue for PHP.
View Replies !
String Replacement :: Replace Characters In Urls
I have a script that replaces characters in urls. It stores information in a php file as opposed to a database. What I would like to do is change the function as to where I can create the links with my own link text. Below are the functions used by the script. $str = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)', '<a href="1" target="_blank">1</a>', $str); $str = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)', '1<a href="http://2" target="_blank">2</a>', $str);
View Replies !
RemoveHandler .html .htm (parse Php In .html Files)
I want to parse php in .html files. I put this in .htacces file: RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Its work, but some of my php aplications have urls: www.mysite.com/this-is-page without .html in the end how to parse that? Which code I must use.
View Replies !
Finding Links In String
I'm trying to find all URL links in a string, extract them and put each link in an array. Remember some links will start http:// and some https:// and some won't have this at all. Just to make it extra confusing.
View Replies !
Parse A String With PHP
Just a quick question on something I can't figure out to do with PHP! Case 1: $text = "You worked at the local bar and made $1456 for the night"; Case 2: $text2 = "You worked at the local shop and made $5831 for the day"; Im looking for the following result: Case 1: $worked = "bar"; $wage = "$1456"; Case 2: $worked = "shop"; $wage = "$5831";
View Replies !
Parse A String Out
I'm trying to parse a string out. From the URL I manged to get the size. Code: if (powerpoint_size=="small") { psizeW="320"; psizeH="148"; powerpointAddress = "http://www.testurls.com/powerpoint.320.ppt"; embedPowerPoint(powerpointAddress, psizeW, psizeH); } else if (powerpoint_size == "medium") { psizeW="480"; psizeH="216"; powerpointAddress = "http://www.testurls.com/powerpoint.480.ppt"; embedPowerPoint(powerpointAddress, psizeW, psizeH); } else if (powerpoint_size == "fullsize") { psizeW="640"; psizeH="284"; powerpointAddress = "http://www.testurls.com/powerpoint.640.ppt"; embedPowerPoint(powerpointAddress, psizeW, psizeH); ...................
View Replies !
Strip Links From Html
I want to strip links from various html pages that I enter from a form. I am so far using file_get_contents() to get the info into a string. The part I am confused with is how exactly do I get the link text itself into one string and then the href or url it leads to in another?
View Replies !
Getting Title From HTML Links
I'm trying to get the title from a string with an html link using this code: <?php $string = "<a href=/test>test link</a>"; $get_title = ereg_replace('<a href=[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]+>([[:alpha:]])+</a>', Ƈ', $string); echo $string; ?> however, it just spits out the same HTML link, a bit of help please?
View Replies !
Suggestion On Ways To Make SEF Urls (search Engine Friendly Urls)
I'm trying to create search engine friendly urls for my site. The site structure looks something like this: Category1 -Article1 -Article2 -Product1 -Sub-catetory --Article3 --Article4 --Product2 --Quiz1 Category2 -Article5 -Quiz2 Basically, there are 2 levels of categories and there can be an Article, a Product or a Quiz at any level. I need the URLs to look like folders. Code:
View Replies !
How To Create Dynmanic Links In URL String
I need to create a list of links from a table. I have them displayed, so that part is done. I need the links to pass info through the URL string to another page that will be dynamically constructed using that POST or GET data. I know how to do that part too. Code:
View Replies !
Using PHP To Parse Through HTML
I'm using PHP 4 and trying to parse through HTML to look for HREF attributes of anchor tags and SRC attributes of IMG tags. Does anyone know of any libraries/freeware to help parse through HTML to find these things. Right now, I'm doing a lot of "strstr" calls, but there is probably a better way to do what I need.
View Replies !
Html To Parse Php
i want my html files to parse php files. how do i do it? i have access to httpd.conf what should i add? is it not advised to do something like that?
View Replies !
Parse Php Through Html...
I'm trying to get my php pages to parse php within HTML, instead of php brackets. Basically instead of having: lets echo a variable/constant: <?php echo $somevariable . ' or ' . SOMECONSTANT; ?> I want to use somhing like: lets echo a variable/constant: {$somevariable} or {SOMECONSTANT}Is this at all possible? I'm not wanting to do anything more difficult than echoing simple variables or constants..
View Replies !
Parse Html
I want to chunk a html page and parse that page using php.ie that html page contain many data.I want to retrive that data using php and want to save in a database.
View Replies !
Parse A String For Certain Words
I was wondering if php can parse a text string for certain words and return "true" if that word is found. For example, I have a string like this: $string = "The rain in spain is the same as the rain on the plain"; I want to run a php command(s) that will parse the sentence and return true if, for example, the word "spain" is found.
View Replies !
IMAP To Parse String
I currently have incoming email piped to a php script using a .forward file. I would like to be able to parse the incoming mail, perform operations, and then fire back an email (immediately) to the sender. Is there any way that I can use the php IMAP functions on either the php://stdin stream (the means through which the email is piped as raw text) or on a plain string? If not, are there any recommendations for what I can use to parse an incoming email which may or may not be MIME?
View Replies !
Parse / Split String
I'm trying to parse/split the following text using preg_replace and haven't had too much luck so far. String = string is surrounded by other text and also contains the brackets exactly as shown. I would like to do something like this with it: <a href="http://www.domain.com/please parse">this part</a>
View Replies !
Parsing Out Links In HTML Docs
A question from a PHP newby who is disorientated by the overwhelming amount of existing example scripts. -- What is the best/simplest way to parse out the links in a a HTML document and putting them in an array? --
View Replies !
Grabbing Links Off Html Pages
does anyone know of a way to grab all the links on a html page with PHP, I'm trying to develop a doorway page maker, that will search the search engines and grab the keywords from the top ten of each search engine then extract the keywords and store them in a database. Also does anyone know if I can use PHP to zip files up?
View Replies !
Relative Links From Html Page
I am trying to pass variables from a html form to a php form. I am using IIS as a server on XP Pro and find that relative links are not working (see explanation below), but a fully qualified link (http://localhost/weblink.php) does work. If the relative link is used, the browser opens up the PHP page as code and does not execute the code. Is this a IIS problem, or a configuration problem, and where might the problem be?
View Replies !
Parse PHP Code In .html??
I was wondering if it's possible to parse PHP code in .html documents without requiring root access (since I'm on a virtual server). I want to make a two line call to a log program, but I don't want to have to change all of my .html files to .php.
View Replies !
Parse A Html Site
does anybody know a script that cachtes any data from a web site (html) and put it in a csv or something? I think parse is here the magic word or?
View Replies !
Parse A Html Document
Anyone have any ideas how to parse a html document. I am trying to extract out specific information from the page. Also, what do you do if the page is dynamic (e.g. a cgi generated page) how do you find it?
View Replies !
Parse Html Page
How can I import a html page with my php script? I have a simple html page that actually just generates a simple table of values. I just want to strip the values to insert in to a database. How do I import the html page to my php script to parse it?
View Replies !
Parse HTML From Within A PHP Script
I'm writing my website backend. This consists of a series of pages for adding and updating information about widgets to a database. Most of the pages have bene very simple, however I elected that three fields would accept HTML as there data by necessity. These three fields contain a manufactures description of the item, a description written specifically by the company, and lastly the spec sheet on the product. I'm designing the back end page that will allow modification of existing database items. I'm using <textarea> tags for the data. The problem being that I believe if I write a line like: echo "<textarea name="$fieldname[$i]" rows="5" cols="25">$thevalue[$i]</textarea> $theValue will be interpreted as the HTML it is instead of displaying the HTML so it can be edited and resaved to the DB. I haven't finished all the entire script so I haven't been able to test that theory yet, so if I'm wrong I'd be happy to hear it. if I'm right how can I get around it?
View Replies !
Parse HTML ASCII
When parsing HTML is it possible to have all the ASCII codes converted to their real values first so that I do not need to search for them to exclude them. For example the following is retrieved as a price however it would be easier to extract using a regex if the code was first converted to a dollar sign: <h3> $249,000 </h3>
View Replies !
How To Parse This Into HTML Tables
I'm trying to parse a file in order to get it displayed onto a webpage using HTML and tables. I got a good deal of the parsing done but there's a problems that I can't solve. So here is a part of the file Code:
View Replies !
Parse Query String Question
Hello, I have a querystring (&amt=138.06&opt=none), and I dont know how to read these passed variables. For example, where my querystring says "&amt=138.06" I cannot read these variables in my php script as $amt , or . $amt....these give me a parse error. When I do this: $data = $HTTP_SERVER_VARS['QUERY_STRING']; echo $data; It outputs the complete querystring-- can anybody please suggest some code to extract the value of "amt" from $data?
View Replies !
Parse A String With An Email Address
I need to parse a string with an embedded email address. The string always has the format NAME (name@domain) SOMETEXT. What I need to get is the email address as name@domain. I came up with this (I know it's broken, but it's a first start): <?php function ParseTicketEmail($ticket) { global $TicketEmail; for ($i=0; $i< strlen($ticket); $i++){ //we need to pass everything between ( and ) to $TicketEmail nothing else do { $ticket[$i] = $discarded; } while ($ticket[$i] != '('); while ($ticket[$i] != ')'){ $TicketEmail = $TicketEmail . $ticket[$i]; } } return $TicketEmail; } $ticket = "hello (world@world.com) bla"; print "$TicketEmail"; print "$discarded"; ?> But that doesn't return anything for either $TicketEmail or $discarded. So: a: why doesn't it return anything for either string? (It's too early in the morning here) b: does anyone have such a function anywhere for me to check out for how to do it?
View Replies !
Connect String Parse Error
I am getting this error when I use the connection string. I have no trouble connecting to MySQL via telnet, but I cannot connect using PHP connection string? Parse error: parse error in /connect.php3 on line 3 line 3 is the username. <? $hostname = "" $username = "user" $password = "pass" $dbname = "db" MYSQL_CONNECT($hostname,$username,$password) OR DIE ("Can't Do It");?>
View Replies !
Parse String , Return Hyperlinks
I have a string with the following information. $myString= "This is my example string please. Please visit http://www.mylink.com . More example text goes here. another link http://www.link2.com . more text.. blah.."; What I'm wanting is a function to return the following string : $myString= This is my example string please. Please visit <a href'http://www.mylink.com'>link</a> . More example text goes here. another link <a href='http://www.link2.com'>link</a> . more text.. blah.."; Each string may contain 0 or more http:// instances. The function would only parse on an http:// match. I know this could be done with regular expressions, but I'm not sure how to insert the modified data back into the original string at the correct location.
View Replies !
Parse An Alpha Num String For Validation.
I am needing to parse an alpha num string for validation. The string needs to always begin with one (1) alpha character (A - L only) then be followed by eight (8) numerical characters (0 - 9) and then end with one (1) alpha character (A - Y but not allow the O). If the string is not in this format I need to kick it back to the form for the user to fix the string. Any ideas on the best way to validate this type of string.
View Replies !
Another Parse Error, Unexpected T String
Parse error: parse error, unexpected T_STRING in /home/sites/example.co.uk/public_html/checkout.php on line 47 I new to PHP and i'm using WA Ecart and DW MX2004 to create a very simple shop. For learning purposes. The checkout page seems to have a error on line 47 which is the submit button. My code:
View Replies !
HT://dig And Other Search Engines Wont Look At Query String In Links
I realize that this is no the HT://dig support forum but I haven't been able to get htdig to index my site properly: It will only show one file: index.php when every other files is linked off the main page (i.e. index.php?content=page2.html ) I believe that this search engine is not looking at the QUERY_STRING properly or following the links off the main page. Does anyone know how to get htdig to work on a dynamically generated site - or can you recommend another search engine that would help index and search such a site.
View Replies !
How Do I Parse PHP Code Within An HTML File?
I'm trying to figure out a way to save message bodies of the various e-mails I send from my site into HTML pages and then import them when I send the e-mails. But I've never tried anything like this before so I'd appreciate some help. Here's an example of the code I'm using: Code: $email_body = file_get_contents("emails/application_approved.htm"); I can import the HTML files without problems, but I've also got PHP variables in the HTML code and I need to know how to parse those variables. Is it even possible?
View Replies !
WinXP/IIS Set Up For PHP To Parse .html Extensions
I just installed PHP (4.3.3) on a WinXP (SP1) system using IIS (5.1) as the web server. I am using FrontPage 2002 and would like to be able to debug my PHP scripts locally. Since FP does not handle the .php extension as a web page (edit, display, navigation, etc.), I am trying to set it up to parse files with the .html extension. I have added the .php and .html extensions to the Application Configuration page of IIS and I have also applied some regedit changes suggested by the documentation. All to no avail. The .php extension works, the .html does not.
View Replies !
How To Use .htaccess To Parse Only .html Files As .php?
I am trying to make my server (Apache) parse .html files as .php. I found this line of code: ForceType application/x-httpd-php placed it in an .htaccess file and uploaded it to the directory I wanted it to work. And it worked; my .html files are all parsed as .php. But, apparently, so are my images, so they aren't loaded into the pages. And something else, my css file isn't found anymore by Netscape and Mozilla, while IE has no problem... I'm calling my css file with @import url(all.css); in the <style> block in the head of my .html files. How do I make the server parse _only_ .html files as .php, and why don't Mozilla and Netscape find the css file? (They did before I sent the .htaccess file)
View Replies !
|