Last Active: Nov 19, 2024
Threads:
615
Posts:
7,941
Reputation:
86
Question: if I was to code a web page form, can I use PHP and skip Perl altogether?
My complaint is that Perl is inconvenient to use. I just gave up on it. CGI coding is not my way.
PHP is heaven.
Last Active: Nov 19, 2024
Threads:
615
Posts:
7,941
Reputation:
86
Thank you.
#IFuckingHatePerl
Last Active: Nov 12, 2022
Threads:
0
Posts:
2
Reputation:
0
Perl is pretty much a joke and no shops use it.
PHP 8.1 really is an awesome programming language...I started programming in the mid 80s in C and after 10 years of pointer errors I moved to C++ and OOP.
When i first started web development in 2001 I saw the LAMP stack as the obvious winner as its very hard to compete with free.
Last Active: Mar 04, 2024
Threads:
1
Posts:
18
Reputation:
1
Yes, well you can use PHP and skip Perl altogether to create a web page form.
Code Example -
<!DOCTYPE html>
<html>
<head>
<title>PHP Form Example</title>
</head>
<body>
<h2>Contact Form</h2>
<form method="post" action="">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br><br>
<label for="message">Message:</label><br>
<textarea id="message" name="message" rows="4" cols="50" required></textarea><br><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
// Process the form data, e.g., send an email
$to = 'recipient@example.com';
$subject = 'New Contact Form Submission';
$messageBody = "Name: $name\nEmail: $email\nMessage:\n$message";
mail($to, $subject, $messageBody);
echo '<p>Thank you for your submission!</p>';
}
?>
</body>
</html>
Thanks
Last Active: Nov 19, 2024
Threads:
615
Posts:
7,941
Reputation:
86
gulshan212, I thank you, but I think that I know how to code a PHP form, that's why I prefer PHP better than Perl.
But I admit fault in asking the question in the beginning. Perhaps I will learn to spare these questions.
Again, I thank you.