PHP Form submit & concatenating text...

Discussion in 'Web Design and Development' started by bigandy, Jun 19, 2006.

  1. bigandy macrumors G3

    bigandy

    Joined:
    Apr 30, 2004
    Location:
    Murka
    #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! :(
     
  2. NoNameBrand macrumors 6502

    Joined:
    Nov 17, 2005
    Location:
    Halifax, Canada
    #2
    Lots of functions to do this. strstr(), for instance. It has links to other functions that will also do what you want.
     
  3. Coolnat2004 macrumors 6502

    Coolnat2004

    Joined:
    Jan 12, 2005
    #3
    After the form has been submitted..

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

Share This Page