dc_jt Posted November 16, 2006 Share Posted November 16, 2006 I have a form where the user can add a url using a text field. I want to be able to have 'http://' in the text field all the time so they always put this before their website.I have the following:[code] <td >URL</td><td ><input class="fmfield200" type="text" name="url" value="<?=(isset($_POST['url']))?$_POST['url']:$aListing['url']?>"/></td> </tr> <tr>[/code]How can I put it into this?Thanks Quote Link to comment Share on other sites More sharing options...
Orio Posted November 16, 2006 Share Posted November 16, 2006 [code]<td>URL</td><td><input class="fmfield200" type="text" name="url" value="<?phpif(isset($_POST['url']) && strpos($_POST['url'],"http://") === FLASE) echo "http://".$_POST['url'];elseif(isset($_POST['url']) && strpos($_POST['url'],"http://") !== FALSE) echo $_POST['url'];elseif(strpos($aListing['url'],"http://") === FASLE) echo "http://".$aListing['url'];else echo $aListing['url'];?>"/></td></tr>[/code]Orio. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.