
Floydian
Members-
Posts
900 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Floydian
-
Re: Dropdown box. Cool, good luck with it. Let us know how it goes ;)
-
Re: New Login pg. Whilst the fact that it doesn't bother you is anecdotal evidence for your position Wickidnezz, that doesn't necessarily mean that everyone who has the same exact connect speed you do will see things exactly the way you do. Flash will cut down on potential customers. Clearly, there are tons of sites out there that do use flash though. And that's what I would use to bolster a position in favor of using flash, if I were to take up that position. ;) There is a trade off though in using flash, so anyways, there you go.
-
Re: Help with DB Class. You've made it clear you have something against me codestryke. Point taken, you can resume your regularly scheduled programming now ;) Don't worry, I'll still be nice to you
-
Re: Dropdown box. I think I got ya. When you get your list of items, something like select * from items add in something like select * from items where itm_type = xxx You will need to know the id number for the specific item type you want though. your items will each contain the number for the item type they are associated with or you can look in the item types table and pull the id for the item type there.
-
Re: Strange thing!!! Try this: <form style="display: inline"> // ...... </form> With that, your form will not start on a new line.
-
Re: Help with DB Class. Horrible programming techniques can run super fast, but doesn't mean they aren't horrible. I.e., horrible and fast are not mutually exclusive. PHP and mysql can do a lot of things in under a second. A friend of mine was running a loop a million times in a test that came in in like the hundredth/thousandths of a second. His million iteration test however was demonstrative of a better technique and an okay technique. The speed for both was close. Nothing to make any decisions upon really. So fast code does not mean good code ;) It's kind of like sex, if you think about it :O
-
Re: Dropdown box. that sounds like a HTML Select Element. <form method="post" action="TheSiteYouWantToSendThemTo"> <select name="someName"> <option value="itemId">Some Item Name</option> <option value="itemId">Some Item Name</option> <option value="itemId">Some Item Name</option> <option value="itemId">Some Item Name</option> </select> <input type="submit" value="Submit"> </form>
-
Re: Help with DB Class. Nyna, my reference to smarty was to illustrate the absurdity of what killah is trying to do by suggesting he do something even more absurd. Killah, we could tell you how to do what you're doing, but why would we tell you how to do something that is completely the wrong way to do it? If you want to do something as assinine as what you're doing when the ENTIRE CE COMMUNITY is telling you it's a bad idea, then figure it out yourself, or try smarty like I said. It does have fantastic text replacement features. ;)
-
Re: Help with DB Class. The %'s in a name like that wouldn't pose a problem with a simple = deal in a query. Where you can get into trouble is when you use like in the query. Naturally, one shouldn't be allowing anything but letters, numbers, underscores, and spaces in names IMHO. sprintf is not a means of securing anything. It is a function that formats a string. It's how you format a string that gives you security or weaknesses. It's that way with anything. Using encryption doesn't mean your data is secure if you leave the key in the open.... or use something simple like "key" for your key lol
-
Re: Help with DB Class. Try using smarty ;) It has a great text replacement feature. http://www.smarty.net/
-
Re: Help with DB Class. Is it possible you're making a mountain out of a molehill? A query string is just a string. Why go through permutations a contortionist would have have trouble with just to make a query string? It's my opinion that adding all that extra stuff could even make your code less secure. All that replacing, if you don't understand 110% what is going on, could come back to bite you in the rear. I would suggest making methods in your db class that validate and cleanse one thing at a time. Have something for strings that allow html, strings with no html, integers with no negatives, integers with negatives, and so on. Cleanse the individual variables that are user submitted. You might even cleans some variables with values that are set by the script if needed. Then just make a query string on the fly either by concatenating or using sprintf.
-
Re: InnoDB or MyISAM lol
-
Re: Member-list That would return 25 records starting from the 25th position, i.e., page 2
-
Re: Member-list Pagination is the name most people give that sort of thing. It doesn't necessarily require a loop per say. If you retrieve all records, you will have to loop through a segment of them instead of the whole thing. Since you're probably getting the data from the db, you're most likely already doing a loop anyways. Where the pagination comes in is not going through the entire record set. You could get part of the record set by putting a limit clause on your query. It's not the easiest thing to do though when you haven't done one before. There are API's out there specifically for pagination though. ;)
-
Re: Which piece of code is better to use? Personally, I would recommend type casting first, and then doing a check. settype($blah, 'int'); Then check if $blah is less than 1 or 0 if you want to filter out negs.
-
Re: Include or Require? There's certainly an argument for relative paths. But there's an equally valid argument for abs. paths (although when it comes to html links I'd highly recommend not using abs. links) The argument for abs. paths, defined in one config file for the entire site, is that should you ever want to move your include folder, you aren't tied in by all those relative paths. Should you ever move your site to a new domain, simply changing the BASE_URL and BASE_URI would change every other path as well. I use BASE_URL as "http://example.com/" and BASE_URI as "/home/user/public_html/" Then the include path would be defined using the BASE_URI define('BASE_INC', BASE_URI . 'includes/'); Doing it that way means there is only two things to change, and it's actually sort of relative, no? Incidentally, Horizons Game Engine is setup that way :)
-
Re: Variables.. I'm not sure what w3 was talking about there, but using the keyword "var" multiple times on the same variable does nothing. It has a special use within functions/objects to set scope, but within the same scope, it's doing nothing for you to use var more than once. var x = 1; x = 2; x = 3; alert(x); -------------- You'll see the alert pop up with "3". hope that helps.
-
Re: Error Reporting... As far as what you can and cannot do with goddady, you're far better off calling their support techs. I was hosted by goddady and they have a pretty good support line, low wait times and real natural english speakers (no Indians with english as a third language (no offense) ) if you're on shared hosting, you're going to be very restricted... but IIRC, go daddy puts a php ini right in your public html you might even have a php.ini and a php5.ini if you're running php 4 and php 5 concurrently
-
Re: Opacity in IE Browser's it's more than likely that safari 2 works the same as safari 3 as far as most css rules opacity is part of css 2 IIRC, which has been around a long time feel free to test it, I already tested safari 3 (downloaded yesterday, so should be latest one)
-
Re: tutorial? Simple answer: no, there aren't there are totorials on making things like: authentication system mysql queries basic web page design and on and on So you'd have to go over tutorials "one chunk" at a time since there is no tutorial that I know of that covers it all.
-
Re: Opacity in IE Browser's <html> <head> </head> <body> <div style="height: 300px; width: 300px; opacity: 0.2; background-color: #000000"> hey hey hey</div> </body> </html> Try that in safari. opacity: 0.2 does indeed work there. safari uses webkit by the way. Therefore, what I said stands and that -moz stuff is not needed there. (besides, wouldn't -moz be gecko specific?)
-
Re: Opacity in IE Browser's webkit should be following css specs pretty good. I'm willing to be either the ff or ie version's of opacity will be used by webkit as well. there's really very few things that, when they work in both ff and ie, they won't work in webkit. In the case of opacity, using something like killah suggested should be enough for webkit.
-
script to prevent users to register or login using proxies
Floydian replied to mrasiankix's topic in PHP
Re: script to prevent users to register or login using proxies I normally eat mine after dinner -
Re: How to use sprintf? Making code readable is generally thought of as more desirable than squeezing every bit of code you can into the smallest space possible. The way code is formatted just doesn't have much impact on performance. Cases where this does not hold true is in html, js, and css that is sent to a user's computer. Since php code is executed locally, that "over the wire" penalty isn't incurred. Summing up: readability over squashability!
-
Re: Include or Require? It's really up to personal preference which you use. It's my opinion that most of the time, included files are required. So I normally use require_once. require is a bit faster than require_once, they say (on php manual page, I'll take that as a solid ref) As far as include paths, I prefer to use constants, defined in a config file for include paths. require_once(BASE_DIR . 'blah.php');