
531joshua
Members-
Posts
629 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Everything posted by 531joshua
-
I'm not sure if this is what you mean, but here's one way you could do it using PHP: <?php // If no image number is specified get the default, first image if (empty($_GET['img'])) { echo ' <table width="935" border="0" cellspacing="10" cellpadding="10"> <tr> <td width="565" rowspan="4"><img src="full_img_1.jpg" width="565" height="1270px" /></td> <td width="300"><a href="example.php"><img src="thumb_1.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=2"><img src="thumb_2.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=3"><img src="thumb_3.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=4"><img src="thumb_4.jpg" width="300px" height="300px" /></a></td> </tr> </table> '; } // Image two elseif ($_GET['img'] == "2") { echo ' <table width="935" border="0" cellspacing="10" cellpadding="10"> <tr> <td width="565" rowspan="4"><img src="full_img_2.jpg" width="565" height="1270px" /></td> <td width="300"><a href="example.php"><img src="thumb_1.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=2"><img src="thumb_2.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=3"><img src="thumb_3.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=4"><img src="thumb_4.jpg" width="300px" height="300px" /></a></td> </tr> </table> '; } // Image three elseif ($_GET['img'] == "3") { echo ' <table width="935" border="0" cellspacing="10" cellpadding="10"> <tr> <td width="565" rowspan="4"><img src="full_img_3.jpg" width="565" height="1270px" /></td> <td width="300"><a href="example.php"><img src="thumb_1.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=2"><img src="thumb_2.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=3"><img src="thumb_3.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=4"><img src="thumb_4.jpg" width="300px" height="300px" /></a></td> </tr> </table> '; } // Image four elseif ($_GET['img'] == "4") { echo ' <table width="935" border="0" cellspacing="10" cellpadding="10"> <tr> <td width="565" rowspan="4"><img src="full_img_4.jpg" width="565" height="1270px" /></td> <td width="300"><a href="example.php"><img src="thumb_1.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=2"><img src="thumb_2.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=3"><img src="thumb_3.jpg" width="300px" height="300px" /></a></td> </tr> <tr> <td><a href="?img=4"><img src="thumb_4.jpg" width="300px" height="300px" /></a></td> </tr> </table> '; } ?> Really quickly put together, so it isn't very good, but you get the idea. You could make a image management console or something, using databases to store specific data along with uploaded images, and secure areas to manage the files etc.
-
Great site you've got there Only thing I can really say bothers me a bit, is as tom said: Other than that, it's awesome.
-
Awesome video. Vast improvement since your 1st one, well done
-
I think I've found a bit of a bugger with the TrialsTube swf upload script... I got a raw JPEG image file, changed the mime type to .mpeg, filled in all the form fields, hit the submit button, and it returned the following: I know it's not bad, obviously because it isn't letting me upload the file, however, just for visual improvement and what not, maybe have the forum template, just telling the user the file they sent was invalid or something. Looks kinda messy with all the PHP error stuff IMO.
-
So basically, it doesn't use PHP to check the file type, only PHP to upload and convert the file?
-
I did a Triumph Spitfire 1500 MK1. Found it great, was the first car I had done aswell. Really simple, as in you can "get to" the components pretty easy and most of the parts are cheap to buy. And my favourite part of buying the car... it's British! Also fairly cheap to insure, and great fun on a open country road.
-
Good old card, 2 quid, can't go wrong
-
I changed the permissions of '/uploads/' to 777 and still got the same error. I don't like .mp4 files much EDIT: On TrialsTube, I noticed you've made it so that when the user browses for files, it doesn't allow "All files" to be selected, only the types you specify, and you can't type into the file field, so to enter C:\badfile.bad or whatever. Is this how you've limited file types, or is it just an extra? And how've you done it... just flash or javascript or something?
-
Yeah the root is correct. And I'll change the permissions thing of uploads, see how that does. Thanks again EDIT: About the username thing, in the root dir, hasn't my host just used "sites", rather than /home/users/yourname/public/blahh or whatever? Might be wrong.
-
Righto, I've tried something, not sure if I've done it right, but anyway... I get this error: <pre>Possible file upload attack! Here is some more debugging info:Array ( )</pre> Here's the script I've used: <?php // Process form stuff if($_GET['form']=="sent") { // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/home/sites/bikearea.co.uk/uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; } // Display the form else { echo ' <form action="index.php?form=sent" method="post" enctype="multipart/form-data"> <input type="file" name="userfile" id="userfile" /> <input type="submit" /> </form> '; } ?> I think it's because I'm grabbing the $_FILES array before it's actually uploaded? I'm not quite sure, as I've moved the uploaded file before I display the file array so... The php upload bit if from php.net if you wondered. And I've used one of the .mp4 files for this, the type I was getting problems with before hand. Any ideas?
-
Haha, nah I don't, it's not my server, I'm just on shared hosting, and trying to improve my PHP knowledge by doing little things like that bike upload crap. Infact, you'll be lucky if you can download 5 videos before it goes over the limit ha. I would get my own server, well I want one 'cos I wanna learn about ffmpeg stuff, and you need your own server with it on to use it I believe. Servers are outa my budget though, so it's shared or local for now. Ahh right. I have always thought checking via mime type was quite secure, but oh well. Thanks for the info
-
Yeah, I'll have a mess about and see what I can do. Thanks for all the replies, much appreciated
-
Hmm, well I've tried the thing you suggested, and it works. I'm still a little unsure how to restrict the upload though, unless I make ftp accounts every time someone made an account (I think it can be done automatically through PHP but I'm not keen on doing it).
-
Ah I see. Anyway, the way which you did it, still didn't give me anything but a blank page. I've tried echoing the $_FILES['file']['name'] to see if that works, and I've had no luck. So it's as if my server just doesn't recognise the file or something, or my version of PHP doesn't recognise it. Thanks for the replies So... upload the file via ftp to my server not in public though. List files in that directory using dir() or something, hyperlink em, so upon click of the hyperlink, it displays the file type and name?
-
Ah right, yeah I've tested it with other files. I uploaded a .mpeg file, worked fine. I'll try that code you posted up, thanks Btw, what else could be used apart from mime types, to limit what file types can be uploaded?
-
Yeah, PHP is installed on the server I use. And I'm not sure if it works on other extension... if it does, then my server needs an upgrade to PHP 5, or whatever PHP version supports that file, if one does at all. How would I test if another extension recognises it? You couldn't do one of those amazing rails scripts for me could you Danny please? Unless I try a simple upload form and output with javascript or something. Thanks for the replies, Josh. EDIT - Btw Danny, the BB-code for the 'code' quotes changes <br /> to a break on the page, rather than displaying the HTML. I think it would be better if it displayed the code, saying as it's designed to display raw code anyway
-
Hi there. I've just put together a php script for uploading a file to a web server. I've set it so it accepts certain file types (mime file type) and if the file isn't that type, it returns an error. Anyway, I've set one of the file types to be accepted as .mp4 video files. I get an error when I try to upload though, so I tried testing the file type. I made a script that echoed the files type as below: <?php // Form sent if ($_GET['page'] == "sent") { $file = $_FILES['file']['type']; echo $file; } // Form else { echo " <form action='?page=sent' method='post'> File: <input type='file' name='file' id='file' /> <input type='submit' /> </form> "; } ?> The problem I'm having is, when I use a .mp4 video file, it just doesn't echo anything, just blank. I think it'll be something to do with php not recognising that file type, but I'm really unsure. Anyone got any ideas? Regards, Josh. EDIT - sorry I posted twice, wasn't loading so I refreshed and it posted twice.
-
You code this yourself? ... or is it just a plugin thing for IPB? Nice work.
-
Anyone know what the 1st song off that video is called? Artist and song name prefferably. Any help much appreciated, Thanks.
-
I think Apple have limited themselves some what by making this iPhone limited to the o2 network. From my point of view, o2 isn't the best of networks. I also think the main reason for expense is that Apple are a Niche company, they produce a unique product totally different from the others. Also the fact that it's only on o2 aswell.
-
Super Bad. 10 / 10. Best film I've seen in a good while.
-
Once I had a dream about a porn site I had been on that very night. Pretty sure I talked abit whilst dreaming, pretty sure my parents heard it aswell
-
Great phone. Bit slow as has been said, but it's full of top stuff. Only thing that pushed me away was how common it was, but I got one
-
I can't be bothered to google it... I take it it's an 18?