Jump to content

Records do not display as paragraphs


Datnigz2002

Recommended Posts

I am kind of lost here. I am using Dreamweaver's update record feature. In my input field...  If I type the following...

 

"Todays date, My Name

 

My issues

 

Please call"

 

On the page that pulls the info it looks like:

 

"Todays date, My Name, My issues Please call"

 

It doesn't recognize the returns for each line.

 

How can I get it to display as it should without displaying it within an ugly giant input text box?? (Which does work however)

Link to comment
Share on other sites

The reason is because HTML doesn't recognize new line characters. You can do one of the following:

 

-use PHP to add <BR> tags with nl2br()

-use PHP to manually replace new lines with <BR> tags using str_replace() or similar

-wrap it in <pre> tags

Link to comment
Share on other sites

if you use < p r e > (spacing it so it won't crap out again) in conjunction to my previous comment, you will not need to add < b r /> to each line., so it would go something like this:

<pre>
"Todays date, My Name\n
\n
My issues\n
\n
Please call"\n
\n
On the page that pulls the info it looks like:\n
\n
"Todays date, My Name, My issues Please call"
</pre>
//just as he said, pre works best

 

 

Link to comment
Share on other sites

This is for end users to enter information to a database and I don't want to have them add html commands in their information.

 

How exactly will I be able to use the PHP methods. I have never done this before and don't know where to start. I just need it for a small page that displays the paragraphs in a table.  Just as you see my lines while your reading this now is what I'm looking for.

 

Thanks

Link to comment
Share on other sites

This is for end users to enter information to a database and I don't want to have them add html commands in their information.

 

How exactly will I be able to use the PHP methods. I have never done this before and don't know where to start. I just need it for a small page that displays the paragraphs in a table.  Just as you see my lines while your reading this now is what I'm looking for.

 

Thanks

have your text field automatically add the < p r e> before and < / p r e > at the end of all posts. they won't need to do it.

Link to comment
Share on other sites

Sorry if I sound a little slow but I'm knew to this. I don't know where to put it in. This is what I have for my form. Can you show me where it goes. Then Maybe I will understand why it goes there. (:

 

 

 

<form action="<?php echo $editFormAction; ?>" id="tstest" name="tstest" method="post">

          <div align="center">

            <table width="636" border="0">

              <tr>

                <td height="24"><label>

                <input name="support" type="checkbox" id="support" value="Yes" <?php if (!(strcmp($row_user_lookup['Support'],"Yes"))) {echo "checked=\"checked\"";} ?> />

                  </label>

                  ITHelp Thread   | 

                  <label>

                    <input name="imac" type="checkbox" id="imac" value="Yes" <?php if (!(strcmp($row_user_lookup['IMAC'],"Yes"))) {echo "checked=\"checked\"";} ?> />

                  </label>

                  Configuration Thread

                   |   Created By:

                  <select name="creator" id="creator">

                    <?php

Link to comment
Share on other sites

I see so are you saying this the code would go in the page that is displaying the data from that particular field?  This is what the code looks like around where the data shows up on the page.

 

      <td colspan="2" bgcolor="#E1E1E1" class="style30">

        <div align="center">

          <table width="606" border="0" cellspacing="2" cellpadding="2">

            <tr>

              <td><div align="left"><?php echo $row_keywords['Ticket']; ?>

                <label></label>

              </div></td>

            </tr>

                  </table>

 

I tried playing around with the echo you see but just not getting it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.