imagettftext() not working
Hiya,
I am trying to make a tracker and the code I have used is valid but
Warning: Wrong parameter count for imagettftext() in /home/a7265961/public_html/blog/update.php on line 12
comes up.
Here is my code
Code:
<?php
$submit = $_POST['submit'];
if($submit) {
$password = $_POST['password'];
$status = $_POST['status'];
$server = $_POST['server'];
$room = $_POST['room'];
$lastupdate = "Last Update:".date("Y-m-d H:i:s");
if($password == "s****") {
$im = imagecreatefrompng("images/trackerbg.png");
$colour = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, 30, 0, 115, 60, $colour, $status);
imagettftext($im, 30, 0, 120, 95, $colour, $server);
imagettftext($im, 30, 0, 120, 135, $colour, $room);
imagettftext($im, 10, 0, 5, 175, $colour, $lastupdate);
imagepng($im, 'tracker.png');
imagedestroy($im);
echo "Updated!";
}
else {
echo "Incorrect Password! Please try again!";
}
}
else {
}
?>
<html>
<head>
<title>Acess 1 Tracker</title>
</head>
<body>
<form action="<?php echo $_['PHP_SELF']; ?>" method="POST">
<p>Tracker Password: <input type="password" name="password" id="password" value="<?php echo $_POST['password']; ?>"></p>
<p>Status: <input type="text" name="status" id="status" value="<?php echo $_POST['status']; ?>"></p>
<p>Server: <input type="text" name="server" id="server" value="<?php echo $_POST['server']; ?>"></p>
<p>Room: <input type="text" name="room" id="room" value="<?php echo $_POST['room']; ?>"></p>
<p><input type="submit" name="submit" id="submit" value="Update Tracker"></p>
</form>
</body>
</html>
What's the mistake and please could you fix it.
Thanks in advanced.
Cap123
Last edited by Cap123; 11-18-2012 at 06:30 AM .
Reason: Blocking out password
Originally Posted by
Cap123
...the code I have used is valid...
If it were valid, you would not be getting that error.
imagettftext () requires 8 parameters, but you are only supplying 7. Check the manual page to figure out which one you forgot to include.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in
Nation
eBookworm.us
Okay, Thanks it turns out I need
Code:
<?php
// Not all the code, BTW.
$font = "arial.otf";
imagettftext($im, 30, 0, 115, 60, $colour, $status, $font);
imagettftext($im, 30, 0, 120, 95, $colour, $server, $font);
imagettftext($im, 30, 0, 120, 135, $colour, $room, $font);
imagettftext($im, 10, 0, 5, 175, $colour, $lastupdate, $font);
imagepng($im, 'tracker.png');
?>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks