Thread: Smarty Help
View Single Post
  #1  
Old 09-20-2005, 02:43 PM
 
mikefeiman mikefeiman is offline
 

Member
  
Join Date: Jan 2005
Posts: 23
 

Default Smarty Help

I'm trying to create a form that passes information within it self to validate if a field has been populated with information. Can any one point out why this code may not work?

Code:
{php} if ($GLOBALS["HTTP_GET_VARS"]["B2"] == "Reset") echo "Reset"; $process = ($GLOBALS["HTTP_GET_VARS"]["B1"] == "Submit"); $ok = "ok"; $msg = " There are errors:"; if ($process) { // check first name FIRST_NAME $firstname = ($GLOBALS["HTTP_GET_VARS"]["FIRST_NAME"]); if ($firstname == '') { $ok = 'not ok'; $msg .= " First name cannot be blank"; } } else { $firstname = ""; } {/php} <form name="b1" action="{php} echo "$form"; {/php}" method="post"> {php} if ($ok == 'not ok') printf('<span class="error">%s</span> ', $msg); {/php} First Name <input class="form3" size="30" name="FIRST_NAME" type=text value="{php} echo $firstname;{/php}"> <input type="submit" value="Submit" name="B1" class="button"> </form>
__________________
Billiard Exchange
Version 3.5.4
Reply With Quote