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




Export Entire Site And Save As HTML


I feel as though I will be covering ground that others have posted, but I have searched and not found much at all.

Basically, my site is in PHP/mysql, but before I go online I want to save 95% of the site's output as HTML (basically everything but the search pages). This will be around 4,000 pages. Is there a way I can get PHP to save the output that a scirpt generates as a separate HTML file?

What I would like to do is build this feature into my admin menu. Thus, when I make a change to the database, I can pull up the individual record, and click on a button that says "rebuild html pages".




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
One File Throughout Entire Site?
I would like to have a file header.php used throughout my entire website. When I do this however it does not work 100% For example the file maybe in /home/header.php with 10 hrefs for the site. Then if a inc() in /home/dir1/dir2/ uses the file it will of course link wrong. For example Code: <a href="dir1/">

If this is in the header file in the /home dir then when the file in /dir2 uses it of course teh link will look like this to the broswer Code:
http://www.domain.com/dir1/dir2/dir1/ of course this is not what I want. Everytime I make a change I'm having to make it to over a 100 files so I would like this one file to be used throughout the entire site.

Http Authenticate Entire Site
we are validating users in several different sections (each section is in it's own directory..ex. the download section is in /downloads) using http authentication. when a user authenticates in one section they can roam freely in that directory without having to authenticate again.

for some reason however, when i change to a different directory and then run a phpinfo(), both $PHP_AUTH_USER and $PHP_AUTH_PW are gone, meaning the user will have to authenticate again.

the user can go back to the first directory again and they are still authenticated within that directory. i would like the users to only have to authenticate once for the entire site, but scince there are areas of the site that do not require validation i don't want to make them authenticate until they have to.

Optimizing Dynamic Php Code (entire Site)
my web site seems to load rather slow because it accesses the db several times and there is a lot of code (because of features).

i was wondering how i could optimize/cache this so that the query is only executed once (until i modify the actual code).

any ideas?

Using Just One Entry Point For An Entire Dynamic Site
I'm thinking of an architecture for a medium-complexity dynamic site
as follows:

- I use one php file, say a.php as the entry point for the entire
site. PATH_INFO allows me to pass information to my script by using
URLs like http://mysite.com/a.php/user1000 or
http://mysite.com/a.php/images/10.gif and perform the appropriate
action by calling the appropriate function (which may reside in an
included php file)

- I use apache's url rewriting to redirect urls like
http://mysite.com/page25 to a.php b adding the script name -
http://mysite.com/a.php/page25

- Using Smarty to control the actual HTML output.

This seems to me like a sound and obvious way to do things (and also
rarely done) so my questions are:

- Has anyone on this group tried to do or done something like this
before, using one entry point for the entire site for maximum control?

- If so, what do you think are the pros and cons or this approach?

How To Export A Table To HTML ...
In my project I want to export a table from a database to HTML format , in a simple table, and save the file to a specific dir/.

Converting A PHP Site To A Total Static HTML Site
What's the best way to convert a PHP site to a total static HTML site? You might wanna ask why I wanna do this. Reason: I would like to create an offline version (without server) for demo purposes. Looking at my current PHP site, I am having problem dealing with this issue.

HTML Forms - Alert To Save Changes
Is there a way in PHP to prevent a user from moving away from a page with an HTML form on when they made changes and didn't click submit? I would like some alert box to confirm if they want to leave or if they want to save the changes. Is that at all possible? I've tried Javascript but with no luck.

How Do I Send HTML And A File For 'Save-As' At The Same Time?
If you point your browser to this page,

http://prdownloads.sourceforge.net/...?use_mirror=umn

the server sends you the HTML page, and very soon afterwards, you are
prompted to do a 'Save-As' for a file to download.

How do they do that without the classic "Headers already sent" error?



How To Save And Retrieve HTML In Its Original Form
When i am saving the below shown html to a text file using php write function, the text file is not the same as the html source. Character "&nbsp" changes to "Â" and "&gt" converts to ">".How can i save the below shown html as it is to the text file.
Code:

Coding For Save HTML File In Folder?
my quesion:

1. how coding for save HTML file (website build use template like us build one blog use blogger.com) in different folder for any user?
2. how coding to make template so used by any user?
3. how coding drag and drop and then save that drag and drop?

Strip HTML Tags, And Save To A Seperate Array
I am trying to take a string, and seperate the HTML code from the string and put it into an array, and then take my string it into several strings of around 110 characters, and then put the HTML back in, does anyone think it can be done, and how?

Save Html-forms Data To Local Disk?
A question on html-forms:

We have an application where users will get a CD with,
among other things, some html-forms for them to fill in.
When they click the submit-button, the data is transferred
to a webserver php-script that will then process the info.
The forms-definition looks something like this:

<form action="http://www.ourdomain.com/receiver.php" method="post">
<p>Question 1:
<p><textarea name="reply01" cols="40" rows="5"></textarea>
<p>Question 2:
<p><textarea name="reply02" cols="40" rows="5"></textarea>
<p>Question 3:
<p><textarea name="reply03" cols="40" rows="5"></textarea>
... etc ...
<p><input type="submit" value="Submit answers!">
</form>

Now, my concern is (since there might be quite a lot of data filled in),
if e.g. the internet-connection for some reason is broken
at the moment when the user clicks the submit-button,
there is a risk they will lose all the text and would have to re-type it,
which I would like to avoid, of course.

How can I best solve this issue?

Ideally, I would like to store the info on their local C: drive
before submitting, and automatically retrieve the text if they
later return to the page, but I guess that's not possible from
an html doc, right?

If so, any other suggestions how to resolve this issue?

Site Html Search With Php?
My client ask me to make a search at his site to search the site. Now we have a PHP part that is connected to mysql database wich I will search through SQL query, and a HTML part wich also contains product data but is in plain html. Any ideas on how can I make search with php to search that html part of site ? Or is there some other common way to search html sites for specific word ? I see google search to search the site on some websites , how is it done ? Can I do it like that ? Some applet ? What is the best way you suggest?

Read From A Html Site
I want to read a html site on the net. And the php script must catch (or better parse?) all the data between <td> </td> to put it in a txt file. Can anyone of you help me out?

<TABLE bgColor=#cccccc border=1 cols=5 width="100%">
<TBODY>
<TR>
<TD>Gabler Joachim</TD>
<TD>&nbsp;</TD>
<TD>Goethestr. 5, 14163 Berlin</TD>
<TD>&nbsp;030-809729-0</TD>
<TD>&nbsp;</TD></TR>
<TR>
<TD>Gabriel Christian</TD>
<TD>&nbsp;</TD>
<TD>Otto-Suhr-Allee 97, 10585 Berlin</TD>
<TD>030-3416024</TD>
<TD>030-3419042</TD></TR>.

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?

Extract Records From HTML Of Another Site
First of all let me say I'm new to php. I pieced the following code together
from samples
I found on the net and a book I bought called PHP Cookbook. So please
forgive me if this isn't the best approach - I'm open to suggestions
I finally got my code to work that logs into another site and pulls the
orderstatus page to my server.

<?php
/*
Login to site
*/
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName");
curl_setopt($ch,
CURLOPT_URL,"https://www.homier.com/default.asp?page=signin");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"EMail=homierorders@swbell.net&Password=1040ez");
ob_start(); // prevent any output
curl_exec ($ch); // execute the curl command
ob_end_clean(); // stop preventing output
curl_close ($ch);
unset($ch);

