Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Extracting Info From HTML


Im needing some help with writing a PHP script. Basically all i want to do is write script that can extract data from a table in html format into a MySQL database on my server.




View Complete Forum Thread with Replies

Related Forum Messages:
Extracting Img Tag Info From HTML Source
I'm having a bit of a brain meltdown trying to figure this out. If anyone has a suggestion I could try, that would be excellent.

I'm trying to extract specific pieces of data from an html source file. In particular image tag information. If my file contains lines similar to:

<a href="images/picture.jpg" target="_blank"><img src="thumbnails/picture.jpg"></a>

I'd like to be able to extract the a href URL and the img src as two seperate variables and ignore any other HTML source and tags inside of the file. For all intents and purposes ending up with an array of the following:

$link[0]="images/picture.jpg";

$thumbnail[0]="thumbnails/picture.jpg";

View Replies !
Extracting Info From An Array
I have an array named Task and inside the array is another Array it looks like this
[task] => Array ( [0] => prr [1] => tyh [2] => rfd [3] => sds [4] => yui [5] => rtr [6] => wer ) I need to find out how to extract the initials prr, tyh, rfd,sds,yui,rtr,and wer is there any way possible to do that so i can send each set to my database.

View Replies !
Extracting Info From Array Problem
I am having problems trying to solve an issue with something I would like to do with a site I am creating.

I would like to store a bunch of words into an array. Then, I would like to be able to extract all of the words that, say, are repeated at least two times inside of the array.

For example,

$test_array = array("butter", "bread", "milk", "butter", "bread", "yoghurt", "butter", "eggs", "eggs");

I would like to be able to extract the words that are repeated at least twice, as well as extract the info about how many times they had appeared. So I would have something like

butter - 3 times
bread - 2 times
egss - 2 time

I am trying to extract this information, and thought about using a 'foreach' statement, followed by a 'for' statement that would go through the array and try and match the current array value (as retrieved from the 'foreach' statement) with the rest of the values of the array. If there was a match i would increase a counter variable by one.

However, I am having lots of troubles with this, and because my knowledge of php is very basic, I am not sure of what to do, or if there is an easier way for me to achieve my aims.

View Replies !
Reading And Extracting Info From Another Page?
How would I extract some info from another site and then display it on my site?

View Replies !
Extracting Info From Files In A Flat File Database
I am in dire need of a script that can read the variable files from within a file (ie: client_01.inc).

I already know about the include()  and require() commands, but I want a table with a script that points to a directory of files.

I have client files each with variables in each file and the table needs to extract the info from each file in that directory to display in the table. Code:

View Replies !
Extracting Specified HTML Tags With Regex
I have a regex problem, spent about 7 hours on this now, but I don't find
the answer in the manual and googling, though I think this must have been
discussed before.

I try to simply extract the title and meta tags of a valid HTML page as an
array:

function extract_html($filename)
{
$ret = array();
// put file into string
$contents = file_get_contents($filename);
// title
$p = preg_match_all('<(title|TITLE)>(.+)</(title|TITLE)>', $contents,
$matches);
if ($p > 0) {
$ret[] = $matches[0][0];
}
// metatags
$p = preg_match_all("<(meta|META)(.+)>", $contents, $matches);
if ($p > 0) {
for ($i=0; $i<$p; $i++) {
$ret[] = $matches[0][$i];
}
}
return $ret;
}

What happens is:
- The title part gets no match
- The meta matches are correct, but miss the opening <

The examples I have seen in the manual all seem to have no problem with <
and > in the patterns. I don't know where to look and also don't understand
all parts of the regex section.

View Replies !
Extracting Parts Of An Html File
Given a regular formed html document, what would be the easiest way to
grab 3 parts of the file?
1- everything from beginning of file up to and including the <body>
tag
2- everything between the <body> and </body> tags
3- everything from and including the </body> tag to the end of file

Storing the contents of the file into an array I think would be best
but I can read the 2nd set into an array if I could figure out how to
isolate it.

View Replies !
Passing Info From Html To Php
I'm trying to pass info from a "Drop list" in an .html form into a .php which will then query a database. It doesn't work and I wondered if I'm missing something easy?

If I junk the dropdown list and just put a "textfield" there is no problem but I want to have the fixed choices list. Here is the code:

