Jump to content

Balmung-San

Members
  • Posts

    327
  • Joined

  • Last visited

    Never

Everything posted by Balmung-San

  1. It's probably this line: $c = $c++; Instead, use either: $c = ++$c; or just: $c++;
  2. It's because you echo it before you rtrim. Also, your loop will rtrim everything, which isn't what you want. I suggest you build up one big string, remove the ending comma from it, then echo.
  3. Scope is basically where the variable can be seen. Since the first use is within a while loop in the included file, I'm thinking the variables stay local to that loop, and die once the loop is done.
  4. Then the issue has to be scope. Try declaring $tickerLink, $tickerTitle, and $tickerMessage before the require statement.
  5. Use $tickerLink[1], $tickerTitle[1], and $tickerMessage[1]. You're trying to use the string '1' as the key, when the key is the numeric 1.
  6. I believe your comparison wrong, and I'm unsure as to why it works on Server A. fsockopen returns a resource on success, or FALSE on failure. <?php //test the server to see if it's up $server_testing = fsockopen ("1.1.1", 80, $errno, $errstr, .2); if ($server_testing === FALSE) { echo "DOWN"; } else { echo "UP": } ?>
  7. AddType? No, you want to use AddHandler. AddType will alter the mime value, which is just sent to the client. AddHandler will tell apache how to handle the file on the server side.
  8. It could be that you're not outputting anything, at least not with this code. As well, $tickerLink, $tickerTitle, and $tickerMessage are all local within the loop, at least that's what I can tell from the little code you've given us.
  9. What's the problem? As well, why don't you run error_reporting(E_ALL) at the top of your script? That's not something that the server admin will usually block against, as it's specific to that script.
  10. Try public function getMyValue() It should work the way it is, but better safe then sorry.
  11. I'm not entirely sure how you would want to do it. I personally have never tried to abstract out the mysql functions, and if I was going to use an OO approach, I would use PDO.
  12. That's because you're not updating the pointer within the result. mysql_fetch_array keeps a pointer for that result tucked away, so that it will move through each record one at a time, allowing the while() loop to work. Your class only ever returns the first record because it does not update the pointer, and with the way your function is designed, it cannot update the pointer because you requery each time.
  13. Sanitize your $_GET variables. Don't just use them right away. You would use file_exists() to check if the file you wish to include exists before including it. If it doesn't, then you would include the 404.php file.
  14. if(isset($_POST['check1']) && $_POST['check1'] == value_here) { do X instead } else { run normal } That's the basics of it. You still want to sanitize your variables. Also, you'll want some value in your HTML code for it.
  15. My way of thinking would be to do this: <?php $maxHeight = 0; foreach($array as $key => $add){ $image_height = round($_SESSION['imgheight'.$key]); if($image_height > $maxHeight) { $maxHeight = $image_height; } } ?> Though I'm sure somebody else will have a more efficent way of doing this.
  16. short_tags is disabled in your php.ini. I would suggest you always use the <?php tags, even if you have short_tags enabled. This will allow for support on all systems, regardless of the php.ini configuration.
  17. I wake up real early. Then I go to work, where I spend my days pretending to write PHP code (well, I do actually get some things done), and posting on these forums. Then I get home, eat dinner, and usually go to school. If I don't have school I either go over my girlfriend's (if she's not working), or sit around playing City of Heroes.
  18. Explain "won't work". jesirose's code is a perfect example on how to do exactly what you want.
  19. Okay, I'll make the first reply then. I've actually been meaning to get more of their stuff. I had heard The Ultimate Showdown of Ultimate Destiny ages ago, and really enjoyed it. It's one of those songs that you can't help but laugh at.
  20. I'll chip in the SkyOS vote here. May not be fully up there in hardware support, but they've got a fair amount of apps, and a killer community. I also find the way they're doing purchasing/beta of it to be interesting. You can buy the final version now for $30, and get beta access, plus all minor version updates past the 5.0 final release. It's really worth looking into for a simple, yet powerful desktop computer.
  21. You're going to have to be a bit more specific then that. There are a ton of ways to have an "I agree to ..." built in, it's a matter of what you're looking for. I know that phpBB puts up the ToS on a page, then for the agree link it sends you back to the same page with a variable attached to the back of the url, then in the page they check for the value, and output accordingly. Another common way is to have a checkbox at the bottom of your registration form. When they submit it you can then check whether or not it's checked. It all really depends on how you want to do it.
  22. You'd need to have access to .htaccess files (or be able to setup new handlers in your web hosting control panel). For .htaccess: AddHandler application/x-httpd-php .htm That should work, but don't hold it as 100% perfect. I'm no master at .htaccess or Apache.
  23. $testvalue disappears after your function call. The variable you have has been declared with scope local to that function, but it dies beyond that. You might want something like this: <?php class test{ public $testvalue; function fetchsomevalues() { $testvalue = 1; } } $fetcobj = new test; //or should it be test()? Is this one of my Java irks coming out again? $fetcobj->fetchsomevalues(); echo $fetcobj->somevalue; //output: 1 ?> It has to be declared outside of the function to have access to it, and it must be public to access it that way. Also, using a function name like fetchsomevalues() to set a variable is a bad naming idea. The name makes the user think that it will return the value back, in which case you'd want to change fetchsomevalues to this: <?php function fetchsomevalues(){ $somevalue = 1; return $somevalue; } ?>
×
×
  • 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.