Jump to content

[SOLVED] Auto Upload After Generate?


jnerotrix

Recommended Posts

Ok I Have Created An Id Generator and i want the generated image to automatically upload to specified folder after generated

 

and then display the filename must be in a count Up 1st generated image = 1.png 2nd generated image = 2.png.

 

 

here is the Files:

 

Index.php

<html>
<head>

<script language="javascript">
<!--

function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
//-->
</script>

</head>
<title> Example Form </title>
<body>
<center>

<h1>Sandbox ID Card Generator</h1>
<br><br>



<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">

<form name="mygallery" action="generatred.php" method="post"<p>

User Name:<br>
<input type="text" name="user">
<br>
Text Line:(Max 25 Char.)<br>
<input type="text" name="text">
<br><br>

Color:<br>
<select name="picture" size="1" onChange="showimage()">
<option selected value="./default.png">-- Default --</option>
<option value="./babyblue.png">Baby Blue</option>
<option value="./blue.png">Blue</option>
<option value="./darkblue.png">Dark Blue</option>
<option value="./darkpink.png">Dark Pink</option>
<option value="./green.png">Green</option>
<option value="./hotpink.png">Hot Pink</option>
<option value="./orange.png">Orange</option>
<option value="./purple.png">Purple</option>
<option value="./red.png">Red</option>
<option value="./teal.png">Teal</option>
<option value="./yellow.png">Yellow</option>
</select>

</td>
</tr>
<tr>
<td width="100%"><p align="center"><img src="default.png" name="pictures"></td>
</tr>
</table><br>
<input type="submit" value="Generate">
</form>

Generated.php:

<?php

$user = $_POST['user'];
$img = $_POST['picture'];

$string = $user;
$im = imagecreatefrompng($img);

$textColor = imagecolorallocate ($im, 0, 0, 0);
imagestring($im, 80, 60, 85, "$string", $textColor);

header ("Content-type: image/png");

imagepng($im);

?>

 

I Want it so when it generates it uploads the file

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.