View Replies !
Get Info From A Html Page With Php
im looking for a way to get info from a html page in php i have a code that was sapose to work but no longer does any one have any ideas on how to make it work? here is the Code:

View Replies !
Pass Info From To HTML
I'm wanting to pass a value from PHP into a hidden input in HTML. I don't want it to travel in the URL if possible.

for example to help paint the picture.

From PHP
I want to pass this: value="true"

To HTML
<input type="hidden" value="false">

View Replies !
Retrieveing Info Passed From Html
i have a flash banner on a page that when clicked sends the browser to another page. This banner is linked to a php file that counts the amount of clicks on the banner. In the html page for the flash banner I have: Code:

<embed src="swfs/banner1.swf?clicktag=forms/tracking/bannertrace.php&clickheader=http://www.somewebsite.com" width="570" height="80" align="middle">

in my php file I have: PHP Code:

<?php
$traceFile = "banner/clicktrace.txt";
$clickURL = $_GET(clickheader);
$fh = fopen($traceFile, 'r'); $theData = fread($fh, filesize($traceFile));
fclose($fh);$fw = fopen($traceFile, 'w');
$theData = $theData+1; fwrite($fw, $theData);

However the clickheader variable that contains the URL does not get passed to the php file.

View Replies !
PHP Displaying Info Input On HTML Form
I'm in an exercise where I've created an order form in HTML. The form displays properly and allows me to input certain test order info just fine. The relevant lines in the HTML form are: Code:

View Replies !
Parse An HTML File Using Php To Get Some Specific Info
I want to parse an HTML file using php to get some specific info from that page. How do i get started? Do u have any tutorials about it?

View Replies !
HTML Presentation Page For Uploaded Info?
I've seen a lot of posts about uploading files, but not much about what happens afterwards. Can someone point me to a tutorial, post or book which will help me solve this problem:

I'd like to have a form where users can upload a photo, add a short bio, put in some contact info, and have all of this information stored in a database (natch).

Then I'd like for this form to take this user's data and put it into an html presentation template. Ideally, members would sign in and be able to modify their own profiles as well as view other profiles.

View Replies !
Filling My SQL Database With Info From HTML Source Code?
I am desperatly browsing around trying to find some way to add data to mySQL from raw HTML sourcecode.

I basicly have HTML pages showing lots of info on work, and I want to take that info - add it to mySQL so I can sort, select and browse the information in a better way.

Hope someone knows what I mean.. (many online textbased games have this on various fan pages for calculating purposes, ie. Earth2025 and Utopia)

View Replies !
Sending "header" Info After HTML?
I am looking to use "header("Location:index.php");" in my code. Basically this will be called when the user logs in to redirect them to the home page but as you expect I get the usual "headers already sent message"

Just wondering how to get around this? Do I use the ob_start() method or something?

View Replies !
Reading Unix Group Info And User Info
how one reads group/user info of *nix servers using PHP? Is it possible at all? I need to authenticate people on a secure local website by looking at their group and user rights.

View Replies !
Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed.

Here is the situation...

If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'.

So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.

View Replies !
No Mysql Info Through Info();
I am trying to install mantis, and I get errors when I try to run the install script saying that mysql is not configured to run on php.

I call the phpinfo() function and I see nothing relating to mysql.

I open the php.ini file, and, to be honest, it looks alright.

the extension_dir points to /usr/lib/php4 which includes the mysql.so extension.

Furthermore, I located the mysql.sock file and pointed the default socket to it, but nothing. what exactly am I missing? Code:

View Replies !
Extracting Tar.gz
is it possible to extract tar.gz files on a remote server through PHP? Or do i need to use telnet or something?

View Replies !
Extracting URL
I am try to write a script using PHP and Ajax that is able to extract information from the URL. Says, web page 'A' will call this url using Ajax with information attached at the end of it So, I am just wondering how to extract the information from fname onwards. How will be the coding looks like in check.php?

View Replies !
Extracting The End Of A URL
I am trying too make a script that can check URL's, which I managed too do with no problem at all. I was wondering was there a way my users can enter multiple urls into a textbox and have the script extract the end of each URL. For example, the user submits:

http://mydomain.com/files/13039621/2k5pro.part28.rar.html

I want the script too delete the first part so it is left with:

