n12br()

  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

Using this function gives me a fatal error saying its an undefined function... does that mean its no longer supported?

the line im using it in is

Code: [ Select ]
$news_main = n12br($news_main);


its supposed to set normal line endings to <br> tags (html line endings)

Anyone?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Because there is no PHP function called n12br(); :)

The function is nl2br();

The l is a lower case L, not a 1 :)
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Exactly.

nl = new line

2 = to

br = break tag (<BR /> tag I believe is how it exports it, if not it's just <BR>)

So the function is basically called newline to breaktag aka nl2br() :)
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

damn font id swear its a 1 :)
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

hehe, don't worry about it, it happens :)
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

hey, ill just post it here to continue this topic,

theres a file called news_new.php that has a form to add a message,
its sent to news_list.php that displays the messages and allows to remove or edit them.

the header is not showing up in news_list.php, nor in the public message display (which means its not posted in the database table (correctly))
the rest is working fine

Code: [ Select ]
<input type="text name="news_header" size="90" maxlenght="90">

write down the header in there

Code: [ Select ]
$news_SQL_insert = "INSERT INTO news (news_header, news_datetime, news_main) VALUES ('$news_header','$news_datetime','$news_main')";


insert the values into the table

----

Also, after clicking on post, i get to news_list.php, but the message doesnt appears immediately. If i refresh it, ill have to send it again, which means itll be posted again. I can refresh it just by accessing it through the addressbar again.
But this is not very user friendly.
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

I checked it and the code that adds the message is above the one that displays it, so it SHOULD be fine. But its not.
  • Fireblazer
  • Born
  • Born
  • Fireblazer
  • Posts: 1

Post 3+ Months Ago

I've had similar problems. You have to insert the post before you fetch all of the posts from the database. Also, you forgot a quote in this code:
Code: [ Select ]
<input type="text name="news_header" size="90" maxlenght="90">
See it? If not try this:
Code: [ Select ]
<input type="text" name="news_header" size="90" maxlenght="90">


Hope it helps,
Fireblazer

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 58 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.