Custom contact form for WordPress using PHP

I've done my best to create a custom contact form (I don't want to use a bulky add-on) and everything looks and seems fine until I press send.

After completing the form and pressing submit, all that happens is a redirect to a 404 page that says that does not exist (scf is the slug name of the page / publication where the shortcode is).

I do not understand Obviously, I have changed the recipient of the email to a real one in my code and still nothing. Only a 404.

Here is the complete code:

add_shortcode( 'scf', 'contact_scf' );
function contact_scf() { ?>

Contact Form





Contact Request Submitted









'; // Set content-type header for sending HTML email $headers = "MIME-Version: 1.0" . "rn"; $headers .= "Content-type:text/html;charset=UTF-8" . "rn"; // Additional headers $headers .= 'From: '.$name.'<'.$email.'>'. "rn"; // Send email if(mail($toEmail,$emailSubject,$htmlContent,$headers)){ $statusMsg = 'Your contact request has been submitted successfully !'; $msgClass = 'succdiv'; }else{ $statusMsg = 'Your contact request submission failed, please try again.'; $msgClass = 'errordiv'; } } }else{ $statusMsg = 'Please fill all the fields.'; $msgClass = 'errordiv'; } } ?>

Duplicate contact fields several times

In Google contacts, I recently noticed field duplication (NO duplicate contacts). Sometimes, an email field will be duplicated hundreds of times, sometimes a note, sometimes a phone number, sometimes a spouse. Contact records become so large that it takes a few minutes to load when viewed in the contacts application. I tried using contact optimizer (paid version) without success. From my PC, looking at Google contacts, the records appear well: the field duplication problem only exists on the phone. Yesterday I deleted all contacts on the phone and on Google and then made a full recharge on Google. This solved the problem and everything seemed fine. Today, however, duplication seems to have begun again. Some contact records already have massive amounts of duplicate fields.

Say the contact name of the SMS sender

How to speak automatically (); the getOriginatingAddres (); When do you receive an SMS?

javascript – How can I submit a form and close the popup using contact form 7?

I have a contact form 7 popup inserted in a bootstrap modal in a WordPress template, but I need that when sending this message an alert is activated with a message and then this window closes automatically.

I have this code, what would I need to complete it correctly?

document.addEventListener( 'wpcf7mailsent', function( event ) {
  if(event.detail.contactFormId == '445') {
  alert("tu maldito formulario se envio")
}, false );

customer service – Is it better to "contact" than "contact us" or "contact me" to get a contact link (which leads to contact details)?

In many cases, the staff of a web application can slowly grow from one person to two or more people and / or slowly grow back from two or more people to one person.

My problem

This problem could be understood as insignificant, but in fact there could be some formality linguistics recommendation to use only "contact" to avoid the following possible commercial interaction bias (or similar):

A customer is bothered to receive an email response from an attachment if
It was a written seller (I expected the website owner, as I expected the website owner to be the only responder).

My question

Is "contact" better than "contact us" or "contact me" for a contact link (which leads to contact details)?

That is asking; Is it better, for some formal (accessibility?) guide or by some formal linguistic argument, to use the contact<>,
Instead of "contacting us" or "contacting me"?

What does this circle with a lime through it +1 mean about my contact?

Samsung Galaxy S9. When I open my contacts, this contact has this icon above the number. What does this mean? enter the description of the image hereenter the description of the image hereenter the description of the image here

html: is it recommended to put a price list on the same web page of a contact form?

I have a website that contains a pricelist website and a contact us web page that contains a simple contact form that contains the following mandatory fields:

  • Name
  • E-mail
  • Type of service the researcher is interested in (selected from a select list of up to five options)

A non-mandatory option field is also available to obtain a copy of the message in the applicant's email.

My problem

To further reduce the possibility of cognitive bias such as inconsistency between the price list and the contact form, I plan to join the two web pages into one.

I am not sure if this is a bad or good practice and I wonder what professional organizations or authorities (scientific or engineering) have concluded about this from a marketing point of view.


  • My price list page contains notes on international payment options and some other notes that make the page a little longer than a simple price table and is also divided into three chapters, each with another type of service.

  • An action I already took was to add (according to price list) Note as a text postfix in any selection field value, but that does not avoid the question about the merging of the two pages

My question

Is it recommended to put a price list on the same web page of a contact form (the contact form is below the price list)?

magento2 – Magento 2: Your web server is configured incorrectly and allows unauthorized access to confidential files. Please contact your hosting provider.

I am struggling to try to solve this very annoying problem in my Magento 2.3.3 store.
Today I forced SSL on the website (I did it by enabling https in the unsecure URL). After 10-15 minutes, while I was editing some coupon codes, I received this notification in my backend:

Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider.

I tried everything. The / app folder has the .htaccess file and has this rule (all suggested this as a solution).

    order allow,deny
    deny from all

= 2.4>
    Require all denied

All my folders seem to have 755 and all files 644 permission.

PLEASE NOTE: This error occurs when the folder / app is visible to everyone. The strange thing is that if I try to navigate in that folder or in the application / etc / config.php, I get the 404 error, so it seems that my files are safe.

Why do I receive this error?


magento2.3 – How do I make the phone number mandatory on the Contact Us form?

You need to extend the template file in your application / design.

: app / design / frontend / vendor / theme / Magento_Contact / templates / form.phtml

add the following code in the place of the phone number field.

enter the description of the image here

php – Contact form not updated

Hello, I need a contact form in which the client clicks on "comment", it is on the same page, that is, do not update after submitting the form. What I have so far is the following code, that when I send the form data, the user is sent to the php page where the data is processed and inserted into MYSQL. Does anyone know a way to take the update, I think through ajax, if you can give me an example of how to thank!


Deixe um comentário:

php page

<? php
requires & # 39; connection_comment.php & # 39 ;;

$ name = mysqli_real_escape_string ($ conn, trim ($ _ POST (& # 39; name & # 39;))) ;;
$ comment = mysqli_real_escape_string ($ conn, trim ($ _ POST (& # 39; comment & # 39;))) ;;
$ user_id = mysqli_real_escape_string ($ conn, trim ($ _ POST (& # 39; user_id & # 39;))) ;;
$ product_id = mysqli_real_escape_string ($ conn, trim ($ _ POST (& # 39; product_id & # 39;))) ;;

$ sql = "INSERT IN THE COMMENTS (user_id, product_id, name, comment) VALUES (& # 39; $ user_id & # 39 ;, & # 39; $ product_id & # 39 ;, & # 39; $ name & # 39 ;, & # 39; $ comment & # 39;) ";
$ result = mysqli_query ($ conn, $ sql);
threw out "";