/*
Dump html of orderstatus page into a file on my server
*/
$fh = fopen('raw_orderstatus.html','w') or die($php_errormsg);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
curl_setopt($ch,
CURLOPT_URL,"https://www.homier.com/default.asp?page=orderstatus");
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_exec ($ch);
curl_close ($ch);
?>

My problem: How can I capture only the data in the "<td
class='n8n_CCCCCC_default>" tags?
Is there a way to do this at file creation?
I checked with my ISP and I can't use LYNX -DUMP file.html

The goal here is to load these records into MYSQL database.

Search Feature On HTML Site W/PHP Capability
I have been asked to add a search feature to an existing site written by somebody else. The site is all plain html. The customer wants to search by keyword and by employee name. I understand how to do this with PHP/MYSQL. The site has PHP capability but the site is currently not MYSQL.

Can somebody please give me some pointers on The best way to do a search on a bunch of html source files?

Or better yet, is there a prewritten code out there for this purpose that somebody knows about?

Some Problems With HTML Emails My PHP Site Is Sending
I'm creating HTML emails from a PHP site and sending them out to an email
list (just about 40 people so far are on this list). I've tested and
confirmed that these emails work in yahoo.com's webmail. And I know they
work on *my* Outlook Express. But I have one person (I know of) who gets the
emails as plain text, so she sees the HTML code for the email instead of its
proper representation. She has, like myself, OE6, and other html emails (not
necessarily the emails that come from my site, but HTML emails I've sent her
directly with my OE), have worked OK.

