Contact us form help!

This is a discussion on "Contact us form help!" within the PHP Forum section. This forum, and the thread "Contact us form help! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 21st, 2006, 07:36
New Member
Join Date: Jun 2006
Location: Minnesota
Age: 31
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Contact us form help!

Can you help me with my contact us form.. Its not working.. Im totally newbie in .php. please tell me what to do.. here's the link. http://www.startanursingagency.com/contactus.php
Reply With Quote

  #2 (permalink)  
Old Jun 21st, 2006, 11:17
herkalees's Avatar
Highly Reputable Member
Join Date: Jul 2005
Location: Massachusetts, USA
Age: 87
Posts: 576
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to herkalees Send a message via MSN to herkalees Send a message via Yahoo to herkalees
Re: Contact us form help!

Thread moved to proper forum
Reply With Quote
  #3 (permalink)  
Old Jun 21st, 2006, 11:57
Up'n'Coming Member
Join Date: Jan 2006
Location: East Sussex
Age: 26
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Contact us form help!

What's the problem?
Reply With Quote
  #4 (permalink)  
Old Jun 21st, 2006, 12:09
New Member
Join Date: Jun 2006
Location: Minnesota
Age: 31
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Contact us form help!

Its not working.. What will i change..
Reply With Quote
  #5 (permalink)  
Old Jun 21st, 2006, 19:31
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: Contact us form help!

Paste the php in here. We can onyl see HTML if we view source.
Reply With Quote
  #6 (permalink)  
Old Jun 21st, 2006, 19:38
New Member
Join Date: Jun 2006
Location: Billericay, Essex.
Age: 15
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Contact us form help!

Post removed
Please don't hi-jack this thread by posting a link to another thread of yours.

Last edited by herkalees; Jun 21st, 2006 at 19:59.
Reply With Quote
  #7 (permalink)  
Old Jun 22nd, 2006, 01:57
New Member
Join Date: Jun 2006
Location: Minnesota
Age: 31
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Contact us form help!

Here's the script.

Code: Select all
//Site defines
$SITE_URL = 'http://www.startanursingagency.com';
$SITE_NAME = 'How to start a nursing agency business guide!';
$SITE_EMAIL = 'startanursingagency@gmail.com';

//Check if form is submitted
if($_POST['submitid'] == 1){
    if(strlen($_POST['name']) < 3){$message = 'Please enter your name.';}
    if(preg_match('/^[.\w-]+@([\w-]+\.)+[a-zA-Z]{2,6}$/', $_POST['email']) == false && $message == NULL){ $message = 'Please enter a valid email.';}
    //comment following line if you want to make comment optional
    if(strlen($_POST['comment']) < 3 && $message == NULL){$message = 'Please enter a comment.';}
    //uncomment following line to make phone number mandatory
    //if(strlen($_POST['phone']) < 6 && $message == NULL){$message = 'Please enter a phone number.';}

    if($message == NULL){
        $besttime = $_POST['time'] . ' ' . $_POST['nightorday'] ;
        if($_POST['comment'] == NULL){$_POST['comment'] = 'NA';}
        if($_POST['phone'] == NULL){$_POST['phone'] = 'NA';}

        // This is the Subject of this message
        $subj= "A Contact From $SITE_NAME"; 
        // Headers will included The From, Return Email
        $header = "Return-Path: $_POST[name] <$_POST[email]>\r\n"; 
        $header .= "From: $SITE_NAME <$SITE_EMAIL>\r\n"; 
        // Header also include the Type, and Language the Email being sent
        $header .= "Content-Type: text/html; charset=iso-8859-1;\n\n\r\n"; 
    
        //Message
        $ownermes = '<p><b>Hello '. $_POST[name] .',</b></p>
        <p align="justify"><b>We have recieved your contact at: <font color="blue"> ' . $SITE_NAME . ' </font></b></p>
        <p align="justify"><b>The message you wrote was: '. $_POST[comment].' </b></p>
        <p align="justify"><b>Your telephone number was :<font color="blue"> ' . $_POST[phone] . '</font> </b></p>
        <p align="justify"><b>We will be contacting you at :<font color="blue"> ' . $besttime . ' </font></b></p>
        <p align="justify"><b>The reason of your contact was :<font color="blue"> ' . $_POST[reason] . '</font> </b></p>
        <p align="justify"><b>We will be replying to you at :<font color="blue"> ' . $_POST[email] . '</font> </b></p>
        <p align="justify"><b>If there is any change of info, please reply back to us.</b></p>
        <p><b>Thank you for your contact,</b></p>
        <p><b>'.$SITE_NAME.',</b></p>'; 

        mail ($SITE_EMAIL,"$subj",$ownermes,$header);
        mail ($_POST[email],"$subj",$sednermess,$header);
        $message = "Your message has been sent, thank you $_POST[name]";
        $_POST = NULL;
    }
}
?>
<!--

-->
<?php
//Check if we are displaying a message to the user:
if($message != NULL){?>
<?php } ?>
<form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="contactus" id="contactus" style="display:inline;">
  <table width="100%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#00CCFF">
      </table>
</form>
<form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="contactus" style="display:inline;">
  <table width="100%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#00CCFF">
    </table>
  <table width="78%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#00CCFF">
    <tr bgcolor="#99CC99"><td colspan="2" bgcolor="#5A7CA1"><div align="center" class="style1">Contact 
      Us:</div></td>
          </tr>
  </table>
</form>
<form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="contactus" style="display:inline;">
  <table width="100%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#00CCFF">
  </table>
</form>
<form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="contactus" style="display:inline;">
  <table width="78%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF">
    <tr> 
      <td width="142" bordercolor="#0066FF"><strong>Your Name:</strong></td>
              <td width="305" bordercolor="#0066FF"><font face="Georgia, Times New Roman, Times, serif">&nbsp; 
                <input name="name" type="text" id="name" value="<?=$_POST['name'];?>" >
                </font></td>
          </tr>
    <tr> 
      <td bordercolor="#0066FF"><strong>Your E-mail:</strong></td>
              <td bordercolor="#0066FF"><font face="Georgia, Times New Roman, Times, serif">&nbsp; 
                <input name="email" type="text" id="email" value="<?=$_POST['email'];?>" >
                </font></td>
          </tr>
    <tr> 
      <td bordercolor="#0066FF"><strong>Your Reason of Contact:</strong></td>
              <td bordercolor="#0066FF"><font face="Georgia, Times New Roman, Times, serif">&nbsp; 
                <select name="reason" id="reason">
                  <?php if($_POST['reason'] == 'Comments'){$sel='selected';}else{$sel=NULL;}?>
                  <option value="Comments" <?=$sel;?>>Comments</option>
                  <?php if($_POST['reason'] == 'General Support' || $_POST['reason'] == NULL){$sel='selected';}else{$sel=NULL;}?>
                  <option value="Support" <?=$sel;?>>General support</option>
                  </select>
                </font></td>
          </tr>
    <tr> 
                    
          
             
          </tr>
    <tr> 
      <td bordercolor="#0066FF"><strong>Your Message:</strong></td>
              <td bordercolor="#0066FF">
                <textarea name="comment" rows="4" id="comment" style="width:100%;"><?=$_POST['comment'];?></textarea>              </td>
          </tr>
    <tr> 
      <td bordercolor="#0066FF">Phone Number:</td>
              <td bordercolor="#0066FF"><font face="Georgia, Times New Roman, Times, serif">&nbsp; 
                <input name="phone" type="text" id="phone" value="<?=$_POST['phone'];?>">
                </font></td>
          </tr>
    <tr> 
      <td height="84" colspan="2" bordercolor="#0066FF"><div align="center"> 
        <input type="submit" name="Submit" value="Send Message">
        <input name="submitid" type="hidden" id="submitid" value="1">
        </div></td>
          </tr>
    </table>
</form>
<br>

Last edited by herkalees; Jun 22nd, 2006 at 02:02.
Reply With Quote
  #8 (permalink)  
Old Jun 22nd, 2006, 02:59
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: Contact us form help!

Let me guess.. you downloaded this script?
Reply With Quote
  #9 (permalink)  
Old Jun 22nd, 2006, 03:17
New Member
Join Date: Jun 2006
Location: Minnesota
Age: 31
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Re: Contact us form help!

Yes you're right.. Im totall newbie in php. Can you help me please?
Reply With Quote
  #10 (permalink)  
Old Jun 22nd, 2006, 19:21
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Contact us form help!

Clicked on your page link above so I could see the html as well as the php but got a 404 error message - page not found.
Reply With Quote
  #11 (permalink)  
Old Jun 23rd, 2006, 13:27
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Contact us form help!

Is it uploaded to the correct place?
Reply With Quote
Reply

Tags
contact, form, help

Thread Tools

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
[SOLVED] PHP contact form redirect to same form Posie PHP Forum 14 Jan 29th, 2008 20:28
help with asp contact form? Ella Classic ASP 4 Jan 2nd, 2008 00:45
php contact form geyids PHP Forum 5 Jun 14th, 2007 16:59
what is the best contact form Phixon Web Page Design 10 May 15th, 2007 18:47
Need Quote Form and Contact Form Av8er Flash & Multimedia Forum 5 Oct 30th, 2003 17:14


All times are GMT. The time now is 22:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43