Jump to content

mk dir()


Lassie

Recommended Posts

I am trying to make a folder identified by a hash code.
When using the following I get a folder with the variable name and not the variable value.
What am I doing wrong?
Help please.
This is the code

<?php
/*
  include ('book_sc_fns.php');
  // The shopping cart needs sessions, so start one
  session_start();
  //set the variables
 
  $email = $POST['email'];
  */
  //create unique hash (email plus salt) and store in database.Values hard coded for testing.
  $email= '[email protected]';
  $salt="nigel";
 
  $hash=md5($email.$salt);
 
  include("misc.inc");
    $connection = mysql_connect($host,$user,$password)   
      or die ("$connection:".mysql_error($connection));
  $db = mysql_select_db($database,$connection)         
      or die ("$db:".mysql_error($connection));
     
        $query = "Insert Into Customer (hash)
  Values ('$hash')";
 
  $result = mysql_query($query);
  if (!$result)
  return false;
 
     
  //create temp folder with hash info
 
  //check if folder already exits
 
  if(file_exists($hash))
  {
    echo "Dir exist";

}else{
  mkdir('$hash');
  echo "dir made";
}
exit();
  ?>


Link to comment
https://forums.phpfreaks.com/topic/31701-mk-dir/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.