Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
You can't do this using PHP.
-
How about reading PFMaBiSmAd's post. He just told you that no such file exists. How are you going to read a file that doesn't exist. Maybe if you tell what you're trying to do we'd be able to help you better.
-
The problem is just that you can't do none of this at all if you've designed your application so multiple files are accessed directly by the UA. register.php, login.php, index.php, etc.
-
As an example, the posts you've written on this forum are stored in the database, but the files that control how these are represented how they will look are stored on the file system. You could do it the other way around, or store both in the database or both in separate files on the harddisk. However, you need to consider if you actually need the functionality a RDBMS like MySQL offers. Do you need them for the template files? Well, not really. Besides. You do for the posts though. We would like to find posts that belong to a particular topic, in a particular forum, or created by a particular user, or perhaps created within a time interval. Whether you should store something as a file on the disk or in a database depends on your needs.
-
Still though, hope for the best, plan for the worst. This is true in particular with programming.
-
I think it's a fine analogy. You don't know how to use X, so you ask someone who has experience with X instead of consulting X's manual. X can be PHP, your new TV or anything else that has a manual and people do not have an innate knowledge of. Point being that consulting X's manual should always be your first course of action. Moreover, you cannot determine the difficulty of understanding the manual without having ever looked at it. An analogy is "a form of reasoning in which one thing is inferred to be similar to another thing in a certain respect, on the basis of the known similarity between the things in other respects" (dictionary.com). No, there are probably no websites dedicated to teaching how to setup a TV, but that wasn't the thing that was drawn upon as a similarity, so the fact that TVs and PHP are distinct in that respect doesn't invalidate the analogy.
-
Syntax error unexpected '' expecting & or T_Variable
Daniel0 replied to acctman's topic in PHP Coding Help
<?php='something'?> isn't correct. You need to do <?php echo 'something' ?> It's Javascript, but for some reason he decided to put it in tags. You can see the opening and closing PHP tags in the code. -
SELECT DISTINCT SUBSTRING(username, 1, 1) AS firstLetter FROM members;
-
preg_replace highlight search terms- how to disregard URLs?
Daniel0 replied to immanuelx2's topic in Regex Help
Any reason why you can't use what's discussed in this sticky topic? http://www.phpfreaks.com/forums/index.php/topic,122857.0.html Also, do make sure you read the rules. You obviously haven't yet. -
Well, but if you have a problem with something, the obvious choice should be to consult the documentation. If you purchase a TV and you cannot figure out how to use it, do you go searching on the internet for tutorials "how to use TV" or do you consult the manual that came with your TV?
-
how can i delete my thread or question
Daniel0 replied to vinpkl's topic in PHPFreaks.com Website Feedback
Because editing is disabled 10 minutes after post creation. -
how can i delete my thread or question
Daniel0 replied to vinpkl's topic in PHPFreaks.com Website Feedback
You can't. Don't publish things on the internet you don't want to persist forever. That's a kind of golden rule for behavior on the internet. -
If people read the "Language Reference", "Security" and "Features" chapters in the manual they will posses most of the information they need. This is the first thing they will read: http://www.php.net/manual/en/language.basic-syntax.phpmode.php You will find language like this: "This is the simplest type. A boolean expresses a truth value. It can be either TRUE or FALSE." (http://www.php.net/manual/en/language.types.boolean.php) It's written in an easily comprehensible language, and if you have a decent understanding of the English language you should have no trouble understanding it. Hell, it's even translated to numerous other languages: "Este es el tipo más simple. Un boolean expresa un valor de verdad. Puede ser TRUE or FALSE." (http://www.php.net/manual/es/language.types.boolean.php), "C'est le type le plus simple. Un booléen représente une valeur de vérité. Il peut valoir TRUE ou FALSE." (http://www.php.net/manual/fr/language.types.boolean.php)
-
It boggles my mind why so many people always skip the most obvious choice when they want to learn PHP.
-
That is true, but never disputed in this topic as far as I'm concerned. We're disputing the fact that he claims that hashing algorithms can be cracked. If he still believes it to be true, here is another challenge. The following is a hashing algorithm: function hashMod10($n) { return $n % 10; } If I run my cell phone number through that hashing algorithm I'll get the hash "4". Now send me a text message or give me a call. I'm looking forward to hearing from you.
-
The advantage is that people can only access the files they're supposed to access. Of course if you haven't designed your application so all requests are routed through a single file, this is not easily possible.
-
Okay, I suppose I should adjust what I said. For the regular computer user, who has no interest in learning deeply how Linux works, what it means to compile a file, and who just wants their computer to work, Gentoo would be a poor choice because all those things are necessary to use Gentoo. That's not necessarily a bad thing, but for most people it would just be a hassle. Gentoo is not being marketed as a beginner friendly or mainstream distro either though. Most people only have one computer. I do for instance. There is no way I could possibly reserve one week on just installing an operating system. Maybe if I had a spare computer I didn't use for anything I would attempt to do a Gentoo stage 1 install on it just for fun. That's not most people's idea of fun though. I think that if you're looking for a free OS alternative to OS X or Windows and you just want it to work out of the box without too much hassle, Ubuntu would be the best choice. If you're a more experienced user the range of possibly options is vastly greater though.
-
No need to trace it. Just block it on server level. Make the firewall drop the packets.
-
[SOLVED] select a substring between two characters
Daniel0 replied to anatak's topic in PHP Coding Help
Assuming they're always named like that you can do this: preg_match('#_(\d+)\.jpg$#', $filename, $matches); $number = $matches[1]; -
Escape external content using functions like htmlentities before using it in an HTML context.
-
Learn math. That's the shortest answer I can give you because to be honest, it doesn't seem like you've understood any word of what we said so far (or you're ignoring it, I can't really tell). Besides, do you need to quote entire long posts to comment on one statement? If I write an essay on something and I want to comment on something written in a book, I don't embed the entire book within my essay either.
-
No need for the star -- it's trivially true. There has to be a fixed number of inputs that you have to perform in order to generate all the outputs. Whether or not that's equal to the number of different hashes is a different question (which, incidentally i'm guessing is false -- i bet my bottom dollar that there are collisions within the first |sigma|^32 items [where sigma is the alphabet. I would use 16(hex) but i'm not convinced md5 is limited to hex but i cba to check]). Yeah. I for some reason became unsure before I was about to hit the post button, so I included that in case I wasn't true. I had to leave so I didn't have time to check. I'm 100% sure now though. Especially considering simpler hashing algorithms like modulo operations it's pretty obvious that it's true. Anyway, MD5 does output in hex. The PHP function md5() does anyway. You can represent it in any base you want.
-
Mine doesn't. According to the contract I have with them, either party can terminate the contract should the other party be in breach of an obligation under the agreement. I'm pretty sure it wouldn't be legal to just suddenly decide that you no longer wish to live up to a legally binding contract without any real reason. Of course they can put it in the contract, and in that case it may or may not hold up in a court of law depending on which country you're in. Either way you can just find a host that doesn't have something like this though.