Jump to content

Dynamic Signatures


Recommended Posts


Can you post a screenshot of what it's giving you? I don't really understand what you mean by it giving you a "link to the page as an image."

When, I fill out the form, and leave the select box alone, or choose Home (which is the default) it works, but none of the others.

Now if I did this correctly, it will show the screen shot, That link that you see, is in, it's just hard to tell in the screen lol.

post-236414-1237425252_thumb.jpg

Link to comment
Share on other sites

The problem's not with your code, it's with your images. Only sample_card.png is a valid PNG file; the others are just JPEG files with a PNG file extension. You have to convert them to valid PNG files in order to avoid having to edit the code at this point. The GD library in PHP expects a PNG image when you call imagecreatefrompng, otherwise it spits out a useless "error" like the one you're getting.

Link to comment
Share on other sites

The problem's not with your code, it's with your images. Only sample_card.png is a valid PNG file; the others are just JPEG files with a PNG file extension. You have to convert them to valid PNG files in order to avoid having to edit the code at this point. The GD library in PHP expects a PNG image when you call imagecreatefrompng, otherwise it spits out a useless "error" like the one you're getting.

Ohh, I forgot, I was doing several things when I was uploading them, and I thought I had converted them.

Thanks for that, and um.. *cough* yeah, thanks. =D

Link to comment
Share on other sites

Hmm, okay well I have checked www.php.net

And I have gotten a code for textwrapping, but, that Code doesn't resize the text for the more words you type in. Would you happen to know how to do that?

Ill try to be more clear.

So, here's a sentence or two:

I went to the market to buy Lucy Sue a show. When I got there, the market was closed.

The code I found for text wrapping does this (Depending on the amount of characters I choose):

I went to the marker to

buy Lucy Sue a show.

When I got there, the

Market was closed.

Now, that would work, if I had a restriction on the amount of characters someone could type in. But I don't want the restrictions. Thus making this code invaluable to me..

Oh, heres the code Im using:

<?php
$text = "A very long woooooooooooord.";
//8 is the limit of characters, '\n' is the breaking method, and false means if it was a word being cut, the word would stay whole instead.
$newtext = wordwrap($text, 8, "\n", false);

echo "$newtext\n";
?>

Link to comment
Share on other sites

Oh, heres the code Im using:

<?php
$text = "A very long woooooooooooord.";
//8 is the limit of characters, '\n' is the breaking method, and false means if it was a word being cut, the word would stay whole instead.
$newtext = wordwrap($text, 8, "\n", false);

echo "$newtext\n";
?>

That's the only way I ever did it. :( The trick is to find the correct limit for the number of characters you want on a single line.

Link to comment
Share on other sites

Oh, heres the code Im using:

<?php
$text = "A very long woooooooooooord.";
//8 is the limit of characters, '\n' is the breaking method, and false means if it was a word being cut, the word would stay whole instead.
$newtext = wordwrap($text, 8, "\n", false);

echo "$newtext\n";
?>

That's the only way I ever did it. :( The trick is to find the correct limit for the number of characters you want on a single line.

=/

I know the number of characters I want for a single. But the problem is, that if the group of text is long enough, it will just keep doing down. and that ruins what im trying to do =/

Link to comment
Share on other sites

=/

I know the number of characters I want for a single. But the problem is, that if the group of text is long enough, it will just keep doing down. and that ruins what im trying to do =/

You can always limit the number of characters someone submits. See an example here: http://www.webmasterworld.com/forum88/7649.htm

Hmm, alright, the code when I put it into my PHP it doesn't work, I don't know where to put it.

Link to comment
Share on other sites

Hmmm... You have two options:

First, you can use that code and output an error to the user if the inputted characters are more than your limit using an if statement. Otherwise, you can just truncate the inputted text using another PHP function I'll let you look up.

Link to comment
Share on other sites

Hmmm... You have two options:

First, you can use that code and output an error to the user if the inputted characters are more than your limit using an if statement. Otherwise, you can just truncate the inputted text using another PHP function I'll let you look up.

Yeah I figured that, but making a set character limit wont let me use the wrap code. So i just kept the wrap code and lowered the text size.

But I have another question. How come when ever I try to use an image, like if I wanted to have the option for the user to have an icon. It always makes that image the background =/ How come? It's getting really annoying..

Link to comment
Share on other sites

Hmmm... You have two options:

First, you can use that code and output an error to the user if the inputted characters are more than your limit using an if statement. Otherwise, you can just truncate the inputted text using another PHP function I'll let you look up.

Yeah I figured that, but making a set character limit wont let me use the wrap code. So i just kept the wrap code and lowered the text size.

But I have another question. How come when ever I try to use an image, like if I wanted to have the option for the user to have an icon. It always makes that image the background =/ How come? It's getting really annoying..

There are a few reasons for this. It would help if you posted your modified code so I could look at it and tell you why.

Link to comment
Share on other sites

Hmmm... You have two options:

First, you can use that code and output an error to the user if the inputted characters are more than your limit using an if statement. Otherwise, you can just truncate the inputted text using another PHP function I'll let you look up.

Yeah I figured that, but making a set character limit wont let me use the wrap code. So i just kept the wrap code and lowered the text size.

But I have another question. How come when ever I try to use an image, like if I wanted to have the option for the user to have an icon. It always makes that image the background =/ How come? It's getting really annoying..

There are a few reasons for this. It would help if you posted your modified code so I could look at it and tell you why.

Alright I sent it to you in a PM

Link to comment
Share on other sites

Bloodrun,

After looking at your code, I have to tell you that you've got quite a bit of learning to do before you continue coding something as complex as this, especially since you're a beginner at PHP. I suggest starting off small, maybe with a simple website just to get to know PHP.

The reason your background image isn't showing up is because you're using the same $image variable to create and display multiple images in your code. This will result in only the last image in your code being parsed and displayed. What you really need to do is, first of all, is use a different variable. Once you have all of these different variables with different images, you'll have to merge all of the images into a single one; this is done with the imagecopymerge function.

As well, the syntax in most of your code is incorrect, but I, personally, cannot take the time to fix it because I am not quite sure what you are trying to do and it would also defeat the purpose of you learning PHP. Like I mentioned, you have to start off small and work your way up; you can't start midway and expect everything to work at once.

Unfortunately, this is where I'm going to stop. You've got the basics of it. Now it's all a matter of browsing the http://www.php.net and learning about all of the functions that are a part of the GD library.

Cheers and good luck,

Link to comment
Share on other sites

Bloodrun,

After looking at your code, I have to tell you that you've got quite a bit of learning to do before you continue coding something as complex as this, especially since you're a beginner at PHP. I suggest starting off small, maybe with a simple website just to get to know PHP.

The reason your background image isn't showing up is because you're using the same $image variable to create and display multiple images in your code. This will result in only the last image in your code being parsed and displayed. What you really need to do is, first of all, is use a different variable. Once you have all of these different variables with different images, you'll have to merge all of the images into a single one; this is done with the imagecopymerge function.

As well, the syntax in most of your code is incorrect, but I, personally, cannot take the time to fix it because I am not quite sure what you are trying to do and it would also defeat the purpose of you learning PHP. Like I mentioned, you have to start off small and work your way up; you can't start midway and expect everything to work at once.

Unfortunately, this is where I'm going to stop. You've got the basics of it. Now it's all a matter of browsing the http://www.php.net and learning about all of the functions that are a part of the GD library.

Cheers and good luck,

Lol, I wondered when this was gonna pop up.

Alright, well thanks for the help.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...