PDA

View Full Version : $_GET?



HabbDance
29-11-2008, 11:49 PM
Well, I'm trying to make something like this: http://habbcrazy.net/hcv3/php/text.php?t=Behind%20The%20Habbo&border=blue

I know how to get the text, but I don't know how to make it the font I want.

This is worded pretty bad, but w.e. :D

Thanks.

PS - I'm new in PHP.

Jam-ez
29-11-2008, 11:51 PM
Insert some html code into your echo? You'll have to ask someone else for the code... Or add a css style sheet?

HabbDance
29-11-2008, 11:52 PM
Insert some html code into your echo? You'll have to ask someone else for the code... Or add a css style sheet?
The font can't be made with CSS. It is the volter font with a border.

Calon
29-11-2008, 11:59 PM
<?php
$text = $_GET[ 'text' ];
?>

wsg14
30-11-2008, 12:00 AM
<?php
$text = $_GET[ 'text' ];
?>


I believe he wants to change the font family, in which case he's going to need to use PHP GD. Well, you don't have to but it would be easier.

HabbDance
30-11-2008, 12:02 AM
<?php
$text = $_GET[ 'text' ];
?>

create.html

<form action="test.php" method="get">
String: <input type="text" name="string" />
<input type="submit" />
</form>create.php

<?php echo $_GET["string"]; ?>I know how to get the text. But how can I make the output the Volter Font with a black border :S

Edit: Yes Will.

Moh
30-11-2008, 12:02 AM
If your new with PHP, your going to struggle with this. We do ours using PHP GD. For the font, we have a file uploaded and for the background, a file uploaded.

Simon (Invent) did ours :)

Calon
30-11-2008, 12:27 AM
http://us.php.net/gd

HabbDance
30-11-2008, 12:48 AM
If I turn every letter into a variable is there a way I can do it?

Calon
30-11-2008, 12:53 AM
I know a way without using GD, but it's pretty stupid.

HabbDance
30-11-2008, 12:54 AM
I know a way without using GD, but it's pretty stupid.
Nothing's to stupid for me :P What is it?

L?KE
30-11-2008, 10:53 AM
I'd like to know how to do this too :P

Johno
30-11-2008, 11:39 AM
You could always use sIFR - but yeah, you can specify which font you use in GD.

RichardKnox
30-11-2008, 07:13 PM
You could, really stupid way, save each individual letter of Volter font with border in a folder and then replace each input letter with the url to the image.

--ss--
30-11-2008, 07:20 PM
Basic GD GET header would look like:


<?php
header("Content-type: image/png");
$text = htmlspecialchars($_GET['t']);
$im = imagecreatefrompng("images/header_bg.png");
$font = "volterb.ttf";
$white = imagecolorallocate($im, 255, 255, 255);
imagettftext($im, 7, 0, 9, 14, $white, $font, $text);
imagepng($im);
imagedestroy($im);
?>

The output will be something like
http://shanes.sawhosting.com/c/header.php?t=Navigation

But if you want to put a 1px border round the letters it will be much much more complicated.

HabbDance
30-11-2008, 09:26 PM
Basic GD GET header would look like:


<?php
header("Content-type: image/png");
$text = htmlspecialchars($_GET['t']);
$im = imagecreatefrompng("images/header_bg.png");
$font = "volterb.ttf";
$white = imagecolorallocate($im, 255, 255, 255);
imagettftext($im, 7, 0, 9, 14, $white, $font, $text);
imagepng($im);
imagedestroy($im);
?>

The output will be something like
http://shanes.sawhosting.com/c/header.php?t=Navigation

But if you want to put a 1px border round the letters it will be much much more complicated.
Damn, I want the border. lol. Thanks though, this will come in handy. +rep
Also if you can explain how to do it with a border?:s

EDIT: Need to spread, in sig.

Doritos
30-11-2008, 10:34 PM
Here's a simple black border, it's not as thick as the other one though:

http://www.tehupload.com/uploads/app-710245268444738017.png (http://www.tehupload.com/share/18968)

It's just --SS--'s code modified:



<?php
header( "Content-type: image/png" );
$text = htmlspecialchars( $_GET ['t'] );
$im = imagecreatefrompng( "header.png" );
$font = "volterb.ttf";
$white = imagecolorallocate( $im, 255, 255, 255 );
$black = imagecolorallocate( $im, 0, 0, 0 );

imagettftext( $im, 7, 0, 8, 15, $black, $font, $text );
imagettftext( $im, 7, 0, 9, 14, $black, $font, $text );
imagettftext( $im, 7, 0, 10, 15, $black, $font, $text );
imagettftext( $im, 7, 0, 9, 16, $black, $font, $text );

imagettftext( $im, 7, 0, 9, 15, $white, $font, $text );

imagepng( $im );
imagedestroy( $im );
?>

HabbDance
30-11-2008, 11:47 PM
Here's a simple black border, it's not as thick as the other one though:

http://www.tehupload.com/uploads/app-710245268444738017.png (http://www.tehupload.com/share/18968)

