Jump to content

bluesoul

Members
  • Posts

    149
  • Joined

  • Last visited

Everything posted by bluesoul

  1. You'll be using a table, with each call to the function in it's own <td> block.
  2. In case the tutorial makes your eyes glaze over, the major bug is in your <form> tag, but that's a handy enough tutorial I'm not gonna tell you what it is.
  3. 200 to 300k temp images, even if brief, will kill your memory. The creation of the image normally takes tens of MBs per image, even with ones that aren't particularly large. Using a buffer to track the length of it makes much more sense, though I've never had need to write the code.
  4. In my experience a POSTed value left blank will still be a variable with a pointer and physical address, with a null value (\0). This is why sometimes checking the strlen() of a POSTed variable is the easiest way to determine if operations need to be performed on it. I tend to only use isset() on GET vars for a centralized page, e.g. if ?do=foo execute this block, if ?do=bar execute that block, if ?do isn't set show the index.
  5. Yeah, strtr() requires the two strings to be identical lengths, and extra characters are ignored. It's more for this kind of thing: $addr = strtr($addr, "äåö", "aao");
  6. Try str_replace() instead of strtr(). Same arguments.
  7. This got it, thanks a ton, I'd have been beating my head on this for a while.
  8. It's entirely possible your host doesn't allow fopen() but you'd also want to make sure your absolute paths are correct (/home/indiana/etc...).
  9. Ugh, having some problems getting this working. Before my loop: $list = array ( 'Account ID,Invoice ID,Domain,Invoice Date, Registrar, Description, Exp. Date, Charge, Balance'); In the loop: $fp = fopen('invoice'.$timestamp.'.csv', 'w'); $list .= array ( "$aaid,$aiid,$adn,$invdate, $arid, $adesc, $expdate, $charge, $balance"); foreach ($list as $line) { fputcsv($fp, split(',', $line)); } After the loop: fclose($fp); Results in "Warning: Invalid argument supplied for foreach() in searchinvoices.php on line 77". I'm assuming it's because I can only pass it one element at a time. Ideas?
  10. <? isset($userinf['clan']) ? "- <a href=\"cforum.php\">Clan forum</a><br>\n" : ""; ?>
  11. <?php $q = "SELECT view FROM profiles WHERE username='{$_POST['username']}' LIMIT 1"; $query = mysql_query($q) or die(mysql_error()); $row = mysql_fetch_assoc($query); if($row['view'] == "private") { echo "This profile is set to private, redirecting you. <meta http-equiv=\"refresh\" content=\"3;url=index.php\" />"; } else { //display profile } ?> That's a rough idea, I'd highly recommend escaping posted data rather than using it directly in a query at the least.
  12. Easiest way without messing with headers or anything would be to do... <img src="$foo" /> Where $foo is the URL you stored.
  13. I believe I'd try and add another publisher column or two to the table just for instances like this, giving them both the same game_id is going to be a primary key violation. So perhaps... game_id title devname genre pub1name pub2name sysname 4 Fallout 3 Bethesda Game Studios Role-Playing ZeniMax Media Bethesda Studios Xbox 360
  14. Premiso beat me to the punch. Anytime something says unexpected T_STRING, T_ECHO, or what have you, start counting brackets, commas and semicolons.
  15. Never mind, found a working script on php.net. Thanks though.
  16. I have a static date and time in the future, and I need to have a simple echo of the difference in hours and minutes (or rounded hours) between now (when the page is called) and then. Can't seem to wrap my head around much this morning, can someone give me a hand?
  17. <?php if(isset($_SESSION['MM_UserGroup'])&& ($_SESSION['MM_UserGroup']=='9' || $_SESSION['MM_UserGroup']=='8')){?>
  18. Clean up the username, make sure there's no garbage added on in transit, use trim() and mysql_real_escape_string(). Also add "or die(mysql_error());" to the end of your query. Where is $tbl_name being defined?
  19. $newtime = strtotime("+2 hours",$oldtime);
  20. <li class="med"> <?php switch($stars) { case '5': echo '<img src="../../elements/images/layout/5star.jpg" alt="5 star"/>'; break; case '4': echo '<img src="../../elements/images/layout/4star.jpg" alt="4 star"/>'; break; //etc default: die("Invalid result"); break; } $stars = ""; ?> </li>
  21. Huh. Never knew about that shortcut, I always assigned them to new vars just to be safe.
  22. Right, you can keep an array in a cookie of thread id's, then if the thread listed is in the array in the cookie, it's noted as read.
  23. There are a few ways of going about marking forums as read, vBulletin's docs may give you an idea or two.
  24. http://www.workingwith.me.uk/articles/scripting/mod_rewrite
×
×
  • 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.