0

i have done each and every thing but i cant get into the folder. my file path: C:\xampp\htdocs\Project\p\new project\admin\index.html but failed. i have place the condition in if portion so that if condtion is true, then should open up a file fron that path. i dont know why m getting failed. here is my code:

<html>



<body>
<?php
session_start();
if($_SESSION['SHALA']!=1)
{
    echo" Authentication unsuccessful";
}
else if($_SESSION['SHALA']==1)
{

    $_SESSION['SHALA']=1;
    $con=mysql_connect("localhost","root","");
    mysql_select_db("civil",$con);
    $username=$_SESSION['u'];
    $passid=$_SESSION['p'];
    echo $username;
    echo $passid;

    if($username=="amirlatif")
    {

         echo "hello";
            //include('C:\xampp\htdocs\new project\admin');
            //ini_set("include_path", "/C:\xampp\htdocs\new project\admin\admin.html".ini_get("include_path"));
        dirname('C:\xampp\htdocs\new project\admin\index.html');
    }

   else
   {
             //iss main user profile ka ok!!!

   }

}
?>
</body>
</html>

1 Answers1

0

You need to set the include path properly. Uncomment the line and add a path separator and include the directory, not a file. See here.

ini_set("include_path", "C:\xampp\htdocs\new project\admin" . ":" .
                                                       ini_get("include_path"));
Axel Amthor
  • 10,980
  • 1
  • 25
  • 44
  • i did place it in the same way but not opening is that is: ini_set("include_path", "/C:\xampp\htdocs\new project\admin" . ":" .ini_get("include_path")); ? – user3187733 Jan 26 '14 at 13:30
  • What dou you mean by "but not opening is that"? In order to "open" something you need to do that, ini_set is changing the php configuration, not "opening" something. – Axel Amthor Jan 26 '14 at 13:34
  • i did not understand ur way,my file is: index.html how its configuration will be change. i dont know what else i do have to do?? i just need to get file through path. – user3187733 Jan 26 '14 at 13:37