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




How To Insert Arrays From Screen Scrape Into Db?


I am currently running a class to execute screen scrapes from a general stats page. Currently it is set to print out the arrays. How can I utilize and organise this data so I can then enter it into my database?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Screen Scrape Issue Preg_match
I need to create a simple page to find the .gif file below from the
page below. No matter what I try it doesn't work.... Any ideas?

Insert Multiple Arrays Into Mysql
I am having problems writing the code to generate my SQL INSERT query. I have 3 arrays and one static variable ($cat_number):

$track_name[]
$music_link[]
$track_number[]
$cat_number

Should I be using a foreach command. I know how to insert multiple values but its generating the query that i'm not sure about.

INSERT INTO table (track_name, music_link, cat_number, track_number)
VALUES
(var1,var2,var3,var4),
(var5,var6,var7,var8),
(var9,var10,var11,var12);

I don't want to store the actual array in the dataabase, I am just using an array to catch the data.

How To Insert Arrays Into Mysql Database
This is my order.php file. Now I try to make a new php-file for processing the ordered items on this page, into another table "ordered_products" in the database. I want to INPUT following values into the table "ordered_products":
'order_num', 'order_item' and 'order_ant'

I know how to insert rows in a table using the INSERT query, but I don't know how to do it while looping the arrays. I have to fetch the arrays from this page, and insert them row by row in the "ordered_products" table. Code:

