473,320 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Small PHP button

Hello. I want to make a PHP button that's small. Problem is, all my attempts either screwed up the layout or needed MUCH more code than i want to do. The page I'm using is set up with tables, if that helps any

My first attempt was to use a <span> tag with a javascript function, which gave me the layout i wanted, but in order to transfer the javascript functions to PHP, i need a JSP page to right it to the Database, which confuses the devil out of me, or a way to transfer the variables from javascript to PHP without adding hundreds of lines of code.

My second attempt was to make an image button using the <INPUT> tag, which gave me the function i wanted, but it screwed up the layout, since the first instance (which is in a while php function) is always elongated (like, it would make the division between the title and the message have a gap bigger than what i want), but after that, all of them look fine.

How it works:
Basically, using the <Form> tag with no attributes, a button, and a hidden field, set up like so:
Expand|Select|Wrap|Line Numbers
  1. <? if ($var1) mysql_query("query"); ?>
  2. HTML stuff
  3. <?php stuff
  4. echo "<FORM><TR><TD colspan=4 align=right><INPUT type=hidden name=target value='{$messages_row[datetime]}'>";
  5. echo '<INPUT type=submit value="button" name="var1"></TD></TR></FORM>';
so when the page reloads itself, the query is executed. Not the prettiest code wise, but it works.

The question:
Is there anyway to make a button small (13x10 Pixels), layout friendly (no PNG image), and also not use a ton of code to do what i want?

Thanks,
Hh2
Jul 24 '08 #1
1 2186
Markus
6,050 Expert 4TB
Use css to acheive this:

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. .small_button{
  3.     width: 13px;
  4.     height: 10px;
  5. }
  6. </style>
  7.  
  8. <input type="button" class="small_button" value="This is a small button!" />
  9.  
Jul 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Pat | last post by:
I want to submit an HTML form and have the reply appear in a small window that overlays the form window. After the reply is read, the user should be able to delete the small window, and then...
5
by: F. Barth | last post by:
Hello, I've posted this problem to one other newsgroups, and gotten some diagnostic help, but I still need a solution. The full text of the message box is: "The field is too small to accept the...
1
by: Netserver | last post by:
Hi in the display properties off the control panel, tab settings,advance button. Font size has two sizes, the default is small. when you create your form with this default size everything is fine...
2
by: Nathan Sokalski | last post by:
I have been trying to make a (supposedly) simple control. The control is nothing more than a control used to select integers, I was planning on making it a UserControl composed of a TextBox and 2...
3
by: Arjen | last post by:
Hi, How do I keep the viewstate small? I think I'm only using it for redirection (String)ViewState. Thanks! Arjen
7
by: Daniel Kabs | last post by:
Hi there, for a long time I've been using tables to layout elements on a web page. Example: Say we have a 2x2 table and I'd like to put text (left aligned) and buttons (right aligned) in the...
12
by: pwiegers | last post by:
Yes, I know, this is sort of commercial.. but how else to get people to, what I think, is a handy online applicaton? I created this app because I hate do document :) (Don't we all?) Sometimes I...
1
by: 6655326 | last post by:
Newbi needs a very small help, thank you very much. Hello everyone and thank you very much for your time. I Have a small db for invoicing and on my form (with a subform) there is a CANCEL...
9
by: nma | last post by:
Hi How should I make this window small just to show only that text like in the box pop up? It just want to show deleted info and ok button only. But currently the window is too big. <?php...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.