Dynamic buttons

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

why do you need a to make a link look like a form button? why not use this in your html:

<input type="button" value="link" onclick="document.location='newpage.php';">

and it actually is a form button that send the browser anywhere you need it to go
BassPlayer
Forum Newbie
Posts: 12
Joined: Sun Aug 24, 2003 10:18 pm

Post by BassPlayer »

This thread gets the most confusng award! I was offering up my hack in case anyone needed it. I put a side comment in about the font thing and then it exploded. I like the TTF thing that would clean things up nicely. If I could somehow use the DIV inside a DIV and use php to create the font then that prolly would be faster. Realistically I need something to that I can put in a url that is extensible enough that my users can modify it.
BassPlayer
Forum Newbie
Posts: 12
Joined: Sun Aug 24, 2003 10:18 pm

Post by BassPlayer »

That works sweet. Exactly what i'm looking for but will it work for something like this?

Code: Select all

echo "<a href="#" onclick="window.close()"><img src="$roster_config&#1111;relative_path]/button.php?text=Close"></a>";
BassPlayer
Forum Newbie
Posts: 12
Joined: Sun Aug 24, 2003 10:18 pm

Post by BassPlayer »

or this

Code: Select all

echo "<a href="http://www.clanwolf.ws/cgi-bin/drop_gen.cgi" target="_blank">
          <img src="$roster_config&#1111;relative_path]/button.php?text=Drop Calculator"></a>\r";
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Code: Select all

// CSS inline style: bg color and borders

<p style="background: #ccc; border-top: #000; border-left: #000; border-right: #000; border-bottom: #000;"><?php echo $text; ?></p>

// or use bg image (take a screenshot of a submit button and edit out text in graphics prog; width and height below refer to the image dimensions):

<p style="background-image: url(path/to/image.gif); width: Xpx; height: Ypx;" ><?php echo $text; ?></p>
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

This thread is confusing, you're right. I don't even really know what I was trying to say anymore, or if it's still useful. I guess you got all sorted out.

On another note, though, you shouldn't use inline styles.
BassPlayer
Forum Newbie
Posts: 12
Joined: Sun Aug 24, 2003 10:18 pm

Post by BassPlayer »

I found that when using inline styles it hosed all my other ones

I was inable to get the document.location code to work with target=\"_blank\"

I've yet to try the JS type link.
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Inline styles will take precedence over previously declared styles, yes. That's as it should be. But that's not really the issue. The issue is that you shouldn't use them unless you absolutely have to.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Unipus wrote:The issue is that you shouldn't use them unless you absolutely have to.
?
Post Reply