can anybody tell me whats wrong with this code

Discussion in 'Programming' started by dawilster, Sep 11, 2008.

  1. #1
    can anybody tell me whats wrong with this code

    <?php
    /**
     * Coded By Cleanscript.com 2008
     * For Support contact us via cleanscript@gmail.com
     *
     */
    session_start();
    $words = "shiel shier shies shift shill shily shims shine shins shiny ships shire shirk shirr shirt shist shits shiva shive shivs shlep shoal shoat shock shoed shoer shoes shogs shoji shone shook shool shoon shoos shoot shops shore shorl shorn short shote shots shott shout shove shown shows showy shoyu shred shrew shris shrub shrug shtik shuck shuln shuls shuns shunt shush shute shuts shyer shyly sials sibbs sibyl sices sicko sicks sided sides sidle siege sieur sieve sifts sighs sight sigil sigma signs siker sikes silds silex silks silky sills silly silos silts silty silva simar simas simps since sines sinew singe sings sinhs sinks sinus siped sipes sired siree siren sires sirra sirup sisal sises sissy sitar sited sites situp situs siver sixes sixmo sixte sixth sixty sizar sized sizer sizes skags skald skate skats skean skeed skeen skees skeet skegs skein skelm skelp skene skeps skews skids skied skier skies skiey skiff skill skimo skimp skims skink skins skint skips skirl skirr skirt skite skits skive skoal skosh skuas skulk skull skunk skyed skyey slabs slack slags slain slake slams slang slank slant slaps slash slate slats slaty slave slaws slays sleds sleek sleep sleet slept slews slice slick slide slier slily slime slims slimy sling slink slipe slips slipt slits slobs sloes slogs sloid slojd sloop slope slops slosh sloth slots slows sloyd slubs slued slues sluff slugs slump slums slung slunk slurb slurp slurs slush sluts slyer slyly slype smack small smalt smarm smart smash smaze smear smeek smell smelt smerk smews smile smirk smite smith smock smogs smoke smoky smolt smote smuts snack snafu snags snail snake snaky snaps snare snark snarl snash snath snaws sneak sneap sneck sneds sneer snell snibs snick snide sniff snipe snips snits snobs snogs snood snook snool snoop snoot snore snort snots snout snows snowy snubs snuck snuff snugs snyes soaks soaps soapy soars soave sober socko socks socle sodas soddy sodic sodom sofar sofas softa softs softy soggy soils sojas sokes sokol solan solar soldi soldo soled solei soles solid solon solos solum solus solve somas sonar sonde sones songs sonic sonly sonny sonsy sooey sooks sooth soots sooty sophs sophy sopor soppy soras sorbs sords sorel sorer sores sorgo sorns sorry sorts sorus soths sotol sough souks souls sound soups soupy sours souse south sowar sowed sower soyas soyuz sozin space spacy spade spado spaed spaes spahi spail spait spake spale spall spang spank spans spare spark spars spasm spate spats spawn spays speak spean spear speck stich stick stied sties stiff stile still stilt stime stimy sting stink stint stipe stirk stirp stirs stoae stoai stoas stoat stobs stock stogy stoic stoke stole stoma stomp stone stony stood stook stool stoop stope stops stopt store stork storm story stoss stoup stour stout stove stowp stows strap straw stray strep strew stria strip strop strow stroy strum strut stubs stuck studs study stuff stull stump stums stung stunk stuns stunt stupa stupe sturt styed styes style styli stymy suave subah subas suber sucks sucre sudds sudor sudsy suede suers suets suety sugar sughs suing suint suite suits sulci sulfa sulfo sulks sulky sully sulus sumac summa sumos sumps sunna sunns sunny sunup super supes supra surah sural suras surds surer surfs surfy surge surgy surly surra sushi sutra sutta swabs swage swags swail swain swale swami swamp swamy swang swank swans swaps sward sware swarf swarm swart swash swath swats sways swear sweat swede sweep sweer sweet swell swept swift swigs swill swims swine swing swink swipe swirl swish swiss swith swive swobs swoon swoop swops sword swore sworn swots swoun swung sycee syces sykes sylis sylph sylva synch syncs synod synth syphs syren syrup sysop tabby taber tabes tabid tabla table taboo tabor tabun tabus taces tacet tache tachs tacit tacks tacky tacos tacts taels taffy tafia tahrs taiga tails tains taint tajes taken taker takes takin talar talas talcs taler tales talks talky tally talon taluk talus tamal tamed tamer tames tamis tammy tamps tango tangs tangy tanka tanks tansy tanto tapas taped taper tapes tapir tapis tardo tardy tared tares targe tarns taroc tarok taros tarot tarps tarre tarry tarsi tarts tarty tasks tasse taste tasty tatar tater tates tatty taunt taupe tauts tawed tawer tawie tawny tawse taxed taxer taxes taxis taxon taxus tazza tazze teach teaks teals teams tears teary tease teats techy tecta teddy teels teems teens teeny teeth teffs tegua teiid teind telae teles telex telia telic tells telly teloi telos tempi tempo temps tempt tench tends tenet tenia tenon tenor tense tenth tents tenty tepal tepas tepee tepid tepoy terai terce terga terms terne terns terra zingy zinky zippy ziram zitis zizit zlote zloty zoeae zoeal zoeas zombi zonal zoned zoner zones zonks zooid zooks zooms zoons zooty zoril zoris zowie zymes";
    $words = explode(" ",$words);
    $ray = array();
    for($x=0;$x<sizeof($words);$x++) {
    	if($words[$x] == '') continue;
    	$ray[] = $words[$x];
    }
    $words = $ray;
    $length = sizeof($words);
    $word = rand(0,$length-1);
    $word = strtoupper($words[$word]);
    $_SESSION['word'] = $word;
    $bgs = glob("captcha/*.gif");
    $ray = array();
    for($x=0;$x<sizeof($bgs);$x++) {
    	if($bgs[$x] == '' ) continue;
    	$ray[] = $bgs[$x];
    }
    $bgs = $ray;
    $total = sizeof($bgs);
    $bg = rand(0,$total-1);
    $bg = $bgs[$bg];
    $font = "fonts/Florsn01.ttf";
    $letter1 = $word{0};
    $w = 100;
    $h = 30;
    $img = imagecreatetruecolor($w,$h);
    $color = imagecolorallocate($img,14, 98, 190);
    $temp = imagecreatefromgif($bg);
    imagecopy($img, $temp,0,0,0,0,$w,$h);
    //fonts
    $start = 10;
    $plus = 15;
    $angle = array(20,-20);
    for($x=0;$x<strlen($word);$x++) {
    	$ran = rand(0,1);
    	imagefttext($img, 14, $angle[$ran], $start, 22, $color, $font, $word{$x} );
    	$start += $plus;
    }
    header("Content-Type: image/gif");
    imagegif($img);
    ?>
    Code (markup):
    this is the html part

    	<tr>
    							<td><div class='break'>Captcha <small>(required)</small></div><div class='break'><img src='{TEMPLATE.DOMAIN}image.php?refresh={TEMPLATE.RAND}' /></div><br /><input type='text' name='captcha' />
    							</td>
    						</tr>
    Code (markup):
    i get this error

    Fatal error: Call to undefined function imagefttext() in /home/godofwar/public_html/watch-weeds/image.php on line 44
    Code (markup):
    from this url http://watch-weeds.co.cc/image.php
     
    dawilster, Sep 11, 2008 IP
  2. scoopy82

    scoopy82 Active Member

    Messages:
    838
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    70
    #2
    I am not a PHP coder... but the error is telling you that "imagefttext" is not defined any where in that code. It needs a line such as:
    $imagefttext = something;
     
    scoopy82, Sep 11, 2008 IP
  3. dawilster

    dawilster Active Member

    Messages:
    844
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    yea but i just dont no what u replace it with
     
    dawilster, Sep 11, 2008 IP
  4. scoopy82

    scoopy82 Active Member

    Messages:
    838
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    70
    #4
    ok... I had an idea that maybe "imagefttext" had to do with something installed on the server and maybe it is a function that is not available on your server. I found it is a GD extension and we have that on our server... and it seems to work... minus the fonts which we don't have.

    3sfmedia.com/dawilster

    You will want to try asking your host to install the imagefttext extension for GD.
     
    scoopy82, Sep 11, 2008 IP