Jump to content

dannyb785

Members
  • Posts

    544
  • Joined

  • Last visited

Posts posted by dannyb785

  1. when you move an uploaded file to a folder, you start with the folder name, not a "/" and you dont need any document root stuff. so go from:

     

    $upfile = $_SERVER['DOCUMENT_ROOT'].'/images/'.$_FILES['image']['name'];
    

     

    to

     

    $upfile = 'images/'.$_FILES['image']['name'];
    

     

    This is bc the move_uploaded_file moves relative to the current position. So if you root folder is public_html and you have the upload script there, you can't do "move uploaded file to 'public_html/images/image.jpg' " because there is no folder called public_html in your public_html folder.(if that made sense)

  2. these all look like basic templates that you can buy on ebay 100 for $5...nothing really special...my advice:  dont spend much money on a template...they are cheap as chips.

     

     

    if someone can't afford a couple hundred bucks for a nice design(a custom design), there's nothing wrong with getting a nice $50 template from one of a bunch of sites(4templates and templatemonster are 2 favs). They look really nice(most anyways) plus you can get commission for a purchase if you refer someone.

     

    I'd just recommend staying away from free templates... those usually suck

  3. Any user can repeatedly submit a form if they know what they're doing. All they gotta do is revisit the page that processing was done on. What I'd suggest is before doing an insert, do a query searching for a row with all of the inputted credentials that are exactly the same. If you get a mysql_num_rows() > 0 then you can know if was refreshed and then skip the INSERT query. That's really the only way to protect refreshing from inserting multiple times.

  4. when a user uploads an image, are you giving that image the same name as the uploaded one? like, if I upload main.jpg is that what you're calling it? If so, I recommend renaming it something with a unique name(like the username plus the timestamp or the image's id in the database).

     

    Otherwise, are you filtering the images before uploading? Perhaps you're doing htmlentities() and it's changing the & into something else(I think it's & but not exactly sure). If that's what you're doing, I'd still suggest my first suggestion

  5. If you want to override one style with another, the one that will be overriding needs to be explicitly stated in css form within the element.

     

    So in your case, take away the width= and put 'style="width:33%" ' though I can't promise you'll get the results you're looking for, this is the way to override something you've previously declared

  6. In any event, you are asking for someone to provide the whole ball of wax. If you want that, then you should post in the freelancing forum and perhaps someone would be willing to do it for compensation.

     

    I'm pretty sure all he typed was:

    I'm assuming this requires JavaScript, but maybe it is something else or a combination of things.  Can someone provide any guidance or point to examples on either or both of these?

     

    doesn't seem to me like he's asking for any code at all.

     

    Here's my input. Do you use firefox? If not get it. If so, download the stumble application. And stumble things web programming-related. I had a bunch bookmarked, but lost the bookmarks(dont ask) but I remember stumbling across tons of ajax websites that give you code for tons of different methods, one of which being the auto-complete facebook-esque thing you're looking for.

  7. What would be the point of spoofing an ip for an http transaction? For example, if I were able to make a request originating from, let's say, 192.168.1.1, I'll NEVER get the response. Pointless!

     

    Also, why two or three digits? Surely, some public address out there has single digits in an octet. What are you trying to accomplish with the redirect?

     

     

     

    Why are you asking my why I want to do this? I have my reasons. If you don't have an answer, why even post?

     

    edit: you did have a point with single digits. I adjusted my validator to allow single digits in the ip.

  8. Ok, so I have my client's site setup so that if the ip you are showing(whether spoofed or not) doesn't fit proper ip pattern(4 separate numbers either 2 or 3 digits separated by periods), it will redirect you somewhere else. My question is, since anyone can spoof their ip to be any of millions of ips that fit the pattern, is there a way I can check that the ip the user is giving me is a valid ip(that pertains to a valid computer). Because if I did an ip lookup of 111.111.11.11 I'm positive it'd give me no results.

     

    So I'd like a way to check that the ip I am being shown is the real ip for a real computer and not just made up to fit the pattern

  9. ohhhhh...

     

     

    well how about keeping all my folders set to 777 permissions then I get a call from paypal saying my server space has been used for phishing scams. I didn't get in troble, but my hosting company shut down my server temporarily til all files were removed.

  10. Hi, I have 2 main questions...

     

    Firstly, since I have my mysql username and password(and all connection info) in a .php file, I know it can't be read if accessed, so does that make it completely safe from anyone being able to read it and get the information?

     

    Secondly, even if someone did have my login info for the database, would they really be able to use my database on their server? Because I connect thru 'localhost' which I've seen is the same for other hosts, so I imagine that 'localhost' on another server couldn't possibly connect to my server. Or am I wrong in that assumption?

     

    Lastly, I'm sure most of you guys's ftp directories go like "root -> public_html -> files visible by all" so that if I have a file in public_html, anyone can access it. But what if I put it in the root folder, and then was to access the file by doing "../file.php" with an include. Would it work correctly, and if so, would that prevent others from being able to view it?

     

    Basically, in summary, what the absolute best, safest way to protect my database connection information?

×
×
  • 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.