Hi all
I like write on any images uploaded, all types .gif .png .... I like add function to this code uploade Images
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>HD Uploader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" cellspacing="2" cellpadding="2" height="100%">
<tr>
<td>
<div align="center">
<table width="550" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#336699">
<tr>
<td background="top.gif" height="60"><img src="head.gif" width="256" height="45"></td>
</tr>
<tr>
<td background="bg.gif"><table width="100%" cellpadding="5" cellspacing="5">
<tr>
<td background="bg.gif">
<form name="formen" action="uploader.php" method="post" enctype="multipart/form-data">
You can upload to the folders: uploaded_pics, uploaded_files
and uploaded_docs.<br>
This scripts uploads only: *.jpg, *.gif *.png *.exe *.zip
*.rar *.html and *.php<br>
You must give the file a name on the server. Do not forget
the ending.<br>
Max filesize: 1000kb.<br>
<br>
<table width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="180" background="bg.gif">File: </td>
<td background="bg.gif">
<input type="file" name="bilde_fil">
</td>
</tr>
<tr>
<td width="180" background="bg.gif">Choose folder:</td>
<td background="bg.gif">
<select name="folder">
<option>Choose folder</option>
<option value="uploaded_pics/">Uploaded Pics</option>
<option value="uploaded_files/">Uploaded Files</option>
<option value="uploaded_docs/">Uploaded Docs</option>
</select>
</td>
</tr>
<tr>
<td width="180" background="bg.gif">Name of the file
on the server:</td>
<td background="bg.gif">
<input type="text" name="nyttnavn">
</td>
</tr>
<tr>
<td width="180" background="bg.gif">Filetype:</td>
<td background="bg.gif">
<select name="ending">
<option>.png</option>
<option>.gif</option>
<option>.jpg</option>
<option>.jpeg</option>
<option>.bmp</option>
</select>
</td>
</tr>
</table>
<br>
<input type="submit" value="Upload" name="submit">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<?php if ($folder == "Choose folder")
{
echo "<b>Error: </b> You must Choose a folder to upload your file.";
}?>
<?php
#Config
$path=$folder; //The file-path(remember the last '/')
$site_url = 'http://localhost/uploader/';
#Do not edit below :)
if ($bilde_fil && $nyttnavn){
$ok = 1;
if (is_file($path.$nyttnavn.$ending)){
print "<b>Error</b>, the name allready exists. Choose another name.<br>";
$ok = 0;
}
if (preg_match("/^[\/\\\.]/", $nyttnavn)){
print "<b>Error</b>, Filname can't start with: '.', '/' or '\'";
$ok = 0;
}
if(!($ending == '.jpg' || $ending == '.jpeg' || $ending == '.jpe' || $ending == '.gif' || $ending == '.png' || $ending == '.bmp')) {
print "<b>Error</b>, do not mix with the filename ($ending) Thanks!";
$ok = 0;
}
print "";
}
if ($ok){
$res = copy($bilde_fil, $path."/".$nyttnavn.$ending);
print ($res)?"<b>Finish</b>, uploadet <a href=\"$site_url$path".$nyttnavn.$ending."\">$site_url$path".$nyttnavn.$ending."</a><br><br><center><textarea rows=\"3\" cols=\"30\"><img src=\"$site_url$path".$nyttnavn.$ending."\" border=0></textarea> <textarea rows=\"3\" cols=\"30\">[img]$site_url$path".$nyttnavn.$ending."[/img]</textarea></center>":"<b>Error</b>, could not upload the file.<br>";
ImageString(4, 210, 30, "Hello John", $black);
// release image
ImageGIF($im);
print "";
}
?>
<br>
</form>
</td>
</tr>
</table> </td>
</tr>
<tr>
<td height="37">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="37" background="bottom.gif">
<div align="center">All Rights Reserved. <a href="http://www.harlemdesigns.org">Harlem
Designs</a> are Free Softwares.<br>
Copyright Harlem Designs ©2001-2003</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p class="headcell"> </p>
</div>
</td>
</tr>
</table>
</body>
</html>
This code write on images I like add to above codeπ
<?
// send header
Header("Content-Type: image/gif");
// create image and colours
$im = ImageCreate(500, 75);
$red = ImageColorAllocate($im, 255, 0, 0);
$black = ImageColorAllocate($im, 0, 0, 0);
// fill image
ImageFill($im, 0, 0, $red);
// write string at (210,30) in black
ImageString($im, 4, 210, 30, "Hello John", $black);
// release image
ImageGIF($im);
?>
π