how to save imageString into database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nadya
    New Member
    • Aug 2010
    • 2

    how to save imageString into database

    i had write code using php, user may add their own text in the image that has been retrieve from database. but now i having a problem how to save the new image(include the text) in the database.

    Code:
    Header ("Content-type: image/jpeg"); 
    $productId = $_REQUEST ['productId'];
    $image = $_REQUEST ['image'];
    $size = $_REQUEST ['textSize'];
    $x = $_REQUEST ['xPosition'];
    $y = $_REQUEST ['yPosition'];
    $y = $_REQUEST ['yPosition'];
    $img = imagecreatefromjpeg($image);
    $color = ImageColorAllocate ($img, 500, 500, 100);
    $textInput = $_REQUEST ['textName'];
    ImageString ($img, $size, $x, $y,  $textInput, $color);
    Imagejpeg ($img);
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    You know that text and image are separate data type. If you add a text in a image, the text will not be text anymore. it will be added as image too.

    You can save created image directly into database, or for better information saving, you can save image with combined text in one column, string in one column and original image in another column.

    Comment

    • nadya
      New Member
      • Aug 2010
      • 2

      #3
      johny : tq for replying my question

      i have add this code inside the code above

      Header ("Content-Disposition:att achment;filenam e='apple_image' ");

      so now the image and the text added had been auto save in the user computer without preview the image first.

      actually, i would like to save the image in my database too.. but still trying to solve that problem..

      Comment

      Working...