+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 14

Thread: contact forms...?

  1. #1
    Stylish Member philjohns's Avatar
    Join Date
    Oct 2007
    Location
    Ivybridge, Plymouth
    Posts
    627

    contact forms...?

    Ive followed a tutorial online to create a basic contact page (I have just copied and pasted the code to start with) but it doesnt work....

    Can anyone tell me, or point me in the right direction of how to make a contact form using xhtml preferably as I dont know php although I am williing t o learn a bit if its not possible with JUST xhtml...

    thanks guys...


  2. #2
    Netvibes is an Addiction™ Toon's Avatar
    Join Date
    Jan 2007
    Location
    Sheffield, UK
    Posts
    23,646
    Blog Entries
    12

  3. #3
    Stylish Member philjohns's Avatar
    Join Date
    Oct 2007
    Location
    Ivybridge, Plymouth
    Posts
    627
    Thanks Toon, but is there no way of me creating one where the message simply gets sent to my email address?

  4. #4
    sarcastic encouragement, brilliant! rossable's Avatar
    Join Date
    Oct 2007
    Location
    IN, USA
    Posts
    1,138
    what language are you writing it in?
    PHP or JavaScript?

  5. #5
    Stylish Member philjohns's Avatar
    Join Date
    Oct 2007
    Location
    Ivybridge, Plymouth
    Posts
    627
    haha, thats the thing...xhtml

    Whats the easiest way for me to do what I want to do?

  6. #6
    Stylish Member philjohns's Avatar
    Join Date
    Oct 2007
    Location
    Ivybridge, Plymouth
    Posts
    627
    The tutorial that I followed and of which used a bit of php script creates this but it doesnt work...

  7. #7
    sarcastic encouragement, brilliant! rossable's Avatar
    Join Date
    Oct 2007
    Location
    IN, USA
    Posts
    1,138
    DONT JUST BYTE MY CODE! figure out why it is the way it is.
    after you get your XHTML form set and retrieve all the data from it with PHP make sure you have something similar to this (this is copy and pasted from my personally developed code so you will have to tweak it a little)

    PHP Code:
        $to "ross@justross.com";
        
    $from repme();
        function 
    repme() {
            if (
    $from == "@batmobile.websitewelcome.com") {
                
    $from "$email_1" "@batmobile.websitewelcome.com";
            } else {
                
    $from "$email_1";
            }
        }

        
    mail ($to$_POST['subject_text'], $body$from ); 
    to put it into context i will post the whole control.

    PHP Code:
    <?php

        
    //////////////////////////
        //    VALIDATION ERR    //
        //////////////////////////
        
        
    ini_set ('display_errors'1);
        
    error_reporting (E_ALL & ~E_NOTICE);
        
        
    $prefix $_POST['prefix'];
        
    $first_name $_POST['first_name'];
        
    $last_name $_POST['last_name'];
        
    $email_1 $_POST['email_1'];
        
    $email_2 $_POST['email_2'];
        
    $phone_1 $_POST['phone_1'];
        
    $phone_2 $_POST['phone_2'];
        
    $cell $_POST['cell'];
        
    $fax $_POST['fax'];
        
    $subject_type $_POST['subject_type'];
        
    $tone $_POST['tone'];
        
    $subject_text $_POST['subject_text'];
        
    $message $_POST['message'];
        
    $send $_POST['send'];
        
        print 
    "<p class=\"hilite\">Thank you for taking the time to contact me. The following is the information you have provided.</p>
            <p>$prefix $first_name $last_name</p>
            <p>
                $email_1<br />
                $email_2<br />
                $phone_1<br />            
                $phone_2<br />
                $cell<br />
                $fax
            </p>
            <p>
                $subject_type<br />
                $tone<br />
                $subject_text<br />
                $message
            </p>"
    ;
            
        
    $body "
            Tone: $tone
            Type: $subject_type
            
            $message
            
            $prefix $first_name $last_name
            $email_1
            $email_2
            $phone_1
            $phone_2
            $cell
            $fax
        "
    ;
        
        
    $to "ross@justross.com";
        
    $from repme();
        function 
    repme() {
            if (
    $from == "@batmobile.websitewelcome.com") {
                
    $from "$email_1" "@batmobile.websitewelcome.com";
            } else {
                
    $from "$email_1";
            }
        }

        
    mail ($to$_POST['subject_text'], $body$from );
            
    ?>
    and so you can see what they are related too.

    HTML Code:
                     <form action="validation.php" method="post">
                        <legend>Name:</legend>
                        <fieldset>
                            <p>
                                <select name="prefix">
                                    <option>Prefix</option>
                                    <option value="Mr.">Mr.</option>
                                    <option value="Mrs.">Mrs.</option>
                                    <option value="Ms.">Ms.</option>
                                </select>
                                <label class="required">First:</label>
                                    <input type="text" name="first_name" size="18" />
                                <label class="required">Last:</label>
                                    <input type="text" name="last_name" size="30" />
                            </p>
                        </fieldset>
                        <legend>Email Adress:</legend>
                        <fieldset>
                            <p>
                                <label class="required">Primary Email:</label>
                                    <input type="text" name="email_1" size="50" />
                                <label>Secondary Email:</label>
                                    <input type="text" name="email_2" size="50" />
                            </p>
                        </fieldset>
                        <legend>Phone Numbers:</legend>
                        <fieldset>
                            <p>
                                <label class="required">Primary Phone Number:</label>
                                    <input type="text" name="phone_1" size="50" />
                                <label>Secondary Phone Number:</label>
                                    <input type="text" name="phone_2" size="50" />
                                <label>Mobile Number:</label>
                                    <input type="text" name="cell" size="50" />
                                <label>Fax Number:</label>
                                    <input type="text" name="fax" size="50" />
                            </p>
                        </fieldset>
                        <legend>Subject:</legend>
                        <fieldset>
                            <p>
                                <label>Subject Type:</label>
                                    <select name="subject_type">
                                        <option value="work">Concerning Work:</option>
                                        <option value="play">Not Work Related:</option>
                                        <option value="thnx">Thank You:</option>
                                        <option value="help">Error / Problem:</option>
                                        <option value="other">Other:</option>
                                    </select>
                                <label>Tone:</label>
                                    <select name="tone">
                                        <option value="relaxed">Relaxed</option>
                                        <option selected value="casual">Casual</option>
                                        <option value="polite">Polite</option>
                                    </select>
                                <label class="required">Subject Text:</label>
                                    <input type="text" name="subject_text" size="50" />
                            </p>
                        </fieldset>
                        <legend class="required">Message:</legend>
                        <fieldset>
                            <p>
                                <textarea name="message" rows="7" cols="50">Please enter your comments here.</textarea>
                            </p>
                        </fieldset>
                    <input class="button" type="submit" value="SEND" name="send" />
                    </form>
    DONT JUST BYTE MY CODE! figure out why it is the way it is.

  8. #8
    CSS Wizardry Harry's Avatar
    Join Date
    May 2007
    Location
    Leeds, England
    Posts
    13,881

  9. #9
    Stylish Member philjohns's Avatar
    Join Date
    Oct 2007
    Location
    Ivybridge, Plymouth
    Posts
    627
    Thinks Ive cracked it...can some one check for me?

    Phil Johns Imaging - Website and Graphic Design

  10. #10
    CSS Wizardry Harry's Avatar
    Join Date
    May 2007
    Location
    Leeds, England
    Posts
    13,881
    Is the email being sent through a third party site? It's very slow, and possibly less reliable than one made by yourself.

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Similar Threads

  1. Flash Forms
    By mick young in forum Flash Forum
    Replies: 1
    Last Post: 15-02-2008, 04:31 PM
  2. Forms
    By jwade_m in forum Programming Forum
    Replies: 2
    Last Post: 21-01-2008, 03:16 PM
  3. Multiple Freelance/Contact Positions in London
    By qantmuk in forum Design Forum Employment
    Replies: 0
    Last Post: 18-08-2007, 08:19 AM
  4. Meebo Contact Forms
    By Toon in forum Off Topic
    Replies: 7
    Last Post: 30-03-2007, 03:50 PM
  5. Easy Forms
    By Kelly in forum General Web Design Forum
    Replies: 0
    Last Post: 21-02-2007, 03:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


