Jump to content

tefflox

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by tefflox

  1. the code is meant to echo a line of 50 characters made of long dashes and nbsp's, but it only echoes a single random number.  How can I get this code to echo the string that I need? [code] function flow() {         $ar = array( 0 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f); $count = 0; $output = ""; while($count < 50) { $numSpaces = rand(0, 9); for($i = 0; $i < $numSpaces, $count < 50; $i++) { $output += "&nbsp;"; $count++; } $r1 = $ar[rand(0, 15)]; $r2 = $ar[rand(0, 15)]; $g1 = $ar[rand(0, 15)]; $g2 = $ar[rand(0, 15)]; $b1 = $ar[rand(0, 15)]; $b2 = $ar[rand(0, 15)]; $col = $r1.$r2.$g1.$g2.$b1.$b2; //$output += "<span style=\"color:#\".$col."\">&mdash;&mdash;</span>"; $output += "<span style=\"color:#\""; $output += $col; $output += "\">&mdash;&mdash;</span>"; $count = $count + 2; } echo $output; } // end flow [/code]
  2. Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Warning: Unknown: Failed opening '/var/www/00/index.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0 this page works fine at [url=http://listenlight.net/00/]http://listenlight.net/00/[/url]  but on my localhost (default ubuntu LAMP) it throws that error.  all the other pages work fine, and the code/markup is nearly identical.  thank you kindly for your time
  3. the idea is to make an elliptical favicon of random color that is new for each page load. here's what i've got so far. the page / source is [url=http://listenlight.net/createpng.php]http://listenlight.net/createpng.php [/url] What am I missing? [code]<?php function randomFavicon() {           $img = imagecreatetruecolor(16, 16); /* Create a blank image */           $bgc = imagecolorallocate($img, rand(1,160), rand(1,160),rand(1,160));           $ec  = imagecolorallocate($img, rand(1,160), rand(1,160),rand(1,160));           imagefilledellipse($img, 8, 8, 12, 16, $ec);           //header("Content-type: image/png");           imagepng($img);                      return $img;          }       ?> <?php $favipng = randomFavicon();   echo( "<link rel=\"icon\" href=\"".$favipng."\" type=\"image/x-icon\" /><br /><link rel=\"shortcut icon\" href=\"".$favipng."\" type=\"image/x-icon\" /><br />");   echo ( "<title> testing </title>" ); ?>[/code]
×
×
  • 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.