We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
A Little PHP Form Help; Please
Topic Started: Jun 6 2005, 04:35 PM (329 Views)
shockwave-
My other title is a Ferrari
[ *  * ]
I've got this really nice email form and everything set up, and it works fine, but if I wanted someone to click a link like:

www.site.com/email.php?message=hello&subject=hey

how would I make the message box say "hello" and the subject box say "hey"?

Here's My Source:

Code:
 

<html>

<title>Contact Page</title><form name="form1" method="post" action="
<?
  $header = "From: $textfield3";
  mail($select,$textfield,$textarea,$header);
  ?>
  ">
         <p class="sub"><span class="sub4"><strong>Contact:</strong></span><br>
           <br>[removed]
           Your email:<br>
           <input name="textfield3" type="text" size="15" maxlength="20">
           <br>
           <br>
           Select who you wish to contact:<br>
           <select name="select">
             <option value="[removed]" selected>--</option>
    <option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
           </select>
         </p>
         <p class="sub">Subject:<br>
           <input name="textfield" type="text" id="textfield" size="15" maxlength="20">
<br>
           <br>
           Enter your questions and comments below:<br>
           <textarea name="textarea" cols="50" rows="6"></textarea>
           <input name="imageField" type="image" src="http://www.nike-philips.com/en/images/submit_button.gif" width="70" height="30" border="">
         </p>
         <p align="right" class="bod"> <br>
         </p>
       </form>
</html>
Offline Profile Quote Post Goto Top
 
FearKiller
Member Avatar
www.drewscripts.com
[ *  *  *  *  * ]
Code:
 
<html>

<title>Contact Page</title><form name="form1" method="post" action="
<?
 $header = "From: $textfield3";
 mail($select,$textfield,$textarea,$header);
 ?>
 ">
        <p class="sub"><span class="sub4"><strong>Contact:</strong></span><br>
          <br>[removed]
          Your email:<br>
          <input name="textfield3" type="text" size="15" maxlength="20">
          <br>
          <br>
          Select who you wish to contact:<br>
          <select name="select">
            <option value="[removed]" selected>--</option>
   <option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
<option value="[removed]">[removed]</option>
          </select>
        </p>
        <p class="sub">Subject:<br>
          <input name="textfield" type="text" id="textfield" size="15" maxlength="20" value="<?= $_GET['subject'] ?>" />
<br>
          <br>
          Enter your questions and comments below:<br>
          <textarea name="textarea" cols="50" rows="6"><?= $_GET['message'] ?></textarea>
          <input name="imageField" type="image" src="http://www.nike-philips.com/en/images/submit_button.gif" width="70" height="30" border="">
        </p>
        <p align="right" class="bod"> <br>
        </p>
      </form>
</html>


That should work.
Offline Profile Quote Post Goto Top
 
shockwave-
My other title is a Ferrari
[ *  * ]
Ok, great, thanks FearKiller. :P
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply