[Fei-Yin]
(?)Community Member
- Posted: Sun, 16 Jan 2005 03:27:38 +0000
i don't think that freehost.ultra hosts MySQL.. so I'm trying the php option but I don't know whats what on it because there is no instuctions for that part. where do i put the image? will it show up on the shoutbox section? i have no clue. here's what I have.
Sig.php
Submit.php
what on earth am i doing wrong? this perticular thread is severly lacking instuction.
Sig.php
<?php
$im = ImageCreateFromjpg('try.jpg') // your image
$im2 = imagecreatetruecolor(504, 324) // size of your image
$black = imagecolorallocate($im, 86, 86, 86)
imagefill($im2, 0, 0, $white) // fille the background image
ImageCopyMerge($im2, $im, 0, 0, 0, 0, ImagesX($im), ImagesY($im), 100)
$file = file_get_contents('messagelog.txt')
$file = explode("\n", $file)
$ln = count($file)
$e = 1;
// Write text on image starting from bottom up. (newest on bottom)
for ($i = 7; $i > 0; $i--) {
$j = $i - 1;
$vertdist = $e * 15;
$vertdist = $vertdist + 10;
$lnc = $ln - $i;
$string = $file[$lnc]
switch ($col) {
case 0;
imagestring($im2, 2, 110, $vertdist, $string, $white)
break;
case 1;
imagestring($im2, 2, 10, $vertdist, $string2, $white)
break;
case 2;
imagestring($im2, 2, 110, $vertdist, $string3, $white)
break;
case 3;
imagestring($im2, 2, 110, $vertdist, $today, $white)
break;
default:
imagestring($im2, 2, 110, $vertdist, $whatis, $white)
}
$e++;
}
header("Content-type: image/jpg") // tell browser it's an image
imagejpg($im2) // send image
imagedestroy($im2) // free resources
?>
$im = ImageCreateFromjpg('try.jpg') // your image
$im2 = imagecreatetruecolor(504, 324) // size of your image
$black = imagecolorallocate($im, 86, 86, 86)
imagefill($im2, 0, 0, $white) // fille the background image
ImageCopyMerge($im2, $im, 0, 0, 0, 0, ImagesX($im), ImagesY($im), 100)
$file = file_get_contents('messagelog.txt')
$file = explode("\n", $file)
$ln = count($file)
$e = 1;
// Write text on image starting from bottom up. (newest on bottom)
for ($i = 7; $i > 0; $i--) {
$j = $i - 1;
$vertdist = $e * 15;
$vertdist = $vertdist + 10;
$lnc = $ln - $i;
$string = $file[$lnc]
switch ($col) {
case 0;
imagestring($im2, 2, 110, $vertdist, $string, $white)
break;
case 1;
imagestring($im2, 2, 10, $vertdist, $string2, $white)
break;
case 2;
imagestring($im2, 2, 110, $vertdist, $string3, $white)
break;
case 3;
imagestring($im2, 2, 110, $vertdist, $today, $white)
break;
default:
imagestring($im2, 2, 110, $vertdist, $whatis, $white)
}
$e++;
}
header("Content-type: image/jpg") // tell browser it's an image
imagejpg($im2) // send image
imagedestroy($im2) // free resources
?>
Submit.php
<html><body><center><br><br><br><br><br><br><br><br><br><form action="submit.php" method="POST">
Name: <input type="text" name="username" maxlength='19'><font color="red">*</font><br>
Message / Action: <input type="text" name="message" maxlength='27'><font color="red">*</font><br>
<input type="submit" value="Submit"><br>
</form></center>
<body></html>
<?php
$message = stripslashes($_POST['message'])
$username = stripslashes($_POST['username'])
$password = stripslashes($_POST['password'])
//define vars
if (!empty($username) && !empty($message)){
//checks if all inputs are set
$fh = fopen("messagelog.txt", "a+") // sends stuff to logfile
fwrite($fh, " " . $username . " says: " . $message . "\n")
fclose($fh)
echo "<center>Successful. Check <a href='sig.php'>the shoutbox</a>.";
}
else {
echo "<center>All fields marked with an <font color=\"red\">*</font> are necesary.<br>";
}
?>
Name: <input type="text" name="username" maxlength='19'><font color="red">*</font><br>
Message / Action: <input type="text" name="message" maxlength='27'><font color="red">*</font><br>
<input type="submit" value="Submit"><br>
</form></center>
<body></html>
<?php
$message = stripslashes($_POST['message'])
$username = stripslashes($_POST['username'])
$password = stripslashes($_POST['password'])
//define vars
if (!empty($username) && !empty($message)){
//checks if all inputs are set
$fh = fopen("messagelog.txt", "a+") // sends stuff to logfile
fwrite($fh, " " . $username . " says: " . $message . "\n")
fclose($fh)
echo "<center>Successful. Check <a href='sig.php'>the shoutbox</a>.";
}
else {
echo "<center>All fields marked with an <font color=\"red\">*</font> are necesary.<br>";
}
?>
what on earth am i doing wrong? this perticular thread is severly lacking instuction.