Graphic Design Forum and Web Design Forum  

Go Back   Graphic Design Forum and Web Design Forum »Web Design Forum »CSS Forum

Notices

CSS Forum Cascading Style Sheets (CSS) and XHTML Forum


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-12-2007, 08:06 PM
philjohns's Avatar
Established Member
 
Join Date: Oct 2007
Location: Ivybridge, Plymouth
Gender: Male
Posts: 587
Default 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...
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote

  #3 (permalink)  
Old 15-12-2007, 08:39 PM
philjohns's Avatar
Established Member
 
Join Date: Oct 2007
Location: Ivybridge, Plymouth
Gender: Male
Posts: 587
Default

Thanks Toon, but is there no way of me creating one where the message simply gets sent to my email address?
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #4 (permalink)  
Old 15-12-2007, 08:42 PM
rossable's Avatar
sarcastic encouragement, brilliant!
 
Join Date: Oct 2007
Location: IN, USA
Gender: Male
Posts: 1,055
Default

what language are you writing it in?
PHP or JavaScript?
__________________
http://justross.com/
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #5 (permalink)  
Old 15-12-2007, 08:52 PM
philjohns's Avatar
Established Member
 
Join Date: Oct 2007
Location: Ivybridge, Plymouth
Gender: Male
Posts: 587
Default

haha, thats the thing...xhtml

Whats the easiest way for me to do what I want to do?
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #6 (permalink)  
Old 15-12-2007, 09:05 PM
philjohns's Avatar
Established Member
 
Join Date: Oct 2007
Location: Ivybridge, Plymouth
Gender: Male
Posts: 587
Default

The tutorial that I followed and of which used a bit of php script creates this but it doesnt work...
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #7 (permalink)  
Old 15-12-2007, 09:50 PM
rossable's Avatar
sarcastic encouragement, brilliant!
 
Join Date: Oct 2007
Location: IN, USA
Gender: Male
Posts: 1,055
Default

Quote:
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.
__________________
http://justross.com/
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #8 (permalink)  
Old 16-12-2007, 08:49 AM
PR Design's Avatar
CSS Wizardry -- Not Gay!
 
Join Date: May 2007
Location: Yorkshire, England
Gender: Male
Posts: 5,913
Default

I developed this, it should help: Multiple Emails - PHP :: Labs - PR Design's Public Laboratory
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #9 (permalink)  
Old 16-12-2007, 12:45 PM
philjohns's Avatar
Established Member
 
Join Date: Oct 2007
Location: Ivybridge, Plymouth
Gender: Male
Posts: 587
Default

Thinks Ive cracked it...can some one check for me?

Phil Johns Imaging - Website and Graphic Design
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
  #10 (permalink)  
Old 16-12-2007, 02:10 PM
PR Design's Avatar
CSS Wizardry -- Not Gay!
 
Join Date: May 2007
Location: Yorkshire, England
Gender: Male
Posts: 5,913
Default

Is the email being sent through a third party site? It's very slow, and possibly less reliable than one made by yourself.
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati Share This Article & VoteReddit! Wong this Post!Stumble this Post!RSS Share on FacebookForum Netvibes Page
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash Forms mick young Flash Forum 1 15-02-2008 03:31 PM