Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 

Sign in to follow this  
eXPerience-XP

IP Sig

Recommended Posts

tawxic    0

eh - anyone know why it's tellin me:

[Fri Dec 12 04:11:40 2003] [error] [client 68.116.78.89] Premature end of script headers: /home/phazm/public_html/sig/siggy.jpg

I just got a new host.. they have the latest version of PHP :)

Share this post


Link to post
Share on other sites
tawxic    0

oi, here's my code:

<?php

Header ('Content-type: image/jpeg');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');

$textfile ="quotes.txt"; // change to the filename/path of your file with quotes.
$quotes = file("$textfile");
$quote = rand(0, sizeof($quotes)-1);
$getquote =  wordwrap($quotes[$quote], 55, "\n", 1);
$ipad = getenv("REMOTE_ADDR");
$dns = strtolower(@gethostbyaddr(getenv("REMOTE_ADDR")));
$today = date("m-d-Y");

// create the image
$image = imagecreatefromgif("about-bg.gif");

// set the colours
$cool = imagecolorallocate($image, 87, 87, 87);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);

// counter
$viewss = file("views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$info = "$today - You are $dns ($ipad)";
$counter = "$views people informed - © 2003 Phazm Graphics - http://www.phazm.net/";

// define geek code
$nerd = $getquote;

// line style line
$line = "___________________________________________________________";

// set the font and print text
$font = 'verdana.ttf';

ImageTTFText ($image, 10, 0, 45, 35, $white, $font, $nerd);
ImageTTFText ($image, 8, 0, 27, 126, $white, $font, $info);
ImageTTFText ($image, 8, 0, 27, 130, $white, $font, $line);
ImageTTFText ($image, 8, 0, 27, 143, $white, $font, $counter);

// output and destroy
imagepng($image);
imagedestroy($image);

?>

Share this post


Link to post
Share on other sites
Vega    0

Is this sopposed to be like, in php or something? I have never programmed in php but I have thought about it. If it is, can someone give me resources where I could learn to program in php and get a compiler (if one is required)?

Share this post


Link to post
Share on other sites
bman3022    0

I found this script :

<?php

/*
   Name your images 1.jpg, 2.jpg etc.

   Add this line to your page where you want the images to
   appear: <?php include "randomimage.php"; ?>
*/

// Change this to the total number of images in the folder
$total = "11";

// Change to the type of files to use eg. .jpg or .gif
$file_type = ".jpg";

// Change to the location of the folder containing the images
$image_folder = "images/random";

// You do not need to edit below this line

$start = "1";

$random = mt_rand($start, $total);

$image_name = $random . $file_type;

echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";

?>

I got it from here: http://www.devscripts.com/visit.php?sId=3424

Try working with it in the script it might work.

Share this post


Link to post
Share on other sites
tawxic    0

well, here is the other one I'm working on:

siggy2.jpg

And I want to make a random image in the right side of it, cuz it's blank..

I Could just make the background have that image in it, but that would be tedious... actually... I think I will do that.. lol :)

Thanks!

Share this post


Link to post
Share on other sites
Tinker    0

Well MERRY X-MAS..............

Looks like the 500x100 80k sig rule is no longer in effect. The sigs just keep getting bigger and bigger. I can not believe that the folks that have over sized sigs do not know that they are breaking the rules. The sig rule is at the top of this thread for all to read. So let me be the first to say, "Have a Big Sig day"...

Share this post


Link to post
Share on other sites
tazz    0

I've been playing with this the whole day and couldn't get it to work. First I got errors and garbles and now I only get a red x.

Does anybody have the source files (ones that work) I could play with?

Share this post


Link to post
Share on other sites
hwa    0

The only thing I'm having trouble with is the actual text showing up.

:/

When I direct my browser to siggy.jpg the blank-bg.gif is what comes up as siggy.jpg, the views.txt is also being updated so the php must be executing.

I've checked and double checked the path to the TTF file. Is there something else that I'm missing that could be causing the image to be generated without any text?

siggy.jpg

I added the .htaccess like I should have (obviously since the code executes) and even went so far as to put full paths in to all the files called out. Anybody have any idea as to what could be going wrong?

