how to fwrite an entire php page

Reply

Join Date: Apr 2009
Posts: 290
Reputation: SKANK!!!!! is an unknown quantity at this point 
Solved Threads: 2
SKANK!!!!!'s Avatar
SKANK!!!!! SKANK!!!!! is offline Offline
Posting Whiz in Training

how to fwrite an entire php page

 
0
  #1
May 20th, 2009
i made a script to create a directory and file within the directory for someone who is registering at my site also knows as
www.socialemo.com/theirusername/index.php
but im stuck on the index.php file
I DONT KNOW HOW TO WRITE HTML AND PHP TO THE FILE
how am i supposed to write a page of html to the file?
and also i need some php script to it too
is it possible to write php to a file with fwrite or do i have to do something else entirely
*the reason i need php is the login check because the page isnt supposed to be accesses unless the person is logged in*

so i basically need to know how to include this into the fwrite script
  1. <?php
  2. require($_SERVER["DOCUMENT_ROOT"] . "/xxxxx/checkforlogedinscript.php");
  3. ?>
  4.  
  5. hhhhhhhhhhhhiiiiiiiiii <a href="http://www.socialemo.com/xxxxx/signouts">sign out</a>
  6. Hi, you are in the session...
  7. ???????????????????????????????????
and some tables and other html maybe a stylesheet include

AND THIS IS WHAT I HAVE SO FAR:
  1. if(mkdir($documentroot ."/". $row['username'] , 0777))
  2. {
  3. $contents = "uhhhhhhhh";
  4. $profile = $documentroot ."/". $row['username'] ."/index.php" ;
  5. $fh = fopen($profile, 'w') or die("can't open file");
  6. $contents = "uhhhhh\n";
  7. fwrite($fh, $contents);
  8. fclose($fh);
  9. echo "<br> You can access your profile at <a href=\"http://www.socialemo.com/" . $row[username] . "\">www.socialemo.com/$row[username]</a> <br>";
  10. }
  11. else
  12. {
  13. echo "There was a problem. Please <a href='http://www.socialemo.com/feedback.php'>contact</a> the administrator. ";

it works.. but i dont know how to put the php and stylesheets in and tables and stuff can anyone help me????
Last edited by SKANK!!!!!; May 20th, 2009 at 8:51 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC