473,379 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

how to save imageString into database

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

Expand|Select|Wrap|Line Numbers
  1. Header ("Content-type: image/jpeg"); 
  2. $productId = $_REQUEST ['productId'];
  3. $image = $_REQUEST ['image'];
  4. $size = $_REQUEST ['textSize'];
  5. $x = $_REQUEST ['xPosition'];
  6. $y = $_REQUEST ['yPosition'];
  7. $y = $_REQUEST ['yPosition'];
  8. $img = imagecreatefromjpeg($image);
  9. $color = ImageColorAllocate ($img, 500, 500, 100);
  10. $textInput = $_REQUEST ['textName'];
  11. ImageString ($img, $size, $x, $y,  $textInput, $color);
  12. Imagejpeg ($img); 
  13.  
Aug 12 '10 #1
2 1698
johny10151981
1,059 1GB
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.
Aug 12 '10 #2
nadya
2
johny : tq for replying my question

i have add this code inside the code above

Header ("Content-Disposition:attachment;filename='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..
Aug 14 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: [ F e r n a n d o L o p e s ] | last post by:
Hello ALL, I need to read data from a .txt file and save this data in a sql server database table. The .txt file format like this: -----------------------------------------------------------...
0
by: BugKiller | last post by:
Hi, I need for an application in pocket pc 2003 to get a signature in the screen and then save it to a database. Is there a control like Ink for TabletPC I can use? How do I save the image to a...
5
by: \A_Michigan_User\ | last post by:
I'm using asp.net/vb.net/ado.net to create a very simple user interface. (Everything works if I use STATICALLY created textBoxes... but not when I make them DYNAMICALLY.) 1. Execute a SQL...
2
by: Marcos | last post by:
Hi Everybody!! Does anyone know how I can save all Access form (with a database) on a CD, for example? I save the file, but there's only the empty form, without other archives. I'd like to know...
1
by: fariba123 | last post by:
hi i am working with php. i am designing a site which will store employee information along with his/her photo and also edit information. i have completed the information save and edit part. now i...
1
by: Rameel | last post by:
Friends, I'm probably being more critical with VB.Net Windows application. I have Developed VisualStudio 20005 VB.Net Windows application how willl i be able to save a specific record into my...
4
by: nch1978 | last post by:
I am new to programming and am sorry if this post is in the wrong area. I have a listbox bound to a table and a datagrid bound to another one with a connection through xml. I can change the data...
5
by: kcal | last post by:
Hi, I have created an access database and copied it to a disk but it is opening as read only. I have checked the properties in access and all seems ok. Is their something else I should be doing. ...
4
by: musica0886 | last post by:
How can I input in a combo box and the data I input must be save in the database.
2
by: BRENDAMAGE | last post by:
can anyone hlp on this... how to trap empty string(value) before it saves to database... this one id like to happen... lastname firstname middlename
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.