Copy link to clipboard
Copied
Finally trying my hand at a contact form -
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!
By @REELHEROId 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:
============
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
...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
...Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Great.. I tested it w a fruadlent attempts and it it didnt submite and shows in the attemps log..
fingers crossed!
Copy link to clipboard
Copied
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 🙂
Copy link to clipboard
Copied
will do!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now