Skip to content
Advertisement

Using fopen and str_replace to auto fill a select option

I have this file ‘gardens.php’, which pulls data from a table called ‘generalinfo’ and I use fopen to send that data to a file called ‘index.html’. Here is the issue, only one option is filled. I have a demo running here Garden Demo <– this is a new updated page and location, there are more errors than I have locally If anyone could help me fix them Username:stack1 Password:stack1

Is there a better way to achieve what I want to?

GARDENS.PHP

JavaScript

INDEX.PHP SNIPPET

JavaScript

CONNECT.PHP

JavaScript

Advertisement

Answer

Do you use this snippet in some other PHP file as well? If not you can just integrate into your gardens.php file:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement