It’s quite simple.
Inside configuration file congif.php
:
<?php
include("secret.php");
$password = PASSWORD; //defined in secret.php
$username = USERNAME;
?>
Inside secret.php
<?php
define('PASSWORD', 'example_password');
define('USERNAME', 'example_username') ;
?>
Inside .gitignore
, just add:
path/secret.php
path: the path to secret.php
Therefore, secret.php
will not be uploaded to GitHub and keep these secret parameters safe!
No comments:
Post a Comment