Hi i maked a sign chat to people dont want the advers from myownsignchat.nl so i decide to code this (Euh i didnt got much time to test it so someone test it :P
gd_library.php
Index.phpPHP Code:<?php
/*
MySql :
CREATE TABLE `gd` (
`id` INT NOT NULL AUTO_INCREMENT ,
`naam` VARCHAR( 255 ) NOT NULL ,
`tekst` VARCHAR( 15 ) NOT NULL ,
`ip` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `id` )
) TYPE = MYISAM ;
*/
session_start( );
ob_start( );
$sql['host'] = 'localhost';
$sql['user'] = 'root';
$sql['pass'] = '';
$sql['daba'] = 'gd';
$sql['tabel'] = 'gd';
@mysql_connect( $sql['host'] , $sql['user'] , $sql['pass'] ) or die( mysql_error( ) );
@mysql_select_db( $sql['daba'] ) or die( mysql_error( ) );
$query = mysql_query( "SELECT * FROM `" . $sql['tabel'] . "` ORDER BY `id` DESC LIMIT 5 " ) or die( mysql_error( ) );
header( 'content-type: image/png' );
$image = imagecreate( 100 , 110 );
$achtergrond = imagecolorallocate( $image , 255 , 255 , 255 );
$kleur['tekst'] = imagecolorallocate( $image , 9 , 34 , 217 );
$kleur['lijn'] = imagecolorallocate( $image , 7 , 24 , 157 );
imageline( $image , 0 , 0 , 0 , 100 , $kleur['lijn'] );
imageline( $image , 0 , 100 , 100 , 100 , $kleur['lijn'] );
imageline( $image , 100 , 0 , 0 , 0 , $kleur['lijn'] );
imageline( $image , 99 , 100 , 99 , 0 , $kleur['lijn'] );
$font = 'font/arial.ttf'; // Let op! Hier de link naar het font dat je wil gebruiken ! Deze .ttf file moet wel bestaan en geupload worden !!! <-- !!!!
$i = 17;
while( $array = mysql_fetch_array( $query ) and $i < 97 )
{
imagettftext( $image , 10 , 0 , 5 , $i , $kleur['tekst'] , $font , stripslashes( $array['tekst'] ) );
$i = $i + 20;
}
imagepng( $image );
imagedestroy( $image );
?>
[EDIT] i need to add some images and fonts sorry ! or else you gonna do it by urself ;DPHP Code:<?php
session_start( );
ob_start( );
$sql['host'] = 'localhost';
$sql['user'] = 'root';
$sql['pass'] = '';
$sql['daba'] = 'gd';
$sql['tabel'] = 'gd';
@mysql_connect( $sql['host'] , $sql['user'] , $sql['pass'] ) or die( mysql_error( ) );
@mysql_select_db( $sql['daba'] ) or die( mysql_error( ) );
echo '<img src="gd_library.php" alt="Spam avi !" />';
?>
<br />
<br />
<?php
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$fouten = array( );
if( empty( $_POST['naam'] ) )
$fouten [] = 'Je moet een naam invullen !<br />';
if( empty( $_POST['tekst'] ) )
$fouten [] = 'Je moet een bericht invullen !<br />';
if( strlen( $_POST['tekst'] ) > 15 )
$fouten [] = 'Je bericht mag max 15 letters zijn !<br />';
if( count( $fouten ) > 0 )
{
?>
<table style="width: 250px; height: auto; font-family: Arial; font-size: 13px; color: #0922d9; border: 1px solid #07189d;" border="0" cellpadding="2" cellspacing="2">
<tr>
<td><b>Er zijn enkele fouten opgetreden !</b></td>
</tr>
<?php
for( $i = 0; $i < count( $fouten ); $i ++ )
{
?>
<tr>
<td><?= $fouten [$i] ?></td>
</tr>
<?php
}
?>
<tr>
<td><a href="javascript:history.back(-1)">Ga terug !</a></td>
</tr>
</table>
<?php
}
else
{
mysql_query( "INSERT INTO " . $sql['tabel'] . "
SET
naam = '" . htmlspecialchars( trim( addslashes( $_POST['naam'] ) ) ) . "' ,
tekst = '" . htmlspecialchars( trim( addslashes( $_POST['tekst'] ) ) ) . "' ,
ip = '" . $_SERVER['REMOTE_ADDR'] . "' " ) or die( mysql_error() );
?>
<table style="width: 250px; height: auto; font-family: Arial; font-size: 13px; color: #0922d9; border: 1px solid #07189d;" border="0" cellpadding="2" cellspacing="2">
<tr>
<td>Je bericht is succesvol toegevoegd aan mijn Spam-avi !</td>
</tr>
</table>
<?php
}
}
else
{
?>
<form method="post" action="">
<table style="width: 250px; height: auto; font-family: Arial; font-size: 13px; color: #0922d9; border: 1px solid #07189d;" border="0" cellpadding="2" cellspacing="2">
<tr>
<td colspan="2"><b>Hier kun je een bericht plaatsen voor mijn spam avi !</b></td>
</tr>
<tr>
<td>Naam : </td>
<td><input type="text" name="naam" /></td>
</tr>
<tr>
<td>Tekst : </td>
<td><input type="text" name="tekst" maxlength="15" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Spammuhh !" /></td>
</tr>
</table>
</form>
<?php
}
?>
Euh can someone help me out lol with the gd_library.php (it doesnt open the image)
(Mod move this to the DEV because it doesnt want open anymore my images ;) )
THX!

