Jump to content

ShadowMage

Members
  • Posts

    3,476
  • Joined

  • Last visited

Everything posted by ShadowMage

  1. ShadowMage

    Record Locking

    Looking for a bit of advice. I have an quoting system that I built for my company. This system allows our estimators to produce quotes for skylight systems. Currently, there is no limit to how many people can be viewing or editing a quote. What I'm wondering is what is the best way to lock a quote so that only one person can modify it at a time? I thought about creating a field in the database called Locked which will hold a value of 0 or 1 (1 being locked, 0 being not locked). This way, when an estimator loads a quote, the field can be updated to hold a 1. The problem is how do I reset it to 0?Anyone have any ideas how this could be accomplished? Or ideas on other ways to accomplish a locking procedure? Thanks in advance.
  2. I've read it about 8 times and that's still what it sounds like OP is looking for.... :umnik2:Apparently I'm missing something though, because it seems the issue is resolved.
  3. What was the code you tried to add the bottom border? I would do something like this: #login input { border: none; /* remove all borders */ border-bottom: 1px solid gray; /* add whatever style you want for the bottom border */}
  4. I completely agree with JSG. You'll never need one specific set of tools. The only thing required for any website is a text editor. IMO the only time you'll ever need to use an image editor like Photoshop is...well...when you have images on your site. Like a personal logo or some such. Personally, I don't think Photoshop should ever be used to design and draw your page. If anything, sketch out the layout of the page but don't mess around with colors or fonts. That stuff can be experimented with in CSS (and far more easily, too, IMO). If you get the "perfect" design drawn up in Photoshop, it's likely to be tempting to just cut the image apart and use it as the background for your site rather than using CSS to achieve the same (or very similar) result, which is rarely a good idea.
  5. I'm sure one of the mods would be able to delete your account if you send them a PM. At the very least they would know who to contact to get it done. I know it's possible because I see posts/threads from *Guest_aUser or some such where aUser is a username I recognize as once having been a member. Or at least I assume that's what that means...
  6. See my edit above. If I could, I would delete this topic for fear of embarrassment.
  7. I'm having a bit of a situation here. I have a query which can contain apostrophes (') so obviously I'll need to escape those. The problem is, they're not escaping, but they're also not causing errors. The query runs just fine but chops off the string where the first apostrophe appears. For example:This is the string I want to enter:This is a 'test'What I actually get in the field is:This is a No error. Just chops it off at the apostrophe... Here is how I'm constructing the data for that field: $tmpDescString = '';if (isset($_POST['Description'])) { for ($x=0; $x<$types; $x++) { if ($x > 0) { $tmpDescString.=';'; } if (isset($_POST['Description'][$x])) { $tmpDescString.=mysql_real_escape_string($_POST['Description'][$x]); } }}$tmpDescString = "'".$tmpDescString."'"; As you can see, the field is actually a semicolon delimited string of several descriptions. Each description suffers the same issue. Each one is chopped off at the first apostrophe and then appended to the string. So if I have three strings:This is a 'test'Another 'test'Yet another 'test'What I actually end up with in the database is this:This is a ;Another ;Yet another ;;;;; I've tried using str_replace to replace apostrophes but that didn't work. I also tried moving the mysql_real_escape_string to the very end and escaping the entire $tmpDescString variable. IE: $tmpDescString = "'".mysql_real_escape_string($tmpDescString)."'"; That didn't work either.It isn't a character length issue either because it doesn't matter where the apostrophe is, it always chops it off at the apostrophe. WTH is going on here? I know that real_escape works because I've used it successfully in other places... EDIT: Scratch that. I don't know what I was looking at in the database, but it seems the issue was actually not using htmlentities to display the values on the page. I could swear the database showed incorrect data, but I could've been half asleep at the time...
  8. Kind of the point of marking the community read, isn't it?
  9. He wants to know which button is broken. A little explanation or a screenshot would be helpful.
  10. Must be you (or your magical browser ) because FF does not highlight anything (as expected).
  11. Yeah I was kind of tossing some idea around for that myself. What if you added an image or some text to the computer screen and turn that orange? Like maybe that character that appears at the top of most pages (and in the middle icon). Seems you answered out of order... as I'm assuming you're referring to the submit button (which is the third thing I mentioned) Margins would make it look more professional, IMO. No, I do not.
  12. Looks very nice, Krewe. Just a few really nitpicky things I noticed though. On the home page with the three large icons:- The hover state for the web development icon (the computer) seems out of place compared to the other two because the whole thing turns yellow, while only parts of the other two turn yellow.- The "hover zone" for the first two icons seems rather large and misplaced. The third icon only changes state when you cross the border of the black circle. The others seem to have extended borders. On the contact page, the submit button should have the cursor change to a pointer. (Told you they were really nitpicky. Though, when a site is really well done, you have to be nitpicky... ) This was tested in FF
  13. I think Tin is looking for something like this: window.onload =(b==true) ? function(){ var c = "Hello!"; func(c); } : null; EDIT: scientist was quicker. His example would also work. Mine only creates the onload function if b is true, where scientist's always creates the onload but only prints output if b is true. Same result, different technique.
  14. Try this one:http://livepipe.net/#scrollbar Haven't used it myself, but it seems pretty robust.
  15. As astralaaron pointed out, it looks as though it printing 1.3 then 3.9 with no spaces. It appears you are first printing out $sb, then printing the product of $sb.Are you sure the code you posted is exactly the code you're running?
  16. If I remember correctly, assign will place an entry in the browser history and allow the user to use the back button to get back to the previous page while replace does not. So if you want to maintain the history, you'll want to use assign instead of replace.
  17. Hmm.....well this is strange... alert("p" == true); alerts false, yet: if ("p") { alert('true');} else { alert('false');} alerts true.... EDIT: Ah, this is the reason (from the same reference I linked above): So in actuality, this:"p" == trueis actually"p" == "true" So, even though "p" is equivalent to true (as evidenced by my second snippet), the == operator treats both sides as if they were strings (when one value is a string) and compares their string values.
  18. No, because they are the same type (ie, they are both strings). Only when they are different types do they get converted. I guess I never said that, but the line I quoted from the reference did. FWIW, here's a good reference table for loose comparisons:http://jsfiddle.net/rodneyrehm/fBKbT/
  19. In a loose comparison, each side is converted, or evaluated, as a boolean and then compared. Loose comparison does not care what type of data it's comparing. Only whether it is true-ish or false-ish. The following values are false-ish:0'' (an empty string)nullundefinedfalse Any of those values, when used in a loose comparison, will evaluate to boolean false.Anything else, will evaluate to boolean true. EDIT: Though, after a quick test, it appears that null and undefined are special. null is (loosely) equal to undefined, but null and undefined are not (loosely) equal to false, 0 or ''. EDIT2: Per the MDN reference on the == operator:
  20. Alright. Let's break it down. First, evaluate the condition for the ternary statement:alert("p"==vowel("i")?"true":"false") We're using loose comparison, so we'll convert each value to boolean. "p" converts to boolean true. "i" is a vowel, so the function will return true. We get:true == trueObviously, that's true. So the ternary will return the first of the two possible results: "true"This means the alert will look like this:alert("true");
  21. In loose comparison (==) "p" is equal to true. In strict comparison (===) it is not. A loose comparison evaluates any value that is not false, an empty string, 0, null or undefined as true.
  22. ShadowMage

    Flash?

    You can't honestly say that until you've tried learning it. How do you know how easy or difficult it is if you haven't tried it? Just because it looks easy doesn't mean it is easy. And vice versa. Your circumstances have nothing to do with the relationship between HTML and Flash. Whether your circumstances are good or bad, Flash is still far more complicated than HTML. Sure. If that's what the job postings are asking for. It can't hurt, anyway.
  23. Something like this: function max(numbers) { var max = numbers[0]; for (var x=1, y=numbers.length; x<y; x++) { if (numbers[x] > max) max = numbers[x]; } return max;}
  24. This is the problem:if( a > b && c ){ What that says is:if a is greater than b, and c is true (or non-false data. Non-false data is pretty much everything except '', 0, undefined, or null)So as long as a is larger than b and c is anything but '', 0, undefined, or null the function will return a. What you meant was this:if( a > b && a > c ){ EDIT: The same thing applies to your else if statement as well.
×
×
  • Create New...