Zen Cart Logo
Forums / General Questions / Why can't I insert my PHP Mail Form into Define Pages Page_2????

Why can't I insert my PHP Mail Form into Define Pages Page_2????

Locked

Views: 3,825

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
23 Feb 2008, 1:59 AM
#1
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Why can't I insert my PHP Mail Form into Define Pages Page_2????

Code included........

When I attempt to go to the page this code is inserted on, it halfway loads, and leaves the right column boxes as well as the body blank, and the header bar offset to the right.

<style type='text/css'>
		.form_title{
			color : #000000;
			font-size: 13px;
			font-family: verdana, Geneva, Arial, Helvetica, sans-serif;
			font-weight : bold;
		}
		
		.form_field {
			font-size : 13px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #474747;
			font-weight : bold;
			text-align:left;
		}
		
		.form_text{
			font-size : 11px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #000000;
		}
		
		.text_box{
			font-size : 11px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #000000;
			width:200px;
		}
		
		.text_area{
			font-size : 11px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #000000;
			width:200px;
			height:60px;
		}
		
		.text_select{
			font-size : 11px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #000000;
		}

		.form_error{
			font-size : 11px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #ff0000;
			font-weight : bold;
		}

		.copyright{
			font-size : 11px;
			font-family : Verdana, Arial, Helvetica, sans-serif;
			color : #000000;
		}
</style>
<?php 	include_once( "20080222-c37c.lib.php" ); ?>
<br><br>
<table cellspacing='16' cellpadding='0' border='0' align='center' ><tr><td>  If you are a practicing Esthetician or Cosmetologist, a Biofeedback Practitioner, or the owner of a Salon, Spa or Wellness Boutique... please take the time to send us some information about yourself.<br><br> As detailed in our Privacy Policy, we do not share your information with anyone, and will only use this information to validate your eligibility for special offers through our store, on our products.<br><br><strong>Please include the email address with which you registered on this site, for proper qualification of benefit.</strong>  </td></tr></table>  <!-- ------------------------ End: Your FormMail's Description  ------------------------ -->      <!-- =======================  Begin: Form Generated By PHP FormMail Generator ======================= -->    <?php
	if( !$isHideForm ): 
		global $sErr ;
		if( $sErr ) print "<br><a name='error'></a><center><font class='form_error' >$sErr</font></center><br>"; 

		$starColor = $sErr ? "#ff0000" : "#000000";
		$style=" class='form_text' ";
 ?>

<form name="frmFormMail" action="<?php print PHP_SELF ?>" method='post' enctype='multipart/form-data'>
<input type='hidden' name='formmail_submit' value='Y'>
<input type='hidden' name='esh_formmail_recipient' value="[email protected]"> <input type='hidden' name='esh_formmail_subject' value="Someone has applied for a discount at Eternale.com"> <input type='hidden' name='esh_formmail_cc' value=""> <input type='hidden' name='esh_formmail_bcc' value=""> <input type='hidden' name='esh_formmail_return_subject' value="Thank you!"> <input type='hidden' name='esh_formmail_return_msg' value="Eternale is dedicated to offering special incentives to qualified practitioners. We will be contacting you shortly."> <input type='hidden' name='esh_formmail_mail_and_file' value=""> <input type='hidden' name='esh_formmail_charset' value="">  <table cellspacing='16' cellpadding='0' border='0'  > 	<tr> 		<td class="form_field" valign='top' align='right'>What is your name?  </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td> 		<td class="form_text"> <input type="text" name="What_is_your_name"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "What_is_your_name" ] ); ?>" class='text_box'> 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>Do you own or represent a Business? </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td> 		<td class="form_text"> <select name="Do_you_own_or_represent_a_Business" <? print $style; ?>>
<option value=''>- Select -</option>
 <option  value="Yes "  <?php  formSelected( $HTTP_POST_VARS[ "Do_you_own_or_represent_a_Business" ], "Yes " ); ?> > Yes 
<option  value=" No"  <?php  formSelected( $HTTP_POST_VARS[ "Do_you_own_or_represent_a_Business" ], " No" ); ?> >  No
</select>
 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>What is the name of this Business? </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <input type="text" name="What_is_the_name_of_this_Business"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "What_is_the_name_of_this_Business" ] ); ?>" class='text_box'> 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>What State & Country is your Business located in? </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <input type="text" name="What_State_&_Country_is_your_Business_located_in"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "What_State_&_Country_is_your_Business_located_in" ] ); ?>" class='text_box'> 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>Please indicate your profession. </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td> 		<td class="form_text"> <select name="Please_indicate_your_profession" <? print $style; ?>>
