Jump to content

Recommended Posts

Posted

Boas

Estou a tentar criar uma signature que diga o IP, o Browser e o ISP da pessoa que visualiza a imagem tenho aqui o codico:

<?php
$image = "userbar.png";
$im = imagecreatefrompng($image);
$blue = ImageColorAllocate ($im, 100, 100, 100);
$ip = $_SERVER["REMOTE_ADDR"];
$isp = gethostbyaddr($_SERVER[REMOTE_ADDR]);
if (strstr($_SERVER["HTTP_USER_AGENT"], "Firefox")){
$browser = Firefox;
}else if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")){
$browser = IE;
}else if (strstr($_SERVER["HTTP_USER_AGENT"], "Opera")){
$browser = Opera;
}

ImageString($im, 2, 18, 10, "O teu IP é: $ip estás a usar o $browser e o teu ISP é $isp", $black);
header("Content-Type: image/png");
imagepng($im,'',100);
ImageDestroy ($im);
?>

Ao abrir este ficheiro vai aparecer tudo bem, mas como n posso por um endereço assim no campo da signature (index.php), fui pesquisar e achei que se podia forçar o servidor a ler uma imagem como php com um file .htaccess portanto criei dois ficheiros.

sig.jpg

x.htaccess

na sig.jpg estava o codico acima

e no x.htaccess estava o seguinte codico:

<Files sig.jpg>

ForceType application/x-httpd-php

</Files

acontece que vai ter a outro endereço.

http://phptriple.orgfree.com/sig/mysig.jpg

mas vejam aqui:

http://phptriple.orgfree.com/sig/index.php

Não sei porque é que isto acontece.

Cumps

Posted

mas o mysig.jpg n é uma pasta, eu já tinha feito uma pasta com o nome de sig.gif, depois pus o index.php e o userbar.png la dentro, depois fui testar num forum que tenho para testes e fiz assim sig.gif e aparecia mas só eu é que via mais ninguém 😛

Cumps

Posted

esquece o htaccess, pk isso so te vai complicar a vida...

o ke podes fazer e criar um index.html

com o codigo

<meta http-equiv="refresh" content="0,url='index.php'" />

Proud LEIC-A@IST student!

Posted

Epah isto está estranho... Eu abocado consegui ver quando mudei o nome da pasta para sig.jpg e testei e deu entao fiquei feliz 😛 Mas passado 5 minitos sem eu ter mexido em nada deixou de dar  :wallbash: Não sei se isto interessa mas o orgfree n deixa conter pontos no nome das pastas por isso tive de ir lá com o SmartFTP.

Cumps

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.