Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>формата</title>
<head>
<body>
<form action="kupon.php" method="post">
име <input type="text" name="ime"/>
адрес <input type="text" name="adress"/>
<input type="submit" name="submit"/>
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])){
$ime=$_POST['ime'];
$adress=$_POST['adress'];?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>начало</title>
<style>
#img{background: url(test.png) no-repeat;width: 200px;height:200px;}
#ime {position:absolute;top:30px;left:130px;}
#adress {position:absolute;top:70px;left:160px;}
</style>
<head>
<body>
<div id="img">
<div id="ime"><?php echo $ime ?></div>
<div id="adress"><?php echo $adress ?></div>
</div>
<div>
<form>
<input type="button" value="принт" onClick="window.print()">
</form>
</div>
<? } ?>
</body>
</html>
<?php
if(isset($_POST['submit'])){
$ime=$_POST['ime'];
$adress=$_POST['adress'];?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>начало</title>
<style>
#img{background: url(test.png) no-repeat;width: 200px;height:200px;}
#ime {position:absolute;top:30px;left:130px;}
#adress {position:absolute;top:70px;left:160px;}
</style>
<head>
<body onLoad="window.print()">
<div id="img">
<div id="ime"><?php echo $ime ?></div>
<div id="adress"><?php echo $adress ?></div>
</div>
<? } ?>
</body>
</html>
по това работя сегаBotzo каза:А в kupon.php какво трябва да добавя за да принтира и test.png ?
Много благодара.IzKuFeLiQqQqQ каза:по това работя сегатъй като съм 2-ра смяна довечера ще ти дам кода
![]()
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>формата</title>
<head>
<body>
<form action="kupon.php" method="post">
име <input type="text" name="ime"/>
адрес <input type="text" name="adress"/>
<input type="submit" name="submit" />
</form>
</body>
</html>
<?php
if(isset($_POST['submit'])){
$ime=$_POST['ime'];
$adress=$_POST['adress'];
header("Content-type: image/png; charset=UTF-8");
$image = imagecreatefrompng("test.png");
$color= imagecolorallocate($image, 0, 0, 0);
$fontsize = 3;
imagestring($image, $fontsize, 127, 33, $ime, $color);
imagestring($image, $fontsize, 127, 73, $adress, $color);
imagepng($image);
imagedestroy($image);
}
?>
<form>
<input type="button" value="принтирай" onClick="window.print()" >
</form>