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 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 Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Parse A Html Page
I would like to parse a html page and extract all image names and thier alt attributes.

View Replies !
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 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 !
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 !
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 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 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 !
Parse Web Page With Fopen()
Can anyone lead me to a good tutorial (or even book) on effective ways to parse web pages? I'm thinking about creating a function that will parse UPS.com pages to get tracking information. to make it a bit trickier, the way to get to the page with the data is by clicking a button. Is that possible? Or does UPS open their data like Amazon does? I've searched their site and not found a suitable solution.

View Replies !
Parse A Remote Web Page
I would like to display some information from a remote web page on my own website. The tags I am looking for are

<a name="picture" href="pictures" title="variable1"><img alt="variable1" title="variable1" src="mysite.com/myimage.jpg" border="0" height="140" width="98"></a>

I need to get the <img tag. I don't need the <a part.

View Replies !
Parse Page Content
I have a request from boss that create a small function which will keep login inforamtion. Then the page will automatic login into targeted site using stored login info and capture content of the page.

View Replies !
How I Could Parse An RSS - XML Feed And Use It In My Php Page
Does anyone know how I could parse an RSS - XML feed and use it in my php page without using fsockopen() ?

Drew wrote a brilliant script, RSS Fetch , but I can't use it b/c my host says they won't allow the fsockopen function.

View Replies !
Parse Multiple Entries On A Page
I'm trying to parse multiple entries on a page, i've managed to get it working for the first entry, but can't seem to figure out a while statement that will run through all the entries on the page: Code:

View Replies !
<link:page.html,xxx> => <a Href="page.html?id=xxx">
I want to transform this code <link:page.html,xxx> to

<a href="page.html?id=xxx"> dynamically.

I tried out alot of preg_replace stuff, but I didn't get to manage it.

View Replies !
Preg_match - Parse A Web Page And Get A Matching Phrase.
I am about to dive into regular expressions, which look like a giant puzzle to me. I'd like to parse a web page and get a matching phrase. Somewhere in the HTML there is this particular part:

<a name="picture" href="{generated dynamically}">
<img border="0" src="{generated dynamically}" width="{generated dynamically}"
height="{generated dynamically}" alt="{generated dynamically}"></a><br>

What I need from this string is the image URL. I wrote a code for this, but it is not working.

View Replies !
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this:

<script src="http://someurl.com/somescript.cgi"></script>

the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this:

<script src="http://someurl.com/somescript.php"></script>

It doesnt work!!

View Replies !
.html' Page Be Replaced By '.html.php'
Can a '.html' page be replaced by '.html.php' page via RewriteRule? To clarify, I'm using a software that formats the look of the site using .html pages. I'd like to add PHP code to that page but of course, it is not of the right page type.

What I was wondering is Could I create a duplicate of that '.html' page, rename it to .g. '.html.php' and make the revisions and then just create a RewriteRule that redirects the '.html' page to the '.html.php' without generating an error?

The alternative and undesired way of doing it would be to rename the original page to '.html.php' and find and revise ALL of the routines that call that page. That would create a revision nightmare especially upon upgrading the software.

View Replies !
Displays Page Will Not Parse Till The Sql Query Is Finished.
I had PHP 4.3.3 running before I updated. When a page was loading, all the php/html that was doing simple prints of tables and images would load while an sql query was running. When the sql finished, the rest of the page displayed. I have now updated to 5.2.3 and when I go to the exact same page, nothing displays until the sql has completely finished.

The issue with this whole thing is the javascript I had loading on certain pages that displayed an image telling the visitor "please wait, processing..". This no longer displays since the page will not parse till the sql query is finished.

View Replies !
Page Redirection - Link Index.html Page To A .php Pag
I have an index.html page with a link to a .php page This is the complete code of the .php page Code:

View Replies !
Passing A Parameter From An HTML Page To A PHP Page
I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ... <li><a href="scripts/pricelist.php???>Pricelist[/url]</li>

