Jump to content

Azercii

Members
  • Posts

    45
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    United Kingdom
  • Age
    22

Azercii's Achievements

Member

Member (2/5)

0

Reputation

  1. I can't seem to find tutorials that are actually secure, I really would like to learn how to secure uploads properly and the best way to go about it. With naming the file, would it be better to combine it with the users ID? Not sure if it can be done like this, but maybe: 07-mynewsetup.jpg.
  2. Currently have no speakers plugged in, thought the captions would help but I couldn't have been more wrong aha Part of me wants to leave it as is, as I know they can't upload anything but an image file (no .txt, .html, .php, .js, etc) which for the standard user is fine. I need to work out how to do moderation of files via an admin panel, so that anything that isn't an image, or is deemed unsuitable, can be removed before being shown via the gallery. Problem is, if that one smart-*** does come along and bypasses it, I have no one to blame but myself.
  3. I'm not amazing with PhP, so excuse me if it looks terrible xD I've taken tutorials, edited them to fit my wanting and tried it out, it seems to deny anything other than an image type, but could it be abused? <div id="image-upload"> <h2>Upload your image</h2> <form action="upload.php" method="post" enctype="multipart/form-data"> Upload:<br><br> <input type="file" name="image"><br><br> Image Title:<br><br> <input type="text" name="image_title"><br><br> <input type="submit" name="submit" value="Upload"> </form> <?php include("upload_file.php"); function GetImageExtension($imagetype) { if(empty($imagetype)) return false; switch($imagetype) { case 'image/bmp': return '.bmp'; case 'image/jpeg': return '.jpg'; case 'image/png': return '.png'; default: return false; } } if ($_FILES['image']['error'] !== UPLOAD_ERR_OK) { die(); } $extension = getimagesize($_FILES['image']['tmp_name']); if ($extension === FALSE) { die("<br><font color='#8B0000'>Unable to determine image typeof uploaded file</font>"); } if (($extension[2] !== IMAGETYPE_GIF) && ($extension[2] !== IMAGETYPE_JPEG) && ($extension[2] !== IMAGETYPE_PNG)) { die("<br><font color='#8B0000'>Only images are allowed!</font>"); } if (!empty($_FILES["image"]["name"])) { $file_name=$_FILES["image"]["name"]; $temp_name=$_FILES["image"]["tmp_name"]; $imgtype=$_FILES["image"]["type"]; $ext= GetImageExtension($imgtype); $imagename=$_FILES["image"]["name"]; $target_path = "../../images/upload/".$imagename; $title = $_POST["image_title"]; if(move_uploaded_file($temp_name, $target_path)) { $query_upload="INSERT into `images_tbl` (`images_path`,`submission_date`,`image_title`) VALUES ('".$target_path."','".date("Y-m-d")."','".$title."')"; mysql_query($query_upload) or die("error in $query_upload == ----> ".mysql_error()); echo '<br>Image uploaded!'; }else{ echo '<br><font color="#8B0000">Only images are allowed!</font>'; } } ?>
  4. Okay, I figured it was repeating the call (the original code wouldn't show without 4 <img src> lines, now removed 3) Now to get them to display in a line
  5. I'm having a really hard time getting my carousel to display in a line when I call my images from the table: <div id="user-gallery"> <h2>Recent Images</h2> <button class="prev"><<</button> <button class="next">>></button> <?php include("file/image/upload_file.php"); $select_query = "SELECT `images_path` FROM `images_tbl` ORDER by `images_id` DESC LIMIT 9"; $sql = mysql_query($select_query) or die(mysql_error()); while($row = mysql_fetch_array($sql,MYSQL_BOTH)){ ?> <div class="anyClass"> <ul> <li><img src="<?php echo $row["images_path"]; ?>" alt="" width="125" height="70" ></li> <li><img src="<?php echo $row["images_path"]; ?>" alt="" width="125" height="70" ></li> <li><img src="<?php echo $row["images_path"]; ?>" alt="" width="125" height="70" ></li> <li><img src="<?php echo $row["images_path"]; ?>" alt="" width="125" height="70"></li> </ul> </div> <?php } ?> </div> Without the carousel it will display perfectly, but as soon as I implement it, the images won't behave normal :/
  6. I have tested it myself on several handheld devices and all seems well, but it all depends on the user and how they feel about scrolling and zooming. I'll probably look at responsive in the future if, like you said, there is a lot of mobile traffic. I'll learn while I'm going though, just so I'm ready for when I do go ahead with it
  7. Little topic that's gonna bug me if I don't ask I'm trying to learn static layouts, and I'm just getting the hang of them. A few friends are telling me to go responsive to accommodate mobile/tablet users? I can see it from a business sites perspective where you want all types of users and with ease of access, but my site is going to be a gaming modification community, where mobile users aren't really the target audience as it's quicker and easier to download them on the PC than a Phone. I was going to accommodate that audience by allowing them very basic usage (chat, forums, account) and leave off the heavy parts like the gallery, and downloads. Am I going in the wrong direction? Should I be heading down the responsive route? I've literally only just started the first page for the site, but it'd mean re-learning a whole bunch more new stuff which'd prolong the sites progress. Just looking for a little advice in which direction to head
  8. Looks like it's back to the drawing board then? I can understand a little PhP, but I can't understand how to do things with user forms. I'm not sure how to put it without sounding ridiculous lol if you gave me a login script and said "I want you to use this on your site, change what's needed and echo out any information for the user", I'd know how it functioned and where errors lie, where to change and what not to touch etc. But if I were to create my own, I wouldn't even know where to begin Do you have any sites that you can recommend that would help me along that path?
  9. After getting my site hacked, I'm not really up for learning PhP, so I'm trying to use uMScript. On the demo site, and when I just load up the files on my server, it will redirect upon log in. But when I then use my styling, for some reason the login_submit.php gives me a blank page and does not redirect, nor does it log the user in. I don't change anything except the positioning of the forum and the container around it, no PhP or JS changes, weird? I can not seem to get a hold of the creator, nor can I find a user script that matches what I'm looking for. Heck, I'm so close to going mad, I'm even willing to pay someone to do the user PhP for me haha Has anyone used this script successfully? You can try it out here: http://mod-universe.com/index.php Demo: http://www.venturehapa.biz/umscript/demo/index.php (I couldn't get the demo credentials to log in, created a new user = Okriani, kieran09)
  10. You'd use css input[type="submit"] { background: url(location here); border: 0; width: 180px; height: 30px; }
  11. In HTML 5 you can use <col> tag to style the width of each column. <col style="width:35%"> <col style="width:40%"> <col style="width:25%"> Place it under your <table> tag. They all need to total 100%, so as you have 10 columns, that would make each <col> 10% width. For tidier code, I would go with the css route; CSS: table { table-layout: fixed; width: 250%; } HTML: <table cellspacing="1" border="1" BGCOLOR="white"> <tr> <th>Week #</th> <th>18</th> <th>19</th> <th>20</th> <th>21</th> <th>22</th> <th>23</th> <th>24</th> <th>25</th> <th>26</th> </tr> <tr> <td>Visits</td> <td>300</td><td>346</td><td>266</td><td>216</td><td>339</td><td>288</td><td>231</td><td>213</td><td></td></tr> <tr> <td>From</td> <td>28/04/2014</td><td>05/05/2014</td><td>12/05/2014</td><td>19/05/2014</td><td>26/05/2014</td><td>02/06/2014</td><td>09/06/2014</td><td>16/06/2014</td><td>23/06/2014</td> </tr> <tr> <td>To</td> <td>04/05/2014</td><td>11/05/2014</td><td>18/05/2014</td><td>25/05/2014</td><td>01/06/2014</td><td>08/06/2014</td><td>15/06/2014</td><td>22/06/2014</td><td>29/06/2014</td> </tr> <tr> <td>USA</td><td>161</td><td>158</td><td>148</td><td>79</td><td>132</td><td>105</td><td>81</td><td>70</td><td></td> etc......... </table> UPDATE: http://jsfiddle.net/Hhg2x/ I know you've solved this, just thought I'd chime in and add a further suggestion in case others find the thread
  12. I know to sort the upload first just wanted to make sure going with the server route will get the result I'm looking for Host/server includes GD library
  13. I'm gonna need to read up some more on this before it's even usable lol Just to make sure I am heading in the right direction; I want a user to upload his/her image, the gallery then grabs the most recent and displays them in descending order. By adding $title to the database, would I be able to display a caption overlay on the img with the users inputted information?
  14. I come out with 1 of 3 things; 4 of one image 4 of the error loading image Boolean error Would uploading to the server and adding the file path, name, and desc to the database be any easier to work with?
  15. bump Anyone wanna break this down for me? Not asking for final code, just a helping hand to better understand
×
×
  • 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.