/13039621/2k5pro.part28.rar.html

and place it in an array. It would also need to be able to take a bunch of links at one time, such as:
http://mydomain.com/files/35539621/2k5pro.part28.rar.html
http://mydomain.com/files/13242343/2k5pro.part29.rar.html
http://mydomain.com/files/13423621/2k5pro.part30.rar.html
http://mydomain.com/files/13044421/2k5pro.part31.rar.html
http://mydomain.com/files/13252331/2k5pro.part32.rar.html
http://mydomain.com/files/12449621/2k5pro.part33.rar.html

View Replies !
Extracting Data From XML ?
The following is the sample XML file from which I want to
extract the data of which availabity ="Available" using php.

The XML file will be generated dynamically from the URL http://www.upc.nl/zipcode.php?zipcode=3565BG

<UPC-Results>
<DateTime>05-12-2005 02:08:26</DateTime>
<Errors/>
<Products>
<Product name="CaTV" availability="NotAvailable"/>
<Product name="Chello Starter" availability="NotAvailable"/>
<Product name="Chello Easy" availability="NotAvailable"/>
<Product name="Chello Light" availability="NotAvailable"/>
<Product name="Digitale telefonie FreeTime" availability="NotAvailable"/>
<Product name="Chello Classic on DSL" availability="Available"/>
<Product name="Chello Plus on DSL" availability="Available"/>
<Product name="Chello Extreme on DSL" availability="Available"/>
<Product name="Digitale telefonie Basis on DSL" availability="Available"/>
<Product name="Digitale telefonie FreeTime on DSL" availability="Available"/>
</Products>
</UPC-Results>
 
from the
above XML, I need to get data of Product name which has the status of
"Available"

View Replies !
Extracting First Character
I was wondering how would I extract the first letter or number of a string. Like if the string was "Goat Chesse" only extract the "G".

View Replies !
Extracting Words
I'd like to extract the first 5 words from a blurb of text. I can't find an easy way to do that. Example. If I were to do that for this message I'd extract "I'd like to extract the"

View Replies !
Extracting XML & RDF Data Using PHP
I have an XML file that contains metadata in the form of RDF. The file
is something like this:

<?xml version="1.0" encoding="utf-8" ?>
<xmpData>
<WavXmpInfo path="C:.....................................")
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/
DynamicMedia/" xmlns:xap="http://ns.adobe.com/xap/1.0/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:xapRights="http://ns.adobe.com/xap/1.0/rights/" xmlns:dc="http://
purl.org/dc/elements/1.1/" xmpDM:audioSampleRate="16000"
xmpDM:audioSampleType="8-bit"
xmpDM:audioChannelType="1"
..........
..........
..........
<dc:rights>
<rdf:Alt>
<rdf:li xml:lang="x-default">HHHHHHHHHHHHHH</rdf:li>
</rdf:Alt>
</dc:rights>
</rdf:Description>
</rdf:RDF>
</WavXmpInfo>
</xmpData>

I want to extract data such as audioSampleRate, audiosampleType etc,
so that i can insert them into a database. I'm having problems
accessing this data.
I'm using DOMXML. Can this type of data be extracted using DOMXML? If
not how would one go about accessing it?

View Replies !
Help With Extracting Please Folks.!
I have this:
a variable like: <a href="http://www.some_html.com/text.html" >some
text</a><br>

I heed to extract the "http://www.some_html.com/text.html " and put
it in var "link"
And extract "some text" and put it var "text",.

So basically extract all between <a href=" and " >
plus extract all between " > and </a><br>.

View Replies !
Extracting Value From A Drop Down Box
I am having problems extracting the values from a drop down box and based on the value obtained there are some operation done. Code:

View Replies !
Extracting Text From Pdf
I have to index the text of a pdf document.

Does any of you know of a PHP script/extension or a binary that is able
to extract the text ?

The pdf extension mentioned in the php.net docs seem to indicate that
it's for _creation_ of documents only, is that so? Same with all the
PHP classes i have found.

View Replies !
Extracting Information
Does anyone know where I should start with this. Im trying to extract the
information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be
looking at. I want to get the OS, Browser, IP etc..

View Replies !
Extracting A Rar File
i try to extract a rar file via php but i get an error:

