1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

"contact us" script

Discussion in 'Programming' started by web-rover, Apr 15, 2005.

  1. #1
    looking to add a "contact" option to my directory. what is a good script for this?
     
    web-rover, Apr 15, 2005 IP
  2. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this out:

    put this form in your contact us form:

    <form name=contactus action=contactus.php method=post>
       <div align="center">
          <table border="0" cellpadding="0" cellspacing="0">
             <tr>
                <td align=right>Your Name:</td>
                <td width="15">&nbsp;</td>
                <td><input size=35 maxlength=35 type=text name=name
                   style="font-family: Courier New; font-size: 10pt"></td></tr>
             <tr>
                <td align=right>Your Email Address:</td>
                <td>&nbsp;</td>
                <td><input size=35 maxlength=35 type=text name=email
                   style="font-family: Courier New; font-size: 10pt"></td></tr>
             <tr>
                <td valign=top align=right>Contents:</td>
                <td>&nbsp;</td>
                <td><textarea name=contents rows=12 cols=60
                   style="font-family: Courier New; font-size: 10pt"></textarea></td></tr>
             <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td><input type=submit value=" Submit " name=submit style="font-size: 10pt; font-family: Tahoma"></td></tr>
          </table>
       </div>
    </form>
    Code (markup):
    then create a new php file with the following contents... please add your your stuff into the html portion:

    <?php
    $msg="
    $name ($email) sent you an online comment:
    
    Comments:
    ========
    $contents";
    
    mail("you@yourdomain.com","online comments","$msg","From: $email");
    ?>
    
    
    <html>
    
    <head>
    .
    .
    .
    </head>
    
    <body>
    .
    .
    .
    Thank you for your comments.
    .
    .
    .
    </body>
    
    </html>
    Code (markup):
    should work fine - you don't need a package script for this :)
     
    daboss, Apr 15, 2005 IP
  3. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sorry for the double post, i forgot to say that the name of the php file will have to match the 'action' part of the form - in this case it's "contactus.php"
     
    daboss, Apr 15, 2005 IP