Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Config required to replace the database strings */
- require('config/config.php');
- /* HTML Form to be echoed for the user */
- $form = "
- <form name='form' action='' method='get'>
- <input type='text' name='host' placeholder='Database host' />
- <input type='text' name='database' placeholder='Database name' />
- <input type='text' name='username' placeholder='Database username' />
- <input type='password' name='password' placeholder='Database password' />
- <input type='submit' name='submit' value='Change values' />
- </form>
- ";
- /* Echo the form so I can see it */
- echo $form;
- /* Get the results from the HTML Form */
- $gethost = $_GET['host'];
- $getdb = $_GET['database'];
- $getuser = $_GET['username'];
- $getpass = $_GET['password'];
- /* Replace the database connections in config.php */
- /* However, does not work :/ */
- if (isset($_GET['submit'])) {
- str_replace($gethost,$host);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment