billede med insat tekst gem som png på server
hej håber i kan hjælpe mig. jeg har lave et program til at lave stambøger til hunde men hvordan gemme jeg billede med den tekst der er indsat som et png billede alså hvor man selv kan skrve det navn som det skal gemmes somhåber der er nogle der kan hjælpe mig for er låst helt fast.
her er min html kode + php kode :
<html lang="en">
<?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'];
//-----------------------------------------------------------------
?>
<head>
<style>
Css er fjernet da det fylder for meget :-)
text53 {
position: absolute;
top: 180px;
left: 830px;
width: 450px;
}
text53 span {
color: Black;
font: bold 34px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: rgb(0, 0, 0); /* fallback color */
background: rgba(0, 0, 0, 0.7);
padding: 10px;
}
</style>
</head>
<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstr ... tstrap.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style/style.css">
</head>
<body>
<div class="header">
<h1><img src="Farve_sorttekst_x1.png" alt="">Hunderegister</h1>
<p></p>
</div>
<body>
<?php include"assets/menu.php"; ?>
<body>
</br>
</br>
<div>
<form method="post">
<text52><p>Far id: <input type="text" name="love1_id" />.Mor id: <input type="text" name="love_id" /></p></text52>
<text53><p><input type="submit" /></p></text53>
</form>
<?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]");
?>
</form>
<?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]");
?>
</div>
<a href="stamtavle.png" download="stamtavle.png">download</a>
</br>
<div class="image">
<img src="image/stamtavle.png" alt="" style=" width:1200;">
<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>
</br>
</br>
<div class="footer">
<a href="mailto:hyggelig1975@gmail.com"> </p>
<font color="white"><p>© Copyright 2019 , Design og udvikling .Kennel Taste of Heaven</p></font>
</div>
</body>
</html>
</body>
</html>