Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2004, 05:13 AM
Authorized User
 
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default reading HTML from file -> write to file

I have 3 HTML files broken up into header, content and footer.
I have these in seperate flat text files.

I am currently reading them in using fopen() and then outputting them to the browser, which is working but I can not seem to get the contents of the text files, (all in straight HTML code)to write to a seperate output file using fputs().

Might anyone know what might the problem be?

Michael.
__________________
Michael.
 
Old July 21st, 2004, 05:20 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Why are you using file system functions and not including them??

Beyond that.. have you a snip of code that we can look at ;)??

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old July 21st, 2004, 05:24 AM
Authorized User
 
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rich,

 
Quote:
quote:Why are you using file system functions and not including them??


What do you mean by this?


Michael.
 
Old July 21st, 2004, 05:31 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Well I mean why are you using the fopen and such instead of the constructs: include, include_once, require or require_once...

Are you doing some regular expression stuff on the files?

The former requires less code and *may* be less resourse intensive than using the various file system functions.

It wasn't clear what you were trying to accomplish from your original post.

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old July 21st, 2004, 05:40 AM
Authorized User
 
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Right ic.
I'm a newbie to PHP so dont know all the pros and cons of using certain functions.

OK. What I have is a dynamic newsletter which gets added by the user and inserted into MySQL database.
What I need, once the user adds an article to the db, is for the newsletter to be ouputted as a file in HTML format for a static website.
I have managed to output all fields from the db using SQL statements on a web page.



Michael.





Similar Threads
Thread Thread Starter Forum Replies Last Post
convert HTML File to PDF file in vb.net gaurikhot .NET Framework 2.0 4 June 16th, 2014 02:33 AM
Help with PHP file reading XML file for output rydog65 Beginning PHP 0 March 26th, 2008 05:13 PM
Reading xml file which is in a JAR file pradheepayyanar J2EE 2 December 26th, 2007 05:52 AM
Getting a Text file from a HTML File or web page rajesh.java Java Basics 1 January 20th, 2007 08:36 AM
Reading html file from website vijaya_murali Java GUI 1 July 26th, 2004 09:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.