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 Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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?
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"
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".
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"
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?
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>.
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.
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:
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.
Extracting Url In Array
I am working on some projects and need some on php. and this is best place for me ever. I need to extract range-url values in an array. The range-url may contains multiple range. Code:
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="
Extracting Metadata
Is there anyway to extract the metadata i.e. title, artist, album, from audio files using PHP?
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 ?
Need Help Extracting Href And Src With Preg
I'm trying to extract the href= & the src= from html files with preg_match and am coming up with nothing. http://<br /> preg_match("/href=&#...esting4);<br /> I want it to give me the url or img src to JPG files and this won't even display anything, no links to anywhere.
Extracting The File Name From A Path?
I want to remove all from before the file name including the slash. $filename = "some/path/to/filename.txt"; or $filename = "some/other/path/to/filename.txt"; Is there a way to remove words that end with a slash? $filename[0] = preg_replace('/.*/','',"$filename[0]");
Php And Extracting Textarea Values
I have a textarea where I am collecting comma separated values, for example: 23213,smith,joe,mytown,MS 34565,dfdfdf,sds,dsds,dsd 32323,ggasd,jgfj,sds,sdsd 74743,hhsdfs,hh,sdf,sffff What I want to do is explode each line as a single entry into an array. PHP Code:
Extracting Captions From Jpegs
I tried searching this forum to see if anyone had asked about extracting caption information from jpegs, but I couldn't find any posts. I also checked the online documentation at PHP.net to no avail. I know that it's possible to extract the EXIF data from a jpeg, but as far as I can tell, that data doesn't include the caption (or other information you can set via Photoshop and other graphics programs). To simplify writing text for my alt tags, it would be awesome to be able to simply extract the caption data from a jpeg and use that. Has anyone ever done this successfully? If so, how?
One Liner For Extracting A Number
Can regular expressions help me here? I want to extract a number from a string which will always be of the form "parameter###" where "###" is an arbitrary number of numeric digits. So if my string contained parameter24 parameter8 parameter90210 I would want to extract "24", "8", and "90210" respectively.
Extracting Data Via URL In Browser
I'm trying to learn PHP right now, and am having trouble hammering down some of the basic concepts. I've set up a database in mysql and got that working, but now I want to use that data to make writing my web pages easier. Basically all I want to do is extract different rows of my db table dynamically by only changing what I write in the url (I've seen how on php pages, the url in the browser will sometimes look like ....index.php id=5....) so that I dont have to manually create each page with each set of data like i am now with just basic html.
Extracting Database Entries
I have a non-profit's web site that wishes to allow their members to fill out information regarding summer camp information (name, contact info, mailing info, physician's name, etc) online and submit it. I can handle taking the info with PHP and putting it into a mySQL database easily. But what has me stuck is that they want the ability to print out hard copies of selected submissions (their choice) if they need to. Would I have to display all the database entries in a form on a new page with a select box next to each entry and have them pick that way, then loop through and print out the selected ones or is there a better, more direct (read: easier) way to accomplish this? Does this sound like something for which there may be a pre-written PHP script that can be altered?
Finding And Extracting From A String
Heres the situation: I got a file with lines like: name:second_name:somenumber:otherinfo etc with different values between colons ( just like passwd file) What I want is to extract some part of it like all names or numbers from each line, simply text fom between e.g. second and third colon. And turn it into array so that I can later operate on these strings. And second, variation of it: To get whole lines that contain some characters like 3 digits from a number second b) :) to extract only nmbers with some digits not whole lines.
Extracting A Word From A String
I have been looking it up but cant come up with the code to extract a word from a string. example : "Hi There I am Kieron" I want to extract "Kieron" It doesn't matter really if the returned value equals what i am looking for a True or False would do. But it would be handy if i could.
Extracting Values From An Array Session!
I am working in a project to add personal info into DB. For some fields I use session to keep values before putting them into DB. So I wrote a test code to insert phone numbers into a session and at the end put it into DB. The problem is, I can wirite into the session but don't know how to extract them, as it's an array. My sesison is writen like this: /tmp/session_file: n_array|a:5:{i:0;a:1:{i:0;s:6:"VALUE1";}i:1;a:1:{i:0;s:6:"VALUE2";}i:2;a:1:{i:0;s:6:"VALUE3";}i:3;a:1:{i:0;s:6:"VALUE4";}i:4;a:1:{i:0;s:6:"VALUE5";}} My code that generates this info is:
Need Help Extracting Specific Records In An Array
I am using a pc of code that is as follows: while ($row = mysql_fetch_array ($result)) { echo "user_id: ".$row["file_name"]."<br>"; echo "user_id: ".$row["file_author"]."<br>"; echo "fullname: ".$row["file_keywords"]."<br>"; echo "fullname: ".$row["file_description"]."<p>"; } This will extract all the data from the records that have been stored in $row. The question I have is how to take out slective informtion? Let's say I have a complete $row array (40 finds) but only want to show the first 3-6 records. How do I access hose specific miages?
Extracting Name Value Pairs From Autogenerated Forms.
I used a for loop to autogenerate form names/values and now I want to get the name keys (with values) back from the form and update the database. Here's how the first part works. I grab all the rows from the database and generate the form ...Php code:
Extracting Data From Database Using Three Strings
I am a complete newbie. I have been working on a self-learning project that will ask users for three strings (i.e. name,dob and number. If details are correct, will vector to a new page and display all their other information unique to their name,dob and number. The second page will then display their school,work,address, etc. which is editable. They will then click the submit button at the bottom to save the displayed data (or any changes they made to it) in the database from where it was initially extracted from. Here is the php for the first page which asks the name,dob and number:
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.
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.
Saving And Extracting Forms, PHP To Database
I'm having to save HTML forms that include PHP strings into a database so that I can display them upon request. The HTML/PHP is entered into a <textarea> and written to the db in the usual way. One note: Because this is an Oracle db, I've written my own little "stripslashes" function for Oracle (because Oracle doesn't care for the standard stripslashes() function for some reason), so you'll see that in the following code. Here's how I'm writing it to the db: $code = addoracleslashes(htmlentities($_POST['code'])); and then I use echo stripslashes(html_entity_decode($code)) to display it on the page. However, the embedded PHP (fwiw, <?php echo $_POST['formdata']; ?> in the value of each field) is displayed as text, so that my form fields are filled with my PHP code. Furthermore, html_entity_decode doesn't seem to be working when I try to echo the data back into a <textarea> for editing.
Extracting Text Between Tags Is Tricky!
Problem: I want to get the whole text between the opening tag <%OPTIONAL%> and the closing tag <%/OPTIONAL%>. The right block is found by (and contains) the placeholder {#xmreisepop_reisepreistext_1_3#}. <%OPTIONAL%> and <%/OPTIONAL%> are not allowed to be inside these tags again. My first idea was: <%OPTIONAL%>(.*?){#xmreisepop_reisepreistext_1_3#}(.*?)<%/OPTIONAL%> But this does not work with the following peace of text, because it takes the first <%OPTIONAL%> before and the first <%/OPTIONAL%> after the placeholder. <%OPTIONAL%> ....bla bla bla.... <%/OPTIONAL%> .... <%OPTIONAL%> .... {#xmreisepop_reisepreistext_1_3#} .... <%/OPTIONAL%> Then I tried it with this version: <%OPTIONAL%>(.*)(?!(<%OPTIONAL%>|<%/OPTIONAL%>)){#xmreisepop_reisepreistext_1_3#}(.*?)<%/OPTIONAL%> No success!
Extracting Data From Inside A PHP Tag In A File.
I need to find a line in a file, such as: <?php $title="This is the text I want." ?> and insert only what's inside the quotes into a mySQL table. I have no trouble using strstr() to find the <?php $title= part, but then my "needle" returned contains all of the rest of the file from that point on. So how would I "extract" that information from inside the file? Or even all of the text that is between <h2> and </h2> tags, for instance?
Extracting Database And Building A Table
I have a mySql database with tblDiary DateEmployeeClient 1/1/04SmithBloggs 2/1/04JonesUnited 2/1/04SmithCentral .....etc tblEmployee NumberName 1Smith 2Jones ....etc Thing is I need to get it to display HTML in a date table like this: MondayTuesdayWednesday...etc 1/1/042/1/043/1/04 SmithBloggsCentral_____ Jones______United_____ ....etc and if the user clicks on say Bloggs it takes them to the booking so it can be amended or if they click on _____ it sets up a new entry in tblDiary. I will be using tblDiary.Data and tblDiary.Employee as a compound primary key.
Extracting Email Attachment (Text)
What's the best way to extract email attachments that's encoded in base64? I can run the base64 encoded stuff through base64_decod(), but I want to know if there is a function to handle attachments. Example: ------_=_NextPart_001_01C7C330.9D7B678C Content-Type: text/plain; name=report.csv Content-Transfer-Encoding: base64 Content-Description: report_=.csv Content-Disposition: inline; filename=report.csv
Extracting Data Into Checkboxes Or Radio Buttons
I wonder what is the standard way to extraxt data into checkboxes from database? Let`s say you have a table (users) in which for each user there are different values stored in a way that username is repeated in each row for differnet value of type of music! In another table (music_type) you have types of music with their names and values! I had it done this way and it works great!
Trouble Extracting Email Address From Text File
I'm trying to put together a script that will read an email box set up for newsletter bounces and remove the bad addresses. There's an old script I've worked with that looks for --- Permanant fatal errro ---, but not all the bounced emails have that line included (3 out of about 700 do). I need to find the bad address, then delete that address out of the database. I've got the deleting out of database down, but am not sure how to find any email address & delete it.
Inserting Then Extracting Multiple Values In Single Db Field.
I need to submit multiple values into a single table field that have been retrieved from a form eg: limit1 ... limit10. At the moment they are seperated by commas in the field (limit1,limit2 etc) thinking I extract these with explode() then assign them as individual variables ($limit1 etc.) so they can be edited by the same form.
Help - Regexp For Extracting A String From A Larger String
I am developing a very basic CMS for a website I'm working on. One of the requirements is for the client to be able to post an image in their news posts, as well as links. I've got the links working (sort of, because I fear the way I have set it up may break images). Ideally I would like something like BBcode but can't wrap my head around regular expressions.
Getting URL Information
Can someone point me to a document anywhere in the Internet where it tells me what are all kinds of information I can get from a URL. Specifically, the ones that are possible to deal with PHP. For example, I can find out the IP address or the URL's host's location.
IP Information
As part of my statistical analysis of the visitors to my site, I record people's IP address. Is there an easy way to get more information (where people are from, maybe even long. and latitude) or perhaps translate the IP address into a named address?
Get Pc Information
How do i get the browser type from the user. I want to display this information on my webpage. I can get the IP,OS of the user already.
How To Get Information From Url
I am using the get method on my form to send information to my proccesing script, but i don't know how to take the information from the url and so that i can search for it in the database using a piece of code like this, $sql = "SELECT * FROM items WHERE id=$art"; Can any one tell me how to do this.
|