PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    insert a picture

    Share
    avatar
    hans

    Number of posts : 2
    Registration date : 2009-04-18

    insert a picture

    Post  hans on Sat Apr 18, 2009 1:37 am

    How do I insert a binary file into database? trough this system....

    $data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));

    <form method="post"..........enctype="multipart/form-data">

    gives a error, cant't change headers......???
    any ideas??? Please.

    Thank you Hans
    avatar
    Linchpin311

    Number of posts : 220
    Age : 32
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: insert a picture

    Post  Linchpin311 on Sun Apr 19, 2009 4:38 pm

    i dont exactly know what you are trying to do? you want to take a pic, convert it into binary, then put that data into the database?! sounds like you want to bring your database to a screeching halt if you plan to put any number of large picture files into the database and then read from them at a later time.

    i just put the filename into the database that would be associated with whatever im doing then i can call that when i need it.

    if we are not on the same page, let me know in greater detail what you are doing.


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    hans

    Number of posts : 2
    Registration date : 2009-04-18

    pictures

    Post  hans on Tue Apr 21, 2009 1:25 pm

    I am rying to store "small" <64kb picture with basic info, think HR app. (name, basic info and picture from ID card), my idea was to keep all of these data together, for easier upkeep, no broken links, duplicate names of picture, easier back up.......
    ---------------------------------------------------------------------------------------------------
    mysql_connect($dbhost,$dbusr,$dbpass) or die(mysql_error());
    mysql_select_db($dbname) or
    die(mysql_error());

    $data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));

    $result=MYSQL_QUERY("INSERT INTO info (firstName,ini,lastName,cellPhone,email,www,picture,fileName,fileSize,fileType) ".
    "VALUES ('$first_name','$ini','$last_name','$cell','$email','$www','$data','$form_data_name','$form_data_size','$form_data_type')");

    <form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
    First Name:
    <input type="text" name="first_name" size="15"> <br/>
    Initial:
    <input type="text" name="ini" size="1"> <br/>
    Lastn Name:
    <input type="text" name="last_name" size="30"> <br/>
    Cell Phone:
    <input type="text" name="cell" size="10"> <br/>
    Email:
    <input type="text" name="email" size="20"> <br/>
    Web Site:
    <input type="text" name="www" size="50"> <br/>
    <br/>
    <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
    <br>Your profile photo:<br>
    <input type="file" name="form_data" size="40"> <br/>
    <br/>
    </form>

    ------------------------------------------------------------------------------------------------

    this piece of code will insert the picture with other info into mysql, just having problem to incorporate this into the login system, so the users can add, edit their pictures ......

    Thank you for your help Hans
    avatar
    Linchpin311

    Number of posts : 220
    Age : 32
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: insert a picture

    Post  Linchpin311 on Wed Apr 22, 2009 8:36 pm

    first off, let me say, this is VERY COOL!! i would have never thought to do this... although im still not 100% convinced this is a good idea if you are planning to implement this on a medium to high traffic web site, (unless you are crazy rich and have a cool $5000 - $10000 to drop on oracle 11g) but that is neither here nor there.

    next let me say i have no idea how to do this. i have been playing around with it when i can find the time and i cant get the file to even print on screen correctly. this is really out of my realm and i fear whats out of my realm is out of our small forums realm (but hopefully someone will prove me wrong!!). i will keep trying and post anything if i get it working, but you might want to go outside of our forum on this one. sorry. Sad


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.

    Sponsored content

    Re: insert a picture

    Post  Sponsored content


      Current date/time is Sun Oct 22, 2017 4:52 pm