- 2019-11-08 at 2:22 pm #21018
I would like to add some PHP to my user interface that mounts my verge app – more specifically i would to be able to test it locally in verge dev enviornment. Is there any way to configure Verge3d app manager to recognize and process PHP?2019-11-09 at 9:00 am #21025
Thanks for the tips Yuri. What I ended up doing (so I can test locally) is I changed the configuration file in Xaamp to point to my document root being my Verge applications directory, instead of the default c:/xampp/htdocs folder
I then add some PHP code instead my projectname.html file and rename it with a .php extension. For testing I have xampp running and chrome (via xampp) open pointed at the file I am working on, and have firefox (my default browser for verge3d app) open where I can experiment in puzzles. Then I just tab over to chrome and refresh to quickly view the results.
Seems to be working great so far. The reason I had to get into PHP (and Mysql) in the first place is to be able to make content available only to registered users (via a login and registrations pages)
I wish there was a puzzle and ‘easy’ button for that shit!
My experiments so far show that trying to ‘envoke’ php code (even on via a local server) within puzzles isn’t going to work. I am I correct there?
For now, the code (PHP + mySQL) I am using (more like tweaking as I am not smart enough to write it) to manage logins creates a few Session variables like username and user id. I’d like to be able to access those in puzzles so for example, when a user clicks a 3d cube object,I have some HTML based puzzles that conjure up a modal window that gives a personalized message like “Great job <username>!”
To do that, I need to access the Session variables in puzzles.
Is there an easy way to do this?
So far what I have figured out, is that after the user logins I assign the Session variable value to a hidden html element, like this
<?php echo “<input type=’hidden’ id=’username’ value='”.$_SESSION[‘username’].”‘/>”;?>
Then in puzzles, I use the html get attribute puzzle to get the value of the element with id “username” and assign it to a new variable inside puzzles.
Thanks2019-11-12 at 6:18 am #21047
I think your approach with using a hidden element and HTML puzzles is already good.
You must be logged in to reply to this topic.