Current location: Hot Scripts Forums » Programming Languages » PHP » Creating pages with php


Creating pages with php

Reply
  #1 (permalink)  
Old 04-15-04, 12:08 AM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Creating pages with php

I have made a php chat system, but I would like to make it so that a user can make a new topic, and make a new page with sertain text on it...(a new php page). Is this possiable.

Just to tell you, this is a non mySQL php chat system for when you can't use mySQL...
thanks for the help.
Reply With Quote
  #2 (permalink)  
Old 04-15-04, 07:49 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
generaly you can create files with:
PHP Code:

$fp fopen('MyFile.txt''a');

$write fwrite($fp$TextHere);
fclose($fp); 
this code will try to append $TextHere to MyFile,txt but if it wasn't found it will attempt to create it and write to it ..
you can use the flag 'w' to write the whole file from scratch instead of appending ..
take a look here :
http://www.php.net/manual/en/function.fopen.php
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]

Last edited by NeverMind; 04-15-04 at 07:52 AM.
Reply With Quote
  #3 (permalink)  
Old 04-15-04, 08:19 PM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, but the problem is I want to make the filename a variable, but it turns out and makes a file (ie. $topicname) and doesn't bother to even add the ".php" part to it.

Also, don't I have to add this "error" script to cancle the person from viewing the errors after it is created...?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP in HTML Pages? ZeoFateX PHP 19 01-04-06 06:42 PM
Creating subdomains using PHP Mr. Tech PHP 7 05-11-04 01:52 AM
dividing pages in PHP Gordon Freeman PHP 2 02-07-04 07:44 AM
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
How to convert php generated pages to SE friendly HTML or PHP(SE friendly) -CLASS 101 crippled PHP 1 11-16-03 06:37 AM


All times are GMT -5. The time now is 10:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.