TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-13-2010, 08:59 PM   #1 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Wink How to detect if keyword is too long

Hello, in my site's comments page, sometimes users write comments like

Hfgdgggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggg

and that crashes my template. Is there anyway to detect and remove that sh*t ?

Thanks!
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 07-13-2010, 09:25 PM   #2 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

thats where the & shy ; (no spaces between) character comes into play. It will split a word if its to long. Use php to insert it into words longer then some length.

alternatively just add a css property or overflow:hidden;
CoryMathews is offline  
Reply With Quote
Old 07-13-2010, 10:05 PM   #3 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Thanks. Gonna try these.
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 07-15-2010, 10:48 PM   #4 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

PHP Code:
wordwrap("QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"15"<br />\n"); 
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 07-16-2010, 12:02 AM   #5 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Realllly? Somebody spent the time to make wordwrap() a core function in PHP?
delayedinsanity is offline  
Reply With Quote
Old 07-16-2010, 02:31 AM   #6 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

It's from one of the early versions of PHP4, PHP3 was still being maintained when wordwrap was introduced if memory serves.

Back then the language was for little more than adding stat counters (hyperbole of course)
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyword Search Form Jako General 1 08-21-2008 07:44 AM
How to detect and prevent including from anothers? superthin General 1 08-20-2008 03:30 AM
return keyword Orc General 8 06-30-2008 02:53 AM
A little unclear about "global" keyword... Dave Absolute Beginners 5 06-08-2008 04:42 PM
Domain Keyword Haris Absolute Beginners 8 11-26-2007 05:13 AM


All times are GMT. The time now is 07:58 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design