Save and print image with text and [DHLnummer) as name

#1

save and print image with text and [DHLnummer) as name
need help to right the code ??
im new to this php :smile:

Unavngivet

this is my php file

<?php

// Initialize the session
session_start();

// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION[“loggedin”]) || $_SESSION[“loggedin”] !== true){
header(“location: login.php”);
exit;
}

include_once ‘config.php’;
$hvalpe_id = $_GET[‘id’];

// Henter Hvalpe data fra $_GET[‘id’]
$sql = "SELECT id, navn1, morther_id, born, kon FROM user_hvalpe WHERE id = $hvalpe_id ";
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);

$row = mysqli_fetch_assoc($result);

$hvalpe_data = array("navn1"=>"$row[navn1]", "kon"=>"$row[kon]", "born"=>"$row[born]","morther_id"=>"$row[morther_id]");	

// Henter race fra morther_id
$sql = "SELECT farve FROM user_hvalpe WHERE id = $hvalpe_id ";
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result);
$hvalpe_data[‘hvalp_farve’] = $row[‘farve’];

// Henter race fra morther_id
$sql = “SELECT Race FROM user_doglist WHERE morther_id = $hvalpe_data[morther_id]”;
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result);
$hvalpe_data[‘Race’] = $row[‘Race’];

// Henter navn fra morther_id
$sql = “SELECT navn FROM user_doglist WHERE morther_id = $hvalpe_data[morther_id]”;
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result);
$hvalpe_data[‘navn’] = $row[‘navn’];

// Henter stamnummer fra morther_id
$sql = “SELECT stam FROM user_doglist WHERE morther_id = $hvalpe_data[morther_id]”;
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result);
$hvalpe_data[‘stam’] = $row[‘stam’];

// Henter farve fra morther_id
$sql = “SELECT farve FROM user_doglist WHERE morther_id = $hvalpe_data[morther_id]”;
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result);
$hvalpe_data[‘farve’] = $row[‘farve’];

$userid = $_SESSION['id'];	

// henter user email fra $_SESSION[‘id’]
$sql = “SELECT firstname FROM users WHERE id = $userid”;
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result);
$hvalpe_data[‘firstname’] = $row[‘firstname’];

$sql = "SELECT lastname FROM `users` WHERE id = $userid ";
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result); 
$hvalpe_data['lastname'] = $row['lastname'];

$sql = "SELECT adresse FROM `users` WHERE id = $userid";
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result); 
$hvalpe_data['adresse'] = $row['adresse'];

