En cours

PHP GD Image and Cron - HELP

I've been tearing my hair out with this >:( I want to generate dynamic forum images using this script:

[php]<?php

if($connect==true){$online=$serverdetails['players'] . ' / '.$serverdetails['max_players'].' players' ; } else { $online='offline'; }

echo '<img src="[url removed, login to view]'.$row['servername'].'&votes='.$row['lastmonthvotes'].'&id='.$row['id'].'&ip='.$row['ip'].'&online='.$online.'&rank='.$row['position'].'" />"';

?>[/php]

This script is what generates the images (I've included the entire script in case I flipped something up elsewhere). Here is [url removed, login to view]:

[php]<?php

header( "Content-type: image/gif" );

// destroy the image in memory to free up server resources

ImageDestroy($gif);

$servername = $_GET['name'];

$rank = $_GET['rank'];

$ip = $_GET['ip'];

$id = $_GET['id'];

$online = $_GET['online'];

$votes = $_GET['votes'];

$image_path = "/var/www/html/serverfinder/img/server_".$id.".gif";

$gif = imagecreatefromgif('/var/www/html/serverfinder/img/[url removed, login to view]');

$yellow = imagecolorallocate($gif, 255, 255, 0);

$white = imagecolorallocate($gif, 255, 255, 255);

$font = '/var/www/html/serverfinder/[url removed, login to view]';

$initialX = '15';

$initialY = '25';

$increaseY = '8';

$fontSize = '14';

$fontRotation = '0';

$fontSizeSmall = '9';

$firstline = $servername;

$secondline = $ip . ' - ' . $online;

$thirdline = 'ranked #' . $rank . ' with ' . $votes . ' votes';

//imagestring($gif, $font, $px, 20, $string, $black);

imagettftext($gif, $fontSize, $fontRotation, $initialX, $initialY, $white, $font, $firstline);

imagettftext($gif, $fontSizeSmall, $fontRotation, $initialX, $initialY+$increaseY+$increaseY, $yellow, $font, $secondline);

imagettftext($gif, $fontSizeSmall, $fontRotation, $initialX, $initialY+$increaseY+$increaseY+$increaseY+$increaseY, $yellow, $font, $thirdline);

imagegif($gif);

// now save a copy of the new image to the cache directory

Imagegif($gif, $image_path);

// send the new image to the browser

Imagegif($gif);

?>

[/php]

[url removed, login to view] is supposed to save the new banners to the /img directory. Now this works perfectly when I manually got to [url removed, login to view] (after about 30 seconds of loading) but does not work when I cron it. Whenever I cron, I get the correct out put, but it doesn't write to the directory. It just spits out code.

Any ideas? I really have no idea :( I need this done TODAY, will hire you if you have a reasonable price.

Compétences : HTML, PHP

Voir plus : php dynamic image cron, php image cron, white and case, type free online write what you want, true hire, string banners, php string to html, php server with html free, php is, php forum script, name banner ideas, hire resources, hire online help, hire image, forum php html, dynamic cache, write php online, loading gif, hire php help, hire help online, GD, dynamic connect, save html image, html header banner, html img

Concernant l'employeur :
( 16 commentaires ) Victoria, Canada

N° du projet : #2374458

Décerné à :

dustafo

I can help get it working right now :)

50 $ USD en 0 jours
(82 Commentaires)
5.5

4 freelance ont fait une offre moyenne de 43 $ pour ce travail

mdjavedakhtar

hi we have 7+ years of exp in php please check pmb

50 $ USD en 1 jour
(25 Commentaires)
5.9
codeguruz

Hi There, I got it what's wrong going on there, will tell you also how to solve it and I'll resolve it immediately.

40 $ USD en 0 jours
(6 Commentaires)
3.7
simjeet

Hello , I had checked your job description posted for this job and is fully confident as I am having 5 yrs of job experience in PHP / MYSQL / CSS / HTML and worked on similar type of job in past also. I have work Plus

30 $ USD en 1 jour
(1 Commentaire)
1.0