Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. // put all lines from file into an array $files = file('picturelist.txt'); // find the value in the array and return the key $key = array_search($current_filename, $files); // assign the value of the next element to var $next_filename = $files[$key+1];
  2. Well...only reason I can see value in that is if you are anticipating the use of both the regular and short tags, but tbh, I'd probably rather look into getting rid of the short tags to begin with. Regardless, it might be cleaner and shorter to use a preg_match, but I'm not really the person to be talking to about that. Hopefully someone more versed in regex will come along with better insight.
  3. ah right, that probably needs to change to -7
  4. I think this is what you are looking for: if (substr($s,0,5)=='<?php' && substr($s,strlen($s)-2,2)=='?>') {$s = substr($s,2,strlen($s)-4); eval($s);$s = '';}
  5. probably because of the comma right before it
  6. great thing about indenting is it's easier to tell when things go awry. Assuming this is how you really want your conditions structured: <? if ($_GET['act'] == "1" && $player->nerve > 0){ if($perc2 > 74 && $crime < 9){ } else if($crime > 8 && $jail < 3) { } else if($crime > { } else { if($perc2 > 48 && $perc2 < 75 $crime < 7) { } else if($crime > 6 && $jail < 3) { } else if($crime > 6) { } else { if($perc2 > 24 && $perc2 < 49 && $crime < 5) { } else if($crime > 4 && $jail < 3){ } else if($crime > 4) { } else { if($perc2 > 0 && $perc2 < 25 && $crime < 3) { } else if($crime > 2 && $jail < 3) { } else if($crime > 2) { } // problem starts here } else { echo "Not enough Nerve"; } ?> You know I'm actually looking at the conditions themselves and I strongly advise you sit down and rethink what it is you're trying to do.
  7. else //Update player echo "You gained 25 EXP" You don't have a { after else and you forgot a ;
  8. -You say you have a 3rd party script. -You mention vague errors, offering to dump a bunch of code on people to pour through. -You haven't mentioned anything as far as your own efforts to fix the problem. -You're wanting general advice for (re)designing the site, when you already admitted your lack of experience. I stick by what I said. It's nothing personal.
  9. And we don't do people's homework for them.
  10. you can nest it like this: <?php $y = 10; $x = ($y < 11)? (($y < 11)? "yes" : "innerno") : "outterno"; echo $x; ?> output will be "yes", though seriously, I would not recommend doing this sort of thing. You should never sacrifice readability for a couple less lines of code.
  11. Given your situation I'd suggest you hire someone.
  12. Though you should note that they are not quite the same thing. They have different orders of precedence.
  13. Hmm...well I've always had my @phpfreaks.com email posted but for a while I was not a mod and therefore did not have access to it, so maybe it was during that time. I'm glad you sorted out the pagination thing. As far as sessions go, here's a quick example: page1.php <?php // tell php you are using sessions. // you must have this on any page you wish // to access session variables. It also has to // come before any html output, even blank lines session_start(); // example of setting a session variable $_SESSION['name'] = 'Fluoresce'; // example to go to next page echo "<a href = 'page2.php'>click me</a>"; ?> page2.php <?php session_start(); echo $_SESSION['name']; ?>
  14. start a session and pass it via a session variable.
  15. You can't make a progress bar with just php, as it is parsed on the server and the results are then sent to the client. Look into ajax.
  16. Because my posts really are that valuable.
  17. While hopping around in circles on a unicycle, even. He's an Unbeatable Banzuke champion. His name is Norm.
  18. Did I mention they hired a full time midget with photographic memory to store my posts in his head? I hear he can also juggle.
  19. Because my posts really are that valuable. In fact, in addition to that, they have a special cron job setup just to personally backup my posts on 3 different servers.
  20. You need to check even those. Form values can easily be altered.
  21. To put more than one thing in your email body, you use basic string concatenation. I kind of find it hard to believe that you don't know how to do that, when you (claim to have) wrote all that stuff there... Also, please use code tags when posting code, and make an effort to only post the relevant chunks of code.
  22. You cannot reliably track how long someone has been viewing a page with php. You would need to use something clientside like javascript.
  23. yeah but lack of food isn't the reason they are having so many problems over there. We can feed them 100% and the situation would be the same. Seriously, instead of trying to push this whole baby thing, why don't you make use of google and read up on the real reasons why there are problems.
  24. Not lately...I did kind of disappear for like a year, and that's an average based on my join date, so that doesn't really indicate my current rate.
×
×
  • 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.