SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why won't this image upload to mysql work

    Hi Guys

    Am trying to get this to work

    following code

    <?
    // connect to the database server
    $dbcnx = @mysql_connect('localhost', 'xx', 'xx');
    if (!$dbcnx) {
    die( '<p>unable to connect to the database server at this time.</p>' );
    }

    // select the sitecontent database
    if (! @mysql_select_db('xxxx') ) {
    die( '<p>Unable to locate the mm database at this time.</p>' );
    }


    $query = "INSERT INTO dossier VALUES ('','$athlete','$profile','$picture')";

    exec("cp /home/user/public_html/images/$picture");

    mysql_query($query);

    mysql_close();

    ?>

    this page is loaded after the form is submitted

    for some reason the location in my database for the file stays as the local drive and not image folder on my webserver

    hope someone can help

  2. #2
    Web developer Carl's Avatar
    Join Date
    Sep 2003
    Location
    sweden
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    exec("cp /home/user/public_html/images/$picture");

    is a local filesystem address, You should try HTTP:// will fopen or fsockopen


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •