Jump to content

unset() [solved]


foreverhex

Recommended Posts

This script is supposed to turn someones text into a gif file and then show them their info. The issue Im having is they can hit refresh a million and 2 times and keep making these image which in the long run is going to screw up the database. Now the varibles I want unset were made in a session, because the form gets checked over two different pages. I hope thats not the issue, but here is my code.

[code]
<?php
$page_name = ' :: Upload Art';
include 'top.php' ?>

<!-------BODY-------->
<table class="fullbody" align=left valign=top>
<tr valign=top>
<td align=left>

<?php

//Name the file for saving later
$randomnum = md5(mktime());
$filename = $randomnum . $artname . '.gif';

if(isset($text) || ($artname)) {
$newtext = wordwrap($text, 60, "\n", 1);
$im = imagecreate (525, 400);
$bgcolor = imagecolorallocate($im, 17, 0, 0);
$fontcolor = ImageColorAllocate ($im, 255, 255, 255);
imagecolortransparent($im, $bgcolor);
ImageTTFText ($im, 11, 0, 1, 20, $fontcolor, "arial.ttf",
"$newtext");
imagegif($im, "art/" . $filename);
imagedestroy($im);

echo '<img src="art/' . $filename . '" width=250></td>
<td align=left><b>You\'re Art upload was a success! Thanks for adding your visions to the Syblings Family! The tumbnail to the left does not reflect how you poem will accually look.</b><br /><br />
<b>Title:</b> ' . $artname . '<br />
<b>Medium:</b> Poetry<br />
<b>Description:</b> ' . $description . '<br /><br />
<a href="art.php">Continue to see you art.</a>';
} else {

echo '<br><center><b>There was an error uploading the file, please <a href="/aeart.php">try again</a>!</b></center><br>';

}

//unset the varibles so they cant screw anything up
unset($artname, $text, $description);

?>

</td>
</tr>
</table>
<!-------/BODY-------->



</td>
</tr>
</table>

<?php include 'bottom.html' ?>[/code]
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.