This is my website http://hopshop.bg/, .this is product page http://hopshop.bg/index.php?main_page=product_info&cPath=15&products_id=7187. added a contact form on products and quick order, but does not work on php 7 .... this is the code:
My Version Zen Cart 1.5.5a
<! ------------------------------------------------ --------------------------------------->
<? Php echo "Quick order with a click of product: .. (* for this product on this page): >>"?> <B> <? Php echo $ products_name; ?> <? Php echo "... Price"?>
<! - Bof Product Price block ->
<? Php
####echo $ one_time. ((Zen_has_product_attributes_values ((int) $ _ GET [ 'products_id']) and $ flag_show_product_info_starting_at == 1)? TEXT_BASE_PRICE: ''). zen_get_products_display_price ((int) $ _ GET [ 'products_id']);
?>
<! - Eof Product Price block ->
</ B>
<? Php
// Contact Form via email // itbg.eu // Dev7 //
$ Gg = 'http: //';
$ Ggg = $ products_name;
$ Gggg = $ one_time. ((Zen_has_product_attributes_values ((int) $ _ GET [ 'products_id']) and $ flag_show_product_info_starting_at == 1)? TEXT_BASE_PRICE: ''). zen_get_products_display_price ((int) $ _ GET [ 'products_id']);
$ Contact_email = $ _POST [ 'EmailAddress'];
$ Contact_subject = $ _POST [ 'Subject'];
$ Contact_name = $ _POST [ 'FullName'];
$ Contact_message = $ _POST [ 'Message'];
$ Mydate = date ( 'l, F d Y g: i A', time () + 240);
$ To = "[email protected]"; // E-mail to which messages will be sent //
$ Message. = "Address:". $ Address. "\ R \ n";
$ Subject = "HopShop-Order:". $ Ggg. "\ R \ n". "Name:". $ Contact_name. "\ R \ n". "Tel:". $ Contact_subject. "\ R \ n"; // // Subject
$ Message = "From HopShop.Bg ---- Tel: 0878843093 \ r \ n \ r \ n" // text message //
. "Product: $ products_name \ r \ n". "Price: $ gggg \ r \ n"
. "Model: $ products_model; \ r \ n"
. "Link product ordered: $ gg {$ _ SERVER [ 'SERVER_NAME']} {$ _ SERVER [ 'REQUEST_URI']} \ r \ n"
. "------------------------------------------------ ------------------------------- \ r \ n "
. "------------------------------------------------ ------------------------------- \ r \ n "
. "Name: $ contact_name \ r \ n"
. "Phone client: $ contact_subject \ r \ n"
. "Shipping Address (+ Other information on order): \ r \ n \ r \ n $ contact_message \ r \ n"
. "------------------------------------------------ ------------------------------- \ r \ n "
. "------------------------------------------------ ------------------------------- \ r \ n "
. "Date: $ mydate \ r \ n"
. "From IP: {$ _SERVER [ 'REMOTE_ADDR']} \ r \ n \ r \ n";
$ Headers = "From: $ contact_name <$ contact_email> \ n"
. "Content-type: text / plain; charset = UTF-8 \ n"
. "Reply-To: $ contact_email \ n"
. "X-Mailer: PHP /". Phpversion ();
if (empty ($ contact_name) || empty ($ contact_email) || empty ($ contact_subject) || empty ($ contact_message)) {
?>
<Form id = "contact" method = "post" action = ""> <br/>
<Div id = "from">
Full name: <br /> <input type = "text" name = "FullName" size = "25" /> <br/>
</ Div>
E-mail: <br/> <input type = "text" name = "EmailAddress" size = "25" /> <br/>
Phone: <br /> <input type = "text" name = "Subject" size = "25" /> <br/>
Delivery address (or Econt office)
<br/> <textarea rows = "6" name = "Message" size = "10" cols = "10" class = "input"> </ textarea> <br/>
<Input type = "submit" value = "confirm order with just one click" /> <input type = "reset" value = "Clear" />
</ Form>
<? Php
} Elseif (! Ereg ( "^ [_ a-z0-9 -] + (\. [_ A-z0-9 -] +) * @ [a-z0-9 -] + (\. [A-z0-9 -] +) * (\. [az] {2,3}) $ ", $ contact_email)) {
echo "<p> Error: Please enter a valid e-mail. </ p>";
} Else {
mail ($ to, $ subject, $ message, $ headers);
echo "<h3> Your order is accepted! </ h3> <p> $ contact_name, <br /> as possible - will soon contact you $ contact_email.";
}
?>