Jump to content

no_one

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

no_one's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You should probably set size to more than one, otherwise it would only show one field in the list. And if you're going to pass this form to php, the names should be arrays: <select size=3 multiple name="mop[]"> ... options .. </select>
  2. Maybe echo/print out all the vars used in the str_replace before using them, just to make sure they even contain what you'd expect them to. Is error reporting on? (Maybe you have one and don't know it). Also, the 4th parameter in str_replace is for a var to be passed by reference and will hold the "count" of how many times the search string was found and replaced. You're not using it in your code, but so you know for future reference. Otherwise, I don't see a problem in the way str_replace is being used.
  3. Hi Ty for the suggestion. Just tried it, and still got the same error, same line (the line where the echo is). Below is is the basic set up, the only thing that needed changing was moving the __ctor() open curly, and putting in an echo. Someone already pointed out the semi-colon on the end of my class, it doesn't hurt anything that I can see (I've removed them and still no help). <?php require_once("required.php"); class mclass { public function __construct(){ echo "page_construct"; $this->somemethod(); } /// other class code.. }; // ... $mc = new mclass(); ?>
  4. Back to this again. I went through all my code, line-by-line, and found nothing wrong. I did a few other things to check for problems. I didn't figure I'd find any, since the problem makes no sense. The site I've been programming is nearly finished (on hold because of this problem) so I uploaded (for the first time) all files to my host server and got an error, after altering a few things (no real coding, just code cleanup while looking at every line), I get a different error, but the same file, same class, and same general area. Parse error: syntax error, unexpected T_PUBLIC in /dir/file.php on line 31 (Note: dir/file.php isn't the real file path.. but w/e). <?php class myclass { public function __construct() // line 30 { // <-- line 31 ?> I've also deleted the 'public' as a test and still got the error. The problem I'm having is even after updating all my software to match or go higher than my host's versions (php 5.2.2) the code runs perfect on my computer, but I get the above error on the host. I do have error reporting set to show everything. I checked for unmatched brackets/braces/quotes, missing semi-colons, colons where it should be semi, etc. Nothing wrong AFAI-Can see.. Any suggestions? I'm seriously losing my mind. If not, then all I can think to do is get another host for a month and see if I get the same problem.
  5. Teng84 makes a good point. If you must use the ~SS~ though.. <?php if( substr($userrow['charname'], -4) == '~SS~' ) { } ?> Get last 4 characters of username, compare to ~SS~ ..
  6. So.... <?php $item_num = 0; foreach($contents as $id=>$qty) { $item_num++; // other code } ?> .. that's what you want?
  7. How about 2: \n\n for <p>?
  8. Yeah, didn't mean anything by it :S Just thought Nat would like to know before trying any of the suggestions given, in case they ran into problems. :-\
  9. $nocomma = str_replace(',', '', '1,553.00'); Something like that
  10. @Charlieholder Tested that before posting, mine ran faster (~194-200% faster.. 2x). Also, afterward, the modified string still contained multiple spaces. Oh, if php version < 5.0.0 <?php function str_multspace_del($str) { $cnt = 0; do { $ls = strlen($str); $str = str_replace(' ', ' ', $str); } while( $ls != strlen($str) ); return $str; } ?>
  11. Something like this should work. <?php function str_multspace_del($str) { $cnt = 0; do { $str = str_replace(' ',' ', $str, $cnt); } while( $cnt ); return $str; } ?>
  12. okay, fetch_array or something :'( I'd think the query is fine though, for the most part.
  13. First, I didn't check everything, but I think in your html you'll need to change the name of the checkboxes from pi to pi[] That way the server will get all in an array. so: $pi = $_POST['pi'] $pi will now be an array, if you want a string: $pi_str = implode(',',$pi); or something.. Help at all?
  14. Not sure what that's about, but another note, I used mysql_fetch_row, might want to try mysql_fetch_assoc(), and change 4 to 10.. I dunno, I'm tired, sorry Hmm, I also changed the 'time_posted' check. Checking all posted less than 4 minutes from now was wrong. Should check all posted -4 minutes from now, hah. <?php $qry = mysql_query("SELECT COUNT(*) as pcount FROM post WHERE time_posted>DATE_SUB(NOW(), INTERVAL 4 MINUTES) AND posted_by = '{$_SESSION['id']}'"); $qr = mysql_fetch_assoc($qry); if ( $qr['pcount'] > 10 ) { // deny } ?>
  15. Nah, pcount is an alias to COUNT(*), basically just a count of how many rows (posts) were found that matched your where condition.
×
×
  • 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.