Goto Page: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
Actual Results
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Html Freeze Columns - Seriously.
- Subject: Html Freeze Columns - Seriously.
- Réponses: 6
- Vus: 6185
- Subject: Html Freeze Columns - Seriously.
Posted: Septembre 2nd, 2011, 9:46 am
It would probably help if you explained what you mean by 'freeze columns/panes'. Also, what part should be frozen? Why aren't they frozen now?
Finally, is this for layout? Tables should only be used to display tabular data. Using tables for layout is the epitome of doing it wrong.
Finally, is this for layout? Tables should only be used to display tabular data. Using tables for layout is the epitome of doing it wrong.
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Logging the user out when truncating the sessions table
- Subject: Logging the user out when truncating the sessions table
- Réponses: 4
- Vus: 765
Posted: Juin 22nd, 2011, 4:50 am
I'd do something like this: [php]public function logged() { // Note, no 'global'. Why? Because our user object should // have a reference to the db. 'Global' breaks // encapsulation, one of the main components of OOP // Checking if the user is logged in the session table $sql = $this->db-...
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: PHP query will not run
- Subject: PHP query will not run
- Réponses: 1
- Vus: 828
- Subject: PHP query will not run
Posted: Juin 20th, 2011, 7:51 am
You need to swap your quotes around:
Variables are only interpolated if the entire string itself is double-quoted. You'll also need to fetch your results as mysqli_query simply returns a resource. Finally, you can't mix...
PHP Code: [ Select ]
"SELECT * FROM users WHERE email='$email' AND pass='$pass'"
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Dataset filtering with infinate options
- Subject: Dataset filtering with infinate options
- Réponses: 2
- Vus: 602
Posted: Juin 19th, 2011, 3:59 pm
This: Each field may contain more than one value, in which case they will be seperated by a comma. Makes me think you should read this: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html Comma-separated values in a column is generally a sign you're doing it wrong. This is espec...
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Javascript Password Puzzle
- Subject: Javascript Password Puzzle
- Réponses: 8
- Vus: 1189
- Subject: Javascript Password Puzzle
Posted: Mai 22nd, 2011, 1:34 pm
A sheet of paper is fragile yet a telephone directory can stop a bullet. Look beyond the weakness of the language and examine its strengths. It took me a week, couple of nights without sleep and coffee so thick you could slice it before I figured out how to do this :lol: . When I have enough posts ...
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: I need help with javascript client-side validation
- Subject: I need help with javascript client-side validation
- Réponses: 4
- Vus: 948
Posted: Mai 21st, 2011, 8:39 am
[javascript]//Javascript Document function checkform(form) { var errors = new Array(); if (form.occupation.value == "") { errors.push("Please enter your occupation."); } var gender = form.elements["gender"]; var genderCount = 0; for (var i = ...
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: I need help with javascript client-side validation
- Subject: I need help with javascript client-side validation
- Réponses: 4
- Vus: 948
Posted: Mai 20th, 2011, 11:40 am
Your mistake is that you keep redefining your checkForm function over and over again. The end result is that only your last definition of the function, which checks the last input, actually exists.
You only need one checkForm function. Combine what you have.
You only need one checkForm function. Combine what you have.
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: An object within an object problem
- Subject: An object within an object problem
- Réponses: 9
- Vus: 731
- Subject: An object within an object problem
Posted: Mai 17th, 2011, 1:33 pm
*eye twitch at more 'global' parameters*
You may want to look into dependency injection for this kind of thing.
You may want to look into dependency injection for this kind of thing.
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Abstract/Interface OOP Question
- Subject: Abstract/Interface OOP Question
- Réponses: 2
- Vus: 1409
- Subject: Abstract/Interface OOP Question
Posted: Mai 17th, 2011, 1:31 pm
Both are used to facilitate polymorphism. Abstract classes and interfaces create is-a relationships. If a class implements a particular interface, or extends an abstract class, then an object of that class is also considered to be an instance of that interface or abstract class. Unfortunately, since...
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: How to write false $_REQUEST, please help
- Subject: How to write false $_REQUEST, please help
- Réponses: 1
- Vus: 623
Posted: Avril 5th, 2011, 4:57 pm
The first one.
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Hash and Salts
- Subject: Hash and Salts
- Réponses: 4
- Vus: 781
- Subject: Hash and Salts
Posted: Avril 1st, 2011, 5:35 pm
FWIW, using a member's registration timestamp as a salt is pretty common. It's unique, and unique to each user. Even better, if you keep that date hidden to everyone except that user when viewing the profile, it's impossible to guess. No one's going to want to brute force every second from the epoch.
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Problem generating menu dynamically
- Subject: Problem generating menu dynamically
- Réponses: 13
- Vus: 1336
- Subject: Problem generating menu dynamically
Posted: Janvier 20th, 2011, 12:08 pm
That still doesn't stop you from passing your config variables in through a function's argument list. When you have a function like:
You're hiding the fact that the function needs your c...
Code: [ Select ]
<?php function doSomething($arg1, $arg2) { global $configVar; // code that does something } ?>
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Problem generating menu dynamically
- Subject: Problem generating menu dynamically
- Réponses: 13
- Vus: 1336
- Subject: Problem generating menu dynamically
Posted: Janvier 19th, 2011, 1:28 pm
Exactly right. Globals lead to coupling rather than reduce it. They, by definition, break encapsulation. They're a crutch, and in the vast, vast majority of cases, a sign of poor design. See also: http://www.ozzu.com/programming-forum/classes-interfacing-php-t97447.html#p546909 Even though the link ...
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Problem generating menu dynamically
- Subject: Problem generating menu dynamically
- Réponses: 13
- Vus: 1336
- Subject: Problem generating menu dynamically
Posted: Janvier 15th, 2011, 5:54 pm
That doesn't stop you from passing the variable in through the function's argument list.
- Nightslyr
- Forums: Programming / Scripting / Coding Forum
- Sujet: Problem generating menu dynamically
- Subject: Problem generating menu dynamically
- Réponses: 13
- Vus: 1336
- Subject: Problem generating menu dynamically
Posted: Janvier 14th, 2011, 3:44 pm
Gah, why are you using a global variable? Pass $sys_url through your argument list.