<option value=''>- Select -</option>
 <option  value="Esthetician "  <?php  formSelected( $HTTP_POST_VARS[ "Please_indicate_your_profession" ], "Esthetician " ); ?> > Esthetician 
<option  value=" Cosmetologist "  <?php  formSelected( $HTTP_POST_VARS[ "Please_indicate_your_profession" ], " Cosmetologist " ); ?> >  Cosmetologist 
<option  value=" Salon Owner "  <?php  formSelected( $HTTP_POST_VARS[ "Please_indicate_your_profession" ], " Salon Owner " ); ?> >  Salon Owner 
<option  value=" Spa Owner "  <?php  formSelected( $HTTP_POST_VARS[ "Please_indicate_your_profession" ], " Spa Owner " ); ?> >  Spa Owner 
<option  value=" Wellness Store Owner "  <?php  formSelected( $HTTP_POST_VARS[ "Please_indicate_your_profession" ], " Wellness Store Owner " ); ?> >  Wellness Store Owner 
<option  value=" Biofeedback Technician"  <?php  formSelected( $HTTP_POST_VARS[ "Please_indicate_your_profession" ], " Biofeedback Technician" ); ?> >  Biofeedback Technician
</select>
 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>If you are a Biofeedback Practitioner, who is your Regional Director? </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <input type="text" name="If_you_are_a_Biofeedback_Practitioner_who_is_your_Regional_D"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "If_you_are_a_Biofeedback_Practitioner_who_is_your_Regional_D" ] ); ?>" class='text_box'> 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>If you are a Biofeedback Practitioner, when did you purchase your device? (MM/YYYY) </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> 	<?php 
selectList( "If_you_are_a_Biofeedback_Practitioner_when_did_you_purchase__MM", $HTTP_POST_VARS["If_you_are_a_Biofeedback_Practitioner_when_did_you_purchase__MM"], 1, 12, "MM", $style ) ;
selectList( "If_you_are_a_Biofeedback_Practitioner_when_did_you_purchase__YYYY", $HTTP_POST_VARS["If_you_are_a_Biofeedback_Practitioner_when_did_you_purchase__YYYY"], date("Y"), date("Y")+3, "YYYY", $style ) ;
?>
 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>If you are a Biofeedback Practitioner, who taught your Beginner's Training Course? </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <input type="text" name="If_you_are_a_Biofeedback_Practitioner_who_taught_your_Beginn"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "If_you_are_a_Biofeedback_Practitioner_who_taught_your_Beginn" ] ); ?>" class='text_box'> 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>If you are a Biofeedback Practitioner, Are you with the Quantum Alliance? </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <select name="If_you_are_a_Biofeedback_Practitioner_Are_you_with_the_Quant" <? print $style; ?>>
<option value=''>- Select -</option>
 <option  value="Yes "  <?php  formSelected( $HTTP_POST_VARS[ "If_you_are_a_Biofeedback_Practitioner_Are_you_with_the_Quant" ], "Yes " ); ?> > Yes 
<option  value=" No"  <?php  formSelected( $HTTP_POST_VARS[ "If_you_are_a_Biofeedback_Practitioner_Are_you_with_the_Quant" ], " No" ); ?> >  No
</select>
 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>Provide your License # for verification. (Business Lic. # if business owner, License # if practitioner) </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <input type="text" name="Provide_your_License_#_for_verification_(Business_Lic_#_if_b"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Provide_your_License_#_for_verification_(Business_Lic_#_if_b" ] ); ?>" class='text_box'> 		</td> 	</tr>  	<tr> 		<td class="form_field" valign='top' align='right'>Lastly, are you anticipating spending more than $1000 at Eternale.com, or on Eternale products, within one purchase? </td><td width='10'  aligh='right' valign='top'></td> 		<td class="form_text"> <select name="Lastly_are_you_anticipating_spending_more_than_$1000_at_Eter" <? print $style; ?>>
<option value=''>- Select -</option>
 <option  value="Yes "  <?php  formSelected( $HTTP_POST_VARS[ "Lastly_are_you_anticipating_spending_more_than_$1000_at_Eter" ], "Yes " ); ?> > Yes 
<option  value=" No"  <?php  formSelected( $HTTP_POST_VARS[ "Lastly_are_you_anticipating_spending_more_than_$1000_at_Eter" ], " No" ); ?> >  No
</select>
 		</td> 	</tr>   	<tr><td colspan=3 align='center'><input type='submit' value='Submit'>    <input type='button' value='Cancel' onclick="location.href='/';"></td></tr> </table>  
