-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
[SOLVED] SELECT * FROM table_name WHERE column= `` Not working!?!?
.josh replied to physaux's topic in PHP Coding Help
use single quotes instead of backticks. -
str_replace needs to have the \n wrapped in double quotes not single. Alternatively, you can use trim
-
Dude seriously, stop pulling numbers out your ass. $600 for an apartment? Maybe an efficiency in a really bad side of town in some areas of the country. $150 for food. Yeah, you can swing that, eating beans and rice, ramen, etc.. $50 for water and electricity? ROFLMAO. Dude where do you live I'm totally moving there. My electricity and water runs a minimum of $300 a month, and that's during the 'off' seasons, when they aren't jacking up the prices extra high because it's summer and people are using more air conditioning, or winter and people are using more heater. My bill has been as high as $700. Sure, turning on the a/c isn't necessary, but you just try going through the winter without the heat. Esp when you live in an area where it get below 0 and stay that way for weeks on end. $15 for bike insurance? Yes, because everybody drives motorcycles and gets the same rate as you. You may be able to live w/out a car, depending on where you live, but you'll probably just make up for it in other transportation costs, like bus, taxi, train, whatever. But you probably will have to have a car of some kind, and insurance is higher. Oh and you're numbers are also assuming you are living by yourself. What about if you have a family? Efficiency won't cut it. Motorcycle won't cut it. Bills go up, esp food. I spend $150 a week on food and trust me, it ain't no steak and potatoes. Utilities go up. Dude you obviously don't know what you're talking about. Living sheltered or else you're too young, haven't been out there yet. p.s.- the min. wage only recently went up to $7.25. It was at $5.15 and only got bumped up recently.
-
uh, no they can't. Maybe if you apply for all kinds of govt. assistance or have like 100 roommates. I've spent most my life in that bracket, I know. There's a reason why govt. turns around and gives out handouts. Because min. wage is not enough. And no I'm not talkin' about not getting to dine out and shit. I'm talking about eating beans and rice, ramen shit 24/7.
-
Americans don't care if you are not an American (or 'native' american). We're actually pretty big on equality, regardless of race, religion, nationality, blahblah. I suspect mostly because we are sue-happy, but whatever. 2 biggest caveats are: 1) "Less than perfect" communication skills. Strong communication skills are always a necessity, no matter what profession you are in, but it becomes even more essential when you are doing "distance" jobs. Body language is a significant part of communication. With that out of the picture, it becomes a lot more important to be able to convey meaning solely through words (and understand, as well). If people have a hard time understanding you and visa versa, then yes, you are going to have a hard time getting work or working efficiently. 2) Working for a fraction of the price as everybody else. We don't hate you because you're <insert some nationality here>, we hate you because you're undercutting us! If you are living in America you will quickly realize that you will not be able to live off that extremely low rate. It simply costs a lot more to live here. Working for like $2.15/hr won't cut it. Hell, even working for the U.S. federal minimum wage won't cut it around here. But it's nothing personal. We don't think foreigners are *evil* for doing that. But that don't make it any better on our end. On that note, you will actually find it harder (relatively speaking) to get this kind of work in America, because you are in America. You will have to become more of a salesman to sell yourself, instead of relying on being able to charge less. You will have to focus on building a reputation, word-of-mouth, etc.. In other words, you will have to excel at that first point: communication.
-
well it looks like you're putting all of the html into a single variable anyways, so instead of using that fopen and fread in a loop, just use file_get_contents
-
did you actually read your error? It tells you what the problem is. fopen expects 2 parameters and you are only giving it one. Pretty self-explanatory. The other 2 errors are being caused because of fopen failing.
-
Okay so I'm not sure what you're asking. Are you wanting to know how your script would save the info and then use it to connect to the db later? You would have your install script generate a config script/file with the info in it, saved to wherever (outside of the public dir). Then your script would have the config file included when it needs it.
-
<?php There you go. That's where you start.
-
haha yeah...I worked in a produce warehouse for a while. I've seen some pretty spectacular shit happen before, forklifts dropping shit from top shelves, pallet trucks rammed into each other (lots of ice and water on floors of produce warehouse). Whole racks toppling over. All kinds of crazy cool shit. Seen lots of people get hurt (myself included...) but no deaths.
-
I had a ps3. It broke. I waffled about whether to get a 360 or ps3 and ultimately I decided on ps3 because they have a tendency to pump out more rpgs, and also the whole blue-ray thing seemed kinda cool at the time. I then got a wii. I was very disappointed. I mean, there are some games on it that are okay. But..meh. Although I admit I am excited about the new mario game coming out in a couple weeks.
-
They delimit. http://dictionary.reference.com/browse/delimiter
-
ah sorry, forgot to put the delimiters in. if (!preg_match('~^[a-zA-Z_-]+$~',$_POST['fname'])) {
-
a character class only matches against 1 character, and you have start of string and end of string anchors wrapped around it, so it will fail if you have more than 1 character entered. You need to add a quantifier to it. Also, eregi is deprecated, use preg_match instead. if (!preg_match('^[a-zA-Z_-]+$',$_POST['fname'])) { the + is the quantifier. It means 1 or more of what's inside that character class. If you want it to be a specific amount, like only 5-10 characters, do this instead: if (!preg_match('^[a-zA-Z_-]{5,10}$',$_POST['fname'])) {
-
DOM
-
I have a plan to reduce the "tl:dr" count!
.josh replied to PugJr's topic in PHPFreaks.com Website Feedback
http://www.phpfreaks.com/forums/index.php?action=profile;u=22533 haha you know, there have actually been several posts I've made that I've gotten the "your message exceeds the character limit" message or however it says it. And it wasn't because of random stuff c/p'd into it... -
I have a plan to reduce the "tl:dr" count!
.josh replied to PugJr's topic in PHPFreaks.com Website Feedback
change the setting on your wheel to scroll more at a time? Or better yet, whenever you see a tldr post, put the poster on ignore. -
You can put an image in your email and the image src will point to a php (or other server-side language). You will send out the emails with a unique id generated for each email, to be put as a param in the image src url. For example, email 1 gets: <img src='yoursite.com/tracker.php?id=1' width='1' height='1' /> email 2 gets: <img src='yoursite.com/tracker.php?id=2' width='1' height='1' /> etc... dunno what system you are using to send out these emails, but a lot of mass mailer/mailing list programs have the ability to auto-generate a number like that. Or you could write up your own basic emailing script and inject it yourself. Or hack an existing one, whatever. When the user opens the email, the image request will be made to your tracker.php script. Your tracker.php script will grab the id, and record the viewing in a database or flatfile. It can be as simple as a single column of ids, as they come in. That way you will have a list of all ids of emails viewed, and can compare that to your overall list. The tracker.php will then, as a response to the email image request, output a raw image. Just a simple 1x1 transparent pixel. Or, if you are already going to have another image in your email somewhere, you can have it output that, instead. You will have to accept a margin of error, because while most email providers do allow images, a lot of them ask the user if they want to view them, or the user can flag in their settings to never view images. Can't get around that. A lot of people put a "click here if you have difficulty viewing" link in there, to try and get the user to click on that link and go to a live webpage version of your email. Passing the unique id in the link and tracking it there.
-
if all you care about is that first set of digits you don't even need the rest of the expression.
-
I have a plan to reduce the "tl:dr" count!
.josh replied to PugJr's topic in PHPFreaks.com Website Feedback
really? you're advocating censorship? really? your efforts to mute me are in vain. -
you cannot put most of the commercial tracking codes into your header, because most of them boil down to outputting an image tag with data appended to the src url. You cannot have image tags in the head tag.
-
awestats on the server is "more accurate" because it will count it from a higher "a request was made to this page" level, so even if your page fails to load fully, or if there are other errors causing it to load fully, etc.. it will still count as a page view. If the commercial tools (I assume you are talking about google analytics, yahoo web analytics, omniture sitecatalyst, webtrends, etc...) are reporting significantly less page views, then more than likely you a) didn't install the tracking tool correctly b) some other script(s) on the page(s) might have an error which causes the tracking tool to fail to load. edit: or c) maybe you are looking at the wrong report(s). Example. page view is not the same as visit. Apparently a lot of people get those two confused.
-
PHP, jAVASCRIPT setting input values, why isn't it working?
.josh replied to iAIN mACfREAK's topic in PHP Coding Help
you cannot execute php inside javascript like that. php is a server-side language, parsed on the server. javascript is a client-side language, parsed client-side. One is just plain text to the other, and visa versa. In order to get javascript to execute php, you have to use ajax, which is a javascript method of sending a request to the server and receiving a response. There are tons of ajax tutorials out there to get you started.