Jump to content

How Do I Get $Salt When It's In The Config.php File?


ChayaCooper
 Share

Recommended Posts

I know this is a really basic question, but I'm still a real php noob. I want to move $salt to the config.php file, but I'm not sure how to call the variable correctly so the page can use it.

 

I tried this:

require_once('config.php);    
$salt = loadSaltFromConfig();

 

I'm assuming that I need to declare loadSaltFromConfig somewhere, but I'm not quite sure what that would need to be.

Link to comment
Share on other sites

I'll try that again :-) I thought that should be the case, but when it didn't work I figured I must be doing something wrong ;-)

 

Just to make sure that I'm not missing something

 

I'm declaring in config.php $salt = "XYZ"; // 10 digit string.

 

Then if I've created a connection to config.php in the other file I can just use it like this:

'".sha1($salt + $_POST['password'])."'

Link to comment
Share on other sites

I think your directories looks good.

Make a simple test for me>

Create a new file in directory- "/home4/clickfi4/public_html/demo" and named it - debug.php.

On the top of your config.php file put it - echo 'test'.

A config.php must locate in "/home4/clickfi4/public_html/demo/secure_folder"

In a debug.php file copy/paste next code:

<?php
error_reporting(E_ALL);
require_once 'secure_folder/config.php';

Edited by jazzman1
Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.