Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. redarrow, do you ever bother trying your code before posting it? <?php $array = array(5 => "001", 2 => "001001", 1 => "001001001", 9 => "002", 7 => "002001"); foreach ($array as $key => $val) { $count = strlen($val) / 3; for ($x = 0; $x < $count; $x++) { echo "*"; } // end for echo "$key<br/>"; } // end foreach ?> That physically shows what you want, however if you were wanting to somehow separate the list, like when it goes from 001 to 002, you would have to throw in a condition on $val to add a new <br/> or <div> or whatever else you want to do to divide it.
  2. My main hangup about the phpfreaks irc channel is that 100 questions being asked at the same time in the same place causes massive confusion. Now in reality, that place is dead, so it's not really an issue, currently. But if it were busy, it would be a very big problem. I think having the ability to be able to open up a unique channel or room, based on individual threads, has some potential. But I do agree that it's not really practical, in a lot of ways. For instance, what Dan mentioned, as far as problems that take awhile to figure out. There's really no point in sitting around forever in a live chat room if people are off somewhere else looking at the problem and not talking. Interface can be made and embedded inside the thread itself, as a collapsible div, or whatever. Rooms created and destroyed when first person enters, last person leaves. content saved and loaded up, just like thread content. Responses can be made in room or thread. We're talking about massive work, though. Forum integration all over the place. Admin/mod settings/actions. Whole new pages for managing stuff. Search function integration. Login integration for viewing/posting. Addition to db structure for chat room data storage. Figuring out a system to handle actions that would have adverse effects on chat room content: for example, what happens when topics are merged or split? Overall, I think that this idea looks good on paper and would make us stand out from the other support boards, but in practice, is not really worth it. At least, not as an individual addition to the community. Maybe if it were made to be very modular, even giving it the ability to be interfaced/installed on other systems, not just smf. I think that the current irc channel more than serves to answer quick questions. And if you're looking for "live chat," well, you could always post an IM to reach you at, and people can choose to IM you at their discretion...
  3. Wasn't trying to nitpick. It's just that you started out by saying "I see a bunch of errors" and then said "you need to do this" and "you need to do that," which implied that his script wasn't working because of those things. At least, that's how I interpreted it. Could be just me >.>
  4. It is not necessary to uppercase sql keywords. It's done purely for programmer readability. sql doesn't care either way. You do not need to use fetch_array instead of fetch_assoc. fetch_array returns double the data: an array with associative indexing and an array with numerical indexing. fetch_assoc returns just the associative version (fetch_row returns just the numerical indexed version). There's even an optional 2nd argument for fetch_array to only return associative or numeric, not both, effectively making it exactly like fetch_assoc or fetch_row, anyways. Unless you for some reason need both (which really, you don't), it's better to just use fetch_row or fetch_assoc, so you aren't using twice the memory. Using <?php ... ?> is preferred over the <? ... ?> short tags, for portability. It's not that not all servers don't have it, it's that not all servers have it enabled in php.ini. Last time I checked, that setting is on by default, so chances of you finding a server that doesn't have it set are minute. If your server has it enabled and you aren't planning on porting your code somewhere else, it really doesn't matter.
  5. You have your select tags inside the loop. The only thing you should be looping is the option tags. Also, you used the wrong var name for value. <td class="right"> <?php $sql = "SELECT * FROM tblcatdetails order by category asc"; $result = mysql_query($sql); echo "<select name='category'>"; while ($row = mysql_fetch_assoc($result)) { $catid = $row["intCatID"]; $category = $row["category"]; echo "<option value='$catid'>$category</option>"; } echo "</select>"; ?> </td>
  6. echo "<img src='{$row['thumb']}' />";
  7. You know what? Frack you. I'll use a table layout if I want to. I'm old school. Hardcore. What you gonna do about it? I was coding before your dad Fracked some crackhead hooker and conceived your sorry ass. You said 8-Track was dead, and you were wrong! Next thing you'll be telling me I should get rid of my beta tapes! Kids these days. Don't know nothin'. Disrespectful little snots. // shakes angry fist
  8. [^="] that is causing it to grab 1 char that is not a = or "
  9. tbh I'm not impressed. I mean, yeah wonderful, if I happen to come across a pattern and wasn't sure what it did, I could put it in there and see what it does, but to me that's not really all that useful. And that's assuming I could read the 'diagram' output. Needs a 'legend' to tell you what the different symbols and lines mean. If you already know what they mean, chances are, you already knew what the pattern did to begin with. Informative? Sure...maybe (again, the output is almost as archaic as the input...). Useful? No. It's a start. If ability to put in subject and it show you what the pattern matches inside the text (within the context of the text as a whole), we'd be getting to something useful. Output is visually appealing, I'll give it that. But overall, it's like seeing a tray full of fruit, walking over to pick an apple off it, and finding out it's just a plastic display. And I'd rather it all be dumped on the same page, not separate pages.
  10. .josh

    Flash & PHP Mailer

    Well technically you should be using $_POST['varnamehere'] in the php but $_REQUEST can be used. Could also be that the mail server on your host isn't working or not setup properly or something. Try going to www.yoursite.com/mailer.php directly, see if you get an email. If you do, then you can at least scratch that off the list.
  11. http://us3.php.net/magic_quotes
  12. google php flatfile hit counter. A billion scripts, example, tutorials, etc.. blahblahblah. Change it to add 10 instead of 1. Bask in the glory of self sufficiency.
  13. Wow, small world. Someone else was looking for almost exactly the same thing recently.
  14. <something[^>]*>
  15. or die(mysql_num_rows()); you probably meant: or die(mysql_error());
  16. ah, yeah, guess that would have the same effect.
  17. .josh

    Flash & PHP Mailer

    doesn't look like anything is wrong with the php. I don't know a whole lot about AS but are you sure you are uh...damn, I don't know the term, but like for instance, if that code is inside a button, but for instance email_box.text is in some other object (like the button is inside an object of some other object or something), you would need to put the right... uh, path.to.object.email_box.text or whatever. Kind of like how _root.email_box.text would (I think) mean that that box is on the root scene or whatever. Well if it's inside an object, it would (I think) be _root.someobject.email_box.text or I guess it kind of works like directories, where you can use relative paths or somethin'. I dunno. I think I halfway know what I'm talking about. Anyways, did you check that you have the right "path"? In other words, I think if you have email_box.text in objectA and this function is in objectB those are two different scopes, and you have to specify the path so AS knows where to find it. Or something.
  18. Well, I'm still kind of confused about your program flow... but it sounds like if you put that session var init in your external page, that should do the trick.
  19. Okay well then it sounds like your index.php is overwriting the array_push with $_SESSION['info'] = array();
  20. Okay, so let me get this straight: your coding order is this? (look at the comments I added): index.php <?php session_start(); $_SESSION['info'] = array(); //some other code // CALL EXTERNAL PAGE HERE include('inc/infoboxes.php'); //some other code external page <?php session_start(); // some other code array_push($_SESSION['info'], array (icon => "add.png",text => ADMINADDINFO )); // REDIRECT TO INDEX.PHP
  21. You initialize $_SESSION['info'] and then turn around and then include infoboxes.php. You didn't actually assign anything to $_SESSION['info'] before the include. What is that external page? The code in "external page" needs to happen somewhere before the include in your index.php
  22. did you declare $_SESSION['info'] as an array, before trying to array_push something into it? edit: yes you did. Sorry, kind of hard to tell, when you have your code all broken up and out of order like that. Repost the code together and in order, please.
  23. You cannot have any output before it, not even blank lines or spaces. I notice in that code you posted, there's a space before the <?php could be that, or if that was just a typo on the forum, something else. Do not use ob_start();. First off, same rule applies: has to be before output. 2nd, it's a bandaid, not a fix. The fix would be to code properly to begin with.
  24. need to put session_start(); before you can use session vars (on any page you use them, not just where you assign something to them). It also needs to come before any output, even blank spaces or lines.
  25. Again, I can't tell you why your code is messing up, unless you actually post your code. I'm not psychic. If that's not good enough for you, then maybe someone who is psychic will come along shortly.
×
×
  • 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.