Results 1 to 2 of 2

Thread: Simple php issue-Please help!

  1. #1
    SEOGuru Guest

    Simple php issue-Please help!

    I have a couple contact forms on my site and I can't seem to get the mailform.php script correct.

    I just need these forms to POST the content to my email:

    Here's the html of both forms:

    <form id='form' action='scripts/mailform2.php' enctype='multipart/form-data' name='form'>

    <div align="left">
    <p><img src="images/link_exchange.gif" alt="contact_us" class="indent_img"><span></span>
    Please double-click to highlight the box below and add the following code to your site BEFORE contacting us. </p>
    <textarea name="LinkHTML" rows=5 cols=46 wrap="hard">&lt;a href= &quot;http://www.ajspromotionalmedia.com/&quot;&gt;AJS Promotional Media - Search Engine Optimization (SEO) | Web Design&lt;/a&gt;
    </textarea>
    <p>We will verify that the link is not broken and contact you once your link is approved. </p>
    <p> Site URL:<br>&nbsp;<br>
    <input class="form" type="text" name="url">
    <br>
    &nbsp;<br>
    E-mail address:<br>&nbsp;<br>
    <input class="form" type="text" name="email"><br>&nbsp;<br>
    Reciprocal Link Page:<br>&nbsp;<br>
    <input class="form" type="text" name="backlink"><br>&nbsp;<br>
    HTML as you wish it to be added in the directory. <br>
    *anchor text (max. 35 characters):<br>&nbsp;<br>
    <textarea rows="5" cols="5" class="textarea" name="anchorHTML"></textarea>
    <a href="#" class="link_gray" onClick="document.getElementById('form').reset()">Clear</a><img src="images/spacer.gif" alt="spacer" width="8" height="1"><a href="#" class="link_gray" onClick="document.getElementById('form').submit()">Submit</a></div>
    </form>

    ______________________________________________________________

    <form id='form' action='scripts/mailform.php' enctype='multipart/form-data' name='form'>
    <div>
    <img src="images/6tx2.gif" alt="contact_us" class="indent_img">Contact us today and receive your copy of "101 Ways to Promote Your Website"<span></span>
    Your name:
    <input class="form" type="text" name="realname"><BR>
    E-mail address:
    <input class="form" type="text" name="email">
    Your telephone:
    <input class="form" type="text" name="phone">
    Message:
    <textarea rows="5" cols="5" class="textarea" name="message"></textarea>
    <div><a href="#" class="link_gray" onClick="document.getElementById('form').reset()">Clear</a><img src="images/spacer.gif" alt="spacer" width="8" height="1"><a href="#" class="link_gray" onClick="document.getElementById('form2').submit()">Submit</a></div>

    </div>
    </form>

  2. #2
    Join Date
    Dec 2007
    Location
    Toronto
    Posts
    25

    user form

    Let me know if this works for you...

    Code:
    <form action="contact-me.php" method="post" enctype="multipart/form-data" name="frogprocess"> 
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> 
      </tr> 
      <tr> 
        <td id="main-text" width="27%" align="left">First Name:</a>    </td> 
        <td width="65%" align="left"><input size="46" name="fname" type="text" /></td> 
      </tr> 
        <tr> 
        <td id="main-text" width="27%" align="left">Phone Number:</a>    </td> 
        <td width="65%" align="left"><input size="46" name="phone" type="text" /></td> 
      </tr> 
        <tr> 
        <td id="main-text" width="27%" align="left">Email Address:</a>    </td> 
        <td width="65%" align="left"><input size="46" name="email" type="text" /></td> 
      </tr> 
        <tr> 
        <td id="main-text" width="27%" align="left">Organization Name:</a>    </td> 
        <td width="65%" align="left"><input size="46" name="organization" type="text" /></td> 
      </tr>
      <tr> 
        <td id="main-text" width="27%" align="left">&nbsp;</td> 
        <td width="65%" align="left"><input name="submit" type="submit" /></td> 
      </tr> 
    </table> 
    </form>
    This goes into a file, is should be the same name as the 'action' property in the <form> tag above...namely, contact-me.php

    Code:
    <?php
    
    // the code block below gets the values/variables from your form
    $fname = $_POST['fname'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $organization = $_POST['organization'];
    // end getting values/variables from your form
    
    // this is pretty much self explanatory
    $subject = "Information from the website form";
    $message = " 
    From: $fname: ($email)\n
    First Name: $fname \n
    Phone Number: $phone \n
    Email Address: $email \n
    Organization: $organization \n";
    
    
    $from = $email;
    $tomail = "me@mysite.com";
    
    // the mail function below sends out the email
    mail($tomail, $subject, $message, $from);
    
    //the below code is your thank you page
    header('Location: http://www.mysite.com/thank-you.html');
    
    ?>

Similar Threads

  1. Simple But Effective PHP Captcha?
    By blindacoustic in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 21 Dec 2007, 08:09 AM
  2. very simple php based cms..
    By pelicanmike in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 19 May 2006, 08:57 AM

Posting Permissions

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