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.





Parse An Html Page With Php To Pull Some Information


Im trying to parse an html page with php to pull some information from it and its not working correctly. I am running this to pull the ul from the page. its the only one on the page with the class directories and it doesnt stop pulling information after the end of the ul.

preg_match('/<ul class="directories">(.*)</ul>/', $postResult, $array);




View Complete Forum Thread with Replies

Related Forum Messages:
Parse And Extract Information From HTML Using SQL
This is a question that seems to have been asked here a few times recently. I've just come across this on PHP Classes and thought it might be of interest to anyone trying to do this, I've not used it myself so it is "Sight unseen" Code:

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 A Html Page
I would like to parse a html page and extract all image names and thier alt attributes.

View Replies !
Pull Information Off An Anchor ID
I have a bunch of links that ref is the same page.  Is there any way on that second page I can tell which link was clicked if my links are structured as:

<html>
<a href="page.php" id="link1">Link 1</a>
<a href="page.php" id="link2">Link 2</a>
<a href="page.php" id="link3">Link 3</a>
<a href="page.php" id="link4">Link 4</a>

View Replies !
I Cannot Pull Information From URL Querystrings
I just made a Gentoo box, with Apache2 and php4 so that I could learn php and a non-windows enviornment.

My problem is that I am unable to pull information from a querystring, which I thought (perhaps incorrectly ) was as simple as refrenceing the variable. Code:

View Replies !
How To Pull Certain Information Off Of A Feed
I am trying to figure out how to pull certain information off of a feed. I know how to do the title and description, but I want the info after that which is under the <cata> array. The xml code would look like <cata:status>up</cata:status> and it displays like this:

[description] => blah blah blah
[cata] => Array
(
[status] => UP
[lastupd] => 11:22 AM
[nextupd] => 11:32 AM
...... and so on.

View Replies !
Array Question - Pull Information From On A Bunch Of Pages.
I'm just starting in php, although I have a little programming experience in
other languages, but only on a surface level.

I have a multidimensional array that I want to pull information from on a
bunch of pages.

$county = array (
array (
key=>"adams",
name=>"Adams",
govwebsite=>"http://www.co.adams.wa.us/default.asp"
demwebsite=>"" ),
array ( name=>"Asotin",

I'm trying to write the php script for the pages to identify the sub array
by the filename, pull the rest of the information out of the array into
variables, and then use those variables to write the page. I've searched
and tried a bunch of things, and nothing is working. Here is what I have:

<?php
include("countiesarray.inc");
$path = __FILE__;
$filename = basename ($path,".php");
foreach ($county as $key => $ArrayRow)
{
if ($ArrayRow[0] == $filename)
{$countyname = $ArrayRow[name];
$govwebsite = $ArrayRow[govwebsite];
$demwebsite = $ArrayRow[demwebsite];
};
);
include ("header.html");
include ("title.html");
if ( $govwebsite != "" ) { include ("countyweb.html"); };
if ( $demwebsite != "" ) { include ("countydemweb.html"); };
include("../navigation.html");
include("../copyright.html");
?>

The error I get is Parse error:
parse error in /home/calador/public_html/wapolitics/counties/adams.php on line 12.
Line 12 is the end of the foreach loop.

View Replies !
SESSIONS - Pull Information From The Db Solely Based On The Userid Field In The Database.
i have a user management system which i want to pull information from the db solely based on the userid field in the database. When the user logs in a session is created which looks as follows: PHP Code:

session_register('userid');
$_SESSION['userid'] = $userid;
session_register('first_name');
$_SESSION['first_name'] = $first_name;
session_register('last_name');
$_SESSION['last_name'] = $last_name;

what would be the code to pull the content from the db? i'm thinking it would be something like the following, but i'm not sure as this is the first time i have ever used sessions. PHP Code:

if($_SESSION['userid'] == $userid;{
    $query = "SELECT * FROM `users";
    $result = mysql_query($query);
    $rows = mysql_num_rows($result);
...............

View Replies !
Parse Information In A PDF
So I've done some googling but haven't been able to find information about reading information in pdf files. I need to extract some information from a pdf file and use that information to rename and move the file to another directory. Anyone ever attempted something like this?

View Replies !
Parse Some Information From A Site
What i am trying to do is parse some information from a site (easy enough) however i need to be loged in to  the site to get that information and i have no idea how to do that. Could someone give me an example please?

http://sigil.outwar.com
login_username=username
login_password=password

Once loged in i then need to go to another page which can just be linked to once loged in.

View Replies !
Parse Login Information
I am just trying to write few web pages in php to manage certain things with mysql.
At the moment I've written everything to check the username and password on the first page. But i've included this bit of code-

<meta http-equiv='refresh' content=&#390;URL=main.php'>

to load the other page if the login is correct. I thought the session variables are kept so I put the username and password in to

$_SESSION['username'] and $_SESSION['password'],

but these values do not get parsed to main.php.

View Replies !
Pull The Text Out Of This Html File
i need to pull the text out of this html file using php here what it looks like Code:

View Replies !
Parse A Text DB File And Seperate All Information In It
I have a little brain freeze going here. I can't remember how to do this.

I'm trying to parse a text DB file and seperate all information in it so that I can insert them into MySQL as seperate values in seperate fields. for example,

1 | howdy | there

That would be three peaces with three different fields in MySQL. I know I've done this before but can't for the life of me figure out how I did it. All I need is somebody to jog my memory and get that little brain of mine weorking again.

View Replies !
Stripslashes() Pull Raw Html Code From A Database
I am trying to pull raw html code from a database that is submited by a WYSIWYG editor. I have gotten the data to display on the page but it displays it as raw html instead of formated html. How do I get it to display right? Code:

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 !
Is It Possible To Direct An Email Message To A PHP File That Will Parse The Information And Store It In A MySQL Database?
Is it possible to direct an email message to a PHP file that will parse the information and store it in a MySQL database? If so, can anyone direct to me to a tutorial or a book so that I can figure it out? I know how to open csv files and put them in a database, but not an email.

View Replies !
Main Page Database Seems To Not Pull Any Data At All.
I have a page that has a connection to a database. I also call a function that makes a connection to a new database, outputs some data and closes. The problem: When I call the function, the main page database seems to not pull any data at all. Im using all new database connection variables and closing them. Still the main connection stops working.

View Replies !
Pull Data From MySQL Database And Display On Web Page.
I am trying to pull specific data from MySQL database using PHP and have it displayed on my web page. Go to my web page to see exactly what I want to do.

Right click on the link and open it in a new browser or else you will get stuck in the page. Please come back and post a reply with your knowledge. Code:

View Replies !
Pull A Url Of An Image Out Of A Text File, And Then It Puts It In The Page.
im using a php script to pull a url of an image out of a text file, and then it puts it in the page.

My problem is, i have some images that are HUGE, that i want smaller, and SMALL images that i DON"T want bigger. Setting a set width in the image tag throws off the small images. Is there any way to say like maximum width is blah blah blah? So small images stay small, and big images are made smaller?

View Replies !
Warning: Cannot Modify Header Information - Redirect From Login Page To Logged In Page
I am trying to redirect from login page to logged in page, but using the {header( 'Location: C:wampwww' ) ;} is giving me this error {
Warning: Cannot modify header information - headers already sent by (output started at C:wampwwwpassword.php:14) in C:wampwwwpassword.php on line 35}, find below my code:

View Replies !
Refresh Problem - Warning: Page Has Expired The Page You Requested Was Created Using Information
i got two php page at the movement, which they called edit2.php and edit3.php. when i submit a form from edit2.php to edit3.php, then i could not come back from edit3.php to edit2.php.

Warning: Page has Expired The page you requested was created using information
you submitted in a form. This page is no longer available. As a security precaution,
Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button. 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 !
How Do You Get Html To Parse As Php
I'd like to configure one domain to parse an .html file as php. Is this possible? I have root access on the server.

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 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 HTML And Add Quotes
Can someone make me a regex that adds quotes around stuff in html for example:

<form action=hi method=post> to <form action="hi" method="post">

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 !
How To Parse HTML TABLE
I have a problem with parsing html table. I need a script witch will pars html table from one site to another.

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 !
Insert JPG Created With Information From A DB In HTML
I look in my DB for a CODE. I find it and now I want to show the jpg
corresponding to this CODE in html. Here is my piece of code, however
the photo will not be shown.. Code:

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 !
Parse .html As Stopped Working
I recently upgraded an old 4.2.2 PHP to 4.3.11 One change I made after was to get my .html files to parse thru PHP. Yes, I've read for years not to do this, but I do anyway.

I accomplish this by changing:

AddType application/x-httpd-php .php
to
AddType application/x-httpd-php .php .html

But now, all my apache redirects don't work, and the apache error pages want to download.

The .html parse thru PHP, and ofcourse .php is fine.

I've covered everything I know, and would like to know if anyone else has come across before.

View Replies !
Parse Error On The Last Line Of Code </html>
/// here is the code i'm getting a parse error on the last line of the
code which
/// is </html> any help will be much appreciated.

<?php

session_start ();
require_once('connect.php');

if ($_SESSION['username']){ //test for logged-in
$query = "SELECT status FROM accounts WHERE
username='".$_SESSION['username']."'";
$result = mysql_query ($query) or die("<b>A fatal MySQL error
occured</b>.
<br>
Error: (" . mysql_errno() . ") " . mysql_error());
$row = mysql_fetch_array ($result,MYSQL_NUM);

if ($row[0] == 0){
$error_message .= "<P>Your account has been frozen. Email the <A
HREF='mailto:account_status@severedrealm.net'>webmaster</A> for more
information.</P>";}

if ($row[0] == 1){
$query2 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_SESSION['username']."'";
$result2 = mysql_query ($query2) or die("<b>A fatal MySQL
error occured</b>.
<br>
Error: (" . mysql_errno() . ") " .
mysql_error());
$character_table .= "<TABLE CELLSPACING=&#392;' CELLPADDING=&#392;'
BORDER=&#390;'><TR><TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experience</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_array ($result2)) {
$x=$x+1;
$character_table .=
"<TR><TD>".$character[1]."</TD><TD>".$character[2]."</TD><TD>".$character[3]."</TD><TD>".$character[4]."</TD>";
$character_table .= "<TD><form action='character.php'
method='post'><input type='hidden' name='character'
value='".$character[1]."'><INPUT TYPE='submit'
NAME='delete_character_submit'
VALUE='delete_character'></FORM></TD></TR>";}
$character_table .= "</TABLE>";
if ($x >= 1){
$error_message .= "<P>You have too many characters. You must
delete ".$x."before you can create another.</P>";
}else{
$character_creation_form .= "<FORM
ACTION='character.php?op=create_character' METHOD='post'>";
$character_creation_form .= "<table cellspacing=&#392;'
cellpadding=&#392;' border=&#390;'><tr>";
$character_creation_form .= "<td>New Character
Name:</td><td><input type='text' name='new_character_name' size=&#3930;'
maxlength=&#3930;' value=''/></td></tr>";
$character_creation_form .= "<tr><td></td><td><input
type='submit' name='New_Character_Submit' value='Create
Character'></td></tr></table></FORM>";}

if ($row[0] == 2){
$query3 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_SESSION['username']."'";
$result3 = mysql_query ($query3) or die("<b>A fatal MySQL
error occured</b>.
<br>
Error: (" . mysql_errno() . ") " .
mysql_error());
$character_table .= "<TABLE CELLSPACING=&#392;' CELLPADDING=&#392;'
BORDER=&#390;'><TR><TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experience</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_array ($result2)) {
$x=$x+1;
$character_table .=
"<TR><TD>".$character[1]."</TD><TD>".$character[2]."</TD><TD>".$character[3]."</TD><TD>".$character[4]."</TD>";
$character_table .= "<TD><form action='character.php'
method='post'><input type='hidden' name='character'
value='".$character[1]."'><INPUT TYPE='submit'
NAME='delete_character_submit'
VALUE='delete_character'></FORM></TD></TR>";}
$character_table .= "</TABLE>";
if ($x >= 2){
$error_message .= "<P>You have too many characters. You must
delete ".$x."before you can create another.</P>";
}else {

View Replies !
Parse Text From HTML Website, Dump Into DB
I am working on a script to extract statistics (which is updated daily) from
a website, and insert them into a MySQL database. I want to take this
website:
http://www.usatoday.com/sports/bask...players0304.htm
and strip off all the HTML tags and etc, make it look like
http://www.enlhoops.com/ratings/parsed.txt
and then insert each players stat line into the database.

I have begun writing the script, getting the file, striping html tags off,
but that doesn't seem to work too well.

View Replies !
Parse HTML Table Rows Into Array
I have a script that extracts an HTML table from a page into a text string. I would like to parse each row of the table into an array named "$rows". I would like to keep the html intact so that I could re-create the same table like: Code:

View Replies !
Using PHP To Parse Html Tables And Extract Values
I've been presented with a task of parsing multiple .jsp's (this is after they have been executed server side so I guess for all purposes its actually a html file).

Anyway each of these pages have large complex tables displaying a lot of reporting data for one of our systems. My original method of carrying out this task was to go into the code and get the actual DB querys that the page executes and have this more as a bash based solution. However after spending several days trying to hack my way through a jungle of 100's of querys which dont hold to any naming convention Im going to plan B.

So here's what Im looking to do. Get php to construct the correct url for the jsp. What I mean by construct is to make the url while dynamically inserting the correct values into the url as it uses GET to set the date range of the information it writes to the browser.

Once its done that and requested the page is processed I want php to search through the page and find the results that Im looking for, assign them to variables and finally format the information from all the different jsp's into one php page. One nice thing is that I'm able to modify the .jsp's to wrap a comment around the data I want for example. I think this should remove the hardest part of the job which is having php identify what values I actually want.

#take_this_value#
1234556
#######

What I dont know is how to get PHP to request the url I create,parse it and extract the values. I'm guessing this is a job for wget and regular expressions but Im not too sure where to start (or if there is more appropriate functions to use).

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 !
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 Replies !
Parse Returned Html Shipping Rate Value
How can I extract as a var, the shipping rate value returned from the HonKongPost website's html webpage/result.

I need to extract whichever value is displayed after the $:
<input type="hidden" name="total_rate" value="$540">

Code:

View Replies !
Problem Using Htacess File To Parse HTML
I know that there are numerous posts on using an htaccess file to cause a server to parse HTML files for PHP. I've read them all (or at least most), but have not found any help for my problem.

Does anyone know of a situation where modifying the htaccess file (or adding one to a specific directory within a hosting account) would cause the following behavior?

I added an htaccess file consiting only of the line to a directroy where I would like .html files to be parsed for PHP: Code:

View Replies !
How To Get Information From Web Page?
I am now writing a programme that can get information from web page.
That is;
The information which I need is on a page and it will be update now
and again.
So I need to get the information automatically at certain time.

View Replies !
Get Some Information From A Page Of Links.
I'm trying to set something up where I will need to get some information from a page of links. there will be an html page with a list of links and names next to them. I need to search for certain names and if they are found, I need to go save that page's URL in a file. I'm experienced in java so I know how to set up all the condition statements, what I don't know is the syntax to doing this.. the URL part.

View Replies !
Remote Web Page Information
I am trying to create a script that can grab information from a 3rd party website. For example, say I wanted to copy the text

"Advertising Programs - Business Solutions - About Google"

Off of Google's homepage. I wanted my website to open Google and select that text and output it onto my site. So if Google where to edit that information, it would also edit on my site.

Anyone have any idea how to do this? I had a buddy who did that once with a Roster Rankings chart for IGN Gamespy Arena, but he ran off.

View Replies !
Constant Page Information
I would like to have a constant logo and list of links at the top of the page. Is there a way to do this so that I do not have to copy and paste this information into every page?

View Replies !
Getting Information To Display On The Same Page
i just want to be able to build a script that outputs the submitted information onto the same page it came from! Code:

View Replies !

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