I can't figure it out. I've checked the headers in the emails I've sent her
where it came out as plain text (she forwarded them back to me), and the
"Content-type: text/html; charset=iso-8859-1" line is present, so it's not a
missing header line.

What's A Good Program For Managing A Mixed Html-PHP Site?
Our site, of which about half the content is PHP pages and is on a Linux
Apache server, is currently administered with Microsoft FrontPage 2003.

Okay, now that you've finished laughing, let me just say it's worked
pretty darn well considering everyone says "you gotta be crazy to have
FrontPage and PHP/Apache". But the writing is on the wall, considering
Frontpage is discontinued, is designed for simpler sites, and there are
so many annoying little quirks as a result of Microsoft pretending that
PHP doesn't exist. I would like something that lets me edit a plain
html page with a degree of WYSIWYG, and launches the appropriate text
editor or whatever when I open a php file, and also manages uploading
any changed pages. Frontpage does all of these pretty well, though the
FPServer Extensions are a bit flaky on our Linux server. Is there such
a beast out there?

Getting The Entire URL
You know how someone submits a form, and it goes to process_form.php, and after processing, redirects it back to that page?

How can I get the URL of my page, and after the person submits the form, take them back? For example:

viewtopic.php?topic=32&post=4&id=33

Can I store that portion of my URL (along with all the variables)?

(I have heard of $_SESSION['url'])

What Can Return The ENTIRE Url?
I'm looking for PHP equivalent to Javascript's location.href property. This returns the ENTIRE url (including any variables that might be submitted to a script). I've looked at phpinfo(), but I didn't see exactly what I am after. If the answer is the HTTP_POST_VARS variable, could someone please give me a simple example of how exactly this variable is to be used in code?

Capturing The Entire URL
Been playing around with capturing the entire URL. I dont have any problems
if it a file,
i.e. http://www.mydomain.com/somefile.php, I am running into problems with
this,
http://www.mydomain.com/test

This is what I use for "redirection" now (btw, it is IIS (Win2k) and PHP
4.3.2)
The test.mydomain.com is setup as a host header under IIS

$redirect = getenv("HTTP_HOST");

if ($redirect=="test.mydomain.com"){
header("Location:http://www.mydomain.com/modules.php?name=test");
}

The above code works fine. Redirects no problem.

However, I am trying to get this to do the same thing:
www.mydomain.com/test or www.mydomain.com/test/
and both would take you here:
http://www.mydomain.com/modules.php?name=test

I have tried every combination of the SERVER vars, but no luck.
I either generate a 404 or the test isn't part of the URL.

How To Copy An Entire Array?
can I do this? You see, I want to pass my values in to another page, but you can imagine how it would be insane to try and copy each value in the array individually

<A HREF="thepage.php?array[0]=$array[0]&array[1]=$array[1]... etc

is there a way to compress an array into a single variable, and then decompress it

like:
Code: $compressedArray = compress(0, 10, $array);
where 0 is the start index, and 10 is the end index

then when I want to use it on the other page
Code: for ($x=0; $x<=10; $x++){
$newArray[$x] = decompressMe($x, $compressedArray);
}
I'm sure that there must be some simple little thing like that.... I looked at the php manual, but couldn't really see anything like I'm talking about (or maybe I dont understand it )

Preventing Entire Db Download
I've collected some data and created a db. I am putting together a
website allowing users to search the db with a search-query
functionality. I am pretty much building a google-like engine,
although the data is stored in a MySQL.

If I use a GET form in the search page (which is what most engines
do), then the query results are displayed in pages where the URL
contains the query_string (example,
www.blahblah.com/search.php?queryitem1=my1&queryitem2=my2+my3).
So far so good, but in my case the data is of a local nature (say, a
yellow page type of thing with some extras) and someone can basically
pick the entire database by running a script like:

wget www.blahblah.com/search.php?zip=00001
wget www.blahblah.com/search.php?zip=00002
..........
wget www.blahblah.com/search.php?zip=99999

This is something I would like to prevent. Could someone please offer
their opinion on:

1. how to best go about it with a GET form?

2. Is it indeed doable with a POST form in the search page (as opposed
to a GET form)?