The Graphics Forum Web Design Stuff Free Decent Downloads Free Quality Wallpapers Graphics Forum Free Vista Themes
The Top The Best Images Tech Talk 247 Logo Design - $149 Affordable Stock Vector Illustrations Creativecurio - Design Blog Graphic Design Advertising

Check the forum often for the latest design announcements. Everything from graphic design and web design, to films and music. Estetica is a great place for people to get together and help each other out.



Web Hosting - UK Web Hosting services for business or personal website hosting needs.

Dedicated Servers - A full range of Managed Dedicated Server solutions suitable for all your requirements.

Graphic Design Blog | Web Design Forum | Graphic Design and Print Forum | Graphic Design Links | Advertise On This Site

Web Design UK | Vision.To Design | Leaflet Printing | Estetica Design Forum's Privacy Policy

Flyer Printing | Photography Blog | Design Forum Links | Logo Design | Graphic Design Social Network | Logo Design

Graphic Design Tutorials | Logo Designer | UK Logo Design Studio | Land for sale | Vector Art Blog | Leaflet Printing

Free Web Hosting | Custom Logo Design - $149 Only | Affordable Print Design Templates | Small Business Logo Design | Company Logo Design

Logo Design Service | Logo Design Firm | Logo Design Reseller | Custom Logo Design | Letterhead Printing | Flyer Printing | Business Card Printing

Printing | Leaflet Printing | Online Backup | T-Shirt Printing | Personalised Mugs | Canvas Printing | Free Web Hosting Comparison Site