$sql = "SELECT post FROM `users` WHERE id = $userid ";
$result = mysqli_query($link, $sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_assoc($result); 
$hvalpe_data['post'] = $row['post'];

//-----------------------------------------------------------------

?>

//is move to css
<meta charset="UTF-8">

<title>Welcome</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css">

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" type="text/css" href="style/style.css">
<div class="header">
 	<h1><img src="Farve_sorttekst_x1.png" alt="">Hunderegister</h1>
 	<p></p>
 </div>
<?php include"assets/menu.php"; ?> 

Far id: .Mor id:

<?php $love1_id = ((int)$_POST["love1_id"]); $sql = "SELECT navn, stamnummer, farve, bedstefar, bedstefar_stamnummer, bedstefar_farve, bedstemor,bedstemor_stamnummer, bedstemor_farve, oldefar, oldefar_stamnummer, oldefar_farve, oldemor, oldemor_stamnummer, oldemor_farve, oldeoldefar, oldeoldefar_stamnummer, oldeoldefar_farve, oldeoldemor, oldeoldemor_stamnummer, oldeoldemor_farve FROM `doglist1` WHERE love1_id =$love1_id"; $result = mysqli_query($link, $sql); $resultCheck = mysqli_num_rows($result); $row = mysqli_fetch_assoc($result); $far_data = array("navn"=>"$row[navn]", "stamnummer"=>"$row[stamnummer]", "farve"=>"$row[farve]", "bedstefar"=>"$row[bedstefar]", "bedstefar_stamnummer"=>"$row[bedstefar_stamnummer]", "bedstefar_farve"=>"$row[bedstefar_farve]", "bedstemor"=>"$row[bedstemor]", "bedstemor_stamnummer"=>"$row[bedstemor_stamnummer]", "bedstemor_farve"=>"$row[bedstemor_farve]", "oldefar"=>"$row[oldefar]", "oldefar_stamnummer"=>"$row[oldefar_stamnummer]", "oldefar_farve"=>"$row[oldefar_farve]", "oldemor"=>"$row[oldemor]", "oldemor_stamnummer"=>"$row[oldemor_stamnummer]", "oldemor_farve"=>"$row[oldemor_farve]", "oldefar1"=>"$row[oldeoldefar]", "oldefar1_stamnummer"=>"$row[oldeoldefar_stamnummer]", "oldefar1_farve"=>"$row[oldeoldefar_farve]", "oldemor1"=>"$row[oldeoldemor]", "oldemor1_stamnummer"=>"$row[oldeoldemor_stamnummer]", "oldemor1_farve"=>"$row[oldeoldemor_farve]");
?>
<?php $love_id = ((int)$_POST["love_id"]); $sql = "SELECT navn, stamnummer, farve, bedstefar, bedstefar_stamnummer, bedstefar_farve, bedstemor, bedstemor_stamnummer, bedstemor_farve, oldefar, oldefar_stamnummer, oldefar_farve, oldemor, oldemor_stamnummer, oldemor_farve, oldeoldefar, oldeoldefar_stamnummer, oldeoldefar_farve, oldeoldemor, oldeoldemor_stamnummer, oldeoldemor_farve FROM `doglist` WHERE love_id =$love_id"; $result = mysqli_query($link, $sql); $resultCheck = mysqli_num_rows($result); $row = mysqli_fetch_assoc($result); $mor_data = array("navn"=>"$row[navn]", "stamnummer"=>"$row[stamnummer]", "farve"=>"$row[farve]", "bedstefar1"=>"$row[bedstefar]", "bedstefar1_stamnummer"=>"$row[bedstefar_stamnummer]", "bedstefar1_farve"=>"$row[bedstefar_farve]", "bedstemor1"=>"$row[bedstemor]", "bedstemor1_stamnummer"=>"$row[bedstemor_stamnummer]", "bedstemor1_farve"=>"$row[bedstemor_farve]", "oldefar1"=>"$row[oldefar]", "oldefar1_stamnummer"=>"$row[oldefar_stamnummer]", "oldefar1_farve"=>"$row[oldefar_farve]", "oldemor1"=>"$row[oldemor]", "oldemor1_stamnummer"=>"$row[oldemor_stamnummer]", "oldemor1_farve"=>"$row[oldemor_farve]", "oldefar2"=>"$row[oldeoldefar]", "oldefar2_stamnummer"=>"$row[oldeoldefar_stamnummer]", "oldefar2_farve"=>"$row[oldeoldefar_farve]", "oldemor2"=>"$row[oldeoldemor]", "oldemor2_stamnummer"=>"$row[oldeoldemor_stamnummer]", "oldemor2_farve"=>"$row[oldeoldemor_farve]"); ?>
 <h2><?=$hvalpe_data['navn1'];?></h2> 
 <h4><input class="text" name="Chipnummer" type="text" value="Chipnummer"></h4>
 <text><input class="text" name="Stambogsnummer" type="text" value="Stambogsnummer"></text>
 <text1><?=$hvalpe_data['hvalp_farve'];?><text1>
 <text2><?=$hvalpe_data['firstname'] . ' ' . $hvalpe_data['lastname'];?><text2>
 <text3><?=$hvalpe_data['adresse'];?></text3>
 <text4><?=$hvalpe_data['post'];?></text4>
 <text5><?=$hvalpe_data['Race'];?></text5>
 <text6><?=$hvalpe_data['kon'];?></text6>
 <text7><?=$hvalpe_data['born'];?></text7>
 
 <text11><?=$far_data['navn'];?></text11>
 <text12><?=$far_data['stamnummer'];?></text12>
 <text13><?=$far_data['farve'];?></text13>
 
 <text20><?=$far_data['bedstefar'];?></text20>
 <text21><?=$far_data['bedstefar_stamnummer'];?></text21>
 <text22><?=$far_data['farve'];?></text22>
 
 <text23><?=$far_data['bedstemor'];?></text23>
 <text24><?=$far_data['bedstemor_stamnummer'];?></text24>
 <text25><?=$far_data['bedstemor_farve'];?></text25>
 
 <text32><?=$far_data['oldefar'];?></text32>
 <text33><?=$far_data['oldefar_stamnummer'];?></text33>
 <text34><?=$far_data['oldefar_farve'];?></text34>
 
 <text35><?=$far_data['oldemor'];?></text35>
 <text36><?=$far_data['oldemor_stamnummer'];?></text36>
 <text37><?=$far_data['oldemor_farve'];?></text37>
 
 <text26><?=$far_data['oldefar1'];?></text26>
 <text27><?=$far_data['oldefar1_stamnummer'];?></text27>
 <text28><?=$far_data['oldefar1_farve'];?></text28>
 
 <text29><?=$far_data['oldemor1'];?></text29>
 <text30><?=$far_data['oldemor1_stamnummer'];?></text30>
 <text31><?=$far_data['oldemor1_farve'];?></text31>

 <text8><?=$mor_data['navn'];?></text8>
 <text9><?=$mor_data['stamnummer'];?></text9>
 <text10><?=$mor_data['farve'];?></text10>
 
 <text14><?=$mor_data['bedstefar1'];?></text14>
 <text15><?=$mor_data['bedstefar1_stamnummer'];?></text15>
 <text16><?=$mor_data['bedstefar1_farve'];?></text16>
 
 <text17><?=$mor_data['bedstemor1'];?></text17>
 <text18><?=$mor_data['bedstemor1_stamnummer'];?></text18>
 <text19><?=$mor_data['bedstemor1_farve'];?></text19>

 <text38><?=$mor_data['oldefar1'];?></text38>
 <text39><?=$mor_data['oldefar1_stamnummer'];?></text39>
 <text40><?=$mor_data['oldefar1_farve'];?></text40>
 
 <text41><?=$mor_data['oldemor1'];?></text41>
 <text42><?=$mor_data['oldemor1_stamnummer'];?></text42>
 <text43><?=$mor_data['oldemor1_farve'];?></text43>
 
 <text44><?=$mor_data['oldefar2'];?></text44>
 <text45><?=$mor_data['oldefar2_stamnummer'];?></text45>
 <text46><?=$mor_data['oldefar2_farve'];?></text46>
 
 <text47><?=$mor_data['oldemor2'];?></text47>
 <text48><?=$mor_data['oldemor2_stamnummer'];?></text48>
 <text49><?=$mor_data['oldemor2_farve'];?></text49>
 
 <text50><input class="text" name="DATO" type="text" value="Dato"></text50>
 <text51><input class="text" name="note" type="text" value=""></text51>
 </br>
        <input type="hidden" name="navn1" 	    value="<?=$hvalpe_data['navn1'];?>">
		<input type="hidden" name="kon" 	    value="<?=$hvalpe_data['kon'];?>">		  
		<input type="hidden" name="born" 	    value="<?=$hvalpe_data['born'];?>">
		<input type="hidden" name="Race" 	    value="<?=$hvalpe_data['Race'];?>">
		
		<input type="hidden" name="navn" 	    value="<?=$hvalpe_data['navn'];?>">
		<input type="hidden" name="stam" 	    value="<?=$hvalpe_data['stam'];?>">
        <input type="hidden" name="farve" 	    value="<?=$hvalpe_data['farve'];?>">
		<input type="hidden" name="farve" 	    value="<?=$hvalpe_data['hvalp_farve'];?>">
		
		<input type="hidden" name="firstname" 	value="<?=$hvalpe_data['firstname'];?>">
		<input type="hidden" name="lastname" 	value="<?=$hvalpe_data['lastname'];?>">
		<input type="hidden" name="adresse" 	value="<?=$hvalpe_data['adresse'];?>">
		<input type="hidden" name="post" 	    value="<?=$hvalpe_data['post'];?>">
		
		<input type="hidden" name="far"         value="<?=$far_data['navn'];?>">
        <input type="hidden" name="far" 	    value="<?=$far_data['stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['farve'];?>">
		
	    <input type="hidden" name="far" 	    value="<?=$far_data['bedstefar'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['bedstefar_stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['farve'];?>">
		
	    <input type="hidden" name="far" 	    value="<?=$far_data['bedstemor'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['bedstemor_stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['bedstemor_farve'];?>">
		
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldefar'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldefar_stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldefar_farve'];?>">
		
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldemor'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldemor_stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldemor_farve'];?>">
		
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldefar1'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldefar1_stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldefar1_farve'];?>">
		
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldemor1'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldemor1_stamnummer'];?>">
	    <input type="hidden" name="far" 	    value="<?=$far_data['oldemor1_farve'];?>">
		
		<input type="hidden" name="mor" 	    value="<?=$mor_data['navn'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['stamnummer'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['farve'];?>">
	 
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['bedstefar1'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['bedstefar1_stamnummer'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['bedstefar1_farve'];?>">
	 
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['bedstemor1'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['bedstemor1_stamnummer'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['bedstemor1_farve'];?>">
	
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['oldefar1'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['oldefar1_stamnummer'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['oldefar1_farve'];?>">
	 
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['oldemor1'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['oldemor1_stamnummer'];?>">
	    <input type="hidden" name="mor" 	    value="<?=$mor_data['oldemor1_farve'];?>">
	 
	   <input type="hidden" name="mor" 	        value="<?=$mor_data['oldefar2'];?>">
	   <input type="hidden" name="mor" 	        value="<?=$mor_data['oldefar2_stamnummer'];?>">
	   <input type="hidden" name="mor" 	        value="<?=$mor_data['oldefar2_farve'];?>">
	 
	   <input type="hidden" name="mor" 	        value="<?=$mor_data['oldemor2'];?>">
	   <input type="hidden" name="mor" 	        value="<?=$mor_data['oldemor2_stamnummer'];?>">
	   <input type="hidden" name="mor" 	        value="<?=$mor_data['oldemor2_farve'];?>">

	
	</div>		

© Copyright 2019 , Design og udvikling .Kennel Taste of Heaven

#2

maybe the following links will help you out:
https://www.php.net/manual/en/function.imagettftext.php
https://www.php.net/manual/en/function.imagejpeg.php

#3

nope that is not helping me…

#4

dumping a lot of code into this forum wouldn’t bring you forward, nobody can reproduce this, also you didnt say what you already tried, nor where you think the error might be. Also your description just says nothing, nobody can understand your usecase and nobody can read your mind what the exact task is. You have to put a lot more afford into your posting to get a useful answer.

1 Like
#5

well said, chorn. I assume that an image should be created with text or text should be added to an existing image.

i am under the impression that my links are helpful. i am thinking:
save an image: to a database? this can be searched using Google. tip: BLOB
print image should not need explanation. even JavaScript can be used as a command.
add text to an existing image or create an image with text?
then the links that i provided should help you solve your problem but i do not think that these are built in options. i think that it is a libraru that needs to be downloaded and made accessible to php.

otherwise, i have no idea what you want.