vex

Web Development • vexiphne@gmail.com

Im kat, 27 years of age, a tinkerer at heart, and obsessed with all things art and computers.

  • Press Enter to submit and Shift+Enter to add a line
  • LostEagle
  • vex
  • StoryoftheRealms

    StoryoftheRealms

    Uhhhhh
    Okay, I'm doing the file uploading thing, and it works dandy. Except I want to limit the file to: .rar, .zip, .mp3, .wav, .ogg, .avi, .mov, .wma, .mpeg, .mpeg4, .divx, .jpg, .png, .gif, .bmp
    Would I have to use: $_FILES['file']['type'] == "image/jpg"; etc. on all of those in a if else statement?

    Jan 30th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      Or could I split the file extension from it (since I am renaming the filenames to random names) and use that to check it? (which way would be better?)

      Jan 30th, 2008 Reply
    • vex

      vex

      you need to check the mimetype. anyone can fake a file extension

      Jan 30th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      Okay, I'll switch my searching to that.

      Jan 30th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      Actually now that I am looking at it, wouldn't the code work either way. Because using: $_FILES way the browser needs to know the extension, where as using my method of extracting the extension then putting it up against the limiters, then not accepting it would make sure that the extension couldn't be made entirely?

      Or am I COMPLETELY and UTTERLY wrong in this situation?

      Jan 30th, 2008 Reply
    • vex

      vex

      /sigh

      i have a image.exe , i rename it to image.jpg

      you split the name looking for ".jpg", my EXE FILE gets by because it is renamed.

      you HAVE to use mimetype if you're only allowing specific filetypes.

      Jan 30th, 2008 Reply
    • vex
    • StoryoftheRealms

      StoryoftheRealms

      Oh OKAY! Except a .exe file wouldnt be executable as a .jpg, but a virus would. SO NEVER MIND! I seen the mime type before, didnt need a link to it LOL, was just wondering if my method could work.

      I owe you more money... GOD DAMN THE WORLD! (Gotta only ask when I absolutely need it now... I shall prevail)

      Jan 30th, 2008 Reply
    • vex

      vex

      here's another link, seems the other function is being deprecated

      http://www.php.net/manual/en/function.finfo-file.php

      Jan 30th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      Yeah, UHHH, the other function seems to be in use alot more. Dreamweaver doesn't even know that the heck kinda function that is, neither does my server know what: finfo_open is. Must be a newer PHP version or something?

      Jan 30th, 2008 Reply
    • vex

      vex

      use whatever works then ;)

      Jan 30th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      Figured out whats missing. PECL, its an extension addon for PHP. I asked my webhost if they add it, or if I do.

      Thanks for the HELP! Again

      Jan 30th, 2008 Reply
    • vex

      vex

      you should sign up to pownce.com (my page is pownce.com/vexiphne) and message me there. Shadowness is starting to spam me emails even when you don't comment.

      Jan 31st, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      OKAY! (begins typeing more and more and more things)

      Jan 31st, 2008 Reply
  • StoryoftheRealms

    StoryoftheRealms

    It seems theres alot of spam joining Shadowness now. Wonder if Meng knows, because most of it is being posted on his account. (7shadows)

    Also I asked Meng awhile ago where you get the info. code to get info. from pictures, and I went to check but I couldn't find your reply?
    (just need link something in the PHP website)

    Jan 29th, 2008 Reply
    • vex

      vex

      no, meng doesn't know. he hasn't been on the site in almost a month.

      and huh?

      I emailed you my paypal btw.

      Jan 29th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      I knwo I sent the money. Hope it went to the right person LOL.

      What I am talking about is the text on the side of images that tells you what camera took the picture etc. (You gave me a link on Meng's page when I asked him)

      Also where is Meng? He's the soul of Shadowness.

      Jan 29th, 2008 Reply
    • vex

      vex

      dunno where he is ;) do a search for php EXIF data.

      and yep i got the $ - thank you very much ;)

      Jan 30th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      No problemo!

      Hmmm we shall team up and find him. I'll start by spamming his email with porn... I mean.... UHHHH

      THANKS for the EXIF data, thats what it was!

      Jan 30th, 2008 Reply
  • vex

    vex

    -has carpal tunnel from Guitar Hero 3

    Jan 19th, 2008 Reply
  • Tricks

    Tricks

    // ----> Hacking Database Starting <---

    XD

    http://www.freelancetipster.com/hourlyrate/ <--- you should check this out ;)

    // -----> Stop Hack <----

    Jan 18th, 2008 Reply Staff :D need help? PM me
  • StoryoftheRealms

    StoryoftheRealms

    Hey vex I'll be on IRC in the morning (7-9hrs from now) Can you meet me there? Just need a question on how to use mysql_num_rows to add the amount of rows together then echo it. Unless you can answer it here?

    Jan 17th, 2008 Reply
    • vex

      vex

      echo mysql_num_rows($result);

      Jan 17th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      well ya I know that. I mean I have 2 different tables. I need both of their info. from mysql_num_rows to be added together.

      Jan 17th, 2008 Reply
    • vex

      vex

      echo mysql_num_rows($result1) + mysql_num_rows($result2);

      Jan 17th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      $username = $_SESSION["username"];
      $idsql = mysql_query("SELECT ID FROM Accounts WHERE Username='$username'");
      $id = mysql_result($idsql,0);
      $dissql = mysql_query("SELECT ID FROM DevComments WHERE UserIDto='$id' AND Read='No' AND Part='comic'");
      $updsql = mysql_query("SELECT ID FROM DevUpdates WHERE UserIDto='$id' AND Read='No' AND Part='comic'");

      Whys that not working??
      It says my mysql_num_rows are invalid.

      ??? any help?

      Jan 17th, 2008 Reply
    • vex

      vex

      well if your myqlnumrows are invalid its because your query has an error in it. try plugging it into phpmyadmin or echo mysql_error to find out why

      Jan 18th, 2008 Reply
    • StoryoftheRealms

      StoryoftheRealms

      WELL that was dumb. I use the phpmyadmin to check it, and what I got was:
      SELECT `ID` FROM `DevUpdates` WHERE `UserIDto`='$id' AND `Read`='No' AND `Part`='comic'

      So I tried it with the ``'s and waddya know it works... WEIRD

      Jan 18th, 2008 Reply
    • vex

      vex

      good! (......... post paddng ----------- )

      Jan 18th, 2008 Reply
  • StoryoftheRealms

    StoryoftheRealms

    Heya vex,

    Okay, now that I am done 1 of the 3 website I am making for my own websites, I need 3 things, one of them probably just needs a link to a resource on how to do it.. Okay here it goes:

    1. Uploading media/duplicating files for directories. How do I do this exactly? (this one is the one where I can probably do with a resource)

    2. Regarding the duplicating files, once the files are duplicated how can you make it so the php edits the file contents (ex. your making multiple pages but one line of code needs to be changed so that it grabs from a different area?)

    3. Okay, this one is probably easiest then all of these. Okay that mysql_fetch_array, it puts them into a list. How could I make it so that every 2nd one is a different color etc.? Kinda like on the eye (on shadowness) how one is black and one is grey then the next is black etc.


    Any help with these, even if its just a resource or something would be appreciated. Other then these I can't think of anything else that I would need besides how to render html within a text box to create a WYSIWYQ editor but that can wait for now.

    ALSO, since your EXTREMELY helpful, I will put anything on my website (links to your website, or even comments in CSS/PHP/HTML) as long as its okay. LOL no pr0n.

    So thats all, THANK YOU VERY MUCH!

    Jan 10th, 2008 Reply
  • StoryoftheRealms

    StoryoftheRealms

    WOW 11 days that amazing LOL. ANYWAYS quick question regarding the array thing.
    Okay for the links I am using say there were off the site (like a external site) now based off your code it doesnt seem to work.

    while ($link = mysql_fetch_array($linkresult)) { echo "<a href="".$link['url'].">".$link['name']."</a><br />"; }
    (thats urs) I made it work somewhat (had to fix a few things) but for a website external it doesnt work.


    while ($link = mysql_fetch_array($comics)) { echo '<li><a href="http:"'.$link['ComicLink'].'>'.$link['ComicName'].'</a></li>';

    I tried that but it doesnt work either. not a thing happens. Any clues?

    Dec 30th, 2007 Reply
    • vex

      vex

      i need to know what your query looks like, as well as what is echoed when you do $link['ComicName']

      Dec 30th, 2007 Reply
    • StoryoftheRealms

      StoryoftheRealms

      $comics = mysql_query("SELECT * FROM WebComics WHERE ID>'6'");

      Thats my query. Reason its >6 is because the 1-6 are reserved for other things.

      just realized that the code didn't paste properly.
      go here: http://www.storyoftherealms.com/query

      The html codes in what I pasted came up as links.

      Dec 30th, 2007 Reply
    • vex

      vex

      what does your table look like ?

      what's your error ?

      Dec 30th, 2007 Reply
    • StoryoftheRealms

      StoryoftheRealms

      It doesnt give me any errors whatsoever. LOL I just want it to link to my main page/different page on my website because unfortunately when you use it it can only link to pages that are in your folder.

      Dec 30th, 2007 Reply
    • vex

      vex

      ok wait, what are you trying to do ?

      Dec 31st, 2007 Reply
    • StoryoftheRealms

      StoryoftheRealms

      Well I am just echoing comics which are based in different folders, not on the main page. That I can do easily, its just if a member comes and links it to his OWN site, it doesnt work.

      Dec 31st, 2007 Reply
    • vex

      vex

      im still not sure what you're doing. you want to echo a bunch of links from your db onto your website, but it changes based on the page you're looking at?

      Jan 1st, 2008 Reply
    • vex

      vex

      Im on IRC btw

      Jan 1st, 2008 Reply
  • StoryoftheRealms

    StoryoftheRealms

    hey Vex just wondering: could you point me to a link or something that would show how to embed images into a php email?

    Dec 18th, 2007 Reply