I have a pretty simple webpage that contains an embedded video where the page author manually sets $variables
at the top of document to set the correct video/photo/title/links, etc. within the "html code" further down the page (for non-expert users to upload and link new content to the template). It's not the prettiest code but it works. (yay!)
In one place, they need to be able to point a variable to a specific video file, OR upload several files into a new directory and point/transform the variable into an include that runs a randomizer php file. I SHOULD CLARIFY THAT THE RANDOMIZING FUNCTION ALREADY WORKS, I just need to be able to point to it with a $variable
$video1sourcedir = '/documents/sword.mov';
//needs to create
<video src="/documents/sword.mov" width="400" height="225" controls autoplay loop preload>
or (I wish) they could change it to something like
$video1sourcedir = '<?php include "randvid.php';
//but I can't nest php with echo so that doesn't actually create
<video src="<?php include "randvid.php"; ?>" width="400" height="225" controls autoplay loop preload>
So basically does anyone know a way to set $variables
at the top of the page that can be called that way? It would be ok for the $variable
to be the entire php include statement but I don't know how to echo
or print
that correctly
Much thanks!