And no better way, but be very careful when including anything that has anything to do with a variable. For example, if it's not to be a directory or have arguments, assert so with a regex like /^\w+$/ . preg_match returns false if it won't match (regex, subject). Finally, it's generally preferred to avoid parenthesis in include and require because they are not functions but statements.
Name:
Anonymous2006-05-22 3:42
Hmm let me try leaving the empty part off, I am pretty sure it returned an error, brb and thanks for taking the time to look.
Name:
Anonymous2006-05-22 3:45
>>2
OK I get:
Parse error: parse error, unexpected T_STRING in /home/content/b/t/a/btard/html/getinst.php on line 24
include("http//www.instructable/... .$project.");
or
Parse error: parse error, unexpected ')' in /home/content/b/t/a/btard/html/getinst.php on line 20
from this
include("http//www.instructable/... .$project.);
Name:
Anonymous2006-05-22 4:21
>>4
This happens because you are using the string concatenation operator (dot) after $project without a second operand. Try:
>>1
You already look like a retard for using PHP, what else is there to lose?
Name:
Anonymous2006-05-22 6:10
>>6-7
You already look like retards for bashing PHP just because clueless people try to use it and fail, what else is there to lose?
Name:
Anonymous2006-05-22 11:24
The only reason to use PHP nowadays is because hosters don't support other superior languages. I have no problem with PHP. I used it for a long time and still like it, but it's a fact that better languages for mostly the same work exist. Use Ruby and Python if you have the chance to.
Name:
Anonymous2006-05-22 11:25
Okay, "no problem" is wrong. PHP _has_ it's problems (e.g. completly inconsistent standard library)
Name:
Anonymous2006-05-22 18:38
>>9
As a language, I like Python better than PHP, but admittedly, PHP is not that bad for what it does; it's pretty productive and reasonably clean for web sights (even large ones with separate presentation from data) and system scripting, and it's pleasuring to work with it if the code is good quality and you know what you're doing. There's no reason to bash it so much compared to other languages which have their share of problems as well.
Name:
Anonymous2006-05-22 21:36
reasonably clean
You have to be kidding.
You'd think several thousand (inconsistently named) functions in one namespace, many which do similar things (but not quite!) would be bad enough. But no, they had to add total stupidity like magic quotes, and that absolutely retarded site-wide configuration.
That's clean?! I don't want to know your definition of ugly!
Name:
Anonymous2006-05-23 6:03
>>12
Functions are a bit of a mess (although you end up using a subset of them which is usually reasonable).
Magic quotes, register globals (I wonder why you didn't mention this), and other "features" are absolute shit, but they are getting/got rid of them. You can use PHP with these disabled you know.
My definition of ugly is Perl, Java, Basic/Visual Basic, and poor PHP newb code.
Name:
Anonymous2006-05-23 7:06
Functions are a bit of a mess
I daresay that's an understatement.
they are getting/got rid of them.
I've learned never to wait for a language to get rid of stupidness. Take a look how long they've been working on Perl6 or Ruby2. It's been years.
Overall, I think we see mostly eye-to-eye. But why bother with PHP at all? Use Python, Ruby, or even the beast known as Perl.
Name:
Anonymous2006-05-23 7:46
>>14
PHP5 is out and I believe they are deprecated in PHP5.
I've been waiting for Perl6 and PHP6 but it seems they're always coming soon. As of today, I like Python best (and use it whenever I can), save for small system scripts, and I haven't used it for the web yet so I wouldn't know, but I'm pretty happy with PHP there (and I choose it over Perl for these tasks). I don't know Ruby yet.
After reading this thread a little more thourogly I now understand what your trying to achieve.
You see the "." operater in PHP is basicly the same thing as a + in any other langauge.
so when your trying to do this:
I never understood why some people appends or prepends PHP variables and constants with empty strings. I've seen this a lot in old PHP code, like echo "" . CONSTANT . "";
Name:
Anonymous2006-06-25 1:31
>>26
>You see the "." operater in PHP is basicly the same thing as a + in any other langauge.
fuck you, java/javascript (are there really any other languages that overload + for concatenation?) :(
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy