Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simple php form in a box


Guest

Recommended Posts

Posted

I'm trying to create a simple php form in a box for name and email address (so it can be entered from wherever the customer is, without having to go to another page; for a mailing list). I tried mixing and matching from contact_us and search, and some other resources. parts of the code work when used individually, but I'm having trouble putting it all together.

 

I keep getting parse errors (on the form line), and my php skills are REALLY weak - maybe someone can identify the problem? (I'm sure thre are other errors too...)

 

Anyway, here's the code from my mail.php file:

__________________________________________________

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_HEADING_MAIL

);

new infoBoxHeading($info_box_contents, false, false);

?>

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_MAIL_TEXT

 

< form action="http://giftsthatdelight.com/shop/default.php" method="post" >

<table cellspacing="2" cellpadding="2"><tr>

<td valign="top" class="inside">Name:</td>

<td><input type="text" name="yourname" size="20"></td>

</tr>

<tr>

<td valign="top" class="inside">Email Address:</td>

<td><input type="text" name="email" size="20"></td>

</tr>

<tr>

<td> </td>

<td><INPUT TYPE="submit" NAME="submitmail" VALUE="SUBMIT" style="background-color: #EEEEEE">

</tr>

</table>

</form>,

);

new infoBox($info_box_contents);

?>

 

<?if ($submitmail == "SUBMIT") {

mail("[email protected]", "GiftsThatDelight Mailing List", "$commentrnrn-----rnSubmitted by $yournamernEmail: $emailrnIP address: $REMOTE_ADDR","From: $realname <$email>rn");

?>

 

 

 

 

Any thoughts?? Thanks!!

Posted

your "contac us" should be on every page, with one click , up pops the form

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...