View Replies !
Using Includes: Html Form Parse Data Inside 2nd Form.
i'm coming down the stretch, so to speak. i've got a lot of the separate things settled that i need for my main "date entry" form. due to the several data items which need to be collected by this form, i've decided to try using includes, which i've found isn't that tricky at all really.

however, one of my includes needs itself to parse it's own little form data to result in the final entry to be submitted in the "date entry" form. perhaps doing this particular bit as an "include" is NOT the best option? Code:

View Replies !
Using PHP To Load Another Page Or Html Page
Ive got a PHP script, which if it ends correctly, i want load another
PHP file or an HTML page automatically, ie without user intervention.
The new page shoud replace the current page on the browser. Is there a
PHP command or function which does this?

View Replies !
HTML Web Page Hyperlink To Php Web Page
I am still having a problem parsing a html page with php. Code in my HTML
is
<? php
echo '<a href="index.php">Home</a><br />
<a href="login.php">Login</a><br />
'
?>
However the link is to the Login page is:
file:///C:/Program%20Files/Apache%20Group/Apache2/htdocs/TeeJayUu/login.php

I am using PHP 5.0.2, Apache 2.0.52, MySQL 4.0.21, and Windows XP SP2. All
pages are in the htdocs folder and the following instructions have been
followed:
- Copy php5apache2.dll to Apache's module dir and rename it to mod_php5.so;
- Copy php5ts.dll to Apache's bin dir.
Finally, add the following line to your httpd.conf file:
LoadModule php5_module modules/mod_php5.so
Apache has been stopped and restarted.
Help - I am lost for what else to do. I want to keep this local until I
have got it working.

View Replies !
If Page = 'about' Show The About.html Page?
I wanted to do some kind of PHP script so that if the current page the viewer is trying to view is called index.php?page=about then it will use the php script to embed with an i-frame the about.html file into a cell in my web page's table. Basically, so that the whole page stays the same other than one cell of the table which is dynamic depending on the status of the index.php?page=whatever. Code:

View Replies !
Send Value From CSS Html Page To PHP Page
help me to find a way or script to pass value "digit" from CSS html page to php page which has funtion to accept value and search in database. for example, in CSS rollover image map. if a user select on particular place, that should call PHP page as well as send value to php page.

View Replies !
Parse Error On "</HTML>"?
What I'm trying to do is display a list of products in a certain category of products . This I can do fine, it displays a thumbnail image, a brand name, a model number, a short description and a price. These are just a few columns from the products table. Heres the code I have that grabs that info from the products table, this WORKS OK: PHP Code:

View Replies !
PHP In Html Or Outside Html Page?
what's better, php code in html page or outside the page in seperate php file...the thing is i have my sql data in that code and i don't want people to see it, can people open up the php files?

View Replies !
Read Contents Of An External XML Page And Then Parse Its Contents
I have a URL that generates an XML page. I'm trying to read its contents and parse the information. But, I keep receiving these error messages: Code:

View Replies !
How Do I Add A <? To Page? HTML - <?xml
I am trying to change my site from asp to php. but have encountered a problem The start of my pages have always been:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

My problem is when I add <?xml ... the php parser kicks in and starts complaining.
If I leave the <?xml version="1.0" encoding="iso-8859-1"?> Off the page is displayed but not correctly in IE!

Questions:
1) How can I make php let me add the: <?xml version="1.0" encoding="iso-8859-1"?>

2) Thinking about is I'm not 100% sure why I originally added the <?xml version="1.0" encoding="iso-8859-1"?> (I made the site over a year ago) - does anyone know why it is needed for the page to display correctly in IE?

View Replies !
PHP/html Page
I am building a PHP/html page. when opened it pulls data from an external db and stores it locally as an xml file. The webpage pulls data from the locally stored xml. I need a line that selects the highest # out of these 3 lines on the xml and assigns it a name. On the xml they look like this:

<atm-0>82190</atm-0>
<atm-1>109190</atm-1>
<atm-2>91895</atm-2>

View Replies !

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