3. I've read that the main advantage of a GET vs POST form is that
someone can bookmark a search results page (eg.
www.blahblah.com/search.php?zip=12356) if it the form is GET. Any
other advantages/disadvantages that i am missing?

Passing An Entire Array In PHP
I saw a previous post about sending arrays but did not quite
understand the answers.

The problem is that I would like to pass an entire array as a hidden
input field from one php script to another. I've simplified the code
where form1.php calls form2.php when "Go" is hit:

form1.php
=========

<html>
<head>
<title>Form 1</title>
</head>
<body>
<h1>Form 1</h1>
<form action="form2.php" method=post>
<?
$record[0]="One";
$record[1]="Two";
printf("<input type=hidden name="record[]" value="%s">",$record);
?>
<input type=submit value="Go">
</form>
</body>
</html>

form2.php
=========
<html>
<head>
<title>Form 2</title>
</head>
<body>
<h1>Form 2</h1>
<?
$record=$_POST['record'];
printf("$record[0]=%s",$record[0]);
printf("$record[1]=%s",$record[1]);
?>
</body>
</html>

The result is:
Form 2
Array=Array=

How do I fix this?

Copying Entire Directories
I need to copy all of the files from one directory to another. This has to happen on the fly. The files that are being copied are actually templates for another site that will be created. I have seen the example on php.net under the fopen section but it doesnt work.

Any Way To Upload Entire Folder?
I'm currently working on a little program that will allow different departments within where I work to upload videos (like training videos or safety videos) and then keep track of who watches them. My guess is that I'll do most of the uploading myself, but I wanted to make it such that I can give anyone access to the upload script so they could do it themselves.

Anyway, we (at the office) all agreed that Flash is the best format for security and ease of distribution. We went out and got a program that will allow conversion of video files to flash and also allow them to have a nice table of contents and controls. The biggest problem is that for the TOC and controls to work on the flash videos, the program creates a friggin mess of files that all relate to each other... and this screws up my 'easy' upload idea. There's no way for this program to create a nice single .swf or .fla that has all the controls and TOC built in, at least not that I've found. :(

Is there any way, other than zipping up a directory and writing an unzipper for the server side, to allow a user to specify a directory where the video resides and just up the whole thing intact?

If not, I suppose I'll have to settle for the single .flv file that is created and dump the controls and TOC... though that's part of the reason we bought this converter program. I'm trying to write it in such a way that it will also play mpegs and avi files down the road if that's what the department has, but to start out we're asking that they send us the movie file so we can convert it to flash.

Copy Entire Contents Of A Folder To Another
Situation:

I am creating a folder based on input from a form and then creating an images folder underneath that -- that works great and I can read and write to the newly created folders AS LONG AS IT IS ONE FILE AT A TIME!!!

What I would like to do:

I would like to copy the contents of an entire folder over to one of the newly created folders ALL AT ONCE -- or in a loop -- which is what I am trying to do but keep getting denied.

My code as it is now:
if ($handle = opendir("$sourcedir")) {
echo "Directory handle: $handle<br><br>";
echo "Files:<br><br>";
while (false !== ($files = readdir($handle))) {
if ($files != "." && $files != "..") {
if (!copy($files, $imagepath)) {
echo "failed to copy $files into $imagepath<br><br>";
}
}
}
closedir($handle);
}

all of the variables are working fine... it goes through the loop just fine -- I know this because it prints out the error for every file in the folder... it just won't copy the files over to the new folder while in this loop.

Here is the beginning of the error messages:
Directory handle: Resource id #2
Files:
failed to copy step_c1.gif into /htdocs/www/schemes/adfasa/images
failed to copy step_b1.gif into /htdocs/www/schemes/adfasa/images
failed to copy step_a1.gif into /htdocs/www/schemes/adfasa/images

by the way: adfasa is the folder name brought in by the form and images is the folder I create underneath it.

Is this something that is possible to do in a loop? If so, what is wrong with this one. If not, how is something like this done?

Of course since I know the files that are in the folder I want to copy from I could just go ahead and copy them ONE by ONE but that doesn't seem to be very efficient.

Including Files From Entire Directory
I have this little news script that stores each entry into a seperate file into monthandyear/day, month date, year hour-minutes-seconds AM/PM

so if it was Sunday, March 9, 2003 11:39 PM then the script would store the new entry in the folder named "March2003" and in a file called "Sunday, March 9, 2003 11-39-00 PM"

now, the problem i have is i want to have an archive of all my news entries by month, so how do i get the contents of all the march entries displayed onto one page in order of date and time?

Viewing Entire HTTP Header ?
is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the apache
functions, but none seem to have a way to show the body that was sent with
the request.

any suggestions for how i would go about doing this? It's mostly for
documentation and instructional purposes, but i'd like to see the results
without having to construct them by hand and telnet'ing into port 80 all
the time ....

Pass The Entire Array Through A Form.
Im working with an array in my php script and need to pass the entire array through a form. Here is the script. Take a look and tell me if you can see my mistake.

I create a dynamic entry screen that has multiple values that I would like to update and want to place them all into an array to update them. At the mo no values are being posted at all. Code:

Can You Send An Entire Webpage Via Email Using PHP?
If you go to File >> Send > Page via email

it will send a snap shot of the current page you are looking at via email.

can this be done via PHP (or another means) so that I can create a script that will email a webpage automatically to a chosen person?

Sending Entire Web Page To Email
Is it possible to send an entire web page to an email using mailto:person@blah.com function, with what has been typed in the text boxes. And if so what would the code look like.

Export To CSV
There are some text fields that I am exporting to CSV contain comma in it. And so when I open the csv file, everything is shifted.

e.g. "Apple, Banana, Orange", "Excellent", "12345"

gives me 5 columns instead of 3 in the csv: Apple Banana Orange Excellent 12345 How can I solve this problem?

PHP Export > Csv
I have got a page on a site that I'm working on. As you can see there are 3 drop down menu's which are dynamicaly driven by 3 tables within my database. On selection of the lists, you are taken to the same page (show if statement - dreamweaver) which shows you the record count. This is based on your criteria!

At this point. I would like to export the query results into a .csv file. Now I have looked across the forums and found a few things and tried to implement them into my site, all of which are bringing up an empty page. Possibly because my search queries are dynamic?

Entire Query String As Script Variable
How would I pull the query string of an URL into my PHP script for use as a variable inside the script?

For example - URL is http://www.mydomain.com/hub.php?ref...bob&lname=smith

In my hub.php script, I want to set a variable

$foo = "ref=affiliate1&fname=bob&lname=smith";
(or whatever the actual query string happens to be)

PHP Http Authentication - Cannot Secure Entire Directories?
I've been trying out HTTP authentication with PHP (yes I've read the Zend tutorial, searched the forum, and read the manual). Things seem to work great.