Curl / Page Scrape
I'm having trouble using Curl.  Here is the situation.  My goal is to perform an Orbitz hotel search and retrieve the results.  I don't need help with any of the regex stuff (well, i can't even get to that point as of yet).  With this URL ... 
 
http://www.orbitz.com/App/Landing?placementID=1&pageID=41&startDate:useDateText=true&endDate:useDateText=true&city=New+York&startDate:date=07/26/2007&endDate:date=07/27/2007&numberOfRooms=1&adults=1

(as an example, I've put in a search for hotels in New York from 7/26 - 7/27). 

The problem is, it goes to orbitz's "now searching" page, and then I get redirected to the page that actually shows the results.  When I try to use  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); it just autmoatically redirects the page that is performing the CURL to the Orbitz url that shows the results.  Any ideas?

PHP + CURL + SCRAPE + Format
I have been told that PHP w/ Curl would allow be to scape and parse information from another site. I am looking to retrieve four lines from: tvkeyz.info and display on the four lines on my internal site. I am looking to just display information in this format: Code:

Screen Scraping Help
I need to find out how i can screen scrape the top ten virus threats from a website, store them in an txt/xml pref xml and the from there i can display them where ever on my site. I know people like NAI.com offer something you can put on your site but you have to have there logo and there layout which i dont want.

I know you can do it with asp but i hate asp so i would like to know how i can do it with php bearing in mind im not exactly hot on it.

Screen Resolution !!
Can Any one tell me how I can determine the Screen Resolution of the user? and then insert it into a variable? Basiclally I want to produce a Page that looks the same, but with a different link according to the screen resolution of the user.

Screen Resolution
Is there a way to determine the client's screen resolution using a php function, javascript, or other way?

Screen Scraping
I need to do some screen scraping from PHP. I'm planning on using

$content = file_get_contents( "http://www.somesite.com/somepage.html" );

to get the page and store it as a variable. I'll then parse it out to get what I need. But I'd rather not reinvent the wheel if there's code out there that might give me a basis to work off of. Anyone know of any? If not, does anyone have any suggestions for parseing the html to find what I need?

Take Screen Shot Using PHP?
Is it possible to take a screen shot of the browser using PHP?

Something similar to Alexa Web Site Screen Dump...

Print On Screen
I have two tables: the first one contains two fields: titleid (auto enc) and titlename. The second one containts, subid (auto enc,), titid (=titleid from table one) and subtitlename. Now, the problem is, I want to print these on screen with a while-function:
I want to have something like this then:

Title1
subtitle1
subtitle2
Title2
subtitle1
subtitle2
subtitle3
and so on and so on . can anybody give an idea, cos I'm quite stuck with my query's atm .

Clear Screen
After a echo statement I close a php script and begin a html code. Before the upload of html code I would like to clear the screen.How can do it?

Loading Screen
I've seen a really cool effect which i would like to use on an intranet
site. Am referring to the 'LOADING..' animation you see when switching
pages. I've seen it somewhere on a website that was using php (cant remember
the url). I've tried googling but came up with nothing - so does anyone know
what function of php allows to display a little animation while a sql query
is being run ?

Clear Screen
I'm using PHP on my Linux box on the command line.

It need to clear the screen, as I would do with the 'clear' command on
the bash. Is there something equivalent in PHP available?

Screen Shot
I have created a ticket system where users can submit their problem.
After several month of experience it appears that offering a zone to paste a
screen shot will be ideal.
Is there anyway to acheive this without pasting to a word doc, and upload
it?

Screen Resolution
Is there a way I can get the screen resolution using PHP? I want to
set some parameters depending upon whether the user's screen is 800
wide or 1024 wide.

Screen Capture
i want to do a screen capture/scrape of a page, resulting in a JPG or PNG that i could save in a dir of my choice. This capture needs to take place a few seconds after the page loads, to allow all JavaScript and Flash elements on page to load.

It would be great if i could also/just target a specific JS or Flash element to grab, instead of the whole page. There has to be some great PHP solutions for this.

Get Screen Resolution
Is there a way that I can get the users screen resolution using php?

Multiple Screen Print Out!
I'm a beginning PHP programmer. And I have a problem to write some code.
I have a database (mysql) filled with Funny SMS messages.
Problem:
I want to print out the content of the database on the screen but I can only print them on screen without page breaks. This means if there are 100 messages in the database they all apppear on one page and I want only 5 messages a page with a NEXT button so people can see the next 5 messages.

How Do We Echo The Message On The Same Screen..
How do we echo the message on the same screen ( e.g. the bottom of the screen then erase the message after a while?

Full Screen Viewing
Can anyone tell me how to make a php page open at 100% of the viewable area?

Monitor Impressions To Screen?
I am building an advertisement management system and need advices on how to implement that. A basic description would be: a webmaster registers, gets a peace of html that is to be inserted in a webpage; I want to be able to monitor the number of impressions, the number of unique clicks, and be able to give stats per day.

For the unique clicks, I am thinking using cookies and storing the user's IP address.

For the other two features, I need advices. How do I monitor the number of impressions of my banners? I still have no clue. I thought about having a php script reading an image on my server and returning it to the screen and have them put something like <img src="thescript.php3">, the problem with that s that if this is not included on the page but the link through is, it messes up my cilck/impression ratio, and I thing this will be heavy on my server, wouldn't it?. I am trying not to depend on Server Side Include. Please help me on that one .

Keeping track of what is happening per day? There are thousands of ways to do that. I would like to know what would be the most efficient way to implement that. I was thinking of having a table username|impressions|clicks|date with username|date being my key. What do you think?

One more question, How heavy do you think this is going to be on my server?

Create Video Screen Cap With PHP
Does anyone out there know of a way to capture a frame (at random, if
possible) of a movie file with PHP?

Screen Resolution Stats
it's about detecting the screen resolution with JavaScript and save the info in af stat-file with PHP.

How To Get At The Clients' Screen Size ?
I want to write a Server Side PHP program that generates a HTML page
client side.
How would I get at the clients' screen size, before serving the
generated page ?
Would it be a two-step process: first let the client execute a piece
of JavaScript to generate Height and Width, and then send those values
to the PHP server (FORM, PUT) ?
Or can it be done in only one PHP program ?

Web Site Screen Scraping In PHP?
Are there any hot tips for stuffing a couple strings into a simple
website page? I want to help people that need to look up a bunch of
zip codes on this website.

http://zip4.usps.com/zip4/welcome.jsp

I expect to hit the URL with Address, city and state pre-loaded and
invoke "submit" and let a Human Being see the response and adjust the
input as necessary.

Screen Size Of The Client
I want to know how can I obtain in a php variable the screen size of
the client monitor. I don't know how to pass the value of a JavaScript
variable to a PHP variable.

Upload Status Screen?
I'm writing a script to upload files via PHP and FTP(built in php functions), my delema is upon submiting the form there is a long wait while the file is being uploaded. I would like to have a "Please wait" page to come up while the file is being uploaded,

I've tried to include the message "Please wait" in the script but it doesnt get displayed until the script is finished. I've tried to use flush() before the upload, but again it doesnt get displayed until its finished uploading the file.

Function To Clear Screen?
Once a user clicks submit on a form, I would like to clear the screen and display the results of the form.

Q. Getting Screen To Always Be Maximized On Open
How do you get a form to always open in the maximized mode (covering the
whole screen). My form looks goofy when it is not maximized. If there is
no way for the screen to always open maximized are there other alternatives
for how to set up this form

Grouping Output To Screen
I'm able to run the following while in php admin, but I want to be able to
run this from a php page and seethe results on the screen. Any suggestions?

SELECT state, count( state ) 'count'
FROM contacts3
GROUP BY state
ORDER BY state LIMIT 0 , 30

Generate A Number On Screen...
i have a screen where i register a new patient into the system. way the system works now is that user enters the patient details(first name, middle initial, last name, dob, sex, insuracne, and so on). along with this user also enters the patient # for each patient(its a 9 digit unique number - on the lines of the ssn). the system validates this field upon submittin gthe page. it should contain only numerics ad shoud be 9 characters long. it returns an error message if this field does not match the validations.

the new requirement now is that user should allow (automatically) a number (18 characters - alphanumeric) to be generated when page is loaded. user can either keep this number (system generated) or should be able to enter a new(numeric - 9 digits) when registering a patient. they can come back later and edit it with a proper patient number.

is there a way i can put a check-box or somethign which i can check and then be able to enter alphanumeric value(18 digits) in the same box (used for 9 digit patient number)? Code:

Array From Screen Input
I am trying to create an array from screen input. I need the array to gather football team scores and display the mean, mode, and median of the array.Here is my code so far. Can anyone tell me if I'm on the right track? Code:

Displaying Screen Values...
i have a screen where i am generating a report on patient activity. i can either enter the search parameters or just hit the search button without specifying any parameters. when i hit search, i build a table(insert the values from different tables into this one) and then i am supposed to call values from this newly built table to display them on screen.

again, i can only display 25 records at a time. there are page number links at the bottom of the screen and clicking on a number takes me to that particular page(the page is reloaded).

now, how do i accomplish the task above without executing the build table(insert into table) query when page is reloaded to display the items on screen?

Screen Capture On A Win2000 Server?
I am trying to add some dynamic contect to my website, which I host off my personal machine running Win2000/php4. Anyone know of a way to take a screen capture and either load it right into a page or dump it to a http port? Thanks!

Generate GIF Based On Screen Size?
I need to generate a gif dynamically based on the browser window size. My problem is that any php code is obviously going to get executed before any javascript which I have to use in order to get the size of the browser window.

Automatically Changing Screen Resolution
I am currently creating an Intranet for the company i work for, however, there is a problem as employee's use 2 different screen resolutions. one being 800x600 and the other 1024x768. i have a problem as i the Intranet pages layout change on each of the screen resolutions. therefore, iwas woundering if there is any code for the pages to auotomatically change to the users screen resolution, without the layout changing. i am fairly new to this so i am unsure if it can be done.

Warp When Text Reachs The End Screen
I am getting a user to enter in some information through a textarea in a form.

But later on when I come to access it I find that when it appears on the screen that it's one big line. I would like the text/line to go down to the next line when it reachs the end of screen. So how would I go about doing this?

Client Side Screen Resolution
I have a fishing related site with a billion photos,
where 600 pixels as a maximum photo width looks OK
at both low resolution and high resolution,
but spectacular in neither. Browser stats sites
say 37% of all users still use 800x600 resolution.
So if you have a site you have to deal with that issue
somehow.
But compromises piss me off.

The pages you make (as php developer) could
use client-side javascript to detect the local
screen resolution. Then, theoretically, you could
send an Ajax message back to the server, to set
a session variable, so all subsequent requests
could be either dynamically generated, with differing
image sizes, or you could, maybe, use url-rewriting
to redirect to the right static html (with differing
image sizes).

But that's got a hidden catch22. Because the 37% of
all users who still use 800x600 resolution probably won't
have browsers that can deal with Ajax requests.

Has anybody ever figured out how to optimize image
sizes for different screen resolutions?

Any Easy PHP Screen Layout Tools?
Putting together some specifications for a PHP/mySQL system which I need to
pass off to a developer. Are there any slick PHP tools that can be used to
design screen layouts so that the communication to the developer can be made
exactly as to what the interface should look like?

Browsing To A Php File I Get A Blank Screen
I am running RedHat Linux 7.2 with PHP/4.0.6 from the shell I can use php fine. but when browsing to a php file I get a blank screen. Does anyone have any ideas?

Stop Screen Refereshing During A Post To 'self'
Is there a way to keep the browser from refreshing the screen during a post back to the same page?
This is annoying when you are viewing something at the bottom of a page an the post refreshes the
screen placing you back at the top.

Php Script Take A Webpage Screen Shot?
I have a question

can we have a php script or function to take screen shot for webpage?

for example , let the php script take a shot for www.google.com and
convert the content to an jpg or gif image using GD library with crul
library?

Text File Displaying On Screen
I have a file that downloaded a CSV file for the user based upon some
information gathered from the Database. My file was working fine until
recently (I believe that my hosting company did something when they
upgraded to PHP5). Everytime a user tries to download the file, it
displays the contents on the screen. Here is what I have for my file
handling. Am I missing anything obvious?

when called, $filecontent is displayed to the screen...

$downloadfile=$shownic."AttendeeRoster".time().".csv";
header("Content-disposition: attachment; filename=$downloadfile");
header("Content-type: text/css; charset=UTF-8");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".strlen($filecontent));
header("Pragma: no-cache");
header("Expires: 0");
echo $filecontent;

Blank Screen After Confirmation Email
I've got the following code to send the user a confirmation email upon registration but when the user clisck on the link, instead of getting a messege, I just get a blank screen?? Code:

Blank Screen While Serving File
Our site allows clients to upload files to share with others.  We have several clients who are sharing many files with many users.  There is one client that inconsistently receives a blank white screen while viewing a file.

She is the only client that has reported this as an issue, so I'm not sure how wide spread it is; I can not duplicate this problem myself but I can watch it happen to her using remote desktop software.

She first reported it last week.  I went into the function that serves the file, added two lines of code, removed those same two lines, saved the file, and the problem went away.

She called again this morning reporting the same problem.  This time I modified the code to pass along extra header information and that seemed to clear the problem up.  She called again about 2 or 3 hours later and the problem had started yet again, without any changes to the code:

Screen Scraping Solutions - Maintain Sessions?
I have an affiliate deal with a company who have given me a number of affiliate urls to run in a frame.

Their branding is included in the site, and I want to remove this. I have their permission to do this.

The urls use sessions.

Is there a way to include these urls in my pages (with the branding stripped out), and maintain the sessions?

Im thinking i need to use CURL or sockets and run everything in an IFRAME .

any tips?

Its a linux server.

Perhaps there is software or scripts already avaible for this?

Showing Full 2d Array On Screen From MySQL
I have successfully created a MySQL database, and inserted a table "65chain" into it.

The table has 10 columns, including the primary key column Drop_1, and 6 rows. The Drop_1 column is indexed at 600, 800, 1000, 1200, 1400, and 1600. The table is representative of a series which will have varying numbers of rows and columns.

In phpMyAdmin, I see the 2d array I would like to see eventually on my web page, when I select the SQL tab and enter
SELECT * FROM `65chain` WHERE Drop_1 is not null

Great. I am now creating my script.

So far I have:

No Error_reporting Errors, Just Blank Screen With Apache 1.
I installed an new REDHAT 7.3 server with apache, mysql and php. After some while all worked fine. Exccept the error messages in php didn't print to the screen. After reading through this forum i overlooked the display_errors: off, so set it to on including the error level to E_ALL. no errors an the screen, so tryed to set it to the minimal error level and then in the script add error_reporting (E_ALL ^ E_NOTICE); to make the script change the level. Still no errors on screen.

Do i have to make an change in the apache config to make in work or am i missing something? phpinfo() provided below. Code:


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