Jump to content

linux1880

Members
  • Posts

    136
  • Joined

  • Last visited

Posts posted by linux1880

  1. Hi friends I have a form with mysqli comnnection

     

    
    <label for="fullname">Fullname</label>
    <input type="text" name="fullname" />
    
    <label for="photo">Upload photo</label>
    <input name="photo" type="file"/>
    

     

    and on the php ends I have

     

    $fullname = $_POST['fullname'];
    
        $uploaddir = './uploads/';
        //upload file in folder
        $uploadfile = $uploaddir. basename($_FILES['photo']['name']);
        //insert filename in db
        $upload_filename = basename($_FILES['photo']['name']);
        move_uploaded_file($_FILES['photo']['tmp_name'], $uploadfile);
        $photo = $upload_filename;
    
    $sql = "INSERT INTO members(fullname,photo) VALUES('$fullname', '$photo');
    $stmt = $link->query($sql) or die($link->error);
        $stmt->close;
    

     

    Please help me, I am using this on a live site

  2. <select name="hello" id="select_hello">
    <option value="hello1">Hello 1</option>
    <option selected value="hello2">Hello 2</option>
    <option value="hello3">Hello 3</option>
    <option value="hello4">Hello 4</option>
    </select>

    I have the following code, why is options 'hello2' not being selected when page load ? pls help

  3. Hi friends,

    a quick print_r() shows the following array while connecting to my database. How to get them as individual items and display on the website ?

    Array
    (
        [0] => Array
            (
                [id] => 52
                [document_name] => xyz
                [document_ext] => gif
                [download_file_name] => ktm_impact.gif
                [upload_dt] => 2010-08-11
            )
    
    )
    

  4. Hi all,

     

    If there are a two tables in a database with primary key are they in relationship without needing to add foreign keys ?

     

    I was doing

    select col1, col2 from table1,table 2

    it just fetch two coluns from two different tables. There was no fk.

     

    Is that possible ?

  5. I have generated css sprites uploading images zip file into this site http://spritegen.website-performance. it gives me coordinates like

    .sprite-accept { background-position: 0 0; width: 16px; height: 16px; } 
    .sprite-add { background-position: 0 -66px; width: 16px; height: 16px; } 

    , when i apply this css on page it gives me like 4 images on the row, I did play setting  background-position into different width It doesn't work, how do i exactly get the required image only ? Pls help

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