server-side-includeslwip

SSI tag inside html form?


I have a simple HTML form in which I would like to pre-populate the fields with SSI tag data. This is what I have done:

<form method="get" action="flashWrite.cgi">
<li><i>Network Configuration</i>
<br>
<table border="0">
<tr>
<td>IP Address:</td><td><input value="<!--#ipaddr-->" name="ipaddr"></td>
</tr>
<tr>
<td>Subnet Mask:</td><td><input value="<!--#snetmsk-->" name="snetmsk"></td>
</tr>
<tr>
<td>Gateway:</td><td><input value="<!--#gateway-->" name="gateway"> </td>
</tr></table>

The results are somewhat disapointing:

tags show up in form!  Crud!

Never-mind that these IP values are showing up as 32 bit integers, I'll deal with that later. What bothers me is that the tags are showing up in the form. Can someone tell me why in the form, the value is appended to the tag instead of replacing the tag?

This is taking place on a TI LM3S9D96 MCU running an LWIP stack.


Solution

  • If html form code is in firmware, you will create the form as you want.

    For example,

    In Html:

    <td>IP Address:</td><td><!--#form_ipaddr--></td>
    

    In Firmware, code for form_ipaddr tag :

    sprintf(pcBuffer, "<input value="%s" name="ipaddr">", pcIpAddrString);