+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 41 to 51 of 51
  1. #41
    DKY
    DKY is offline
    Member
    Join Date
    Jun 2003
    Posts
    34
     
    So I've got to change this
    Code:
    <TR>
          
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="whatitis" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/whatitis.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
    into something like this
    Code:
    <?
    $display = file("../txtfiles/ourhome/whatitis.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    <TR>
          
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="whatitis" cols="100" rows="5" wrap><?php echo $displaytext; ?></textarea>
    </p><br></TD>
         </TR>
    this is getting confusing...lol, Of course, its me that's making it confusing. Look at my "Post.php" which I call ourhome.php

    Code:
    <HTML>
     <HEAD>
      <TITLE></TITLE>
      </HEAD>
      <body>
    <form action="ourhome2.php" method="post">
    
    <CENTER>
       <P ALIGN=CENTER>
        <TABLE WIDTH="600" bordercolor="black" CELLPADDING="0" CELLSPACING="0" BORDER="0">
         <TR>
          
         <TD WIDTH="100%" VALIGN=TOP><p>This is where you can edit the contents of the "Our Home" web page.  There are also a few more blank areas where more information could be added.</p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>Whatitis:  A short sentence that explains what's below.</TD>
         </TR>
         <TR>
          
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="whatitis" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/whatitis.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
        
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="title" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/title.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
          <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="intro" cols="100" rows="15" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/intro.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="firstheader" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/firstheader.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="firstbody" cols="100" rows="15" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/firstbody.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="secondheader" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/secondheader.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="secondbody" cols="100" rows="15" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/secondbody.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="thirdheader" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/thirdheader.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="thirdbody" cols="100" rows="15" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/thirdbody.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="fourthheader" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/fourthheader.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="fourthbody" cols="100" rows="15" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/fourthbody.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="fifthheader" cols="100" rows="5" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/fifthheader.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p><br></TD>
         </TR>
         <TR>
          
         <TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center>&nbsp;</TD>
         </TR>
         <TR>
         <TR>
         <TD WIDTH="100%" VALIGN=TOP><p>
    <textarea name="fifthbody" cols="100" rows="15" wrap>
    
    <?php
    //this is the text file to write to, they can't contain numbers, ie 1header.txt does not work
    $display = file("../txtfiles/ourhome/fifthbody.txt");
    $displaytext = implode("", $display);
    $displaytext = stripslashes($displaytext);
    echo $displaytext;
    ?>
    </textarea>
    </p></TD>
         </TR>
         
        </TABLE>
    <p>
    <input type="submit" name="Submit" value="Submit Changes to OurHome">
    </p>
    </form>
    </body></html>

  2. #42
    DKY
    DKY is offline
    Member
    Join Date
    Jun 2003
    Posts
    34
    oh wait, i think i might have it....i list the variables at the top like so?

    Code:
    $display1 = file("../txtfiles/ourhome/whatitis.txt");
    $displaytext1 = implode("", $display1);
    $displaytext1 = stripslashes($displaytext1);
    
    $display2 = file("../txtfiles/ourhome/title.txt");
    $displaytext2 = implode("", $display2);
    $displaytext2 = stripslashes($displaytext2);
    
    $display3 = file("../txtfiles/ourhome/intro.txt");
    $displaytext3 = implode("", $display3);
    $displaytext3 = stripslashes($displaytext3);
    
    $display4 = file("../txtfiles/ourhome/firstheader.txt");
    $displaytext4 = implode("", $display4);
    $displaytext4 = stripslashes($displaytext4);
    
    $display5 = file("../txtfiles/ourhome/firstbody.txt");
    $displaytext5 = implode("", $display5);
    $displaytext5 = stripslashes($displaytext5);
    
    $display6 = file("../txtfiles/ourhome/secondheader.txt");
    $displaytext6 = implode("", $display6);
    $displaytext6 = stripslashes($displaytext6);
    
    $display7 = file("../txtfiles/ourhome/secondbody.txt");
    $displaytext7 = implode("", $display7);
    $displaytext7 = stripslashes($displaytext7);
    
    $display8 = file("../txtfiles/ourhome/thirdheader.txt");
    $displaytext8 = implode("", $display8);
    $displaytext8 = stripslashes($displaytext8);
    
    $display9 = file("../txtfiles/ourhome/thirdbody.txt");
    $displaytext9 = implode("", $display9);
    $displaytext9 = stripslashes($displaytext9);
    
    $display10 = file("../txtfiles/ourhome/fourthheader.txt");
    $displaytext10 = implode("", $display10);
    $displaytext10 = stripslashes($displaytext10);
    
    $display11 = file("../txtfiles/ourhome/fourthbody.txt");
    $displaytext11 = implode("", $display11);
    $displaytext11 = stripslashes($displaytext11);
    
    $display12 = file("../txtfiles/ourhome/fifthheader.txt");
    $displaytext12 = implode("", $display12);
    $displaytext12 = stripslashes($displaytext12);
    
    $display13 = file("../txtfiles/ourhome/fifthbody.txt");
    $displaytext13 = implode("", $display13);
    $displaytext13 = stripslashes($displaytext13);
    
    <form action="ourhome2.php" method="post">
    then in the respectable text areas I put

    Code:
    <?php echo $displaytext1; ?>
    and displaytext2, and so forth, right?

  3. #43
    Member Carl-cox-'s Avatar
    Join Date
    Nov 2002
    Location
    Kent England
    Posts
    396
    yeh that it remeber to put <? at the begining and ?> at teh end of delcaring them varibles to tell the server or browser that it php code other wize it will diplay as plain text

    so now inside the form we have a text box it will look like this

    Code:
    <textarea name="name" cols="100" rows="15"><?php echo $displaytext1; ?></textarea>
    also if you are worried about showing the <br> in the text box when it loads the file have a look how to hide them

    http://jub.jkub.com/test2.php

  4. #44
    DKY
    DKY is offline
    Member
    Join Date
    Jun 2003
    Posts
    34
    YEAH!!! sweet, it works....i figured out the <? ?> thing by looking at the post2.php. awesome.

    any idea where i can go to figure out that <br> thing? I'm doing this for a web page, and the text all runs together.
    http://dky.sytes.net/rwb/

  5. #45
    Member Carl-cox-'s Avatar
    Join Date
    Nov 2002
    Location
    Kent England
    Posts
    396
    humm do you want a <br> at the end of the text you right or after so many characters. if it is after so many characters why not put in a frame on the main page then <? include("your textfile"); ?>

    this will automatcially wrap the words so it wont be i continuois line.

    if you want to put a br at the end of the block of text you wrote then read back i explaned how to do it.

  6. #46
    Member Carl-cox-'s Avatar
    Join Date
    Nov 2002
    Location
    Kent England
    Posts
    396
    Originally posted by Carl-cox-


    1. this requres modification to the above script a little bit hope you can understand this

    Code:
    	$stripped = stripslashes($news);
    	$somecontent = "$stripped <br>;
    	if (is_writable($filename)) {
     	   if (!$handle = fopen($filename, 'w')) {
     	        print "Cannot open file ($filename)";
     	        exit;
     	   }
     	   if (!fwrite($handle, stripslashes($somecontent))) {
     	       print "Cannot write to file ($filename)";
     	       exit;
     	   }
        
     	   print "Success, wrote ($somecontent) to file ($filename)";
        
     	   fclose($handle);
    
    	} else {
    	    print "The file $filename is not writable";
    	}
    as you can see $news is the varible from the textbox and $filename if the varible for the filename
    Last edited by Carl-cox-; June 7th, 2003 at 10:47 AM.

  7. #47
    DKY
    DKY is offline
    Member
    Join Date
    Jun 2003
    Posts
    34
    when I type text in the text area, and then hit the carriage return, it doesnt put a <br> in the txt file, thus causing the text to all run together when called up on the php main page. Is there a way around that? Maybe its not supposed to put a <br>, but someway to recognize the carriage return.?.?.?

  8. #48
    Member Carl-cox-'s Avatar
    Join Date
    Nov 2002
    Location
    Kent England
    Posts
    396
    umm i really dont know on this one, there is a way as this forum uses but i dont know how it works all i can think is it counts the number of lines then puts a <br> at the end there for a blank would be <br> on it own making a line. but i dont know how to count lines in a text file then to even put <br> at the end

  9. #49
    DKY
    DKY is offline
    Member
    Join Date
    Jun 2003
    Posts
    34
    i dont know what you mean about counting lines? I just want it to <br> when I type in the textarea and hit the "enter" key

    BTW, do you have an instant messenger?

  10. #50
    DKY
    DKY is offline
    Member
    Join Date
    Jun 2003
    Posts
    34
    nl2br() took away the br's in case anyone wants to know.

    Does anyone know of a php function that keeps spaces? as for right now, I'll type something like "1. hello world" and it comes up on my page like "1. hello world".

  11. #51
    Member Carl-cox-'s Avatar
    Join Date
    Nov 2002
    Location
    Kent England
    Posts
    396
    look what i found and thought of you

    http://phpfreaks.com/forums/viewtopi...74074d641a77ae

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews