Home > Articles > Web Services > XML

  • Print
  • + Share This
Like this article? We recommend

Implementation

The following 15 lines of code implement the full system described above in the design. The remainder of the article will describe this program in detail.

<defobject subscriber fullname email/>

<set subscribers = <vector/> />

<set subscription_form=
 <FORM action="<subscribe fullname email/>" >
  First and Last name: <INPUT name="fullname"/>  <BR/>
  Email Address:       <INPUT name="email"/>     <BR/>
  <INPUT type="submit" value="Subscribe"/>
 </FORM>
/>

<defmethod subscribe fullname email  >
 subscribers.<insert <subscriber fullname email/> />
 <receipt fullname/>
</defmethod>

<defmethod receipt the_name>
 <H3><do the_name/> is now subscribed.</H3>
</defmethod>

subscription_form
  • + Share This
  • 🔖 Save To Your Account