Fatal error: Call to undefined function: rar_open() in --parksdiary.com/httpdocs/rar2.php on line 8 Code:

View Replies !
Extracting Data From XML
What I want to do is extract data from an XML file and store it as a variable for writing to a MySQL database. I have read many google-found tutorials, but none of them seem to work/do what I want.

View Replies !
Extracting Part Of Specified URL
I have seen some tutorials on how to retrieve a section of the current URL with php, but what I am trying to do is a little different. I need to be able to specify any myspace URL in a form and have the output be a section of that URL. For example:

I input the following URL into a form field:
http://www.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=257367900

when the submit button is pressed the output should show:
257367900

I need it to be so that I can input any myspace url as such and the output will be everything after the "&friendid="

View Replies !
Extracting Metadata
Is there anyway to extract the metadata i.e. title, artist, album, from audio files using PHP?

View Replies !
Searching Then Extracting
I have a page with a lot of html jiberish and burried in that page is a series of links in the form of

<a href="site.php?site=xxxxx">xxxxx[/url]

I want php to do this.

Search through the file and find each <a href="site.php?site=xxxxx">xxxxx[/url] then isolate what is between site= and "> then add that to an array so that

$matches[0] = xxxxx
$matches[1] = xxxxx

How would I go about doing this ?

View Replies !
Extracting Data Row
Lets say i have a page with 10 input rows, and i have a txt file with 10 lines of text in it, how do i upload this file so the script would place each line into each row?
Where can i find an example of similar script?

View Replies !
Extracting Between Commas
I'm working with a database that would take me days to change to the correct format so I'm in need of a workaround. Is it possible to extract text that is in between two commas?

I have a long string with multiple commas seperating the values, but it's only the 2nd line that I need for passing on in my code. The best way to explain is example:

What's in the database:

text123, WHAT I WANT, more stuff, another line of junk, both letters and #'s

Can I create a function that turns a variable into "WHAT I WANT"?

I know this is weird, but this database has 20,000+ entries and the "part number" I need is within one of the fields...and it's the only way to identify what I need.

View Replies !
Extracting Anchor From Url
I have a page with a bunch of anchor tags. eg:

<a name="tag1">
some text
<a name="tag2">
some more text

(In case you didn't know what anchor tags looked like!)What I want to do is write to the database when a particular anchor is requested. So for Code: <a href="page.php#tag1">
We just go to the tag. But for Code:

View Replies !
Extracting The Query
I need to extract the query data from a refering URL and post it through my form. I've viewed several examples with some very complex filtering but I dont think it needs to get that involved. Can someone point me to a very basic starting point or some commented scripting that I can start with.

View Replies !
Extracting Data
I have a text file I need to extract 2 values from. The data I need is in the form

<tag var1="123.456" var2="987.456" />

The file has a lot of other junk I don't need. "<tag" is unique and only occurs once in the file. I need to assign these values to a couple PHP variables. The number of digits in each number might change. The names "var1" and "var2" will not change, but are not unique (other tags might use the same variable names).

What is the best way to do this in PHP? I tried regex, but I am not very good with regex.

View Replies !
Extracting Data From Pdf
I was wondering if anyone has any experience processing data or extracting data from pdf documents?

I have a group that uses an online system to place orders. Documentation of the order is output in pdf format. The same group uses another (separate) online utility to log and track purchases. I'd like to create a script that can process these pdf's for automated upload into the database the utility extracts from.

I found a feature in Acrobat 6.0 called batch processing. One of the predefined processes is to convert a selection of (multiple/single) files to rtf's (rich-text). That is half the battle right there. Unfortunately, I don't see a php function comparable to this Acrobat feature (not surprising since most php functions are for generating pdfs not breaking them down). I'm just beginning to look into this, but my initial/backup plan is to manually convert these saved pdf receipts into rtfs and then process the rtfs using reg exp.

Does anyone have any other ideas/methods of processing these documents? Is there a way (script) to automate this conversion from pdf to rtf? Any suggestions, comments, or potential pitfalls would be appreciated.

View Replies !
Extracting Images Only
I have a directory on a site from which I want to extract the button images only for preloading purposes. These images start with "button.". I suppose I first use scandir('..'), but then how do I extract just those filenames that are buttons?

View Replies !
Extracting Every URL From A Page
Trying to extract every URL from a page, but not having much luck. Can get the page okay, but think there's an issue with my regexes when it comes to matching URLs. I've tried searching for regex examples but they don't seem to work so well. Code follows:

$url = $_GET["url"];
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 20); // times out after 4s
//This gets the page
$result = curl_exec($ch); // run the whole process

