Hi, I'm new at working with the embed library, (mongoose.c and moongose.h
files) using Ubuntu 12.4.
I'm having problems to load some html pages with frames. (index.html) Any
suggestion? With the file sendFileServerMostrarArchiu, i'm able to load
simple html files.
I add to the message the html files that i'm using and the code to render
them.
If I open from my browser the html files they render correctly.
--
You received this message because you are subscribed to the Google Groups
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.
Title: Documento a cargar en principal
Has pulsado el enlace correctamente
|
Title: Juge
<frameset rows="15%,*">
<frame src="./pagina/title.html">
<frameset cols="15%,*">
<frame src="mark.html">
<frame src="welcome.html" name="main">
</frameset>
</frameset>
Title: Marco de la izquierda con enlace
Title: Documento a cargar en principal
Has pulsado el enlace correctamente
|
Title: Welcome
#include "mongoose.h"
static int ev_handler(struct mg_connection *conn, enum mg_event ev) {
if (ev == MG_REQUEST) {
if (strcmp(conn->uri, "/start") == 0) {
mg_send_file(conn, "./index.html");
return MG_MORE;
} else if (strcmp(conn->uri, "/problems") == 0) {
mg_send_file(conn, "./title.html");
return MG_MORE;
}else if (strcmp(conn->uri, "/pagina") == 0) {
mg_send_file(conn, "./pagina");
return MG_MORE;
}/* else {
return MG_FALSE;
}*/
return MG_TRUE;
} else if (ev == MG_AUTH) {
return MG_TRUE;
}
return MG_FALSE;
}
int main(void) {
struct mg_server *server = mg_create_server(NULL, ev_handler);
mg_set_option(server, "listening_port", "8080");
mg_set_option(server, "document_root", ".");
printf("Starting on port %s\n", mg_get_option(server, "listening_port"));
for (;;) mg_poll_server(server, 1000);
mg_destroy_server(&server);
return 0;
}