bigandy macrumors G3 Original poster Jun 19, 2006 #1 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! 🙁
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! 🙁
N NoNameBrand macrumors 6502 Jun 19, 2006 #2 Lots of functions to do this. strstr(), for instance. It has links to other functions that will also do what you want.
Lots of functions to do this. strstr(), for instance. It has links to other functions that will also do what you want.
Coolnat2004 macrumors 6502 Jun 19, 2006 #3 After the form has been submitted.. PHP: if (substr($_POST['urlform'], 0, 7)!='http://') $_POST['urlform'] = 'http://'.$_POST['urlform'];
After the form has been submitted.. PHP: if (substr($_POST['urlform'], 0, 7)!='http://') $_POST['urlform'] = 'http://'.$_POST['urlform'];