However I have noticed that is does not work like a .htaccess file would. Only the PHP script which sends the headers will check for anything. No very useful for blocking out a whole directory tree. I wanted to move away from just using a .htaccess so that I could authenticate the passwords over a MySQL database.

The current setup has an index.php in the directory that is to be protected. It checks for password, then initializes a session and forwards the user to the protected section. Each script in the protected section checks if valid session exists, and if not, forwards back to the main index.php to HTTP authenticate again.

This seems to work fine except I'm afraid of one day forgetting to check for the session or people accessing non PHP files that are in the protected directory.

My question is, is there a way to combine PHP based http authentication with a .htaccess file? Or somehow have an entire directory be authenticated through one script. And the other concern is that if I do have the entire directory protected and go through that one PHP script somehow, wouldn't it have to check the l/p with MySQL every time they accessed any file?

Regular Expression Detecting Entire Page
I am making a flat file, static HTML search engine for a site. I
downloaded a script from the net and have been working with it for my
needs.

Everything was working OK with a few test Lorem Ipsum pages. But the
moment I try to search real data, fit hits the shan.

The script uses a regular expression to search through the files. And
for most of these files, the regular expression doesnt seem to pick up
the matches as it should, and for lack of a match, it outputs the
entire html page as a hit. The search word is on the page somewhere,
but it still outputs the entire page.

