Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Unhappy Using lots of inverted commas in Textarea

    Hello, I'm newbie. I couldn't make this tiny code work.

    PHP Code:
    <?php

    $caps
    =$_POST["caps"];
    $aciklama=$_POST["aciklama"];
    $linkler=$_POST["linkler"];
    $tur=$_POST["tur"];


    echo 
    '<table border="1" width="100%" id="table1" height="638">
        <tr>
            <td width="590">
            <p align="center"><font size="5"><b>F1</b></font></p>
            <p align="center">
            <textarea rows="11" name="S1" cols="58">[img]'
    .$caps.'[/img]'.<br><br>nl2br('.$aciklama.')<br>nl2br('.$linkler.').'</textarea></p>
            <p align="center">
            </p>
            <p align="center"></p>
            <p>&nbsp;</td>
        </tr>
        </table>'
    ?>

    All I want is simple, this;

    <textarea> [img]$caps[/img]
    <br>
    <br>
    nl2br($aciklama)
    <br>
    nl2br($linkler)
    </textarea>

    But I'm lost in inverted commas, please help.
    Last edited by cevaps; 06-27-2010 at 09:15 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Um... first problem is I see you have F1' half way through, closing the quotes and screwing everything up. Escape it with a \.

    Also, what do you mean inverted commas? And in textareas, html appears as paintext, not as HTML formatting. So are you trying to get an image to appear in the textarea? Or the code?

    I guess the simple problem is you have a bunch of stuff that isn't properly encapsulated (everything after F1, the breaks before $ackilama). Get those sorted and I don't see why it wouldn't work.

  • Users who have thanked Keleth for this post:

    cevaps (06-27-2010)

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Keleth View Post
    Um... first problem is I see you have F1' half way through, closing the quotes and screwing everything up. Escape it with a \.

    Also, what do you mean inverted commas? And in textareas, html appears as paintext, not as HTML formatting. So are you trying to get an image to appear in the textarea? Or the code?

    I guess the simple problem is you have a bunch of stuff that isn't properly encapsulated (everything after F1, the breaks before $ackilama). Get those sorted and I don't see why it wouldn't work.
    F1 was just part of another text i forgot before send it here, so i deleted it.

    I just want to write the code in textarea, to use on another php.

  • #4
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Well, first like I said, encapsulate the breaks you have. Also, you seem very confused with how to concatenate functions in PHP strings.

    PHP Code:
    '<textarea rows="11" name="S1" cols="58">[img]'.$caps.'[/img]<br><br>'.nl2br($aciklama).'<br>'.nl2br($linkler).'</textarea></p>' 
    Again though, what do you mean by an inverted comma? Do you mean apostrophes?

  • Users who have thanked Keleth for this post:

    cevaps (06-27-2010)

  • #5
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Keleth View Post
    Well, first like I said, encapsulate the breaks you have.

    Again though, what do you mean by an inverted comma?
    Ah, I see what i wrote wrong.

    I mean with inverted comma is ' ' ' ' using in textarea. I guess you thought i'm trying to wrote <br> in textarea too, but i just want to make double enter with <br><br> but it shows <br> in textarea. I want this ;

    <textarea> [img]$caps[/img]


    nl2br($aciklama) - i must use nl2br in php code because all i want is multiline $aciklama

    nl2br($linkler) - same with $aciklama. just need multiline $linkler.
    </textarea>

    I want to get VBB post code. [img] will be in textarea but not nl2br or <br>. I'm trying to use them to change display of code.

    So, because of trying to use php commands in textarea, i'm using '. .' but it doenst work. I just need to make double space line after [/img] for next sentence.

    edit : it'll seem like this
    Last edited by cevaps; 06-27-2010 at 09:34 PM.

  • #6
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Well... thats why I said, html will appear as plain text in a textarea, not as formatting. If you wanna skip lines in textareas, use new lines (\n).

  • Users who have thanked Keleth for this post:

    cevaps (06-27-2010)

  • #7
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Keleth View Post
    Well... thats why I said, html will appear as plain text in a textarea, not as formatting. If you wanna skip lines in textareas, use new lines (\n).
    OK I get it! Thanks for tip.

    Edit :

    Now i have another problem.

    My new code is like you said;

    PHP Code:
            <textarea rows="11" name="S1" cols="58">[img]'.$caps.'[/img]

    '.nl2br($aciklama).'

    '.nl2br($linkler).'
    </textarea></p
    But nl2br command adds <br> to texts like this :

    Last edited by cevaps; 06-27-2010 at 09:47 PM.

  • #8
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Because you're telling it to? nl2br means new line to break... you're telling it to replace all new lines with breaks. The function is doing exactly what its supposed to.

  • Users who have thanked Keleth for this post:

    cevaps (06-27-2010)

  • #9
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hehe please don't get mad. It's the only command that i could find, which transfers multiline texts. I want multiline texts seems in textarea like;

    asdf
    ghjk


    Just without br. Because using directly $aciklama makes my text like;

    asdf ghjk

  • #10
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Heh, I'm not mad... just sometimes I help people who don't even seem to try. I'm not trying to accuse you of this, just... nuances of language don't work on the interwebs. I'm sorry if I came off aggressive: the function is doing exactly what its meant to, and that's that

    How are you getting $aciklama? And it shows up as a single line in a textarea when you don't use nl2br? Or it shows up in html as a single line?

  • Users who have thanked Keleth for this post:

    cevaps (06-27-2010)

  • #11
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    6
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hey it worked hehe! Just deleted one last comma that i forgot and it worked. Thanks for your all help. This 10 lines ruined my last 48 hours lol.

    Thanks again for making my tiny code alive.
    Last edited by cevaps; 06-27-2010 at 10:08 PM.

  • #12
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ohh,Very good programmer is here.Its my first post and i think this forum will help me to learn PHP...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •