ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
Hooray, an apple complaint thread! Every single apple product, when a button is pushed, does what Apple believes you really meant. They take form over function to the logical extreme. My iPod doesn't pause or skip tracks when I hit the pause button if I've hit the center button in the last 15 seconds (because it refuses to affect the track in anything other than "volume control" mode). I had a mac for a long time when OSX first came out, and I couldn't get used to it. It just never did what I wanted it to do, it always got really close. I tried to switch to the iPhone, I borrowed one and used it for a few days. It just doesn't let you do what you want to do. I understand their design philosophy insists that everything be perfect, but what if I want an imperfect feature, or I want to install my own stuff? Maybe Jesi doesn't want turn by turn GPS, a text terminal, or the ability to play internet radio while using an NES emulator, but all of those things I do every day.
-
How did you end up with such invalid code? Wouldn't it be easier to just...fix whatever is generating this code? It won't even display right in a browser. However: echo preg_replace('#(<br)(.+?)/>#', "\\1 />\\2", $a);
-
Any time you place restrictions on the user, especially for personal information, you're going to run into problems. Let them decide how their last names are capitalized, especially since there ARE no rules. Macdonald and MacDonald are both acceptable capitalizations. Also, Jesi, and someone who once dated a Koh, I feel your pain for the string length limits on name fields.
-
Oh no, I definitely don't know anything about screenshot programs (apparently) but now I'm interested. What do you do that requires this? I've taken probably 6 screenshots in the last 4 months, and I program web interfaces for a living.
-
It's not really confusing, you're just not really explaining everything you need and why. You're not trying to take screenshots, you want screenshots of the active window, or portions of the active window, with graphics overlaid. That's a lot more than most screenshot apps give you. If you want to capture only the active window to the clipboard, use alt+prtscn. You'd still have to paste it into a graphics editor of some sort to add your arrows and whatever else you need. I've personally never used a standalone screenshot app, since I use gimp for all this, but the above links look promising.
-
So what are you trying to do, exactly? Maybe we can approach it from the other direction.
-
I assume "install Ubuntu" isn't a good idea then? PrintScr copies the screen to the clipboard. Why not open photoshop/gimp/photoimpact/whatever and just paste into there instead of paint?
-
Are you trying to do this on a timer? If so, various malware and spyware does this.
-
Oh geeze, I thought the errors weren't showing at all. your errors are an array. echo implode("<br />", $_SESSION['errors']);
-
Put session_start before ob_start
-
...are HTML files being parsed as PHP on your system?
-
Wherever you put it, there needed to be a space.
-
Are you calling session_start() at the top of every page?
-
You're redefining $r inside your loop. This is why you need to use descriptive variable names.
-
| is a vertical pipe. Put a space in here: echo '<u>|</u>'
-
There's no whitespace in your output, so the browser cannot break because this is one long word. Put a single space after your vertical pipe, and it will work fine.
-
Nice, thanks.
-
preg_match_all('#<TR[^>]*><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD></TR>#', $thisText, $foo); $foo will be a multidimensional array with foo[0] being all the rows, and then foo[1]-[6] being each column, in order, with the header in the first slot. so $foo[3][0] is 'Dep', and $foo[3][1] is STN. You could also use the DomDocument on this, but the documentation is terrible.
-
This is not at all a PHP question, so I'm moving it to the HTML/CSS section. Reply to this and paste the resulting HTML of this output, along with relevant CSS. The PHP loop probably works fine, but none of this HTML is styled (and there's no div at all) so we need to see the actual HTML output.
-
You should always actually echo mysql_error() to read the error message. Your problem is that at least one (maybe two) of your column names on that table are reserves mysql keywords. Enclose column names in `backticks` to avoid this error. Probably, I mean, I don't have your database or anything other than a single comment saying a single query has failed.
-
Josh, is your regex faster than mine? Just wondering. Conditional regexes have always thrown me, despite being an 'expert' otherwise.
-
You could also have added the ID as a hidden form element, so that it would be available in POST
-
Ok, the error is in your takedamage function, and nowhere else. You need to debug just this function. Your code has no error handling or even any concept that something could go wrong, so debugging is going to be difficult. First, dump the SELECT and UPDATE statements to the screen before they're called. Then, add output for mysql_error() after every mysql_query command. You should be adding error-handling code to all of these queries, especially if you're a new developer. It should be something like: $rs = mysql_query($sql); if ( !$rs ) { echo "ERROR IN QUERY: <br /><i>{$sql}</i><br />Mysql Returned: " . mysql_error() . "<P />"; } $row = mysql_fetch_array($rs);//or whatever, proceed with your code.
-
This is the perfect way to debug on your own. How are you sure $_POST is set? Did you print_r it? There are 4 redirects in this code snippet, did you figure out which one is the culprit? Insert die() statements before each redirect to identify which one it is. Once you find it, var_dump all the variables that lead to that logical condition, and ensure they are what you expect them to be. If one (or more) of them is not, move up in the code until you identify the fault. This is far too much code which relies on page load effects and external files for us to find it by hand.