caronthegerman
Members-
Content Count
25 -
Joined
-
Last visited
About caronthegerman
-
Rank
Newbie [Level 2]
-
8ennett's Php Web Community: Part 1 Advanced User Account System
caronthegerman replied to 8ennett's topic in Programming
Awesome tutorial, thanks!I'll be looking forward to part 2. -
Using Watermarked Images Is it allowed?
caronthegerman replied to caronthegerman's topic in Websites and Web Designing
Well that kinda sucks...Oh well, I guess I'll have to do without. Thanks -
Using Watermarked Images Is it allowed?
caronthegerman replied to caronthegerman's topic in Websites and Web Designing
So what about pictures that don't have watermarks? Those are ok right? -
Using Watermarked Images Is it allowed?
caronthegerman replied to caronthegerman's topic in Websites and Web Designing
No i meant because of copyright issues. Is it legal to use other websites images if they have a watermark on them and display them on my website if I leave the watermark as it is. -
Hey guys,I wanted to use a couple of watermarked images on my website. (They have the website name on the bottom)Is this allowed? Can I use images that have text on the side or the bottom?Thanks
-
Yea that worked. Thanks. I also changed the form action. However, the url is still http://forums.xisto.com/no_longer_exists/ The question mark after randomizer.php is still showing up. Although it doesn't bother me, I don't get why it does. Also, could I change the line: return '<img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top">'; so that if I click it, it also opens randomizer.php? For example, could I <a href a php returned image as well? I attached the randomizer.php file to this post. Oh and 8ennet, I started the php tutorial and am reading it daily.
-
Thanks for pointing that out.I made the change and when I view the source code, it displays it as /useruploads/random***.jpg but the picture still fails to come up. I've also noticed that if I leave out the / at the end, a ? appears after the randomizer.php. This doesn't appear if I put / at the end.What does the question mark mean/do?
-
Hey it's me again. For some reason the pictures that come up on my randomizer.php are sometimes forced under where the picture is supposed to be. For example, if it is supposed to be in the middle of the screen, the top of the picture will be right where the bottom of the picture is supposed to be. When this happens the picture is under the "New Picture" button and you can only see a tiny bit of the top. Do you know what the problem is? It happens very randomly, but, because the images are random too, it might be because of the picture.
-
Well since I didn't know how to do any of that stuff I just kind of wanted the information to be sent to my email so that in case anybody uploads something I know who uploaded it and if I can view the image and see if it is suitable and allowed. I didn't really think much about the credit thing, but I would probably post their name in the forum topic I make every day or so shows new pictures on a newpics#.html, which I post on the forum for anybody who wants to see the new pictures and not every picture. Here is an example: (the pictures don't work anymore because I put them in picturearchive/archive/, but since I don't have any users who care about new pictures yet, it doesn't matter that much. I'm putting up a new link and a new newpics5.html soon) Taken from this forum topic.
-
Yea you're right. I was getting kind of lazy and dependent on you guys. Heh. I put the two php files together and the html forms as well. It work as far as I know. I will post the two up. uploadimage.html <font color="black"><form enctype="multipart/form-data" action="uploadandmailform.php" method="post" name="form1" id="form1"> <table align="center" cellpadding="5" cellspacing="5" border="0" width="60%" bgcolor=#D2B48C> <tr> <td align="left" valign="top"> <p>Select A File<br> </td> </tr> <tr> <td align="left" valign="top"> <p><input type="hidden" name="MAX_FILE_SIZE" value="2000000"> <input name="uploaded_file" type="file"> </td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> <span class="required">User Name:</span><br> <input type="text" name="user_name" size="35" maxlength="50" /> </td> </tr> <tr> <td align="left" valign="top"> <span class="required">Real Name:</span><br> <input type="text" name="real_name" size="35" maxlength="50" /> </td> </tr> <tr> <td align="left" valign="top"> <span class="required">Image Source:</span><br> <input type="text" name="image_source" size="35" maxlength="50" /> </td> </tr> <tr> <td align="left" valign="top"> <span class="required">Email:</span><br> <input type="text" name="email" size="35" maxlength="50" /><br><br> </td> </tr> <tr> <td align="left" valign="top"> <span class="notrequired">Tell us which one of the following you would like:</span> <br /> <input type="radio" name="category" onclick="updateTo('1');" />Please credit me for finding this picture.<br /> <input type="radio" name="category" onclick="updateTo('2');" />Please do not credit me for finding this picture.<br /> <input type="radio" name="category" onclick="updateTo('3');" />Please credit me for finding this picture only in the forums when the new pictures topic appears.<br /><br> <input type="hidden" name="request_category" value=" " /> </td> </tr> <tr> <td align="left" valign="top"> <input type="hidden" name="request_category" value=" " /> <span class="notrequired">Please give any additional information you think will be useful.</span><br /> <textarea name="request" rows="5" cols="38"></textarea><br><br> </td> </tr> <tr> <td align="left" valign="top"> </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> <input type="submit" name="Submit" value="Submit" /> </td> </tr> </p> </table></form></font> uploadandmailform.php ($_FILES['uploaded_file']['type'] == 'image/png') || ($_FILES['uploaded_file']['type'] == 'image/jpeg') || ($_FILES['uploaded_file']['type'] == 'image/jpg') || ($_FILES['uploaded_file']['type'] == 'image/pjpeg')) && ($_FILES['uploaded_file']['size'] < 2000000)) { if ($_FILES['uploaded_file']['error'] > 0) { echo "Error linenums:0'><?php if ((($_FILES['uploaded_file']['type'] == 'image/gif') || ($_FILES['uploaded_file']['type'] == 'image/png') || ($_FILES['uploaded_file']['type'] == 'image/jpeg') || ($_FILES['uploaded_file']['type'] == 'image/jpg') || ($_FILES['uploaded_file']['type'] == 'image/pjpeg')) && ($_FILES['uploaded_file']['size'] < 2000000)) {if ($_FILES['uploaded_file']['error'] > 0) { echo "Error: " . $_FILES['uploaded_file']['error'] . "<br>";} else { echo "Upload: " . $_FILES['uploaded_file']['name'] . "<br>"; echo "Type: " . $_FILES['uploaded_file']['type'] . "<br>"; echo "Size: " . ($_FILES['uploaded_file']['size'] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES['uploaded_file']['tmp_name'] . "<br><br>"; $target_path = "useruploads/"; $target_thumb_path = "useruploadstrue/"; if(!is_writable($target_path)) { die('Cannot be uploaded to the specified directory. Please change permission to 777.'); } if(!is_writable($target_thumb_path)) { die('Thumbnail cannot be created. Please change permission to 777.'); } $uploaded_file = $_FILES['uploaded_file']['tmp_name']; $src = imagecreatefromjpeg($uploaded_file); list($width, $height)=getimagesize($uploaded_file); $new_width = 150; $new_height = ($height/$width)*$new_width; $tmp = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($tmp, $src, 0, 0, 0, 0, $new_width, $new_height, $width, $height); $filename = $target_thumb_path . $_FILES['uploaded_file']['name']; imagejpeg($tmp, $filename, 100); imagedestroy($src); imagedestroy($tmp); $target_path = $target_path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target_path)) { echo "The file " . basename( $_FILES['uploaded_file']['name']) . " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; }} }$upload_name= $_POST['uploaded'];$user_name= $_POST['user_name']; $real_name= $_POST['real_name']; $image_source= $_POST['image_source']; $email= $_POST['email']; $category= $_POST['category']; $request_category= $_POST['request_category']; $request= $_POST['request']; $message= $_POST['message']; $body = " User Name: $user_name Real Name: $real_name Name of Image: " . basename( $_FILES['uploaded_file']['name']) . "Image Source: $image_source Email: $email Request Category: $request_category Additional Info: $request$message "; if (!isset($email) || !isset($user_name)) { header("Location: [url="http://forums.xisto.com/no_longer_exists/; "); } elseif (empty($email) || empty($user_name)) { header("Location: [url="http://forums.xisto.com/no_longer_exists/; "); } else { mail("admin_caron@loldmypants.com","From: loldmypants.com visitor",$body); header("Location: [url="http://forums.xisto.com/no_longer_exists/; "); } ?> Sorry that I made it long again.
-
Hi guys, I have pieced together two fine pieces of code but need to put these two puzzle pieces together correctly. So, this is my upload script: <form enctype="multipart/form-data" action="upload.php" method="POST"> <table align="left" cellpadding="5" cellspacing="5" border="0" width="100%" bgcolor=#FFFFFF> <tr> <td align="left" valign="top"> Select A File </td> <td align="left" valign="top"> <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> <input name="uploaded_file" type="file"> </td> </tr> <tr> <td align="left" valign="top"> </td> <td align="left" valign="top"> <input type="submit" value="Upload This File"> </td> </tr> </table></form> With upload.php being: ($_FILES['uploaded_file']['type'] == 'image/png') || ($_FILES['uploaded_file']['type'] == 'image/jpeg') || ($_FILES['uploaded_file']['type'] == 'image/jpg') || ($_FILES['uploaded_file']['type'] == 'image/pjpeg')) && ($_FILES['uploaded_file']['size'] < 2000000)) { if ($_FILES['uploaded_file']['error'] > 0) { echo "Error linenums:0'><?phpif ((($_FILES['uploaded_file']['type'] == 'image/gif') || ($_FILES['uploaded_file']['type'] == 'image/png') || ($_FILES['uploaded_file']['type'] == 'image/jpeg') || ($_FILES['uploaded_file']['type'] == 'image/jpg') || ($_FILES['uploaded_file']['type'] == 'image/pjpeg')) && ($_FILES['uploaded_file']['size'] < 2000000)) {if ($_FILES['uploaded_file']['error'] > 0) { echo "Error: " . $_FILES['uploaded_file']['error'] . "<br>";} else { echo "Upload: " . $_FILES['uploaded_file']['name'] . "<br>"; echo "Type: " . $_FILES['uploaded_file']['type'] . "<br>"; echo "Size: " . ($_FILES['uploaded_file']['size'] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES['uploaded_file']['tmp_name'] . "<br>"; $target_path = "useruploads/"; $target_thumb_path = "useruploadstrue/"; if(!is_writable($target_path)) { die('Cannot be uploaded to the specified directory. Please change permission to 777.'); } if(!is_writable($target_thumb_path)) { die('Thumbnail cannot be created. Please change permission to 777.'); } $uploaded_file = $_FILES['uploaded_file']['tmp_name']; $src = imagecreatefromjpeg($uploaded_file); list($width, $height)=getimagesize($uploaded_file); $new_width = 150; $new_height = ($height/$width)*$new_width; $tmp = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($tmp, $src, 0, 0, 0, 0, $new_width, $new_height, $width, $height); $filename = $target_thumb_path . $_FILES['uploaded_file']['name']; imagejpeg($tmp, $filename, 100); imagedestroy($src); imagedestroy($tmp); $target_path = $target_path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target_path)) { echo "The file " . basename( $_FILES['uploaded_file']['name']) . " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; }} }?> The second piece of the puzzle is my email form. This is the html part: <form action="mailform.php" method="post" name="form1" id="form1"><table width="450" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td background="styles/images/gif/clearpixel.gif" class="text"><p><span class="required">User Name:</span><br><input type="text" name="user_name" size="35" maxlength="50" /><br><br><span class="required">Real Name:</span><br /><input type="text" name="real_name" size="35" maxlength="50" /><br><br><span class="required">Image Source:</span><br /><input type="text" name="image_source" size="35" maxlength="75" /><br><br><span class="required">Email:</span><br /><input type="text" name="email" size="35" maxlength="100" /><br><br><span class="notrequired">Tell us which one of the followingyou would like:</span> <br /><input type="radio" name="category" onclick="updateTo('1');" />Please credit me for finding this picture.<br /><input type="radio" name="category" onclick="updateTo('2');" />Please do not credit me for finding this picture.<br /><input type="radio" name="category" onclick="updateTo('3');" />Please credit me for finding this picture only in the forums when the new pictures topic appears.<br /><br><input type="hidden" name="request_category" value=" " /><span class="notrequired">Please give any additional informationyou think will be useful.</span><br /><textarea name="request" rows="5" cols="38"></textarea><br><br><input type="submit" name="Submit" value="Submit" /></p></td></tr></table></form> And this is my mailform.php: $user_name= $_POST['user_name']; $real_name= $_POST['real_name']; $image_source= $_POST['image_source']; $email= $_POST['email']; $category= $_POST['category']; $request_category= $_POST['request_category']; $request= $_POST['request']; $message= $_POST['message']; $body = " User Name linenums:0'><?php $upload_name= $_POST['uploaded'];$user_name= $_POST['user_name']; $real_name= $_POST['real_name']; $image_source= $_POST['image_source']; $email= $_POST['email']; $category= $_POST['category']; $request_category= $_POST['request_category']; $request= $_POST['request']; $message= $_POST['message']; $body = " User Name: $user_name Real Name: $real_name Name of Image: $upload_nameImage Source: $image_source Email: $email Request Category: $request_category Additional Info: $request$message "; if (!isset($email) || !isset($user_name)) { header("Location: [url="http://forums.xisto.com/no_longer_exists/; "); } elseif (empty($email) || empty($user_name)) { header("Location: [url="http://forums.xisto.com/no_longer_exists/; "); } else { mail("admin_caron@loldmypants.com","From: loldmypants.com visitor",$body); header("Location: [url="http://forums.xisto.com/no_longer_exists/; "); } ?> What I would like to do is to put the two php files into one and the two forms into one. I would also like to have the name or full url of the uploaded image to be called by $upload_name and to be displayed in the $body of the email that will be sent. If you want to help, please do. Thanks
-
It works!!! Thank you, thank you, thank you.Also, is there any way to make the width about 600 pixels and to calculate a new height to keep the aspect ratio the same?For example something like this: list($width, $height)=getimagesize($uploaded_file) $new_width = 600; $new_height = ($height/$width)*$new_width; $tmp = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($tmp, $src, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
-
I changed everything as you said, but now I'm getting this error:Warning: readdir(): supplied argument is not a valid Directory resource in /home/caronthegerman/loldmypants.com/picturearchive/randomizer.php on line 107Warning: closedir(): supplied argument is not a valid Directory resource in /home/caronthegerman/loldmypants.com/picturearchive/randomizer.php on line 113I uploaded randomizer.php as an attachment.