🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.lang.php
8 messages
8 total messages Started by Jose Luis Thu, 13 Jul 2000 00:00
HTML File
#27
Author: Jose Luis
Date: Thu, 13 Jul 2000 00:00
17 lines
978 bytes
Hello All.

I need some function that tell me if a file that my visitors put in a form
is an HTML file or not.

If you know how i can do it please tell me an example of this. Thank You.

Bye. Jose Luis
_________________________________
Jose Luis Rodr�guez Sevilla
FERCA NETWORK
Tel: +34 926 574 009
Fax: +34 926 573 681
ICQ: 69357481
email: joseluis@ferca.com
http://ferca.com
_________________________________
Re: HTML File
#28
Author: Martin Jansen
Date: Thu, 13 Jul 2000 00:00
26 lines
1418 bytes
* "Jose Luis" <joseluis@REMOVEMEferca.com> wrote:
>I need some function that tell me if a file that my visitors put in a form
>is an HTML file or not.

The only idea, I have, might be to check for the "typical" tags, that
occur in a html-file:

This might look like this:

<?php

/* $buffer contains the whole content of the html-file */

if (eregi("<html>",$buffer) AND eregi("<head>",$buffer) AND
ereg("<body>",$buffer))
  echo "The file seems to be an html-file.";
?>

Of course you can add more Regular Expressions to the script to look
for other html-specific tags.

HTH,
Martin
-- 
Martin Jansen  � mailto:mail@martin-jansen.de
PGP 0x18176561 � http://www.php.martin-jansen.de/
Creating new file
#29
Author: Siim Einfeldt
Date: Thu, 13 Jul 2000 00:00
9 lines
893 bytes
Hi guys

How can I create a new file in php? Let say I have a guestbook, where all
the posts go to a separate file. How can I make the program (script) to
create new files for that purpose? Is there a specific tag for that?

Thanks,
Siim Einfeldt
Re: Creating new file
#30
Author: Martin Jansen
Date: Fri, 14 Jul 2000 00:00
17 lines
1382 bytes
* Siim Einfeldt <siim_e@pshg.edu.ee> wrote:
>How can I create a new file in php?

With fopen():

<http://www.php.net/manual/function.fopen.php> says:

"[...]'w' - Open for writing only; place the file pointer at the
beginning of the file and truncate the file to zero length. If the
                                                            ^^^^^^
file does not exist, attempt to create it.[...]"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Martin
-- 
Martin Jansen  � mailto:mail@martin-jansen.de
PGP 0x18176561 � http://www.php.martin-jansen.de/
Re: Creating new file
#31
Author: Siim Einfeldt
Date: Fri, 14 Jul 2000 00:00
30 lines
1797 bytes

Thank you

On Fri, 14 Jul 2000, Martin Jansen wrote:

> * Siim Einfeldt <siim_e@pshg.edu.ee> wrote:
> >How can I create a new file in php?
> 
> With fopen():
> 
> <http://www.php.net/manual/function.fopen.php> says:
> 
> "[...]'w' - Open for writing only; place the file pointer at the
> beginning of the file and truncate the file to zero length. If the
>                                                             ^^^^^^
> file does not exist, attempt to create it.[...]"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Martin
> 

-- 

_______________________________________________________________________________
 ___                                 
||_   Siim Einfeldt                         |<---------------------------------   
||__  siim_e@pshg.edu.ee                    |<---------------------------------      
||__  "Everything Is Possible"              |<---------------------------------
|___| http://www.pshg.edu.ee/~siim_e/vb     |<---------------------------------
Re: Creating new file
#32
Author: Kristian Koehntopp
Date: Fri, 14 Jul 2000 00:00
20 lines
1604 bytes
Siim Einfeldt <siim_e@pshg.edu.ee> writes:
>How can I create a new file in php?

Willkommen in de.comp.lang.php, der Newsgroup zur Diskussion von PHP in
deutscher Sprache. Wir haben eine FAQ. Du findest sie in

	http://www.koehntopp.de/php/

Loesungen fuer Dein Problem und weitere Information ueber Filehandling
findest Du in

	http://www.koehntopp.de/php/faq-10.html
	"Dateifunktionen und Programmausfuehrung"

Kristian
-- 
"The lawyers won't solve this and the technologist won't solve 
 this piracy problem," Griffin said. "Anyway, anything that a 
 41-year-old thinks up, a 14-year-old can undo." 
	-- http://www.wired.com/news/business/0,1367,37151,00.html
some help
#33
Author: Siim Einfeldt
Date: Sat, 15 Jul 2000 00:00
29 lines
1871 bytes
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--683786542-1842228789-963673712=:11501
Content-Type: TEXT/PLAIN; charset=US-ASCII


I`m working on a message board, I want to put all the posts to separate
files. Here`s a address, where it is: www.testphp3.f2s.com/mb/index.php3
 - it doesn`t work. I also attached the main file to this letter. I`m 
quite
a newbie and would appreciate if anyone could take a look at it?


Thanks,
Siim Einfeldt,
siim_e@pshg.edu.ee

--683786542-1842228789-963673712=:11501
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="mb.php3"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.21.0007151708320.11501@pshg.edu.ee>
Content-Description: the main file
Content-Disposition: attachment; filename="mb.php3"

<encoded_portion_removed>
JG5ld21lc3NhZ2UpOw0NCg0NCmVuZGlmOw0NCg0NCj8+DQ0KDQ0KDQ0K
--683786542-1842228789-963673712=:11501--
Re: Creating new file
#34
Author: Jeroen Straathof
Date: Mon, 31 Jul 2000 00:00
21 lines
1666 bytes
Creating a file can be done with the touch() function

"Martin Jansen" <mail@martin-jansen.de> wrote in message
news:qbatmscnts9kfeaggq6928tuhcdfftf50o@4ax.com...
> * Siim Einfeldt <siim_e@pshg.edu.ee> wrote:
> >How can I create a new file in php?
>
> With fopen():
>
> <http://www.php.net/manual/function.fopen.php> says:
>
> "[...]'w' - Open for writing only; place the file pointer at the
> beginning of the file and truncate the file to zero length. If the
>                                                             ^^^^^^
> file does not exist, attempt to create it.[...]"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Martin
> --
> Martin Jansen  � mailto:mail@martin-jansen.de
> PGP 0x18176561 � http://www.php.martin-jansen.de/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads