Jump to content


Photo

Word Wrap Problem 1


  • Please log in to reply
14 replies to this topic

#1 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 01:08 AM

Why don't it word wrap it?
$Comment2 = wordwrap($Comment, 40, "<br />\n");
echo"<center><table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='35%' height='100'>
  <tr>
    <td width='100%' height='18' bgcolor='#808080'>
    <p align='center'>Posted by: <font color='Black'><a href='mailto:$EMail'>$First_Name</a></font></td>
  </tr>
  <tr>
    <td width='100%' height='81' bgcolor='#C0C0C0' align='left' valign='top'>
    <p align='center'>$Comment2</td>


#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 18 October 2006 - 01:28 AM

I don't see why that would not work. That appears to be a text book use of word wrap. I see that you edited your post.. Did you already fix the problem?

Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#3 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 01:29 AM

No, but I don't understand why the news page wordwraps and the news comments don't.

#4 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 18 October 2006 - 01:35 AM

Are you getting any errors?? Have you tried placing an echo after the word wrap? Also, please post the code that works so that I may compare it..

Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#5 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 01:37 AM

Ok, I will in a few minutes.

#6 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 01:39 AM

News.php
$News=$row["News"];
$News2 = wordwrap($News, 80, "<br/>\n");
$sql = mysql_query("SELECT * FROM news_comment WHERE Title = '$Title'");
$CommentCount = mysql_num_rows($sql);
echo"<center><table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='500'>
  <tr>
    <td width='100%' align='center' bgcolor='#808080'>
    <p style='margin-top: 0; margin-bottom: 0'><font color='#C0C0C0'>Title:</font> <font color='Black'>$Title
    </font>
    <p style='margin-top: 0; margin-bottom: 0'><font color='#C0C0C0'>Date:</font> <font color='Black'>$Date_Added</font><br />
    <font size='1'><a href='Add_News_Comment.php?Title=$Title'>Add A Comment</a></font>/<font size='1'><a href='View_News_Comments.php?Title=$Title'>View Comments(</font><font size='1' color='Red'>$CommentCount</font><font size='1'>)</font></a></td>
    </tr>
    <tr>
    <td width='100%' align='center' bgcolor='#C0C0C0' bordercolor='#000000'><font color='Blue'>$News2</font></td>
    </tr>
    </table></center>
<br />";

View_News_Comments.php
$Comment=$row["Comment"];
$Comment2 = wordwrap($Comment, 40, "<br />\n");
echo"<center><table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='500'>
  <tr>
    <td width='1000' align='center' bgcolor='#808080'>
    <p style='margin-top: 0; margin-bottom: 0'><font color='#C0C0C0'>Posted by:</font> <a href='mailto:$E_Mail'>$First_Name</a>
    </td>
    </tr>
    <tr>
    <td width='1000' align='center' bgcolor='#C0C0C0' bordercolor='#000000'><font color='Blue'>$Comment2</font></td>
    </tr>
    </table></center>
<br />";


#7 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 01:40 AM

OMG I replaced the news code with the comment code. Now I got to remake that comment table. I'll reply when the codes above are correct.

#8 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 01:42 AM

Ok, the codes I posted 2 replys above are correct now you can compare.

#9 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 18 October 2006 - 02:01 AM

I don't see where it is going wrong... When you say that it is not word wrapping, what is happening? They both look fine to me.

Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#10 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 02:14 AM

What browser are you using? Sorry for the late reply had to do something.

#11 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 18 October 2006 - 02:16 AM

Fire Fox

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#12 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 02:17 AM

I use IE. That may be why but I want it to work for IE to.

#13 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 02:18 AM

Thanks for trying I'll try somethings.

#14 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 18 October 2006 - 02:22 AM

I do most of my developing in Fire fox then test in IE. The reason that I do this.. Almost every thing that works fine in FireFox will work fine in IE but not the other way around. So it is best to develop with Fire Fox in mind and then to fix any IE errors.

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#15 ShanesProjects

ShanesProjects
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 18 October 2006 - 02:35 AM

I fixed it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users