</form>
<?php
		if( $sErr ) print "<script language='javascript' type='text/javascript'>location.href='#error';</script>";;; 

else: //!$isHideForm
	print( "<br><br><hr><center><b>Your form has been sent. Thank you.</b><br><br><input type='button' value='Home' onclick=\"location.href='/';\"></center><br><br>" );
endif; //!$isHideForm

	<br><br><br><br>
	</div>
	<br><br><br>
</html>

Am I doing something wrong?

Link to the page: http://www.eternale.com/cart/index.php?main_page=page_2

23 Feb 2008, 6:03 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

I do not believe you can include php in the defines pages - only html

23 Feb 2008, 9:25 AM
#3
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

How would you recommend going about inserting a mail form on my ZenCart?

23 Feb 2008, 9:27 AM
#4
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

Could I write a frame in html in the Define Page, that calls for the php file from another source?

23 Feb 2008, 2:16 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

Or this might be of some useful reference:
http://www.zen-cart.com/forum/showthread.php?t=4855

23 Feb 2008, 5:10 PM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

Not correct, at least in the new version. PHP works just fine.> kobra:

I do not believe you can include php in the defines pages - only html

23 Feb 2008, 7:47 PM
#8
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

yellow1912:

Not correct, at least in the new version. PHP works just fine.

Apparently, good sir, this is not the case..... otherwise, I'd have been able to pull off this php mail script with no post on this form. :)

As well, Mr. Yellow..... if php works fine, why can't I insert my mail form?!

23 Feb 2008, 8:07 PM
#9
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

misty:

Could probably achieve using EZ Pages
i.e. see
http://www.zen-cart.com/forum/showthread.php?t=37252&highlight=pages+include+php

The result of me putting the PHP code into an EZ Page......

http://www.eternale.com/cart/index.php?main_page=page&id=5

This actually is closer to resolution than anything I've seen so far, as far as me trying to get a functioning Email form up. Yay!

What else do I need to do?

Also, important question..... my PHP mail form calls for another file in the first line of it's include.... where in the Cart directory do I put this file????

23 Feb 2008, 8:15 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

I also believe that ezpages will not parse php correctly...

Why not use DrByte's suggestion and clone the contact us files with your names and php or make this a html form?

23 Feb 2008, 8:27 PM
#11
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

kobra:

I also believe that ezpages will not parse php correctly...

Why not use DrByte's suggestion and clone the contact us files with your names and php or make this a html form?

  1. Can I create a self-contained html email form without SMTP coordinates? The hook of using PHP here was that it handles email functionality from within the script. Also, with HTML, isn't there an include file, just like the PHP method?

  2. Which files would I be cloning to duplicate the process on the Contact Form? How would I handle the addition of, say, 4-6 more fields, on top of the 3 they only currently have there?

What would you suggest is easiest at this point? I've considered doing this in Flash, but that UTF8 crap means I never get Flash email forms right.

23 Feb 2008, 8:34 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

DavidHojak:

  1. Which files would I be cloning to duplicate the process on the Contact Form? How would I handle the addition of, say, 4-6 more fields, on top of the 3 they only currently have there?Did you even look at the discussion thread I suggested?
23 Feb 2008, 10:29 PM
#13
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

DrByte:

Did you even look at the discussion thread I suggested?

I swear I did, Dr. Byte. These discussions lose me for two reasons:

  1. I know relatively little about PHP... enough to recognize a PHP tag, that's about it. Some people seem to follow along with no problem. These people confidently know what they are doing. Dave Hojak admittedly does not.

  2. Resolution usually comes over the course of multiple pages, and I'm in need of something a little more simplified as far as the explanation of the process.

I read thoroughly through your links to the forum topics about data collection, and it appeals to me as though I'm missing something.

23 Feb 2008, 10:45 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

Well, the link I posted takes you to a discussion which has a big bright red note at the top suggesting where you can download a packaged pre-assembled version of the entire discussion for quick installation: http://www.zen-cart.com/forum/showthread.php?p=386482#post386482

The attachment to that post is a sample form with lots of validated fields whose results are emailed to the store owner upon submission.
You can use it as a starting base to set up some additional or different field types, etc.

24 Feb 2008, 5:31 AM
#15
davidhojak avatar

davidhojak

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: Why can't I insert my PHP Mail Form into Define Pages Page_2????

I greatly appreciate your time, Dr. Byte. Thank you.