ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
If only they made fire-proof NAS boxes. I'm sure someone could figure that out... Also, a free unlimited cloud service? How could they possibly monetize that? I don't trust them...
-
RAID is not an alternative to backups, but his argument of "you have more chance of a drive failing if you have 4" is countered by "not if it's raid." A proper setup is a RAID array with a separate backup drive. If you're really paranoid then you need the backup drive to be off-site.
-
Why didn't something like prettyprinter work, then? You said you tried something (which works) and that it didn't work for you. Why? What else are you expecting?
-
One thing you haven't thought of (though you of all people should) is trolls. If you let people go back and retroactively edit what they said during an argument or discussion, it's possible they could completely change what they had said and make people look foolish or angry. We had that problem on devshed, and the fact that users aren't allowed to edit their posts after a minute or two really helps with arguments on PHPFreaks.
-
In HTML, all whitespace is condensed to a single space. You can either run nl2br on it, or wrap the output in <pre> tags, whichever you think works better.
-
1) It returns zero because you're asking PHP to subtract two formatted strings, both of which will resolve to 18. You need to work on timestamps or numbers, not formatted time strings. 2) You need DATETIME or TIMESTAMP, not just TIME. TIME, as pika pointed out, will be ambiguous unless you can guarantee that the times will always be on the same date, and/or the first one comes before the second one. Regardless, to get a timestamp you need to use a date and a time in strtotime or mktime. 3) You will eventually go insane if you keep naming your variables $result9 and $m2. Name them what they are.
-
It depends on so many factors. What you did was destroy the file system tables, which include the folder and file names, but that data may be recoverable and it may exist elsewhere on the disk. Those data recovery firms charge tens of thousands of dollars though. You should try these backup/restore programs until either you find one that works, or you give up and go to a firm. Also, I bet you'll start backing up your data for real from now on.
-
Based on the way filesystems work, no you can't. You can only recover "whatever we can find," you cannot recover specific files or folders, because you deleted all the names of all the files and folders.
-
you need to run all these user-submitted variables through mysql_real_escape_string to avoid SQL injection. Also, I wouldn't search based on price, it seems silly to have a user search for "2" and get back something that costs $82.50.
-
Two seconds on google produced this list of code beautifiers. Zend studio does very good auto-formatting. You should really be doing this yourself though. I do it by hand when I write.
-
Googling produced this company with a data recovery suite.
-
Ah-ha. The inside of your loop can still be condensed to 4-5 lines without this big chain of if/elseif.
-
Well if you answered the question I'd be able to help you. Go up and find the question. So far you're saying you have two lines and you only want one of them. "Just print one" is your answer unless you read and answer the last question.
-
No, sorry, you're still not making any sense at all. Explain it to me like I don't know what you're saying (which clearly none of us do). Look at your comments here: $value1 = 0.10 //Want this one to run into that IF to find the "$result" $value2 = 0.30 //Then this one to go in You want to run into a an if and then the other one to go in? What? Also, you echo one result twice, I don't know how you think they'll be different numbers.
-
No, it's just a pain in the ass for the dev. It's only necessary if you have complex formatting in your posts. Install or write a BBCode parser, there's a thread on it on the front page of the forum right now. Download and install something like FCKEditor. Pain in the ass and generally not worth it for article comments. Even PHPFreaks doesn't let normal users edit their posts after 30 seconds, all of the "edit" functionality is reserved for just us mods. It's only really necessary on discussion forums like this, you will often see people simply replying to themselves with corrections.
-
Nope, sorry, doesn't make sense. Show some starting inputs and their desired outputs. Right now you have some kind of calculation that appears to follow a pattern (except for the 2 examples I cited) but does random division beforehand and only works on one of the two variables you keep calling 'grades' but are named 'mod'
-
Possible Wordpress malicious activity discovered - zboard.php?
ManiacDan replied to simcoweb's topic in Applications
Why not attach this file of yours to this thread so we can look at it? Also, XSS attacks don't create files on your hard drive, so that's not the category of exploit you should be looking at. -
"Bumping" your threads is actually against the rules of the forum. Explain the logic you're trying to implement here. Like Requinix, I think I can condense this to a couple of lines, but you have a random rule that breaks the pattern. Why does this block appear? elseif($intel_mod < 0.1){ $int_mod = 0.95; } Regardless, it's in the wrong spot, as is this one: elseif($intel_mod > 0.20){ $int_mod = 1.50; } Explain the "rule" you're trying to implement, and don't bump.
-
In fact, that line will always set $option_id equal to '' and then execute the IF condition regardless of the original value of $option_id.
-
Please read the responses, the experts here are worth a lot of money, you're getting thousands of dollars worth of professional help for free. I told you that you don't need quotes at all, and you added MORE quotes.
-
There is no "edit" form, there's just the one form. That's the problem. Make a reply to this page. Look at the address bar. The URL is: index.php?action=post;topic=354623.0 Type something and hit "preview". The URL doesn't change, a preview box just appears. (PHPFreaks does it in JS, btw, but the post method works the same way). You post back to yourself. If the submit button is "submit", submit the comment and take them wherever you normally take them. If the submit button is "preview", re-draw the comment form, but this time put a box above the textarea featuring the comment as they posted it. Let them preview as many times as they want before hitting submit.
-
Neither, which is why I mentioned neither in my post. Accept the post, immediately re-draw the page and put their post back in the edit box. No sessions, no db. Yes, the name is always "submit" and you change the VALUE. Never. People are stupid and never double check anything. that doesn't mean you're required to cater to them with an edit button, let them reply with spelling corrections.
-
thumbnail-web-screenshots-script with php
ManiacDan replied to dilbertone's topic in PHP Coding Help
imagegrabscreen only works on windows and it grabs the current screenshot that you see on your monitor. It does not load websites and render them. You will have to find a third party solution for this, PHP cannot do it by itself. You can attempt to: 1) Figure out how to pass URLs to firefox, then use imagegrabscreen to take screenshots of your entire desktop, which you will have to trim later. 2) See if you can exploit the rendering engine and plugins of firefox or chrome, the firefox plugin ScreenGrab might be useful to you. -
Generally students are pretty good at breaking into systems, especially those which will email their parents to tell them the child is in trouble. If you don't have enough PHP/SQL skill to even start this project, you certainly don't have enough to make it secure from school children. I broke into my first school system when I was 11. That being said, if you still want to do this, get a real book. Learning based on free web tutorials isn't great. I recommend O'Reilly's "Web Database Programming with PHP & MySQL." It's at B&N or amazon.
-
So you want PHP to dynamically draw a speedometer and odometer based on two different database values? That's significantly harder, look into the GDImage extension.