Need the mandatory fields are in PHP?

I made a form using php, which I've never done before. The form works fine, but my client would like to make the email address and phone numbers required fields so that they can meet their customers. Can someone look at this php script and tell me what I need to do to this e-mail and phone number are required? The web page with the form is http://www.pearlroadautoparts.com/parts.html. When the form is submitted, you are redirected to http://www.pearlroadautoparts.com/thankyou.html. I don't want to keep guessing cela and hurt because the form is online and working. I don't want real customers have problems with the form. Thank you for your help!

< body > <?

///////////////////////////

Start the Configuration

///////////////////////////

Your email address

$to = " [email protected] ".","; "

Subject of the e-mail

$subject = "parts order form. "" Auto road Pearl. "

Name of the server, display in the headers

$server_name = 'auto road Pearl. "

Where redirect after form is processed.

$url = ' http://www.pearlroadautoparts.com/thankyou.html';

///////////////////////////

Flushing

///////////////////////////

if (! empty($_POST['send']):! empty($_GET['send']))

{

$action = (! empty($_POST['send']))? $_POST ['sent']: $_GET ['sent'];

}

on the other

{

$action = ";

}

$build_message = false;

If ($action! = "")

{

$build_message = true;

$year = trim($_POST['year']);

$make = trim($_POST['make']);

$model = trim($_POST['model']);

$part_name = trim($_POST['part_name']);

$part_info = trim($_POST['part_info']);

$quantity = trim($_POST['quantity']);

$name = trim($_POST['name']);

$email = trim($_POST['email']);

$shipping_address = trim($_POST['shipping_address']);

$city = trim($_POST['city']);

$state = trim($_POST['state']);

$zip_code = trim($_POST['zip_code']);

$phone_number = trim($_POST['phone_number']);

$cell_number = trim($_POST['cell_number']);

$time = time();

$date = date ("F j, Y", time());

$headers = "MIME-Version: 1.0\r\n";

$headers. = "content-type: text/plain;" Charset = UTF-8\r\n ";

$headers. = "from: $email\r\n";

$headers. = ' X-mailer: ".". " $server_name. 'Serveur\r\n ';

}

If ($build_message)

{

/ * message * /.

$message ="

Year: $annee\n

Brand: $vous\n

Model: $model\n

Part name: $part_name\n

Part Information: $part_info\n

Amount: $quantity\n

Name of the customer: $name\n

E-Mail client: $email\n

Shipping address: $shipping_address\n

City: $city\n

State: $state\n

Postal code: $zip_code\n

Phone number: $phone_number\n

Cell phone number: $cell_number\n

Date sent: $date\n ";

if (mail ($ $subject, $message, $headers))

{

$result = "< b > < /b > please. < br / > I'll get back to you very soon. "< br / > ';

}

else

{

$result = ' sorry: an error has occurred, please try again later. ';

}

}

echo "< META HTTP-EQUIV = CONTENT refresh ="0; " URL ='. $url. " » >';

? >

< / body >

I use the Spry Validation, which is on DWCS3 and above all, I would look at that.

Gary

Tags: Dreamweaver

Similar Questions

  • Problem with the mandatory fields are in Panel tabs

    Hello

    I use Jdeveloper 11.1.1.2 and I created a jspx page in which I use < af:panel by tabs > who has 2 < af:showDetailItem > elements.
    Here, the problem is in each item in detail see I have selectOneChoice as required fileds. When I'm Runnin' the page and click on the second tab, it is asked to select a value for the SOC.
    Can someone help me how to required fileds only this element < showdetailitem > but not for the two showdetailitems.

    Thank you
    Harika.

    Set the immediate property to the tab to be true.

    Similar post on the forum:
    Deliver the required property tabs Panel

    Thank you
    Nini

  • Prevent the 'Send Email' dialog box until the required fields are filled

    I am new to JS and fight with a last piece of code.

    I have a form with several fields. I send the form as an attachment to e-mail and need the required fields completed before the form can be sent by e-mail.

    Currently, I have a display alert message if all of the required fields are empty, but if I cancel the box warning, the 'send Email' dialog appears immediately and I can send the form even if the required fields are empty. I want the 'Send Email' box to appear only after completing all the required text boxes.

    The problem seems to be with the if/else line (IF all fields req. are empty, send alert. OTHERWISE open the box "Send email"). What is the best way to write this? Ideally, I would like to alert to list specific areas that are empty. Here is what I have at the moment - but obviously something wrong):

    If (requiredFields.length > 0) {}
    App.Alert (Error);

    } else


    var subject = this.getField("JobNumber").value + '-application form;
    this.mailDoc({)
    cTo: "[email protected]"

    })

    (Using Acrobat XI - thanks in advance!)

    LAST UPDATED 18/12/15

    Talk with someone @ Adobe (through our IT people we actually received a CONF. call w / an Acrobat expert!)

    It turned out to be the word "subject" in our Javascript. The word
    "subject" is a reserved word in newer formats and is read-only in
    Drive.  So we had to redefine the word & read "subject".

    Works great!

  • How to restrict user access to must enter a value in the mandatory fields

    Greetings!

    I had a personal information form. I want to restrict the user to enter values in all areas of mandatory for example fields (username, date of birth, etc.)
    How to limit the search user must enter a value in the mandatory fields

    Create dynamic actions for each of the fields, or you can create javascript.
    for example create dynamic action 1 with event as tune-up losing select the item and the condition as NULL and action as alert and type the message you want to display in the text section.

    Thank you
    Mehabub

  • The required fields are not displayed message when left blank

    Hello

    I set fields as required in the value, the field Type as user entered - required tab. Also, I entered a message in the empty Message field. When the user fills out the form, they are allowed to send the form without fill in the fields.

    Any help is greatly appreciated.

    Thank you

    MDawn

    Use the preSubmit event to check required fields / required before sending...

    Check the wire for ideas below.

    http://forums.Adobe.com/thread/606762?TSTART=0

    Usually, if you use the required field and submit the form, it will display the warning message that the required fields are missing, and continue to submit the form. It is therefore preferable to use the programmatic approach for the control on the form submission.

    When you search for the values of field programmatically, you must set the Type property of the value type as input by the user - option.

    Thank you

    Srini

  • User alert registration PDF if the required fields are empty/null

    Greetings,

    I read a lot of threads on this topic. I'm not trying to force the user to stay in one area or otherwise, be annoyed. I would like to just draw the attention of the user when they record the PDF file if there are mandatory fields have not been completed. The alert message would simply be a reminder polite form before sending.

    I use Acrobat Pro XI.

    (1) is the other tasks/Set Document Actions / Document will save the right place to use a script in this case?

    (2) the script will check each field required name? Or is it possible to reference all the fields requested in the document?

    (3) I have seen a few examples like this:

    f = getField (event.target.name)

    If (f.value.length == 0)

    {

    f.setFocus)

    App.Alert ("this field is required. Please enter a value. »)

    }

    However there are some problems regarding the closure of the alert dialog box and so on. Can someone provide an example script to help me get started?

    Thank you!

    Exactly how you check a field is empty depends on what kind of field it is. For text fields, you must get the value of the field as a string and compare it to an empty string, something like:

    var val = getField("Text1").valueAsString;

    If {(val)

    App.Alert ("field is not empty");

    }

    If there is a default value that needs to be changed, you would compare it to the default value:

    var f = getField ("Text1");

    var val = f.valueAsString;

    If (val! == f.defaultValue) {}

    App.Alert ("field value is OK");

    }

    For checkboxes and radio buttons, you would compare it to the string "Off", which means that none in the group is selected.

    For drop-down lists (combo boxes) and list boxes, there is normally a single value selected, so you should get the value and check the default value (or something else) to see if the field is filled in correctly.

    You could place the script it, but I usually use a separate button that I encourage the user to click to activate the check box. The problem with the help of her saving the event is that you cannot stop the backup.

    The script can loop through all of the fields (and test all zeros required), or you can define an array of domain names to check.

  • The date fields are clearing after selection LOV

    Hello

    On the page of my creation, I have four fields, only two LOV and two Datetime fields. After you have entered the fields date, when I select the LOV fields the two datetime fields are going to cleared. Please do the needful.

    Kind regards

    Jean sebastien

    problem solved.

    Thank you.

  • When you try to import data from csv address book, less than half of the csv fields are available for mapping.

    I exported my Outlook contacts to a CSV file. When you try to import the CSV file into Thunderbird, only some CSV fields are listed in the field mapping tool. More important still, e-mail addresses aren't in the list.

    There is a long discussion of importing csv here:

    https://getsatisfaction.com/mozilla_messaging/topics/importing_windows_live_contacts

    Essentially, you must edit the csv in an editor of spreadsheet or csv file to make it compatible with the address book of TB.

  • Labels are centered, but the text fields are not

    I can't seem to convince a RichTextField is centered on the screen.  This is a limitation of this particular area, or I am doing something stupid?  Copy the following code illustrates the problem:

    package com.rim.samples.hello;
    
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.RichTextField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    final class HelloScreen extends MainScreen {
        public HelloScreen () {
            super();
    
            // The title is centered
            LabelField title = new LabelField("Test Field Attributes",
                    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | LabelField.HCENTER
                    | LabelField.VCENTER);
            setTitle (title);
    
            // A simple label added to the main screen is centered
            add (new LabelField("Yay! I'm centered!", LabelField.FIELD_HCENTER));
    
            // But a rich text field refuses to center
            add (new RichTextField("Boohoo, I'm not!", RichTextField.FIELD_HCENTER));
    
            add (new LabelField("Labels rock!", LabelField.FIELD_HCENTER));
    
            // The vertical field manager makes no difference
            VerticalFieldManager v = new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
            v.add (new RichTextField("field managers don't help :(", RichTextField.FIELD_HCENTER));
            v.add (new LabelField("VFM Labels work!", LabelField.FIELD_HCENTER));
            add(v);
    
        }
    }
    

    I tried FIELD_RIGHT but when HCENTER does not, nor does RIGHT.  I guess I can use a tag instead, but I was really hoping to use a centered text edit field.  Any ideas?  Thank you

    Blister

    The default behavior of RichTextField should use the full width. Try adding the RichTextField.USE_TEXT_WIDTH style

  • Button cancel - ignore the mandatory fields

    Hi all

    I use JDeveloper Version 11.1.1.6.0

    I have a form with the following buttons (see below). I need the "Cancel" button to trigger the cancelAction() method in my grain and requires no text for the inputText 'reason '.

    The cancelAction() sets the ManageRequests bean properties and refreshes the page so that the form can be reset to zero.

    How can I achieve this?
    <af:panelGroupLayout id="pgl5" layout="horizontal" inlineStyle="float:right;">
    
         <af:inputText label="Reason" id="it7"
                                        binding="#{ManageRequests.rejectReasonIT}"
                                        rows="10" columns="50" 
                                        immediate="true"
                                        styleClass="AFStretchWidth"
                                        rendered="#{!ManageRequests.isApproval}"
                                        required="true"/>
    
         <af:commandButton text="Approve" id="cb7" actionListener="#{ManageRequests.approveRequest}"/>
         <af:commandButton text="Cancel" id="cb6" actionListener="#{ManageRequests.cancelAction}" immediate="true"/>
    </af:panelGroupLayout>
    Here's the method
        public void cancelAction(ActionEvent actionEvent) {
            try {   this.rejectReasonIT.setValue("");}  catch (Exception e){e.printStackTrace();};
            this.setDisplayReasonInput(false);
            this.setDisplayConfirmation(false);
            this.setIsApproval(false);
        }
    Published by: ilovebuffets on September 11, 2012 13:57

    Published by: ilovebuffets on September 11, 2012 13:58

    Hello

    change your way of

    public void cancelAction(ActionEvent actionEvent) {
            try {   this.rejectReasonIT.setValue("");}  catch (Exception e){e.printStackTrace();};
            this.setDisplayReasonInput(false);
            this.setDisplayConfirmation(false);
            this.setIsApproval(false);
    
           FacesContext.getCurrentInstance().renderResponse();
        }
    

    The last line allows to avoid the errors of required field

    Frank

  • Can a radio button or box multiple selection in the mandatory fields?

    The initial selection would be necessary, however to choose also other choices in addition to the original selection. In my attempt to install, I can select a field (required), but by selecting an extra field 'unchecked' original field selected

    Something like:

    Or the reasons for the cancellation

    Option 1

    Option 2

    Option 3

    Option 4

    In the case of use, you may choose Option 1 and Option 3.

    Hi K.Winger,

    OK, that's what I thought you wanted to do, but needed to make sure. You can't really do this using a 'game' of option buttons, or a group of check boxes for the reasons you mention, and more that you can't predict which of the available option will apply.

    If you need to do it with 2 sets of options. The first set would you do a group of requred radio buttons, the second is a group of option buttons. But of course it would be a strange layout.

    I think what I'd do it is divided into a drop-down list and a group of checkboxes. You just add therefore place a drop-down list box in the layout.

    In the drop-down list to add all options possible and assign required "."

    Then let what you already like checkboxes in option.

    You can also take it a few steps further.

    first add an additional option to the group box to check something in the sense of "without additional reasons.

    so now you can also do this group of checkboxes required and avoid people to jump it.

    you could also add conditions to the boxes.

    for starters, you can hide all the boxes and show them only when a selection has been made in the drop-down list

    also you can keep hiding the box for the option selected in the drop-down list, if you do not get a doubly selected option.

  • Titles in the menu bar are small and blurry as well as all the text fields are reduced in Photoshop

    As you can see by the picture below, my menu bar titles at the top are small and blurry, most anywhere there is an area of text field (i.e. length & width text fields in the window in the size of the Image) she is collapsed vertically and so I don't see what are my values.  You can also see that the 3 boxes check mark at the bottom of the window the size of the Image are cut.  I have CS6 installed on a Windows XP computer without any problem.  Now that I "upgraded" to Windows 7, this is what I get results after installation.

    Untitled-1.jpg

    Straighten out your system fonts. All menu entries and pallets using the police hurt eitehr because you deleted the right a (trebuchet, Verdana), he is blocked or has another problem. Also update your graphics driver.

    Mylenium

  • Tweaking of default query so that the two fields are searched equally

    I have a 'Customer Details' data block that contains the field "mobile1" and "mobile2" for customer's cell phone numbers. When a customer enters into a mobile number or a field, I need to check the two mobile fields to see if this number exist as the primary contact number or secondary to any client of the query.
    I've tried to set a default_where clause, but oracle automatically adds to him whenever a number is entered in the field, making me a little trouble at the head!

    For example, if I say something like, WHERE MOB1 =: BLOCK. MOB1 OR = MOB1: BLOCK. Mob 2 (do not question true, just one example)
    And I took #-# in the field of mobile2,.
    Forms adds to this "AND mob 2 =: 1'"

    which causes the query to return nothing, since there is no entry mob 2 is equal to the registered number, even if there is an entry MOB1 bearing the same number.

    Is there a way to change the AND a RC for the query?

    If not, can anyone suggest how I can get the result, I'm looking for without having to change my block to a block not DB and duplicate me all the default features of Oracle Forms manually?

    Thanks in advance,

    A

    Do something like this in the PRE-QUERY-trigger:

    IF :BLOCK.MOBILE1 IS NOT NULL THEN
         SET_BLOCK_PROPERTY('BLOCK', ONETIME_WHERE, 'MOBILE1 LIKE ''' || :BLOCK.MOBILE1 ||  ''' OR ' ||
                                                    'MOBILE2 LIKE ''' || :BLOCK.MOBILE1 ||  '''');
    
    END IF;
    :BLOCK.MOBILE1:=NULL;
    
  • Why the text fields are not shown in the exact position where I place, being in a position different from the design view and preview?

    Enclosed is the difference in preview mode and Design Mode.

    Please note that I noticed the same phenomenon occurs on the "IRINA" template that I downloaded for use in training.Looloo1.JPGLooloo2.JPG

    Design_Mode.JPGPreview_Mode.JPG

    Well, what you are is the correct behavior. The image is scaling due to the width of the browser. This is normal because the text does not meet the resizing (yet). You should be able to fix this in the next version of Muse. Or you can join the public beta version now and try it.

  • APEX 4.0 'attributes of the element' field are ignored in the tabular forms

    Hello

    I don't know if I should report it as a bug, but first I want to ask around to make sure I don't do something wrong.

    I noticed that no matter what attribute you put in this area (under the column attributes), when APEX generates your tabular presentation it not include the attribute you entered.

    For example, I create a simple tabular presentation using the wizard and then I entered 'Attributes of elements' of one of the column (which was a textfield): style = "color: red;"

    This piece of code was not the case to be found in any of the source of the page.

    Can someone confirm this problem? Or maybe it has already been reported?

    Thank you

    Published by: reggieh on March 22, 2011 10:09

    Hello

    Idea is that make you example and let us see source.

    Seems in any case there is problem. Use jQuery and add your styles after that document is ready.
    Something like this page run JavaScript when Page loading

    $('[name="f10"]').css({"font-weight":"bold","color":"red"});
    

    Kind regards
    Jari

Maybe you are looking for