-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Making money by doing something for free seems rather contradictory...
-
Playing "word games" by mixing around spellings, creating new spellings, using words in different ways, stretching their meanings out and mixing meanings with meanings to explore and create new meanings and concepts is indeed fun, even to a lot of those people you would label as 'prude' or 'uptight' or 'strict' or <insert whatever word suits you>. That's why there are sonnets and poems and prose and limericks and songs and odes and haikus and all of those other things. But doing things like spelling "learn" as "lrn" is superficial. You haven't changed the meaning of the word, even in the context. At most, I will say that maybe there are some of you "leet speak" kiddies out there who are playing some kind of "let's see how much I can distort my words and still get my point across" game, but if you were smart enough to be looking at it like that, you would certainly be smart enough to recognize that when you are trying to get something done, distorting your words does not help the matter. If you are writing just to write, playing word games, etc.. then it's perfectly acceptable to do things like that. But the world does not cater to you. If you want something from someone, be it item or info, it is your responsibility to make an effort to speak in their language. It is your responsibility to convince them to give it to you or help you out or whatever the situation calls for. If you are serious about your need, then be serious about your communication. People judge how serious you and/or your needs are, by how much effort you are putting into it. So when they see that you aren't even making an effort to spell correctly or be clear about your request or put any of your own work into achieving whatever end you are trying to reach, why should they take you seriously or even bother with you? It makes you come off as someone trying to bum for something you don't really need, which at best, is annoying. What I find particularly amusing about people who fail to be or rebel against being grammatically correct (and spelling correctly), are the people who strive to code. Computers are not as forgiving. Or else they are not smart enough to understand. Or they simply aren't programmed to understand that learn == lern == lurn == lrn == etc... However you want to spin it, point is, I find it amusing and hard to believe that anybody can be a good programmer when they can't even discipline themselves to communicate correctly in their native tongue. I'm not saying it's impossible to (for example) be horrible at English but great at programming. All languages have their own 'grammar' and 'spelling' rules, and programming languages are no exception, in that regard. I recognize that for some, coding 'rules' are a lot easier to understand than traditional oral/written languages. But I'm sorry, in my experience, the vast majority of people who can't or won't follow the rules of their own tongue, do not fall into this category. In my experience, they are indeed crappy programmers because they fail to or refuse to recognize the rules. All day long I see syntax error threads pop up that are a direct result of some missing bracket or brace or quote or semi-colon or whatever. Sometimes it's hard to spot, even if the code is following some sort of indentation format. Usually it's because the code is not being indented. Regardless, most of the time, the poster doesn't even understand what the error means or that he needed some opening or closing something in the first place. Or they can't seem to grasp even the most basic logic rules and structures, like how arrays or loops work, or variable scope, or data persistence. They want to jump right in and write a book when they don't know how to write a sentence or carry a story line. It's nothing personal, and it's not a matter of people trying to enforce their prudishness on you. If you ask for a banana, would you expect someone to hand you an orange? Or a fork? No you wouldn't, because you asked for a banana, and you expect them to understand that a banana is not an orange or a fork. It's the same principle.
-
In your code, you are making an array ($subname) with only one element, effectively making it the same as a regular string variable. You can rewrite all of that code simply by doing $subname = "<span class='small-links'>{$row['name']}</span>"; But you say you have a array of info, so I don't think that's quite what you are looking for. Perhaps you should post the code before that, that retrieves the info from the database.
-
chage the + to * in your patterns. + is 1 or more characters. * is 0 or more. Alternatively, if you want to further remove those extra strlen conditions afterward, just make your patterns '/^[A-Za-z0-9]{0,40}$/'
-
I still think you are running the wrong script. Maybe you uploaded it to the wrong location. Maybe you forgot to upload the update. I don't know. But there's no way you can get that error from the query.
-
are you sure you're running the right script? There's no way that insert could generate that error message.
-
okay so echo out all of your vars and see if they all have what they should be having.
-
I still don't see any place where you are assigning something to $username. Is the user supposed to be entering their username into the form?
-
Unless you are doing it somewhere else or have register globals on, you aren't assigning anything to $username. Also, you'll want to check if $check2 > 0, not > 1.
-
would have to see your form to figure out why your message isn't going through.
-
run code when a loop gets the last item of an array
.josh replied to Darkmatter5's topic in PHP Coding Help
foreach($list as $k => $lst) { echo ($list[$k+1])? "$lst[0], " : end($lst); } -
run code when a loop gets the last item of an array
.josh replied to Darkmatter5's topic in PHP Coding Help
foreach($list as $k => $lst) { echo ($list[$k+1])? "$lst[0], " : "$lst[lastelement]"; } -
Your problem is that "htp://[email protected]" is not valid email address.
-
It also has significance in regex.
-
You know you could use the "Add Bookmark" feature. It's next to the "Reply" button.
-
Well if I told you to go buy carrier pigeons and learn how to make smoke signals, you'd just laugh at me. Just because I can't think of an alternative that you (people in general) are willing to consider, doesn't mean there isn't a problem.
-
No, I mean, if you don't care whether it is 'true' or 'false', only that it is 'true' or 'false' (as opposed to some other arbitrary thing), then there's no need for the 3rd argument. You know, like when you want to check if something is a number but don't care what the number actually is. It seems that he is checking the 'value' to determine whether it's a boolean type. He doesn't actually care whether it's true or false, just that it is a boolean type. Therefore, the 3rd argument is not needed. At least, that's what I interpreted. I guess I would probably throw in the i modifier just to be safe.
-
You don't have to depend on something to take advantage of it. You just have to have a system in place to get by without it, so that you won't freak out and not know how to move forward, if you do have to suddenly go without it. You do not depend on it to get the job done, rather, you just depend on it to get the job done better. The key there is that either way, the job gets done. It's the same principle as having all those backups you mentioned...only thing is you are just backing things up with more things that depend on the same stuff, and therein lies the problem and also my sad face. Let me illustrate with a real world example. Remember the y2k bug? Sure, it turned out to not be that big of a deal, but before it was fixed, people freaked the hell out, making out like armageddon was fixing to happen, and we were about to enter a Mad Max world. And that was for one simple little 2 digit "bug." If people are going to assume the worst and panic over that, how do you think people are going to react if that really did happen? What if some super virus was created that totally wtfpwns all networked computers before we can do anything about it? What if someone creates an AI and it turns out to not be as benevolent as (s)he assumed it would be? What if all these self-replicating nanobots people are trying to make end up taking a turn for the worst, being some kind of combination of BOTH of the previous scenarios? What if some occurrence in nature causes the earth's magnetic poles to reverse (something a lot more likely than you think), causing every single piece of electronic equipment on earth to fry? I'm not suggesting we all keep living in caves, afraid of trying or using anything new and shiny. I'm just saying, we're getting to the point where people are failing to do anything at all unless they are using something that's plugs into the wall or runs off batteries or something, and is 'connected' somehow. We aren't retaining backwards compatibility, and it's only a matter of time before we get bitten in the ass.
-
I'm not offended. I was just telling you how it works around here in a non-sugar coated, dull and boring way. I'm not a mechanic. Does that mean I can take my car somewhere and get it fixed for free? We are willing and happy to help you work through something if you are making an effort to work through it. You made it pretty clear that you were a beginner. You didn't really specify whether you were trying to learn or don't care about programming, you just want it done. If you aren't a programmer and don't really have a desire to get into it...well, that's when you pay someone else to do it for you.
-
There's a difference between taking advantage of something and being dependent on it. The difference is that when you take advantage of something, you are happy and things are great because your life is easier, but no big deal if it suddenly goes away or stops working or insert whatever applicable phrase, depending on what you're talking about. But if you are dependent on it, and it stops working etc..., suddenly the shit hits the fan.
-
That's pretty funny and all, but not all time spent on the computer is for fun and games. Indirectly it is. I mean, you go to work to pay for your bills. You can't necessarily say you need to pay those, or need to have the things you do. Lots of people manage to survive without roofs over their heads or cars or more than a few rags to cover their happy no-no spots. I'm not necessarily saying it's wrong to have those things. I'm just saying, it's sad that we have grown so dependent on the internet and computers.
-
if you are just wanting to test for equality and not actually capture a match, you don't need the 3rd parameter, and you can specify it as a non-captured group and also you don't need the 3rd argument. Not a big deal; just an fyi if (preg_match("/^(?:true|false)$/",$str)) { // matches, do something } Also, I know you said you wanted to use preg_match, but using 2 stripos conditions (one for each alternative) would be a lot faster.
-
You could...read a book? Go outside and play? Take a nap? Oh, sorry. Sadly, you were being serious.
-
Yes it is possible. Don't know if there are any prefab scripts out there though. How are you storing old data? Are you just updating your page manually each time, and previous data is just lost? Or are you like, copy/pasting previous page to a new page, and changing the numbers, so you have like, a million copies of the same page but with different data, as time goes on? If you are absolutely completely new to php then I suggest googling a "hello world" tutorial and working your way through basic syntax, conditions, loops, etc... If you know the basics, you can start with breaking the habit of making a whole new page on each update. You will need to learn some basic database handling to do that.
-
PHP Booking Enquiry Form, Better way of accoplishing this?
.josh replied to aaron1uk's topic in PHP Coding Help
There are two ways you can have the form processing script in a separate file. The first way is to write the form processing script as if the form is in the same file as it, and just include the form processing script in any form page script. You could then continue to use php_self as the form action on your form. If you choose this method, you don't have to worry about data persistence (sending error messages and form vars back to your form). The second way is to have the form action point to the form processing script. If the form is not validated (blank fields, whatever), the processing script would redirect back to the form. Your processing script would know which form page to redirect back to with $_SERVER['HTTP_REFERER'] or by passing the page name to it via a hidden form field or a session variable. The processing script would pass the error messages and form vars back to the form page via session vars. The second way involves more coding. One way is not necessarily better than the other; just depends on your setup, overall.