foreverhex Posted July 26, 2006 Share Posted July 26, 2006 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 upunset($artname, $text, $description);?></td></tr></table><!-------/BODY--------></td></tr></table><?php include 'bottom.html' ?>[/code] Quote Link to comment Share on other sites More sharing options...
foreverhex Posted July 26, 2006 Author Share Posted July 26, 2006 nevermind. It was the seesion thing. I needed to change unset($artname, $text, $description); to unset($_SESSION['text']...ect Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.