Jump to content

Archived

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

pvtpyro

forms and arrays?

Recommended Posts

I'm having a little trouble. I will start by showing what I have done.

i have an html form. here's part of it:
[code]    <select name="bgcolor">
      <option value="000000">Black</option>
      <option value="FFFFFF">White</option>
      <option value="CCCCCC">Gray</option>
    </select>[/code]

the forms action is to a php file. this code works just peachy.
[code]ImageFill($image, 0, 0, fromhex('ff0099'));[/code]

i would like to insert bgcolor from my form in place of ff0099 in the php part. But the only method I know doesn't work.
[code]ImageFill($image, 0, 0, fromhex($_POST['bgcolor']));[/code]

can someone help me with this?

Share this post


Link to post
Share on other sites
How doesn't it work? Your code snippet looks fine as long as the method in your form is "POST", if it is "GET" or missing you need to use the $_GET array not the $_POST array.

Ken

Share this post


Link to post
Share on other sites
Yeah, I'm using POST.
I'm using the same method for my other form elements, and they all work fine.
it seems that because there's content before and after my $_POST['bgcolor'] that it's not working. I've tried single quotes, double quotes. nothings working.

Share this post


Link to post
Share on other sites
Oh wait! I'm sorry. This is the second time today I've corrected my own mistakes.

I am sooo sorry for wasting time. I've never done something right on my own before!  :D

Share this post


Link to post
Share on other sites

×

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.