ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
Whatever tutorial you're using, stop using it. It's using ancient and deprecated PHP functionality and does strings wrong. You'll have to define what you mean by "locking." Once they log in, they're taken to separate pages. You want THOSE pages to be secured, unrelated to the code you posted? If that's the case, you'll have to go to those pages (or work in a common includes directory), and see if the page they're on is one that they have access to. You can store their access levels in the session since you set them there, but I don't know where your page-to-access-level map is. If there's a database table for that, use it. Otherwise set the access level for each page by hand.
-
Replace Characters Not Listed In A Whitelist Array
ManiacDan replied to matthewtbaker's topic in PHP Coding Help
It definitely is. Kicken's solution is the most correct, if OP is really just trying to whitelist 75% of the ascii chart and disallow diacritical marks and utf-8 characters.- 12 replies
-
- preg_replace
- str_replace
-
(and 2 more)
Tagged with:
-
Replace Characters Not Listed In A Whitelist Array
ManiacDan replied to matthewtbaker's topic in PHP Coding Help
listing them individually is the easiest way, but at this point you're allowing most of the ascii range. Might as well make a blacklist, or specify your ranged by hand using an ascii chart. If you use an array as a string, it becomes the word "Array." Implode turns an array into a string so you can actually see the values.- 12 replies
-
- preg_replace
- str_replace
-
(and 2 more)
Tagged with:
-
Determine If One Date Is In A Future Month
ManiacDan replied to Ninjakreborn's topic in PHP Coding Help
function isFutureMonth($one, $two) { $one = strtotime($one); $two = strtotime($two); return $one < $two && date('Y-m', $one) != date('Y-m', $two); } -
This isn't SQL. This is still PHP. You fixed the code and still get the same error message? That's impossible. Are you sure the code isn't cached? Did you put the fixed code in the wrong place?
-
What is your problem then? Why do you absolutely need key #2? Why does it matter if the association between key #4 and its data is lost?
-
Replace Characters Not Listed In A Whitelist Array
ManiacDan replied to matthewtbaker's topic in PHP Coding Help
Use the second example and do: $myText = preg_replace("/[^" . preg_quote(implode('',$symbols), '/') . "]/i", "", $myText);- 12 replies
-
- preg_replace
- str_replace
-
(and 2 more)
Tagged with:
-
Right, every array element has a key, and if none is specified they are automatically numbered starting at zero, unless you manually set a numeric key.
-
You're getting the error message about the undefined function even though your code no longer includes the bad code?
-
Just out of curiosity... Facebook.
ManiacDan replied to phpfreak's topic in PHPFreaks.com Website Feedback
I didn't write down which half of the bible they came from. The whole thing applies though, from what Congress tells me. Unless of course it's a part that doesn't apply. We all know which bits those are. The food restrictions, to my understanding, were partially lifted by the new testament and then permanently lifted in the 50s by the Vatican for no reason. The rest were untouched and are still "law." -
You may be interested in this article I wrote about exactly what happens when you do this.
-
How would you go about doing logging or auditing with two versions of the same user? Why does your client want one username but two users? Why are people sharing usernames to begin with? This whole thing sounds like an unreasonable client asking for something dumb. They pay you to be smart with computers. Tell them when their idea is stupid.
-
Just out of curiosity... Facebook.
ManiacDan replied to phpfreak's topic in PHPFreaks.com Website Feedback
All clothes of mixed fibers are a sin. The act of weaving fabrics from more than one source is a sin. Things that are an "abomination" according to the KJV Bible: "all that have not fins and scales in the seas, and in the rivers, of all that move in the waters, and of any living thing which is in the waters" "Whatsoever hath no fins nor scales in the waters" "the eagle, and the ossifrage, and the ospray, And the vulture, and the kite after his kind; Every raven after his kind; And the owl, and the night hawk, and the cuckow, and the hawk after his kind, And the little owl, and the cormorant, and the great owl, And the swan, and the pelican, and the gier eagle, And the stork, the heron after her kind, and the lapwing, and the bat." "All fowls that creep, going upon all four" "all other flying creeping things, which have four feet" "The carcases of every beast which divideth the hoof, and is not clovenfooted, nor cheweth the cud" "whatsoever goeth upon his paws, among all manner of beasts that go on all four" "the weasel, and the mouse, and the tortoise after his kind, And the ferret, and the chameleon, and the lizard, and the snail, and the mole" "[lying] with mankind, as with womankind" "[uncovering] the nakedness of thy father, or the nakedness of thy mother" "[uncovering] The nakedness of thy father's wife" "[uncovering] The nakedness of thy sister, the daughter of thy father, or daughter of thy mother" "[uncovering] The nakedness of thy son's daughter, or of thy daughter's daughter" "[uncovering] the nakedness of thy father's sister" "[uncovering] the nakedness of thy mother's sister" //etc etc through all relatives, including aunts and uncles, nieces and nephews, sister in laws and brother in laws, as well as the daughters, mothers, and children of women you're already slept with "any bullock, or sheep, wherein is blemish, or any evilfavouredness" "any one that maketh his son or his daughter to pass through the fire, or that useth divination, or an observer of times, or an enchanter, or a witch, Or a charmer, or a consulter with familiar spirits, or a wizard, or a necromancer" "The woman shall not wear that which pertaineth unto a man, neither shall a man put on a woman's garment: for all that do so are abomination" "Her former husband, which sent her away, may not take her again to be his wife, after that she is defiled; for that is abomination" "Thou shalt not have in thy bag divers weights, a great and a small. Thou shalt not have in thine house divers measures, a great and a small. But thou shalt have a perfect and just weight, a perfect and just measure shalt thou have [otherwise, abomination]" (Referring to a merchant's scales, I believe) "A proud look, a lying tongue, and hands that shed innocent blood, An heart that deviseth wicked imaginations, feet that be swift in running to mischief, A false witness that speaketh lies, and he that soweth discord among brethren" "A false balance" (apparently referring to scales again) "They that are of a froward heart" "Lying lips" "The sacrifice of the wicked" "The way of the wicked" (nice catch-all) "The thoughts of the wicked" "Every one that is proud in heart" "He that justifieth the wicked, and he that condemneth the just" "Divers weights, and divers measures" "the scorner" "He that turneth away his ear from hearing the law, even his prayer shall be abomination." -
Luckily you actually pasted the error message that you're clearly getting. That helped.
-
In case your question has something to do with the path of the destination: /images images/ Those are not the same thing. You have both in your code. /images is the root of the filesystem, you don't have permission to that.
-
So your current problem description is "it's wrong, but I won't say how." I'm sure Requinix will get right on that.
-
File On Server Named " Somecustominjectedheaderinjectedbywvs"
ManiacDan replied to rogerdodger's topic in Apache HTTP Server
Good catch David, that's probably what it was. Non-printing characters in the filename. -
Include Keywods Description And Title For Each Page Differently
ManiacDan replied to slayboy's topic in PHP Coding Help
Not sure why we keep having to do this: -
Just out of curiosity... Facebook.
ManiacDan replied to phpfreak's topic in PHPFreaks.com Website Feedback
I didn't realize what I was doing until it was nearly done. The site functions really well though! I use it to disprove a lot of religious based arguments. You should see the number of things listed as abominations in various versions of the bible. Like having sex with your aunt. Or Eagles. Or diver's weights. -
Extra Line Breaks Not Added By Me, Coming As Result Of An Include
ManiacDan replied to Jim R's topic in Applications
I don't know what you're looking for other than "go find where the code does that and stop it". You've given no framework name, style of include, or anything else. Just "my code prints something and I'd like it not to." Well...go stop it from doing that. How is the content doing that? How is the file even being printed? Go find the function or whatever that causes these boxes to show up, and see if they print the extra lines. if they don't, see if there's more functions or includes in that section, and follow them until you find it. -
Which bit is the offset section? What do you consider "wrong"? What, pray tell, would be "right"?
-
Just out of curiosity... Facebook.
ManiacDan replied to phpfreak's topic in PHPFreaks.com Website Feedback
Thanks Derwert, the kinks are still being worked out of the new software. As for facebook: DevShed tracked down the original authors of some serious stuff (like Symfony) in our history. I know I personally wrote half of biblegateway.org through devshed posts. -
Because if it was tasty, there's an obvious answer. If I wanted 60 ft^3 of skittles, it's obviously because I'm going to eat them all. nomnomnomnomnom
-
yes, you have to explain why. by explaining your actual problem (the why) rather than whatever crazy tactic you've decided is the answer (the how), we can actually solve your problem. You don't seem to have a problem. Especially since I gave you the answer. Go look at the fully functioning example I gave you. That provides the exact format you requested. Now you have two questions: 1) How are you going to use that format? 2) Why did you want it in the first place? Unless the values of your arrays are megabytes in size, there is absolutely no reason to do what you're doing. It doesn't matter if it's social security numbers or license plates or street fighter characters. Keep the array as an array.