// This is the part that doesn't seem to work
ereg('https?://([-w.]+)+(:d+)?(/([w/_.]*(?S+)?)?)?',$result,$eventurl);

When I print_r($eventurl) I get all the data from the first URL to the end of the page, all contained in the first array item.

View Replies !
ZIP File Extracting
I am trying to set up a form where users upload zips, the zip is extracted into their specific user directory and then the zip file is deleted (These photos are then displayed on their userpage)

The problem occurs when someone zips a folder and/or uses mac osx to create the zip.

The resource forks (files that begin with ._) get treated as regular images, macosx also creates a folder in the zip called __MACOSX and I can't figure out how to parse all the files into one directory

I'm using the pclzip library

(http://www.phpconcept.net/pclzip/man/en/index.php)

And it has an option to only get files that match a certain preg expression(PCLZIP_OPT_BY_PREG)

I don't know preg's that well, can anyone tell me how to write a regular expression that will select everything BUT files/folders that begin with ._ or __?

View Replies !
Extracting A Numerical Value
I have a string value, "1,250" (one thousand, two hundred and fifty). Is there a PHP function I can apply to this string that will give me the value 1250 in a variable? I've tried "intval", but I get a value of 1 (one), at least in PHP 4.

View Replies !
Extracting All The Words
I have table in Mysql called a... In is it is a bunch of names. How do I change this code to extra all the names that starts with a? from row a?

$result = mysql_query("SELECT * FROM details WHERE a LIKE 'a2'");

while($row = mysql_fetch_array($result))

{
echo $row['a'] . " " . $row['b'];
echo "<br />";
}

View Replies !
Extracting A Whole Sentence
Assume that we have a long string, say a paragraph like:

"sentence1. sentence2. sentence3... This is the sentence containing keywords. sentence5. sentence6...."

I know how search and locate the keywords. My problem is to extract the complete sentence that contain my keywords. That is to say, I will search the string, find the keyword(s), and extract only the sentence with my keyword(s) in it.

View Replies !
MYSQL - Extracting
I've got a problem with the navigation links on my webpage. The navigation links to a page whos url changes. Im new to php so bear with me. I want to be able to grab a cell from a table in mysql and display it something like this: Code:

echo ("<a href="http://www.site.com/body[$insert-from-mysql-columnone-rowone].htm"><img src=image.gif border=0></a>");

View Replies !
Extracting Certain Data
Ok, I'm a bit experienced with PHP and Regex, but this is just over my head. Here is an example for the original string input:

<td><font face="verdana,sans-serif" size=1>&nbsp;153277</td>
<td>&nbsp;<a href="/url/"><font face="verdana,sans-serif" size=1 color=#000000>DATA< /a ></td>

I would like to scrap everything except ?', '/url/', and 'DATA' -- and I would prefer these to be in seperate strings. For example, $number = "153277", $url = "/url/", and $data = "DATA" What would be the regex and PHP code to do this? I'm just completely lost.

View Replies !
Extracting Web Data
Can anyone point me to java packages which aid in parsing web pages?

View Replies !
Extracting Value From <textarea>
I know textareas can be tricky, but I have never tried to extract the contents of a textarea with php. Here is my code that won't work:

<?php session_start();
$textarea = $_POST['textarea1'];
?>
<html><head><title>Untitled Document</title></head>
<body>
<form action="<?php $_SERVER['PHP_SELF'];?>">
<textarea name="textarea1"></textarea>
<input type="submit" name="Submit" value="Submit">
</form>
<br><?php echo( $textarea );?>

View Replies !
Extracting Bit Fields
I need to decode a message that is coming in from a serial port (from an AIS receiver that indicates ship positions) in a packed binary format. It is 424 bits long, encoded as a series of 6-bit chunks, each represented by an ASCII character. Within these 424 bits are fields of various numbers of bits, from 1 to 42. There's no padding, so field boundaries typically don't line up on the 6-bit character boundaries.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved