Jump to content

xtopolis

Members
  • Posts

    1,422
  • Joined

Everything posted by xtopolis

  1. Np, I was uncertain as well. It's because I echo "data" first, then evaluate the mod of $i that it is confusing. $i is already 3, but it hasn't checked it yet.
  2. Hmm, did I error somewhere between this post and my previous one? <?php $i = 1; while ($x < 17){ echo 'Data ' . $i . '<br>'; if( ($i % 3) == 0 ){ echo 'Snippet of text--<br>'; } $i++; $x++; }//while ?> Data 1 Data 2 Data 3 Snippet of text-- Data 4 Data 5 Data 6 Snippet of text-- Data 7 Data 8 Data 9 Snippet of text-- Data 10 Data 11 Data 12 Snippet of text-- Data 13 Data 14 Data 15 Snippet of text-- Data 16 Data 17
  3. They show up. You just need to change their margin/padding values appropriately. also, the white bullets/text on a white background probably isn't helping.
  4. Uff, teach me to copypasta. I think it just needs delimiters on that line: $file = preg_replace('/<[^>]*>/','',$file); (I added slashes) edit, but im not sure that regex does what you want?
  5. 1)They probably get XML files from the websites with the list of Top40 artists. The "Radio1" site could actually offer this to other websites; you could ask them or look on their site for it. Otherwise you can always cURL their site and scrape the results. 2)Not enough info given. AJAX only makes things "live" in this context. The actions of uploading a file and inserting values into a database can be figured out independently first, then made into a nifty AJAX feature. 3)SQL has a statement called "LIMIT" which allows you to select only a certain number of results.
  6. Use file_get_contents / file_put_contents. In your script, $fh points to stream, not the data as a string. $fn = "test.txt"; $file = file_get_contents($fn); $file = preg_replace('<[^>]*>','',$file); file_put_contents($fn, $file); Untested.
  7. http://us.php.net/manual/en/reserved.variables.server.php the script starts out: "If the referrer contains google and search", mail this message. Running it from your own server will not work unless you modify your UA to pretend to be a google page.
  8. $i = 1; while ($row = @mysql_fetch_assoc($result)){ echo '<div id="div2">',"\n"; echo '<p class="name">' . $row['company'] . '</p>',"\n"; echo '<p class="radius">' . round($row['distance'],2) . ' miles from ' . $city . '</p>',"\n"; echo '<p class="address">' . $row['address'] . '</p>',"\n"; echo '<p class="phone">' . $row['phone'] . '</p>',"\n"; echo '</div>',"\n"; if( ($i % 3) == 0 ){ echo 'Snippet of text'; } $i++; }//while ?>
  9. Here is an additional thread about "tooltips" as I would call them. http://www.phpfreaks.com/forums/index.php/topic,222972.0.html
  10. You would have to use eval() on the code to get it to execute. My suggestion though would be for on first load to check if any events happen today, and if so create a countdown timer for them. Then the background script can just check if anything has changed, and if so reload the page.
  11. I didn't test it... but if you remove the whitespace, does it fix it? <li> <label for="message">Message</label><br> <textarea name="message" id="message"> </textarea> </li> --> to <li> <label for="message">Message</label><br> <textarea name="message" id="message"></textarea> </li>
  12. The only thing he see is you, while you're sleeping. He can definitely touch more than your account though. So.... He touches him while he's sleeping? You seem to know a lot about this.. ps> this thread is over >.< and i missed you corbin
  13. I thought it was to balance out the all the shades of blue... :L Also, I agree with Ken's post. Most of the users that might use this system don't really need it anyway. They are here for more than their 1-2 questions, able to learn and evaluate the responses they get as good or not so good. Also, to reiterate what was said earlier, there are multiple solutions to questions usually, and I could see certain styles being given bias based on familiarity. (ie: procedural vs oop, most average users here are not comfortable with oop)
  14. The only thing he see is you, while you're sleeping. He can definitely touch more than your account though.
  15. Certain mods won't be made if they are not SMF sanctioned because the moderators here that maintain the site do not want to have to update the code each time the board is updated, that is why somethings are reluctant to change, if at all. I am not entirely sure, but I think the "Topic Solved" mod is already a custom, non sanctioned mod? Anyway, I wouldn't resist your idea if we made it look much cooler than your mockup. I don't do well with smilies.
  16. Part of being a programmer is learning to evaluate your sources. References from the manual can be usually be trusted, while comments to the manual are slightly less trustworthy. You may not be there quite yet, but most of programming is learning to use the appropriate tools for the appropriate jobs. At this stage you might be thinking of the functions being the only tools you have, but this goes even further such as design patterns, platforms, feature support, etc, etc. I don't think this would be a useful addition. The users that are here can't find the topic solved button most of the time, to expect them to click a "helpful" link, let alone click it honestly (not just to feel useful) would be expecting too much. A good idea, but most of the people with "integrity" are mods here anyway. Besides that, the better coders usually use code tags and formatting effectively as well as proper grammar . . . you'll learn to distinguish them.
  17. $dir = '/home/user/public_html/thumb/'; $files = glob($dir . '?_*.jpg'); foreach($files as $file){ if( (round(filesize($file)/1024) ) > 8 ) { //do things with this file } } This is assuming that the glob correctly selects the files you intend, and your rounding is correct. Haven't tested. You may have to modify the glob function to accommodate capitalization of file extensions. See the manual for more info.
  18. The select box you created will only have one value submitted. http://www.tizag.com/phpT/forms.php If you were intending to make is a MULTI select box, you need to change your code. I suggest using a checkbox submit system instead, sending userIDs or something.
  19. SELECT DISTINCT years FROM `text` ORDER BY id
  20. Hi Firstly, on your php code, you have = instead of == on the $colord.check = true area. It needs 2 = signs for comparison. Secondly, to pass multiple values for the check boxes, you will have to iterate through them to see which are checked and then append to the url using Javascript. corbin's response to my thread shows this. The idea is that the url for sending an array can look like this: http://www.yoursite.com/somepage.php?age=21&wpm=90&sex=m&color[]=D&color[]=F This way, the $_GET['color'] variable will contain and array holding "D" and "F" as separate elements. It looks like the easiest way to handle this with Javascript is to name the checkbox name attribute the same (such as <input type="checkbox" name="color"> and only change the value attribute values. Then you can iterate through them checking their value and if so, append the url to look like the one above. (example of iterating) Hope that helps. ps> be more patient
  21. Pretty much a double post: http://www.phpfreaks.com/forums/index.php/topic,255944.0.html
  22. Uhh.. referring to the only thing that looks like a question... there is a difference between literal and quoted strings. http://us.php.net/language.types.string Long story short, values inside " " are interpreted, while values inside ' ' are taken literally.
  23. I'm going to guess the error is with your column name. Try: $query = "INSERT INTO dp_codes (`id`, `1`) VALUES ('$id', '$code1')"; I think the problem is with the 1 as a column name.
  24. I was using a class for my $db object. $result = $db->query($sql) is the same as $result = mysql_query($sql); $sql refers to the query "SELECT PostID FROM posts WHERE id='$id'". I just prefer to store it in a variable first. It could all together be $result = mysql_query("SELECT PostID FROM posts WHERE id='$id'"); (or something close to that) You will get the same problem a few lines down when it deletes.
×
×
  • 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.