Jump to content

Habbo letter PHP-script


Olli

Recommended Posts

Hi,

I have a script, but it not working. It's habbo letter script. It change normal letters to habbo letters, but small letters not working. Now it printing all letters. Can someone help me? Thanks!

 

<a href="index.php?mod=big">BIG</a> -- <a href="index.php?mod=small">small</a><br><br>
<?php
function habbo($from){
$from = strtoupper($from);
$from = str_replace(' ', '   ', $from);
$from = str_replace('A', '<img src="pictures/isot/A.gif">', $from);
$from = str_replace('B', '<img src="pictures/isot/B.gif">', $from);
$from = str_replace('C', '<img src="pictures/isot/C.gif">', $from);
$from = str_replace('D', '<img src="pictures/isot/D.gif">', $from);
$from = str_replace('E', '<img src="pictures/isot/E.gif">', $from);
$from = str_replace('F', '<img src="pictures/isot/F.gif">', $from);
$from = str_replace('G', '<img src="pictures/isot/G.gif">', $from);
$from = str_replace('H', '<img src="pictures/isot/H.gif">', $from);
$from = str_replace('I', '<img src="pictures/isot/I.gif">', $from);
$from = str_replace('J', '<img src="pictures/isot/J.gif">', $from);
$from = str_replace('K', '<img src="pictures/isot/K.gif">', $from);
$from = str_replace('L', '<img src="pictures/isot/L.gif">', $from);
$from = str_replace('M', '<img src="pictures/isot/M.gif">', $from);
$from = str_replace('N', '<img src="pictures/isot/N.gif">', $from);
$from = str_replace('O', '<img src="pictures/isot/O.gif">', $from);
$from = str_replace('P', '<img src="pictures/isot/P.gif">', $from);
$from = str_replace('Q', '<img src="pictures/isot/Q.gif">', $from);
$from = str_replace('R', '<img src="pictures/isot/R.gif">', $from);
$from = str_replace('S', '<img src="pictures/isot/S.gif">', $from);
$from = str_replace('T', '<img src="pictures/isot/T.gif">', $from);
$from = str_replace('U', '<img src="pictures/isot/U.gif">', $from);
$from = str_replace('W', '<img src="pictures/isot/W.gif">', $from);
$from = str_replace('V', '<img src="pictures/isot/V.gif">', $from);
$from = str_replace('X', '<img src="pictures/isot/X.gif">', $from);
$from = str_replace('Y', '<img src="pictures/isot/Y.gif">', $from);
$from = str_replace('Z', '<img src="pictures/isot/Z.gif">', $from);
print $from;
}
// ERROR IN NEXT FUNCTION
function habbob($kohd){
strtolower($kohd);
$kohd = str_replace(' ', '   ', $kohd);
$kohd = str_replace('a', '<img src="pictures/a.gif">', $kohd);
$kohd = str_replace('b', '<img src="pictures/b.gif">', $kohd);
$kohd = str_replace('c', '<img src="pictures/c.gif">', $kohd);
$kohd = str_replace('d', '<img src="pictures/d.gif">', $kohd);
$kohd = str_replace('e', '<img src="pictures/e.gif">', $kohd);
$kohd = str_replace('f', '<img src="pictures/f.gif">', $kohd);
$kohd = str_replace('g', '<img src="pictures/g.gif">', $kohd);
$kohd = str_replace('h', '<img src="pictures/h.gif">', $kohd);
$kohd = str_replace('i', '<img src="pictures/i.gif">', $kohd);
$kohd = str_replace('j', '<img src="pictures/j.gif">', $kohd);
$kohd = str_replace('k', '<img src="pictures/k.gif">', $kohd);
$kohd = str_replace('l', '<img src="pictures/l.gif">', $kohd);
$kohd = str_replace('m', '<img src="pictures/m.gif">', $kohd);
$kohd = str_replace('n', '<img src="pictures/n.gif">', $kohd);
$kohd = str_replace('o', '<img src="pictures/o.gif">', $kohd);
$kohd = str_replace('p', '<img src="pictures/p.gif">', $kohd);
$kohd = str_replace('q', '<img src="pictures/q.gif">', $kohd);
$kohd = str_replace('r', '<img src="pictures/r.gif">', $kohd);
$kohd = str_replace('s', '<img src="pictures/s.gif">', $kohd);
$kohd = str_replace('t', '<img src="pictures/t.gif">', $kohd);
$kohd = str_replace('u', '<img src="pictures/u.gif">', $kohd);
$kohd = str_replace('w', '<img src="pictures/w.gif">', $kohd);
$kohd = str_replace('v', '<img src="pictures/v.gif">', $kohd);
$kohd = str_replace('x', '<img src="pictures/x.gif">', $kohd);
$kohd = str_replace('y', '<img src="pictures/y.gif">', $kohd);
$kohd = str_replace('z', '<img src="pictures/z.gif">', $kohd);
print $kohd;
}
?>
<b>Habbotext</b><br>
Write text:<br>
<form action="index.php?mod=<?php print $_GET['mod']; ?>" method="POST">
<?php
if($_GET['mod'] == "small"){
$style="text-transform:none";
}
if($_GET['mod'] == "big"){
$style="text-transform:uppercase";
}
?>
<input style="<?php print $style; ?>" type="text" name="text" size="25"><br>
<input type="submit" value="Show text"><br><br>
<b>Your text:</b><br>
<?php 
$func = $_GET['mod'];
$text = $_POST['text'];
if($func == "big"){
habbo(''.$text.'');
}
elseif($func == "small"){
habbob(''.$text.'');
}
?>

Link to comment
https://forums.phpfreaks.com/topic/70175-habbo-letter-php-script/
Share on other sites

Are you sure fixed it? It should look like this:

 

function habbob($kohd){
$kohd = strtolower($kohd);
$kohd = str_replace(' ', '   ', $kohd);
$kohd = str_replace('a', '<img src="pictures/a.gif">', $kohd);
$kohd = str_replace('b', '<img src="pictures/b.gif">', $kohd);
$kohd = str_replace('c', '<img src="pictures/c.gif">', $kohd);
$kohd = str_replace('d', '<img src="pictures/d.gif">', $kohd);
$kohd = str_replace('e', '<img src="pictures/e.gif">', $kohd);
$kohd = str_replace('f', '<img src="pictures/f.gif">', $kohd);
$kohd = str_replace('g', '<img src="pictures/g.gif">', $kohd);
$kohd = str_replace('h', '<img src="pictures/h.gif">', $kohd);
$kohd = str_replace('i', '<img src="pictures/i.gif">', $kohd);
$kohd = str_replace('j', '<img src="pictures/j.gif">', $kohd);
$kohd = str_replace('k', '<img src="pictures/k.gif">', $kohd);
$kohd = str_replace('l', '<img src="pictures/l.gif">', $kohd);
$kohd = str_replace('m', '<img src="pictures/m.gif">', $kohd);
$kohd = str_replace('n', '<img src="pictures/n.gif">', $kohd);
$kohd = str_replace('o', '<img src="pictures/o.gif">', $kohd);
$kohd = str_replace('p', '<img src="pictures/p.gif">', $kohd);
$kohd = str_replace('q', '<img src="pictures/q.gif">', $kohd);
$kohd = str_replace('r', '<img src="pictures/r.gif">', $kohd);
$kohd = str_replace('s', '<img src="pictures/s.gif">', $kohd);
$kohd = str_replace('t', '<img src="pictures/t.gif">', $kohd);
$kohd = str_replace('u', '<img src="pictures/u.gif">', $kohd);
$kohd = str_replace('w', '<img src="pictures/w.gif">', $kohd);
$kohd = str_replace('v', '<img src="pictures/v.gif">', $kohd);
$kohd = str_replace('x', '<img src="pictures/x.gif">', $kohd);
$kohd = str_replace('y', '<img src="pictures/y.gif">', $kohd);
$kohd = str_replace('z', '<img src="pictures/z.gif">', $kohd);
print $kohd;
}

 

Orio.

instead of:

 

print; ing your results in the functions, RETURN THEM;;

 

change:

 

print $kohd;
print $from;

to

return($kohd);
return($from);

 

and then instead of:

if($func == "big"){
habbo(''.$text.'');
}
elseif($func == "small"){
habbob(''.$text.'');
}

use

if($func == "big"){
$do=habbo(''.$text.'');
}
elseif($func == "small"){
$do=habbob(''.$text.'');
}

print $do;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.