Synes selv I skal se hvad der sker:
http://bingo.mr-inc.dk/bingo_plade_1.phpog koden kan i da også få...
<?
SESSION_START();
?>
<?php
include('config.php');
$navn = $_SESSION["Brugernavn"];
$zlol = mysql_query("SELECT * FROM brugere WHERE navn = '$navn'");
$z = mysql_fetch_array($zlol);
if($z['p1'] == "ja") {
echo "Du har allerede din plade nr. 1";
exit;
} else {
$bogstaver = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
$plade = 1;
$tal1 = mt_rand(0,9);
$tal2 = mt_rand(0,9);
$tal3 = mt_rand(0,9);
$kode = substr(str_shuffle($bogstaver), 0, mt_rand(7,8));
$K1T1 = mt_rand(1,9);
$K1T2 = mt_rand(1,9);
if($K1T2 == $K1T1) {
$K1T1 = 2;
$k1T2 = 7;
}
$K2T1 = mt_rand(10,19);
$K3T1 = mt_rand(20,29);
$K3T2 = mt_rand(20,29);
if($K3T2 == $K3T1) {
$K3T1 = 23;
$k3T2 = 27;
}
$K4T1 = mt_rand(30,39);
$K4T2 = mt_rand(30,39);
if($K4T2 == $K4T1) {
$K4T1 = 30;
$K4T2 = 36;
}
$K5T1 = mt_rand(40,49);
$K6T1 = mt_rand(50,59);
$K6T2 = mt_rand(50,59);
if($K6T2 == $K6T1) {
$K6T1 = 50;
$K6T2 = 55;
}
$K7T1 = mt_rand(60,69);
$K7T2 = mt_rand(60,69);
if($K7T2 == $K7T1) {
$K7T1 = 62;
$K7T2 = 69;
}
$K8T1 = mt_rand(70,79);
$K9T1 = mt_rand(80,90);
$K9T2 = mt_rand(80,90);
if($K9T2 == $K9T1) {
$K9T1 = 83;
$K9T2 = 90;
}
$im = ImageCreateFromPng("plade.png");
$sort = ImageColorAllocate($im,130,149,169);
ImageTTFText ($im,10,0,436,13,$sort,"arial.ttf","$plade");
ImageTTFText ($im,10,0,395,37,$sort,"arial.ttf","$kode-$tal1$tal2$tal3");
ImageTTFText ($im,17,0,15,75,$sort,"arial.ttf","$K1T1");
ImageTTFText ($im,17,0,15,180,$sort,"arial.ttf","$K1T2");
ImageTTFText ($im,17,0,75,128,$sort,"arial.ttf","$K2T1");
ImageTTFText ($im,17,0,125,128,$sort,"arial.ttf","$K3T1");
ImageTTFText ($im,17,0,125,180,$sort,"arial.ttf","$K3T2");
ImageTTFText ($im,17,0,177,75,$sort,"arial.ttf","$K4T1");
ImageTTFText ($im,17,0,177,128,$sort,"arial.ttf","$K4T2");
ImageTTFText ($im,17,0,233,128,$sort,"arial.ttf","$K5T1");
ImageTTFText ($im,17,0,285,75,$sort,"arial.ttf","$K6T1");
ImageTTFText ($im,17,0,285,180,$sort,"arial.ttf","$K6T2");
ImageTTFText ($im,17,0,340,75,$sort,"arial.ttf","$K7T1");
ImageTTFText ($im,17,0,340,180,$sort,"arial.ttf","$K7T2");
ImageTTFText ($im,17,0,394,128,$sort,"arial.ttf","$K8T1");
ImageTTFText ($im,17,0,447,75,$sort,"arial.ttf","$K9T1");
ImageTTFText ($im,17,0,447,180,$sort,"arial.ttf","$K9T2");
header("Content-type: image/png"); // image/png hvis det er et png-billede
ImagePNG($im); // eller ImagePNG hvis det er et PNG
ImageDestroy($im);
$ejer = $_SESSION["Brugernavn"];
mysql_query("INSERT INTO plader(ejer, plade_nr, kode, K1T1, K1T2, K2T1, K3T1, K3T2, K4T1, K4T2, K5T1, K6T1, K6T2, K7T1, K7T2, K8T1, K9T1, K9T2)values ('$ejer', '1', '$kode-$tal1$tal2$tal3', '$K1T1', '$K1T2', '$K2T1', '$K3T1', '$K3T2', '$K4T1', '$K4T2', '$K5T1', '$K6T1', '$K6T2', '$K7T1', '$K7T2', '$K8T1', '$K9T1', '$K9T2')");
mysql_query("UPDATE brugere SET p1 = 'ja' WHERE navn = '$navn'") or(mysql_error());
}
?>
Den virkede godt nok på min gamle server, men efter jeg skiftede virker den ikke.