Hello,
I am making a Emergency contact card creator for our clients and so far I have a form that asks the user questions.
like name, emergency contact info, doctor info, blood type. I then use gd to create an image Similar to a business card.
My problem is that I want to be able to ask for allergies to medication, however If they have to many allergies listed the gd will cut the sentence once width is reached, is there a way to "wrap" the users input. So if the user types:
penniciline, arathamisin, asprin, viagra, morphene, vickadine, ect.
the system would turn that into
penniciline, arathamisin, asprin,
viagra, morphene, vickadine, ect.
Here is what i have so far and it works with the exception of allergies:
if ($doctor){
$imgh = "110";
$imgbg = "clientbg110.png";
}else{
$imgh = "55";
$imgbg = "clientbg55.png";
}
$img_handle = @ImageCreateFromPNG ("$imgbg");
$txt_color = ImageColorAllocate ($img_handle, 0, 0, 0);
$white = ImageColorAllocate($img_handle, 255, 255, 255);
ImageString ($img_handle, 2, 5, 0, "Name:", $txt_color);
ImageString ($img_handle, 3, 38, 0, "$name", $txt_color);
ImageLine($img_handle, 12, 16, 228, 16, $white);
ImageString ($img_handle, 2, 5, 18, "Emergency Contact Information", $txt_color);
ImageString ($img_handle, 3, 5, 30, "$ename", $txt_color);
ImageString ($img_handle, 3, 5, 42, "$ephone", $txt_color);
if ($doctor){
ImageLine($img_handle, 12, 57, 228, 57, $white);
ImageString ($img_handle, 2, 5, 58, "Medical Information", $txt_color);
ImageString ($img_handle, 2, 5, 70, "Doctor:", $txt_color);
ImageString ($img_handle, 3, 55, 70, "$doctor", $txt_color);
ImageString ($img_handle, 2, 5, 82, "Phone:", $txt_color);
ImageString ($img_handle, 3, 55, 82, "$dphone", $txt_color);
ImageString ($img_handle, 2, 5, 94, "Blood Type:", $txt_color);
ImageString ($img_handle, 3, 78, 94, "$btype", $txt_color);
}
ImagePNG($img_handle);
Any ideas would be helpfull.
Thank You,
Chris