Jump to content

bluebutterflyofyourmind

Members
  • Posts

    113
  • Joined

  • Last visited

    Never

Everything posted by bluebutterflyofyourmind

  1. I don't really get an error per say just this displays....see img attatched. the stars you see are just called png's but at the very top is where i'm trying to draw a star. [attachment deleted by admin]
  2. hey there, for some extra marks in a class i'm trying to use the gd library to create a start for the purpose of a 5 star rating instead of just using png's stored in a folder. i believe i had the code correct but it is not working for some reason. any help? thanks! //set up array for point in star echo "star start"; $values = array( array(0,5), array(5,5), array(7.5,0), array(10,5), array(15,5), array(10,9), array(5,9), array(7.5,10), array(2,15), array(13,15), ); //create image $img = imagecreatetruecolor(15,15); //colors $bg = imagecolorallocate($img,255,255,255); $black = imagecolorallocate($img,0,0,0); //draw star imagefilledpolygon($img,$values,5,$black); //flush image echo "star end";
  3. hey thanks. the first bit of code you gave did'nt work, but suggestion on how to do it worked well. may i ask exactly what it's doing when i say echo substr($hostName, strrpos($hostName, '.')); thanks
  4. the problem with the code just above is that it's not returning false.....just notifying. what i'm trying to do overall is determine what the ending of the host name of a user is....ie. .com .ca .org excetera. since all host name seem to have a different number of .'s i need to run the loop an unknown amount of time to find the last one. at which point i'm getting the notify error
  5. if($hostPortion == false){ echo "hostportion was false and is now exiting the loop"; $x = 1; $count = $y; } else{ $tempCount = $hostPortion[$y]; } echo "host portion after false if = ".$hostPortion[$y]."<BR>"; when it try's to use $hostPortion[$y] pretty much it's getting to the number 6. but that's an error but it still has to run that sixth time in order to make $prev = $tempCount sorry if this is a bit confusing
  6. k it's a bit messy rigt now from bug testing but here it is $y = 1; $x = 0; $tempCount = 'x'; $prev = 'y'; $hostPortion = explode(".", $hostName); while($x != 1){ echo $prev." = prev before equal tempcount <BR>"; echo $tempCount." = tempcount before equal prev <BR>"; $prev = $tempCount; echo $prev." = prev after equal tempcount <BR>"; echo $tempCount." = tempcount after equal prev <BR><BR>"; if($hostPortion == false){ echo "hostportion was false and is now exiting the loop"; $x = 1; $count = $y; } else{ $tempCount = $hostPortion[$y]; } echo "host portion after false if = ".$hostPortion[$y]."<BR>"; echo $x." = x after false if statement <BR><BR>"; echo $tempCount." = tempcount after = host protion <BR><BR>"; echo $prev." = prev before if <BR>"; echo $tempCount." = tempcount before if <BR>"; echo $x." = x before if statement <BR>"; /* if($prev == $tempCount){ $count = $y; $x = 1; } */ echo $x." = x after if statement <BR><BR>"; $y++; echo $y." = y at end of loop<BR>"; } echo $hostPortion[$count]."<BR><BR>";
  7. I'm running a loop but eventually I get to a point where i get the error "Notice: Undefined offset:" is there a way to catch this error as it happens and then exit the loop acordingly with out actually hitting the error?
  8. wow that makes me sooo happy that works. thanks a lot for your help. ya i'm kinda new to php. for some reason the comma's have been working pretty well. buut they're al changed to periods now that i know better. thanks again!
  9. so that was very helpful but now i'm still running into a problem. I print the specific line of the array just fine but when i use the explode function, it just prints the word "Array". $filearray = file("ProductInfo.txt"); echo $filearray[2],"<BR>"; $portion = explode(":", $filearray[2]); echo $portion,"<BR><BR>"; that's the code i have so far
  10. hey there. I'm using file() to create an array of the lines from a .txt file. I guess i have two questions. 1) how to I refer to each line individually after the array is created. ie. do action A to line 5. 2) how would I search through that line in order to fine a specific character. ex. 1 Product Name: Macromedia Director MX 2004 Bible so I want to loop through to ':' so I can cut of that part of the line and then display the rest of the line. thanks for any help.
  11. hmm. i see where your're coming from. but say for example, i'm in canada and i type in ecay.com, i get redirected to ebay.ca . how does ebay or any other e-commerce site determine where i'm from?
  12. hey there. just working on an assignment for a univeristy course. i'm rather new to php and would like to know how to determine where the viewer is from. ie. what country. so if they have a .ca i can display canadian funds, .com/.us american funds, and .uk for pounds. is there a function that can be used for this or is there a way to set the domain to a variable and extract it from there. (sorry is some terms are wrong. bear with me.) thanks!
×
×
  • 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.