Help On Php Form - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help On Php Form (802 Views)
| Help On Php Form by Taiw(op): 7:26am On Dec 05, 2013 |
I want a situation where when a user types the <a href></a> tag in a form, it automatically converts it to a link..How do i go about it Secondly, i need a working php pagination function script.. Thanks |
| Re: Help On Php Form by greenPHP(m): 9:14am On Dec 06, 2013 |
Taiw: I want a situation where when a user types the <a href></a> tag in a form, it automatically converts it to a link..How do i go about itDo you mean after submitting of the form or instant converting of the tag to link? |
| Re: Help On Php Form by Taiw(op): 1:11pm On Dec 07, 2013 |
greenPHP: Do you mean after submitting of the form or instant converting of the tag to link?I mean after submitting the form. Any inputs filled using the <a href></a> tags should automatically convert it to hyperlink dat can b displayed on my page. my form echos back the tags instead of converting it to clickable hyperlinks |
| Re: Help On Php Form by greenPHP(m): 5:00pm On Dec 07, 2013 |
Taiw: I mean after submitting the form. Any inputs filled using the <a href></a> tags should automatically convert it to hyperlink dat can b displayed on my page. my form echos back the tags instead of converting it to clickable hyperlinksDo you know regular expression in PHP? |
| Re: Help On Php Form by Eesyboi: 7:00pm On Dec 07, 2013 |
Have you tried the PHP htmlspecialchars_decode() Function? |
| Re: Help On Php Form by Taiw(op): 10:10pm On Dec 07, 2013 |
greenPHP: Do you know regular expression in PHP?after hours of searching i found this $text = preg_replace('@(https?://([-\w\.]+) +(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text); how do i go from here |
| Re: Help On Php Form by Taiw(op): 2:41am On Dec 08, 2013 |
got it now <?php $text = "hello http://example.com sample [Name of Link](http://www.yourlink.com/) [Name of a](http://www.world.com/) [Name of Link](http://www.hello.com/) <a href=\"http://stackoverflow.com\">hello world</a> <a href='http://php.net'>php</a> "; echo nl2br(make_clickable($text)); function make_clickable($text) { $text = preg_replace_callback( '#\[(.+)\]\((\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|)/))\)#', create_function( '$matches', 'return "<a href=\'{$matches[2]}\'>{$matches[1]}</a>";' ), $text ); $text = preg_replace_callback('#(?<!href\=[\'"])(https?|ftp|file)://[-A-Za-z0-9+&@\#/%()?=~_|$!:,.;]*[-A-Za-z0-9+&@\#/%()=~_|$]#', create_function( '$matches', 'return "<a href=\'{$matches[0]}\'>{$matches[0]}</a>";' ), $text); return $text; } |
Using Finger Print Scanner On PHP • Help On Php Code For A Dice Game • Free Ebooks On Php Progaming • 2 • 3 • 4
How Useful Is Autocad For Land Development-is It Wort Learning? • Bragnvent App Lets You Boast, Complain And Share Photos Anonymously Online • Welcome Application