Enhance the Contact us page
17 posts
• Page 1 of 1
Enhance the Contact us page
i edited the contact us form. i added more fields to be emailed.
after send i get this:
expects at most 3 parameters, how can i set it to 5 or more?
after send i get this:
- Code: Select all
Warning: html_entity_decode() expects at most 3 parameters, 5 given in /home/XXXXXX/public_html/demo1/catalog/controller/information/contact2.php on line 23Error: E-Mail message required!
expects at most 3 parameters, how can i set it to 5 or more?
Last edited by Maansy on Mon Sep 13, 2010 5:21 pm, edited 1 time in total.
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
Maansy wrote:i edited the contact us form. i added more fields to be emailed.
after send i get this:
- Code: Select all
Warning: html_entity_decode() expects at most 3 parameters, 5 given in /home/XXXXXX/public_html/demo1/catalog/controller/information/contact2.php on line 23Error: E-Mail message required!
expects at most 3 parameters, how can i set it to 5 or more?
5 what? It's parameters for a function
http://php.net/manual/en/function.html- ... decode.php

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: html_entity_decode() ISSUE
thanks
i tried this :
but the only line get sent is the last one
how can i let it send all 4 lines?
thanks
i tried this :
- Code: Select all
$mail->setText(strip_tags(html_entity_decode($this->request->post['website'], ENT_QUOTES, 'UTF-8')));
$mail->setText(strip_tags(html_entity_decode($this->request->post['job'], ENT_QUOTES, 'UTF-8')));
$mail->setText(strip_tags(html_entity_decode($this->request->post['date'], ENT_QUOTES, 'UTF-8')));
$mail->setText(strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')));
but the only line get sent is the last one
- Code: Select all
$mail->setText(strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')));
how can i let it send all 4 lines?
thanks
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
- Code: Select all
$msg = strip_tags(html_entity_decode($this->request->post['website'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$msg .= strip_tags(html_entity_decode($this->request->post['job'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$msg .= strip_tags(html_entity_decode($this->request->post['date'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$msg .= strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$mail->setText($msg);

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: html_entity_decode() ISSUE
thanks Q for replying.
i tried your code but nothing gets send.
so i tried:
1st line: $msg =
changed it to: $msg .=
i got an error.
thanks for trying to help Q
i tried your code but nothing gets send.
so i tried:
1st line: $msg =
changed it to: $msg .=
i got an error.
thanks for trying to help Q

-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
Maansy wrote:thanks Q for replying.
i tried your code but nothing gets send.
so i tried:
1st line: $msg =
changed it to: $msg .=
i got an error.
thanks for trying to help Q
I didn't say to use .= for the first one.. so don't.
The code above isn't finished. I was only correcting your example. You still need to add the rest of the mail stuff like mail->send()

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: html_entity_decode() ISSUE
Qphoria wrote:I didn't say to use .= for the first one.. so don't.
The code above isn't finished. I was only correcting your example. You still need to add the rest of the mail stuff like mail->send()
i was only trying
ok, i see
here is the rest of the email stuff
- Code: Select all
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->request->post['email']);
$mail->setSender($this->request->post['name']);
$mail->setSubject(sprintf($this->language->get('email_subject'), $this->request->post['name']));
$msg = strip_tags(html_entity_decode($this->request->post['website'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$msg = strip_tags(html_entity_decode($this->request->post['job'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$msg = strip_tags(html_entity_decode($this->request->post['date'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$msg = strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')) . "\r\n";
$mail->setText($msg);
if you could take a look at the code and help correcting it, i would be so greatful
Last edited by Maansy on Thu Aug 26, 2010 4:30 pm, edited 1 time in total.
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
I thought i was clear
I don't see a $mail->send(); at the end
Qphoria wrote:The code above isn't finished. I was only correcting your example. You still need to add the rest of the mail stuff like mail->send()
I don't see a $mail->send(); at the end

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: html_entity_decode() ISSUE
yes, added now.
mail is sent fine.
but again the last line only gets sent:
mail is sent fine.
but again the last line only gets sent:
- Code: Select all
$msg = strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')) . "\r\n";
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
I don't understand why you keep changing what I write.
I said remove the .= from the FIRST $msg only. All other $msg after that have the .=
I said remove the .= from the FIRST $msg only. All other $msg after that have the .=

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: html_entity_decode() ISSUE
sorry, i was editing the old file. i paid attention this time.
did all what you have instructed. now its working fine.
one last thing if you dont mind.
how would i get the upload file working in the form?
do you advice against it?
thanks
did all what you have instructed. now its working fine.
one last thing if you dont mind.
how would i get the upload file working in the form?
do you advice against it?
thanks
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
Take a look at the admin/controller/tool/backup.php to get a good example of how to use file upload
Make a field in the contact form for file upload
For the controller, try something like:
I've not tested this but it should get the ball rolling a bit.
Make a field in the contact form for file upload
- Code: Select all
<input type="file" name="upload" />
For the controller, try something like:
- Code: Select all
if (is_uploaded_file($this->request->files['upload']['tmp_name'])) {
$mail->attachment(file_get_contents($this->request->files['upload']['tmp_name']));
}
I've not tested this but it should get the ball rolling a bit.

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: html_entity_decode() ISSUE
Thanks Q for baring with me
i have managed to add:
textbox
checkbox (having some issue with it)
dropdown
datepicker
file upload (not working yet)to the existing field in the defualt contact us form
____________________________________________
i made 3 tests to check if everything working.
TEST 1
as you can see. i filled everything up but not the file upload field.
after sent, i recieved an email with every field i filled. thats great.
TEST 2 (checkbox test)
as you can see. i filled everything up but not the logo design checkbox and the file upload.
after sent i got this error, but the email was recieved:
TEST 3 (file upload test)
as you can see. i filled EVERYTHING this time even the file upload.
after sent i got this error:
files in next post...
i have managed to add:
textbox
checkbox (having some issue with it)
dropdown
datepicker
file upload (not working yet)to the existing field in the defualt contact us form
____________________________________________
i made 3 tests to check if everything working.
TEST 1
as you can see. i filled everything up but not the file upload field.
after sent, i recieved an email with every field i filled. thats great.
TEST 2 (checkbox test)
as you can see. i filled everything up but not the logo design checkbox and the file upload.
after sent i got this error, but the email was recieved:
- Code: Select all
[b]Notice[/b]: Undefined index: cb_logo in /home/xxxxx/public_html/demo1/catalog/controller/information/contact4.php on line 40
[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/demo1/index.php:92) in /home/xxxxx/public_html/demo1/system/engine/controller.php on line 27
TEST 3 (file upload test)
as you can see. i filled EVERYTHING this time even the file upload.
after sent i got this error:
- Code: Select all
[b]Fatal error[/b]: Call to undefined method Mail::attachment() in /home/xxxxx/public_html/demo1/catalog/controller/information/contact4.php on line 25
files in next post...
Last edited by Maansy on Fri Aug 27, 2010 3:20 am, edited 1 time in total.
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
and here are the controller/information/contact & contact.tpl
i hope the fix is not complicated
thanks Q
i hope the fix is not complicated
thanks Q
-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: html_entity_decode() ISSUE
maybe i will wait on this one, since everyone is having fun with 1.49 

-

Maansy - Posts: 930
- Joined: Wed Jun 23, 2010 10:04 pm
Re: Enhance the Contact us page
i tried this on OC version 1.3.2 but not working.. do you have something for older versions?
-

dramony - Posts: 258
- Joined: Sat Oct 24, 2009 4:34 am
Re: Enhance the Contact us page
HI Maansy ,
After reading through the thread.. am still confused.
I have a similar enhancement I'll like to make...
Need drop down boxes & checkboxes in the Contact us form as well:
Drop down -- Subject Line
Checkboxes -- : how do you find us?
Do I just use the zip file, that you've done and edit the codes accordingly to what I need?
Thank you.
After reading through the thread.. am still confused.
I have a similar enhancement I'll like to make...
Need drop down boxes & checkboxes in the Contact us form as well:
Drop down -- Subject Line
Checkboxes -- : how do you find us?
Do I just use the zip file, that you've done and edit the codes accordingly to what I need?
Thank you.
Production Cart @ http://eshop.kgshop-sg.com -- OC 1.5.4.1 -- pending
No more using Apsona, as they are not updated.
No more using Apsona, as they are not updated.
- Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC
- thegeekz
- Posts: 326
- Joined: Tue Nov 02, 2010 2:24 am
17 posts
• Page 1 of 1
Who is online
Users browsing this forum: finerden, kiattiong, soobig and 56 guests













