Sponsored Content
Full Discussion: PHP Help with Form Submit
Top Forums Shell Programming and Scripting PHP Help with Form Submit Post 302300893 by nck on Wednesday 25th of March 2009 10:14:05 AM
Old 03-25-2009
PHP Help with Form Submit

Hi,

I have a custom HTML form that has a couple radio buttons and a text field that requires a number.

I'm not a php programmer and could use some help with putting together php code to calculate a total based on the radio button selection and the text field number.

-------------------------------
Here is a snippet from the form:
<input value="$1.20 standard design" class="radio radio radio" id="$1.20 standard design" name="radio2" type="radio" />
<label for="$1.20/standard_design" class="radio_label">$1.20/standard_design</label>

<input value="$2.10 extended_design" class="radio radio radio" id="$1.20 standard design" name="radio2" type="radio" />
<label for="$2.10/extended_design" class="radio_label">$2.10/extended_design</label>

<div class="form_element cf_textbox">
<label class="cf_label">Quantity to order? *</label>
<input class="cf_inputbox required validate-number" maxlength="150" size="30" id="text_27" name="text_27" type="text" />
</div>
-------------------------------

I need PHP code to take one of the Radio button values and then multiply it by the Quantity, then from the the discount table apply the appropriate discount and save the total in a variable.

Quantity Discount table is:
50-99 10% Off 400-799 40% Off
100-199 20% Off 800-1999 50% Off
200-399 30% Off 2000-4999 60% Off

I appreciate any help with this.
Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using wget to submit a form on linksys router

I'm trying to use wget to submit a form. I have tried to dig out what is actually being "posted" and where, using tamperdata (see below). http://ubuntuforums.org/attachment.php?attachmentid=109123&d=1239224127 Here is my wget command: wget --http-user=xyz --http-password=xyz... (1 Reply)
Discussion started by: mike909
1 Replies

2. Shell Programming and Scripting

Form validation in PHP

My form validation script looks like this of the form like this.... <html> <form method="POST" action=""> <table > <tr> <td >Name:</td> <td ><input type="text" name="name" size="30%"></td> </tr> <tr> <td >Phone:</td> <td ><input type="text" name="phone" size="30%"></td> </tr>... (0 Replies)
Discussion started by: gameboy87
0 Replies

3. Web Development

Attachement Form Mail in php

Dear Sir, I have used a php form mail code in a website. The problem I am facing is: the text in mail body is getting injected to a configured yahoo mail ID, but no attachement file. I need the attachement to go to the configured yahoo mail ID. The code I have used : <?php ... (1 Reply)
Discussion started by: swapan
1 Replies

4. Shell Programming and Scripting

Using cURL to submit a post form

I am trying to write a shell script to use curl in order to automate downloading data from a website. The URL with the post form is here: http://try-db.org/de/InfoBySpecies.php . I have a list of about 1800 different species I want to check. For Example, choose the first species and use the... (2 Replies)
Discussion started by: hansvg
2 Replies

5. Shell Programming and Scripting

Can't submit a form.

