This is a discussion on Long URL breake my html within the PHP Language forums, part of the PHP Programming Forums category; Hello, I have small BB and when someone post long URL it breaks complete forum. Is there anything I can ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
what do you mean it "breaks" the forum?
try your luck with html_entities(), html_entity_decode(), urlencode() and urldecode() or try to detect urls in the post via regex or some library you'll find in the web, there are lots of such libraries. When you detect it you can href it an shorten the shown text for example Hope this helps, Chris dr. zoidberg schrieb: > Hello, > > I have small BB and when someone post long URL it breaks complete forum. > Is there anything I can do. > > TNX > > |
|
|||
|
dr. zoidberg wrote:
> Hello, > > I have small BB and when someone post long URL it breaks complete forum. > Is there anything I can do. <?php // ... $limit = 78; // max length of allowed URLs // ... if (strlen($url) > $limit) { exit('Sorry, your URL is too long for this BB.'); } // ... ?> -- --= my mail box only accepts =-- --= Content-Type: text/plain =-- --= Size below 10001 bytes =-- |