Log in

View Full Version : Signature controller



nets
18-11-2005, 03:36 PM
What I have wrote in this thread may not be correct, and the script might not be very secure. If you use it, your using it at your own risk - and I can't take any responsibility for it.

Ok I've decided to make a thread explaining how you can create a PHP page which controls the image in your signature.

For an example I'm going to make a PHP page which changes the image from "I am on Habbo" to "I am not on Habbo", when you type offline or online into a small page- You could use this to tell people that you are on / not on Habbo without having to use your User CP.


Create a .php page containing this code:


<?php
//Says that PHP page is a GIF image
header("Content-type: image/gif");

//Gives $status the value of status.txt
$file = "status.txt";
$open = fopen($file, 'r');
$status = fread($open, filesize($file));
fclose($open);

//If $status is set to online, the image online.gif is shown
if
($status == "online")
include 'online.gif';

//If it says somthing other than online, offline.gif is shown
else
include 'offline.gif';

?>


The page which you state if you are online or offline in, save it as .php
(You might want to password protect it).


<!-- A form to say if you're offline or online in -->
<form method='post'>Are you offline or online?<br />
<input type='text' maxlength='30' name='about' ><br />
<input type='submit' value='Go!'>
</form>
<?php

//If offline is entered, it changes status.txt to offline
if
($about == "offline")
{$open = fopen("status.txt", "w");
fwrite($open, $about);
fclose($open);
}

//If online is entered, it changes status.txt to online
if
($about == "online")
{$open = fopen("status.txt", "w");
fwrite($open, $about);
fclose($open);
}
?>

You'll now need to create a text file called "status.txt" and chmod it to 777.

Example:
http://joshh.co.uk/status.php

Control page:
http://joshh.co.uk/statusadmin.php

If any one has spotted any mistakes, pm me :p

---MAD---
18-11-2005, 04:12 PM
very interesting :)
You could also put sql into this to password protect it :)

Sam
18-11-2005, 04:44 PM
I dont get it xD Whats it supposed to do? Change the image in your sig? I dont see how it works, Call me dumb if you want

Sygon
19-11-2005, 05:26 AM
Yes :P, with an admin cp i tink

Dan Williamson
19-11-2005, 02:07 PM
Very good :)

- Dan

Sam
19-11-2005, 10:30 PM
Pfffft to be honest im no good at webdesign yet im a habboxlive webdesigner ''/ I resigned anyway, im now a graphics designer xD

Dan Williamson
19-11-2005, 10:30 PM
I got rejected as a HabboxLive webdesigner :p

- Dan

Sam
19-11-2005, 10:39 PM
I resigned n reccomended sygon :)

Dan Williamson
19-11-2005, 10:40 PM
Cool, i probably would forget to do something as i'm always soo busy :)

- Dan

Sam
19-11-2005, 10:44 PM
N me :) lmao

Dan Williamson
19-11-2005, 10:45 PM
I swear tonights been boring, i got the Flu and i feel like absolute s**t

- Dan

nets
20-11-2005, 12:31 AM
Habbox live web designer? I'll do that. Where do I apply?

Want to hide these adverts? Register an account for free!