php inside shell file

36 views
Skip to first unread message

Alessio Mochi

unread,
Apr 26, 2021, 4:08:13 AM4/26/21
to emscripten-discuss
Hello everyone,

I would ask you if it's possibile include a php code inside a shell file
because I need to access to database.

and compile with emcc in similar way
emcc -o out.html --shell-file path/to/custom_shell.html

I tried but I get some errors code.
Thanks in advance.


Floh

unread,
Apr 26, 2021, 10:36:13 AM4/26/21
to emscripten-discuss
AFAIK the only important part in shell.html is this {{{SCRIPT}}} tag here:

https://github.com/floooh/sokol-samples/blob/73af0563ae7e0d5865e1be78d87cbd8f940bb9e6/webpage/shell.html#L62

This is where emcc injects the HTML+JS to load and initialize the WASM module.

I'd imagine if you write an index.php file that looks similar to an emscripten shell.html file, and have this {{{SCRIPT}}} tag in the right place, than emcc would happilly inject the HTML + JS code. Except I guess you'd still get a file with .html file extension out of emscripten, so you'd need to rename that to .php again. And for local testing you'd also need a full-blown web server setup with PHP instead of a bare bones node.js or Python web server.

Alessio Mochi

unread,
Apr 26, 2021, 12:58:44 PM4/26/21
to emscripte...@googlegroups.com
Hello, 
if I use  -s MINIFY_HTML=0 works otherwise no.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/6ce060e3-ebb9-4479-b8b8-7e0b8827e5dbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages