Jump to content


  • Posts

  • Joined

  • Last visited


Posts posted by dharmeshpat

  1. dude don't do the hard delete do soft delete example

    put one more column in database say "status"

    when user is created the status column for that user will be default active

    and as soon as u try to delete the record don't delete the record just change the status to deactivated

    and now when ever u try to display the list of user just display the list with active status

  2. <?php

    $path = $_SERVER['SCRIPT_NAME'];

    $script = explode("/", $path);

    $filename = explode(".", $script[sizeof($script) - 1]);



    <li class="link">

    <a class="link levela" title="The drive formally known as "P"">

    <span>Company Documents</span></a>


    <li class="link">

    <a class="<?php if ($filename[0] == "comm_forms") { echo "current"; }else{ echo "link"; } ?> levelb" href="http://hhnet/company_documents/comm_forms.php" title="Forms... for Commission">

    <span>Commission Forms</span></a></li>


    <li class="link">

    <a class="<?php if ($filename[0] == "complaint_documentation") { echo "current"; }else{ echo "link"; } ?> levelb" href="http://hhnet/company_documents/complaint_documentation.php" title="Documents documenting complaints.">

    <span>Complaint Documentation</span></a></li>

  3. wat u can do is


    u should put one flag  column in database which will tell u whether the logged in user is admin or a normal client

    Once u know which user has logged u u can redirect that user to the respective url


    And yes it would be better to have different folder for different user type


    say for admin it would be admin folder

    and for user it would be user folder

  4. $query = "SELECT * ";

    $query .= "FROM table ";

    $query .= "WHERE malls_id=" . $mall_id;

    $query .=" AND DATE_FORMAT(date ,'%Y-%m' ) =" . $selected_date;


    the above query has to be modified as below


    $query = "SELECT * ";

    $query .= "FROM table ";

    $query .= "WHERE malls_id=" . $mall_id;

    $query .=" AND YEAR(date) = '".$year."' AND MONTH(date) = '".$month."'";



  5. Hi dude still i m not completely cleared but


    If you are getting value in an array format than u don't u store it in a variable and than use that variable to get that data example

    $valueHolder = $json->call('getBits',Array());



  6. Can you try the code the way i have written don't change it place it has it is and try it out


    function findexts ($filename) {

    $filename = strtolower($filename) ;

    $exts = split("[/\\.]", $filename) ;

    $n = count($exts)-1; $exts = $exts[$n];

    return $exts; }



    $ext = findexts ($_FILES['foto']['name']) ; 

    $ran2 = $foto."."; 

    $target = "../images/";


    $target = $target . $ran2.$ext;

    while (file_exists($target)) {

        $ran2 = 'copyof'.$ran2;

        $target = $target . $ran2.$ext;


    if(move_uploaded_file($_FILES['foto']['tmp_name'], $target))  {

    $newFilename = $ran2 . "." . $ext;

    mysql_query( "INSERT INTO `softmarket`.`internet_securitate` (`internet_securitateID`, `nume_produs`, `descriere`, `versiune`,`poza`, `pret`, `disponibilitate_produs`)

    VALUES ('', '$_POST[titlu]', '$_POST[descriere]', '$_POST[versiune]', '$newFilename', '$_POST[pret]', '$_POST[disponibilitate]');");

    echo "The file has been uploaded as ".$newFilename; }


    else { echo "Sorry, there was a problem uploading your file."; }




    header('Location: succes.php');

  7. Can you try to clarify more about ur problem means are you telling that u have order form which user fills in and once it is fill u will create and array of all the data that user and filled in and will pass that array to the class function and insert it into the database than i say,


    It is bad practice to create a array after the data is submitted since the u will get the data in post as an array format and again creating new array not good practice

  8. If i m not mistaken i think the problem is that the name that u r storing in database is different and and file name is different because u r executing insert statement before the move_upload statement


    Execute insert statement after the upload statement and instead of using $foto us $ran2

  9. printer_open function which php use to support i don't have clear idea whether it is support in latest php version since i m using php 5.3.8


    and also the php_printer extension is not present in my php version but i manually downloaded php_printer.dll from internet placed it in my php extension folder and i tried to enabled it but still no use

  10. First can u tell us that wat is $foto variable holding i want to know what does it holds



    And i you don't mind can i suggest u that why don't u change the name of the file on every upload means give new name to the file whenever user uploads a file use date function like this


    $filename = date('dmYHis');


    once u got he file name append the extension and store it in the folder, using this u will get a unique name for every upload that u do

  11. Sorry for that but i m really frustrated as i m trying to print the document what i really want is that


    First suppose their is a form with three input fileds

    1. firstname

    2. lastname

    3. phone

    as soon as user fills this details and press submit button the fill details should get insert into the database but at same time this fill details should get print

    on a paper in format as below

    Name of visitor : XYZ

    Tell : 234567899

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