Page 2 of 2

Re: Email order Form

Posted: Mon Aug 25, 2014 5:39 pm
by donny
not sure about what all the confusion was about but this code works fine and does exactly what i needed it to do

Code: Select all

<?
function get_string_between($string, $start, $end){
    $string = " ".$string;
    $ini = strpos($string,$start);
    if ($ini == 0) return "";
    $ini += strlen($start);
    $len = strpos($string,$end,$ini) - $ini;
    return substr($string,$ini,$len);
}

$fullstring = $_POST["submitted"];
$firstname = get_string_between($fullstring, "[firstname]", "[/firstname]");
$address = get_string_between($fullstring, "[address]", "[/address]");


?>