Displaying text from a submited variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • teetwo
    Special Status

    • Feb 2008
    • 14

    Displaying text from a submited variable

    I am trying to create a page that displays the text entered in a form textarea.

    I am using my own php Processor to acomplish a complex task prior to loading to database
    so far I have within the html on the page
    <?php echo "<pre>".$Item_Description."</pre>"; ?>

    My problem is that on the submission page text in the textarea box wraps but when the post statement transfers the text ie
    $Item_Description=$_POST['Item_Description'];

    The text is displayed in one line unless line feeds are placed at the end of each line within the textarea box.

    My question is. How do I format and display this text whithin a designated area with line wrapping etc.



    |................................|
    |................................|
    | Say in an area like this |
    |................................|
    |................................|

    Thanks in advance
    Terry
  • teetwo
    Special Status

    • Feb 2008
    • 14

    #2
    Re: Displaying text from a submited variable

    Well I found out how.
    My variable is $Item_Description

    <div id="bv_Text2" style="position:absolute;left:88px;top:149px;width :300px;height:100px;" align="Justify">
    PHP Code:
    Echo "<h4>"$Item_Description."</h4>"
    It works a treat and separation can be achieved by inserting a <br> in text input area. I shall note that on page for users.

    Ahh! This editor is better than I thought. My online garage sale site is all go that last display item held me up.

    Comment

    • navaldesign
      General & Forum Moderator

      • Oct 2005
      • 12080

      #3
      Re: Displaying text from a submited variable

      Hm... complicated way.....

      Ok, lets suppose that you have already set the variable $Item-Description

      Ad, in the page, a text object.

      Make the text:

      '.$Item_Description.'

      Right click it, select HTML, and add the following codes:

      In the BEFORE Tag :

      <?php echo '

      In the AFTER Tag:

      ';
      ?>

      You can format the text as you like. If you use the same font, font size, and you give the text object the same width as your text area, the text will be wrapped exactly as in the text area of the form. Changing the width of the text object you can set the real text to the dimensions (width) you like.
      Navaldesign
      Logger Lite: Low Cost, Customizable, multifeatured Login script
      Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
      DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
      Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

      Comment

      • teetwo
        Special Status

        • Feb 2008
        • 14

        #4
        Re: Displaying text from a submited variable

        First off may I apologise for taking so long to respond. I have been working on my site. I appreciate your suggestion. It sure is neater.

        Combining php with html is new to me but like anything what was hard then you look back on and wonder why it gave you so much trouble.

        I have tried many editors and BV is by far the best. I have found now that I can create a beautiful page use the source as a php page and make the page dynamic.

        What with the self testing of submited elements I cannot fault it. A inbuilt help file would be nice but I just remembered this is the wrong forum.

        Thanks again Navel
        Last edited by teetwo; 09-02-2010, 01:34 AM. Reason: spelling

        Comment

        Working...
        X