hello my script is submitting POST-data to a site (its not my first script, i've done these before many times (include parsing scripts) but this one is tough) so the problem is i'm submitting a form with firefox and in firebug i see WHAT exactly i'm submitting then when i do EXACTLY the... (28 Replies)
Discussion started by: tip78
28 Replies

6. UNIX for Dummies Questions & Answers

How to submit form on an php webpage from command line?

Hello, i have page domain.com/form.php the form fields on form.php are named: name=ipaddress name=port and submit button is named: submit i want to ask how the linux command will look like to submit the form filled with: ipaddress: 127.0.0.1 port: 80 I tried various curl and... (5 Replies)
Discussion started by: postcd
5 Replies

7. Web Development

Php help to copy form field if empty

I have an input form with several fields. What I would like to achieve is to auto populate or copy certain fields if they are empty when the form is submitted. I would like to use php if not then javascript but not jquery if possible - I have sort of had a go but I really have no idea... (4 Replies)
Discussion started by: barrydocks
4 Replies

8. Programming

Html form to submit data to bash script

hi all, im going to design a web html form so users can input what username and password they want to make the ftp account, once they enter in a username and password they click on the submit button and it submits it to a bash script and then the bash script will run and finish of making the... (3 Replies)
Discussion started by: robertkwild
3 Replies

9. Shell Programming and Scripting

Exec submit form in bash script

Hi All, I'm new in forum. Many congratulations to everyone for all work. I'm not an expert in bash script I've a problem with a sh file. The sh file run every t minuts and it read data from txt file and then compile form. Finally, the user, from the web browser click on send. The script... (0 Replies)
Discussion started by: Herbert
0 Replies

10. Shell Programming and Scripting

Trying to submit web form content to a shell script

Hi I was hoping some one could help me with a problem I have. I am trying to collect some information from a web form and save it to a text file. I found an example on this site that is sort of what I am trying to accomplish, the shell script bellow should echo the input back to the browser... (0 Replies)
Discussion started by: Paul Walker
0 Replies
QRadioButton(3qt)														 QRadioButton(3qt)

NAME
QRadioButton - Radio button with a text or pixmap label SYNOPSIS
#include <qradiobutton.h> Inherits QButton. Public Members QRadioButton ( QWidget * parent, const char * name = 0 ) QRadioButton ( const QString & text, QWidget * parent, const char * name = 0 ) bool isChecked () const Public Slots virtual void setChecked ( bool check ) Important Inherited Members QString text () const virtual void setText ( const QString & ) const QPixmap * pixmap () const virtual void setPixmap ( const QPixmap & ) QKeySequence accel () const virtual void setAccel ( const QKeySequence & ) bool isToggleButton () const virtual void setDown ( bool ) bool isDown () const bool isOn () const ToggleState state () const bool autoRepeat () const virtual void setAutoRepeat ( bool ) bool isExclusiveToggle () const QButtonGroup * group () const void toggle () void pressed () void released () void clicked () void toggled ( bool on ) void stateChanged ( int state ) Properties bool autoMask - whether the radio button is automatically masked (read only) bool checked - whether the radio button is checked DESCRIPTION
The QRadioButton widget provides a radio button with a text or pixmap label. QRadioButton and QCheckBox are both option buttons. That is, they can be switched on (checked) or off (unchecked). The classes differ in how the choices for the user are restricted. Check boxes define "many of many" choices, whereas radio buttons provide a" one of many" choice. In a group of radio buttons only one radio button at a time can be checked; if the user selects another button, the previously selected button is switched off. The easiest way to implement a "one of many" choice is simply to put the radio buttons into QButtonGroup. Whenever a button is switched on or off it emits the signal toggled(). Connect to this signal if you want to trigger an action each time the button changes state. Otherwise, use isChecked() to see if a particular button is selected. Just like QPushButton, a radio button can display text or a pixmap. The text can be set in the constructor or with setText(); the pixmap is set with setPixmap(). [Image Omitted] [Image Omitted] See also QPushButton, QToolButton, GUI Design Handbook: Radio Button, and Basic Widgets. MEMBER FUNCTION DOCUMENTATION
QRadioButton::QRadioButton ( QWidget * parent, const char * name = 0 ) Constructs a radio button with no text. The parent and name arguments are sent on to the QWidget constructor. QRadioButton::QRadioButton ( const QString & text, QWidget * parent, const char * name = 0 ) Constructs a radio button with the text text. The parent and name arguments are sent on to the QWidget constructor. QKeySequence QButton::accel () const Returns the accelerator associated with the button. See the "accel" property for details. bool QButton::autoRepeat () const Returns TRUE if autoRepeat is enabled; otherwise returns FALSE. See the "autoRepeat" property for details. void QButton::clicked () [signal] This signal is emitted when the button is activated (i.e. first pressed down and then released when the mouse cursor is inside the button), when the accelerator key is typed or when animateClick() is called. This signal is not emitted if you call setDown(). The QButtonGroup::clicked() signal does the same job, if you want to connect several buttons to the same slot. Warning: Don't launch a model dialog in response to this signal for a button that has autoRepeat turned on. See also pressed(), released(), toggled(), autoRepeat, and down. Examples: QButtonGroup * QButton::group () const Returns the group that this button belongs to. If the button is not a member of any QButtonGroup, this function returns 0. See also QButtonGroup. bool QRadioButton::isChecked () const Returns TRUE if the radio button is checked; otherwise returns FALSE. See the "checked" property for details. bool QButton::isDown () const Returns TRUE if the button is pressed; otherwise returns FALSE. See the "down" property for details. bool QButton::isExclusiveToggle () const Returns TRUE if the button is an exclusive toggle; otherwise returns FALSE. See the "exclusiveToggle" property for details. bool QButton::isOn () const Returns TRUE if the button is toggled; otherwise returns FALSE. See the "on" property for details. bool QButton::isToggleButton () const Returns TRUE if the button is a toggle button; otherwise returns FALSE. See the "toggleButton" property for details. const QPixmap * QButton::pixmap () const Returns the pixmap shown on the button. See the "pixmap" property for details. void QButton::pressed () [signal] This signal is emitted when the button is pressed down. See also released() and clicked(). Examples: void QButton::released () [signal] This signal is emitted when the button is released. See also pressed(), clicked(), and toggled(). void QButton::setAccel ( const QKeySequence & ) [virtual] Sets the accelerator associated with the button. See the "accel" property for details. void QButton::setAutoRepeat ( bool ) [virtual] Sets whether autoRepeat is enabled. See the "autoRepeat" property for details. void QRadioButton::setChecked ( bool check ) [virtual slot] Sets whether the radio button is checked to check. See the "checked" property for details. void QButton::setDown ( bool ) [virtual] Sets whether the button is pressed. See the "down" property for details. void QButton::setPixmap ( const QPixmap & ) [virtual] Sets the pixmap shown on the button. See the "pixmap" property for details. void QButton::setText ( const QString & ) [virtual] Sets the text shown on the button. See the "text" property for details. ToggleState QButton::state () const Returns the state of the toggle button. See the "toggleState" property for details. void QButton::stateChanged ( int state ) [signal] This signal is emitted whenever a toggle button changes state. state is On if the button is on, NoChange if it is in the" no change" state or Off if the button is off. This may be the result of a user action, toggle() slot activation, setState(), or because setOn() was called. See also clicked() and QButton::ToggleState. QString QButton::text () const Returns the text shown on the button. See the "text" property for details. void QButton::toggle () [slot] Toggles the state of a toggle button. See also on, setOn(), toggled(), and toggleButton. void QButton::toggled ( bool on ) [signal] This signal is emitted whenever a toggle button changes status. on is TRUE if the button is on, or FALSE if the button is off. This may be the result of a user action, toggle() slot activation, or because setOn() was called. See also clicked(). Example: listbox/listbox.cpp. Property Documentation QKeySequence accel This property holds the accelerator associated with the button. This property is 0 if there is no accelerator set. If you set this property to 0 then any current accelerator is removed. Set this property's value with setAccel() and get this property's value with accel(). bool autoMask This property holds whether the radio button is automatically masked. See also QWidget::autoMask. bool autoRepeat This property holds whether autoRepeat is enabled. If autoRepeat is enabled then the clicked() signal is emitted at regular intervals if the button is down. This property has no effect on toggle buttons. autoRepeat is off by default. Set this property's value with setAutoRepeat() and get this property's value with autoRepeat(). bool checked This property holds whether the radio button is checked. This property will not effect any other radio buttons unless they have been placed in the same QButtonGroup. The default value is FALSE (unchecked). Set this property's value with setChecked() and get this property's value with isChecked(). QPixmap pixmap This property holds the pixmap shown on the button. If the pixmap is monochrome (i.e. it is a QBitmap or its depth is 1) and it does not have a mask, this property will set the pixmap to be its own mask. The purpose of this is to draw transparent bitmaps which are important for toggle buttons, for example. pixmap() returns 0 if no pixmap was set. Set this property's value with setPixmap() and get this property's value with pixmap(). QString text This property holds the text shown on the button. This property will return a QString::null if the button has no text. If the text has an ampersand (&) in it, then an accelerator is automatically created for it using the character that follows the '&' as the accelerator key. Any previous accelerator will be overwritten, or cleared if no accelerator is defined by the text. There is no default text. Set this property's value with setText() and get this property's value with text(). SEE ALSO
http://doc.trolltech.com/qradiobutton.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qradiobutton.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QRadioButton(3qt)
All times are GMT -4. The time now is 11:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy