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.
On Monday, 26 April 2021 at 10:08:13 UTC+2 [email protected] wrote:
> 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.
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/6ce060e3-ebb9-4479-b8b8-7e0b8827e5dbn%40googlegroups.com.