Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Contact Form text area is limiting and the form wont center

Engaged ,
Mar 09, 2025 Mar 09, 2025

Finally trying my hand at a contact form -

 

https://pitchlab.net/contact/

 

 

before I dive into server side I need to make sure it works properly and there are two issues- minor but annoying:

 

first issue is the textarea for "Message" is behaving like an input in that it is limiting the width you can type.. a text area should allow you to type all the way across..

 

and finally-

 

the form div wont center - I used a parent container flexbox for the columns and a div wrapping the  form and it wont center.. 

 

 

my parent:

.contact_flex_container {
width:100%;
height:100%;
display: flex;
justify-content:center;
align-items: center;
padding-top: 10vh;
}

 

my form div:

 

.form_container{
justify-content: center;
}

 

any help would be appreciated!

2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Mar 12, 2025 Mar 12, 2025
quoteId like it to operate more like this with a message received below but Im not sure how secure it is to have the PHP be on the same page including the email in the code:
By @REELHERO

============

To assuage your fears about running scripts on the contact page, PHP scripts are hidden. Nobody can see them. 

 

To illustrate, view source in your browser.  All you see is HTML, CSS and JavaScript.  No PHP code.

 

PHP is invaluable for concealing sensitive information like Google private keys and other

...
Translate
Community Expert , Mar 13, 2025 Mar 13, 2025
quote

I like the way this operates but Im not sure how secure it is to have the PHP be on the same page, including the email in the code, is it opening me up to spam?:

By @REELHERO

 

 

@REELHERO your other thread Contact form/PHP Best practices re security from which this quotation is taken and which has been closed, I can't propose any answer, so please excuse me for polluting this thread.

 

As @Nancy OShea  mentioned, PHP is indeed invisible to the browser, so direct access to its data is not poss

...
Translate
Engaged ,
Aug 07, 2025 Aug 07, 2025

ok I did it from scratch and created a log:

 


// Log suspicious activity
$logFile = '../attempts.log';
function logAttempt($reason) {
global $logFile;
$entry = date('Y-m-d H:i:s') . " - IP: " . $_SERVER['REMOTE_ADDR'] . " - Reason: $reason\n";
file_put_contents($logFile, $entry, FILE_APPEND);
}

 

So i will assume it will create a log file on my server in the "connect" aka my contact form folder?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2025 Aug 07, 2025

Exactly, in fact, a file named “attempts.log” will be created in a folder above the folder containing the PHP file with the code fragment :

// Log suspicious activity

 

If you want to place the log in the same folder, then remove ../ from the declaration

 

$logFile = "attempts.log";

 

Then make fraudulent attempts, or regularly monitor this file via FTP, it will tell you what happened on the server when your form was unexpectedly filled out, when and how.

 

If you still receive spam, it means that the traps are not working, at least through the flaw that will then be exploited and will need to be corrected.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 09, 2025 Aug 09, 2025

Great.. I tested it w a fruadlent attempts and it it didnt submite and shows in the attemps log..

fingers crossed!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2025 Aug 11, 2025
quote

Great.. I tested it w a fruadlent attempts and it it didnt submite and shows in the attemps log..

fingers crossed!


By @REELHERO

 

So it should work as expected... unless a robot or competitor has selected you and is trying to really spam you... :)

 

 

Just monitor your email and check your log from time to time...

However, if your log becomes verbose, you will need to take the necessary measures. For now, just keep an eye on it, and keep us informed 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 11, 2025 Aug 11, 2025

will do!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines