Jump to content

php_begins

Members
  • Posts

    259
  • Joined

  • Last visited

Posts posted by php_begins

  1. This is my code:

    //Create INSERT query

    $qry = "INSERT INTO $tbl_users(email, password, firstname, lastname, middlename, mailingaddress, phone, date, phdinst, researcharea, position) VALUES('$email','$password','$fname','$lname', '$mname', '$address', '$pnumber', '$date', '$inst', '$rarea', '$position')";

     

     

    $result = @mysql_query($qry);

    if($result) {

    error_reporting(E_ALL);

                    ini_set('display_errors', '1');

     

            $oldmask = umask(0);

              mkdir("/san/www/files/".$position."/".$lname."_".$email,0777);

      mkdir("san/www/files/".$position."/".$lname."_".$email."/CV", 0777);

      mkdir("san/www/files/".$position."/".$lname."_".$email."/Cover_letter", 0777);

      mkdir("san/www/files/".$position."/".$lname."_".$email."/List_of_references", 0777);

      mkdir("san/www/files/".$position."/".$lname."_".$email."/teaching_statement", 0777);

      umask($oldmask);

     

    }

     

    The position directories already exist. Like i mentioned it creates the CV directory inside $lname_email, but it does not create the other mentioned directories.

  2. I have problem creating multiple sub-directories inside a single directory using mkdir:

     

    mkdir("files/".$lname,0777);

    mkdir("files/".$lname."/CV",0777);

    The above command works fine and creates the directory under $last name as files/$lname/CV.

    But I am unable to create further sub-directories inside $lname.

    For eg:

    mkdir("files/".$lname."/Cover", 0777); (This does not create the directory Cover)

     

    this is how my code snippet looks like

    if($result)

    {

        mkdir("files/".$lname,0777);

        mkdir("files/".$lname."/CV",0777);

        mkdir("files/".$lname."/Cover", 0777);

      mkdir("files/".$lname."/LOR", 0777);

    }

       

     

  3. function checkuser($id)

    {

        $id = mysql_real_escape_string($id);

      $query = "SELECT * FROM $tbl_employment_users WHERE id='$id'";

      $rowcount = mysql_num_rows(mysql_db_query($db_name, $query));

      if ($rowcount == 0)

        return false;

      else

        return true;

    }

    function validateuser($id, $userpassword)

    {

    $id = mysql_real_escape_string($id);

    $userpassword = mysql_real_escape_string($userpassword);

            $query = "SELECT * from $tbl_employment_users where id='$id' and userpassword='$userpassword'";

    $rowcount = mysql_num_rows(mysql_db_query($db_name, $query));

     

    if( $rowcount > 0 ) {

    return true;

    }

    else

    {

    return false;

    }

    }

    The above function validates usernames and password.

    I have appended all the existing 6 digit usernames in the database with B11 (for eg: B11600123)

    I need to write a code such that  if a user logins with the username 600123, it should check with B11600123 in the database and let him/her login.

  4. Hi, currently in my registration code, the userId allows only six digits as the user ID.

    I need help in performing the following task

    1. Modify the account creation screen to allow users  to enter EITHER a 6-digit ID OR a 9 character ID.  Any 6-digit PLID will be stored with the perpended B11.

    2.Modify the login utility for the users to allow them to use either the 6-digit or 9-character IDs which means you will need to prepend the B11 to any 6-digit PLID to find their record in the database.

    3.Convert existing PLIDs in the database to the new format by prepending the B11.

     

    Any coding help will be greatly appreciated.

     

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