PHP Form submit & concatenating text...

bigandy

macrumors G3
Original poster
Apr 30, 2004
8,852
0
Murka
I'm writing a form that has a weblink in it, and i need to check that it has a "http://" at the start, and if not add it, when the form is submitted.

how would i go about doing this? i've hunted around the fishnet, but not come accross the soultion! :(
 

Coolnat2004

macrumors 6502
Jan 12, 2005
478
3
After the form has been submitted..

PHP:
if (substr($_POST['urlform'], 0, 7)!='http://') $_POST['urlform'] = 'http://'.$_POST['urlform'];