It's just --SS--'s code modified:



<?php
header( "Content-type: image/png" );
$text = htmlspecialchars( $_GET ['t'] );
$im = imagecreatefrompng( "header.png" );
$font = "volterb.ttf";
$white = imagecolorallocate( $im, 255, 255, 255 );
$black = imagecolorallocate( $im, 0, 0, 0 );

imagettftext( $im, 7, 0, 8, 15, $black, $font, $text );
imagettftext( $im, 7, 0, 9, 14, $black, $font, $text );
imagettftext( $im, 7, 0, 10, 15, $black, $font, $text );
imagettftext( $im, 7, 0, 9, 16, $black, $font, $text );

imagettftext( $im, 7, 0, 9, 15, $white, $font, $text );

imagepng( $im );
imagedestroy( $im );
?>

Thanks so much :D Worked a charm. +rep. Is there anyway I can make a transparent background though? Because when I tried it simply didn't appear:rolleyes:

Excellent1
01-12-2008, 12:05 AM
http://us.php.net/imagecolortransparent

Jackboy
01-12-2008, 08:49 PM
<?php
$text = $_GET[ 'text' ];
?>


But Calon, $_GET is being deprecated, is it not ?

L?KE
01-12-2008, 09:16 PM
What is that all about, lol :P

And that GD thing will surely help me :D

Doritos
01-12-2008, 09:18 PM
What is that all about, lol :P

And that GD thing will surely help me :D
What is what all about?

L?KE
01-12-2008, 09:20 PM
The thing Jack said to Calon. I realise it's to do with that thread from a while ago, but I was jw lol.

Doritos
01-12-2008, 09:26 PM
Yeah it is just him carrying on a joke :P That's been used many many times.

L?KE
01-12-2008, 09:29 PM
I thought so :P.

Anyone notice my devious new avatar :P

Hypertext
03-12-2008, 01:50 PM
Yeah it is just him carrying on a joke :P That's been used many many times.

Feel good?

Calon
03-12-2008, 05:51 PM
Yeah it is just him carrying on a joke :P That's been used many many times.
What?! Why is $_GET being deprecated!

Doritos
03-12-2008, 09:32 PM
Feel good?
What are you talking about?

RichardKnox
03-12-2008, 09:50 PM
He tested DIV's. ;)

Doritos
03-12-2008, 10:05 PM
Yeah, but he fails at his joke.. because he thinks that the joke was aimed at me (when I used the "overused" phrase above), so he thought he could create something intelligent.

Excellent2
03-12-2008, 10:39 PM
Yeah it is just him carrying on a joke :P That's been used many many times.Hiya Caleb!

Doritos
03-12-2008, 10:43 PM
Hiya Caleb!
This is not Caleb ;)

Excellent2
03-12-2008, 10:44 PM
This is not Caleb ;)Unless you've joined under a new name you're Caleb :)

Doritos
03-12-2008, 10:47 PM
No it isn't. Caleb is my brother though. I'm his brother Joshua. He's still here from Thanksgiving break.

Excellent2
03-12-2008, 10:56 PM
No it isn't. Caleb is my brother though. I'm his brother Joshua. He's still here from Thanksgiving break.You just happened to know about the whole "testing divs" thing from MONTHS ago did you now?

Let me guess, you're going to say Caleb has been posting off that account?

Doritos
03-12-2008, 10:57 PM
No, he hasn't been on this account at all.

Considering I just said "he's still here from Thanksgiving break.." it means he is still at the house.

He's sitting about 4 feet across from me at his computer right now working on TehUpload.

Excellent2
03-12-2008, 11:00 PM
No, he hasn't been on this account at all.

Considering I just said "he's still here from Thanksgiving break.." it means he is still at the house.

He's sitting about 4 feet across from me at his computer right now working on TehUpload.So you'd just know about the joke from months ago would you? As soon as Dentafrice gets unbanned I can see Doritos going poof.

Source
04-12-2008, 12:27 AM
I doubt it, I have had some long conversations with josh about some API's for a new site i'm working on, caleb (my lover) hasn't been on for a while... well always "away".

Doritos
04-12-2008, 12:31 AM
haha he's on MSN once in a while, he's always going in/out at random hours.

Source
04-12-2008, 12:40 AM
Its because he doesn't want to admit he's actually gay, and going out to get some lovin'.

Doritos
04-12-2008, 12:46 AM
Its because he doesn't want to admit he's actually gay, and going out to get some lovin'.
haha! Na, he's straight. I've seen his woman-lover. ^_^.

Blinger1
04-12-2008, 01:34 AM
Parents don't count ;)

Doritos
04-12-2008, 02:11 AM
Parents don't count ;)
You just outdid yourself there.

http://i56.photobucket.com/albums/g196/lgraddy/so-not-funny.jpg

L?KE
04-12-2008, 05:13 PM
And you were just as funny... :rolleyes:

Doritos
04-12-2008, 08:58 PM
Thank you! :P

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