Share this post


Link to post
Share on other sites
jmoore    0

HWA, try this:

<?php

Header ('Content-type: image/png');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');

// change to the filename/path of your file with quotes.
$textfile ="http://www.advancedstrikeforce.com/hwa/quotes.txt";
$quotes = file("$textfile");
$quote = rand(0, sizeof($quotes)-1);
$getquote =  wordwrap($quotes[$quote], 55, "\n", 1);

// get ip, host info and date
$ip = $_SERVER['REMOTE_ADDR'];
$fullhost = gethostbyaddr($ip);
$host = preg_replace("/^[^.]+./", "", $fullhost);
$today = date("m-d-Y");

// create the image
$image = imagecreatefromgif("http://www.advancedstrikeforce.com/hwa/about-bg.gif");

// set the colours
$cool = imagecolorallocate($image, 87, 87, 87);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);

// counter
$vfile = "views.txt"; // chmod 777
$viewss = file("$vfile");
$views = $viewss[0]; $views++;
$fp = fopen("$vfile", "w");
fwrite($fp, $views);
fclose($fp);
$info = "$today - You are $host ($ip)";
$counter = "$views people informed - © 2003 Phazm Graphics - http://www.phazm.net/";

// define geek code
$nerd = $getquote;

// line style line
$line = "___________________________________________________________";

// set the font and print text GD automatically parses ttf files
$font = 'verdana';

ImageTTFText ($image, 10, 0, 45, 35, $black, $font, $nerd);
ImageTTFText ($image, 8, 0, 27, 126, $black, $font, $info);
ImageTTFText ($image, 8, 0, 27, 130, $black, $font, $line);
ImageTTFText ($image, 8, 0, 27, 143, $black, $font, $counter);

// output and destroy
imagepng($image);
imagedestroy($image);

?>

You can see it here: http://www.wvghosts.com/test/t2.php

Share this post


Link to post
Share on other sites
hwa    0

I figured out what the problem was ... I changed the TTF info | removed the path and capatalized VERDANA.TTF and it worked.

The 1 issue that I have now is that when I save it as siggy.jpg a lot of people can't see it. (I can see it fine) -- but the same people who couldn't display mine couldn't display other sigs on this board.

To fix the issue I renamed the file to siggy.png and changed the .htaccess to reflect the same, then everyone could see it.

Could that problem be with local side browser settings? Just curious since it appears that their browsers were having a problem displaying a .png file as an actual .jpg when it wasn't. My firebird and IE6 both displayed it properly though.

Share this post


Link to post
Share on other sites
ml20    0

<?php

Header ('Content-type: image/jpeg');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');

// change to the filename/path of your file with quotes.
$textfile ="quotes.txt";
$quotes = file("$textfile");
$quote = rand(0, sizeof($quotes)-1);
$getquote = wordwrap($quotes[$quote], 55, "\n", 1);

// get ip, host info and date
$ip = $_SERVER['REMOTE_ADDR'];
$fullhost = gethostbyaddr($ip);
$host = preg_replace("/^[^.]+./", "", $fullhost);
$today = date("m-d-Y");

// create the image
$image = imagecreatefromjpeg("background.jpg");

// set the colours
$cool = imagecolorallocate($image, 87, 87, 87);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);

// counter
$vfile = "views.txt"; // chmod 777
$viewss = file("$vfile");
$views = $viewss[0]; $views++;
$fp = fopen("$vfile", "w");
fwrite($fp, $views);
fclose($fp);
$info = "$today - You are $host ($ip)";
$counter = "$views people informed/";

// line style line
$line = "___________________________________________________________";

// set the font and print text GD automatically parses ttf files
$font = 'verdana.ttf';

ImageTTFText ($image, 8, 0, 27, 126, $red, $font, $info);
ImageTTFText ($image, 8, 0, 27, 130, $black, $font, $line);
ImageTTFText ($image, 8, 0, 27, 143, $black, $font, $counter);


// output and destroy
imagepng($image);
imagedestroy($image);

?>

Is there something wrong here, because I am getting a red X and not an image :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×