Allow me
--------8<----------------------------
if(preg_match_all("/((sS*){0,3})($keyword)
((s?S*){0,3})/i", $portion, $match, PREG_SET_ORDER));
{
if(!$limit_extracts)
$number=count($match);
else $number=$limit_extracts;

for ($h=0;$h<$number;$h++){ // no limit
if (!empty($match[$h][3]))
$text = sprintf("... %s<font
class='keyword'>%s</font>%s ...", $match[$h][1], $match[$h][3],
$match[$h][4]);
else{
//print_r($match);
}
}
}
--------8<----------------------------

There's the regex that looks through $portion, which is the strip_tags
version of the file's contents. And if I echo $portion right before
that line, I see the stripped code. However, when I get to the line
where it checks $match[$h][3] for the keyword that was searched for,
it craps out. Not 100% of the time, but most of the time. Im trying
to figure out details about these html pages, to no avail.
So as a result of failing that empty test, the entire html page is
dumped out as a search result.

Not being a regex expert, Ive had a hell of time troubleshooting. But
I feel the problem lies in there. Something with the regex not finding
the keyword correctly, or something.

Part Of The Script To Refresh With Out Refreshing The Entire ?
I am have a script, and in that script I have a section that pulls information from a database. I also have a drop down box that allows the user to slect which category they want the data to be pulled from. As of now, the way I have it, after they make a selection, the entire page gets refreshed and the new category is loaded. How can I make it that only that section of the script gets refreshed?

Site Flow Chart/site Map Creator For PHP?
I'm working on a site created by someone else, containing a hundred
different pages or so in PHP, with connections (includes and form
actions) going all over the place.

Is there a utility out there that will create a visual site map of all
the connecting pages in a site?
I tried using Dreamweaver MX 2004's, but the best it can do is see
connections in HTML. It'd only go one layer deep and find only a few
connections for a total of about 6 pages out of the dozens.

Export Sql Code
Can I use a php script to move a database from a db on my local machine to a db on a server..

How exactly would it be structured, and what commands would I have to use?

I'm also looking into using mysql to export the code and content from the db on my computer and then import it using phpMyAdmin on the server, but I still havent found out how to do that after searching these forums and reading through the mysql manual.

Import And Export
Anyone could give me some tips about coding an import and export php script
with mysql ?

Export Any File
I want to export a mysql query into text, cvs, or excel file, I was looking and I found the headers to do this, but when I open the saved file appears all the page, I mean save the data but also save all the page. Code:

CSV Export Thing
I am looking at the fputcsv function for something that I need. In summary,
this is what I want to do:

1. Go through a table
2. Get all the columns and put them into an array
3. write the array to a CSV file
4. Go to the next row
5. Append the table row into the CSV file
6. Repeat for each row in the table

The php site shows this:

<?php

$list = array (
'aaa,bbb,ccc,dddd',
́«,456,789',
'"aaa","bbb"'
);

$fp = fopen('file.csv', 'w');

foreach ($list as $line) {
fputcsv($fp, split(',', $line));
}

fclose($fp);
?>

I'm assuming that I need the 'a+' mode for opening the file and not 'w'?

I'm ashamed to say that I have no idea how to loop through the table and put
the columns into the array.

What I'm coming up with at the moment is this:

<?php do {

$list = array (
'
$row_Recordset1['firstname'],
$row_Recordset1['lastname'],
$row_Recordset1['email'],
$row_Recordset1['telephone']'
'
);

$fp = fopen('/path/to/the/file.csv', 'a+');

foreach ($list as $line) {
fputcsv($fp, split(',', $line));
}

fclose($fp);

Export Excel
i have created a page that export in excel format some recordsets
extract from a database, i pass to that page the sql query string via
get

example:
href="export_excel.php?sql=<?=$sql?>"

it works fine but in the address bar and in the title bar (with
Explorer) it write the sql string that i pass to the page and i don't
like it

how can i solve that problem?

Export To Excel
I've been trying to export MySQL data to an excel / CSV file, and I have it pretty much populating the Excel properly with the data; however, the Excel sheet also includes the entire HTML formatting + CSS/JS coding before the export code. I've tried getting rid of it with strip_tags, to no avail. Is it because the export code is to the middle of the file? I tried to move it into the header, but that didn't work either. Any ideas? Code:

Showing Partial Row Info With Link To Entire Record
How can I show in the results just two or three fields of a record, with one of the fields linked to show the entire record?

Match Regular Expressions In A Webpage, Not The Entire Source
In order to check availability, I want to visit many different pages
from a database and try and match the regular expressions 'out of
stock' or 'unavailable' or 'sold out' etc. If found, the product will
be flagged as unavailable.

I tried using fopen() and preg_match() but the problem is, if the reg.
expression is present in javascript or in comments, the item gets
wrongly flagged. Is there a way of taking what appears on the users
screen, after parsing the page, and looking at it as a string I suppose
?

Paint An Opaque Layer Of Color Over An Entire Image?
Is there code (if so, what is it?) to paint an opaque layer of color over an entire image?


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