Triple Posted July 24, 2006 at 01:16 PM Report #39920 Posted July 24, 2006 at 01:16 PM 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 (), 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
karva Posted July 24, 2006 at 01:23 PM Report #39925 Posted July 24, 2006 at 01:23 PM pk o ficheiro .php, tem ke tar na pasta /sig/misig.jpg/index.php Proud LEIC-A@IST student!
Triple Posted July 24, 2006 at 01:25 PM Author Report #39928 Posted July 24, 2006 at 01:25 PM 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 e aparecia mas só eu é que via mais ninguém 😛 Cumps
karva Posted July 24, 2006 at 01:28 PM Report #39930 Posted July 24, 2006 at 01:28 PM pa, mas e esse o metodo, cmg funciona... so nao o testo agora, pk n tenho a GDlib no meu server caseiro de testes... Proud LEIC-A@IST student!
Triple Posted July 24, 2006 at 01:30 PM Author Report #39931 Posted July 24, 2006 at 01:30 PM Mas n dá para executar a imagem como php num servidor?Penssava que esse file .htaccess fazia isso.
karva Posted July 24, 2006 at 01:35 PM Report #39933 Posted July 24, 2006 at 01:35 PM 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!
Triple Posted July 24, 2006 at 01:41 PM Author Report #39936 Posted July 24, 2006 at 01:41 PM Já fiz isso depois foi ao meu forum de testes e escrevi la na signature e n aparece imagem nenhuma.
karva Posted July 24, 2006 at 01:43 PM Report #39938 Posted July 24, 2006 at 01:43 PM pa, entao n sei :S vo xprimentar o codigo... Proud LEIC-A@IST student!
skin Posted July 24, 2006 at 06:41 PM Report #40017 Posted July 24, 2006 at 06:41 PM eu estive a experimentar o código e dá-me este erro: http://localhost/TESTES/new%203.php lol Our lives begin to end the day we become silent about things that matter - Martin Luther King
Triple Posted July 24, 2006 at 08:26 PM Author Report #40048 Posted July 24, 2006 at 08:26 PM 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 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
kingless Posted July 27, 2006 at 02:48 AM Report #40504 Posted July 27, 2006 at 02:48 AM eu estive a experimentar o código e dá-me este erro: http://localhost/TESTES/new%203.php lol Para podermos ver o erro tens que colocar o teu IP e não localhost.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now