Email order Form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: Email order Form

Post 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]");


?>

Post Reply