Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 Before February 2015

scienceguyz
Guest

Need some help with php

I'm trying to make changing sigs like different55, but I can't get the php to work.
I know in html you have to put <html><body> at the top and </html></body>. Is there anything you have to do like that with php? so far the top is just <?php and the bottom is just ?>
Help, and the mods may move this if it's in the wrong section.

#2 Before February 2015

Different55
Forum Admin
Joined: 2015-02-07
Posts: 16,575

Re: Need some help with php

Can I see your code? And yes, it must begin with <?php and end in ?>
My template for image sigs is something like

<?php header("Content-type: image/png"); $imgSrc = "imgsrc.png"; $img = imagecreatefrompng($imgsrc); imagepng($img); ?>

If my memory is working correctly (doubt it) that will send headers saying that the page is a png image, load an image, and then print it out.


"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto

Offline

#3 Before February 2015

scienceguyz
Guest

Re: Need some help with php

it's at totalrandomness.co.cc/imagehosting/coolpictester.php
use the source code. //forums.everybodyedits.com/img/smilies/tongue

#4 Before February 2015

Different55
Forum Admin
Joined: 2015-02-07
Posts: 16,575

Re: Need some help with php

Well, from here it looks like you are echoing html instead of printing an image. You need to send the image headers:

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

and print the image:

$img = imagecreatefromjpeg("path/to.img"); imagejpeg($img);


"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto

Offline

scienceguyz 1423615432346000

Board footer

Powered by FluxBB

[ Started around 1734683433.8546 - Generated in 0.085 seconds, 12 queries executed - Memory usage: 1.34 MiB (Peak: 1.44 MiB) ]