0

My php project folder structure is like below.

MyProject
projadmin
repadmin
inc
   header.php
templates
index.php
config.php
                       

In config.php file I have some configs.

<?php
return Array (    
    'title'         => 'Title',
    'message'       => 'Your message :',
    'warnTime'      => '10000',
    'redirTime'     => '11000',
    'keepAliveUrl'  => '',
    'redirUrl'      => 'http://intranet.domain.com/default.aspx',       
    'logoutUrl'     => 'http://intranet.domain.com/default.aspx'
);    
?>

Now in /inc/header.php file, I've the below code to access the config file. But not getting anything.

$res = require_once('../config.php');
//printing the one value
echo "<script>console.log('In header res[redirUrl] is: " . $res['redirUrl'] . "' );</script>";

Then in the console I'm getting empty value. Please help me where I did mistake?

Ajith
  • 2,476
  • 2
  • 17
  • 38
user2636874
  • 889
  • 4
  • 15
  • 36

0 Answers0