wml / xhtml form function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    wml / xhtml form function

    Anyone got a better way to code a wml / xhtml form function to enable both wml and xhtml in 1 page dynamically?
    Heres my attempt:
    PHP Code:
    function buildform($wml,$action,$method,$fields,$submit,$postfields){
    if(
    $wml){
    $fields preg_replace("/>(.*?)\</textarea>/is"," value=\"$1\"/>",$fields);
    $fields str_replace("textarea","input",$fields);
    $fields str_replace("selected=\"selected\"","",$fields);
    $form $fields;
    $form .= "<anchor>$submit<go href=\"$action\" method=\"$method\">";
    $form .= $postfields;
    $form .= "</go></anchor>";
    }else{
    $form "<form action=\"$action\" method=\"$method\">";
    $form .= $fields;
    $form .= "<input type=\"submit\" value=\"$submit\"/>";
    $form .= "</form>";
    }

    usage:
    PHP Code:
    echo buildform(TRUE,"something.php?else=yes","POST","<input name=\"test\" value=\"yes\"/>","Go","<postfield name=\"test\" value=\"$(test)\"/>"); 
    or can anyone improve my code?

    #2
    goto my profile nd view my posts ul find a good topic i did its an old 1









    Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
    Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

    Comment

    Working...
    X