Question

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.

Was it helpful?

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);

OTHER TIPS

You need to define LWIP_HTTPD_SSI_INCLUDE_TAG 0. By default the tags are included, helps in debugging.

HTML comment cannot (should not) be placed in another tag as it is a tag itself. And that's it.

But, in this case, it depends on how are you replacing those tags.

in httpd_opts.h :

/** Set this to 0 to not send the SSI tag (default is on, so the tag will
* be sent in the HTML page */
#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG
#define LWIP_HTTPD_SSI_INCLUDE_TAG           0
#endif

set LWIP_HTTPD_SSI_INCLUDE_TAG to 0

In that case the tag will not be sent, but its value will.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top