Coding a generic form
#1
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.
Reply
#2
You absolutely can.
Reply
#3
Thank you.

#IFuckingHatePerl
Reply
#4
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.
Reply
#5
(Aug 16, 2022, 23:39 pm)RobertX Wrote: Thank you.

#IFuckingHatePerl

Perl is rather for console scripting. For web-development PHP and JavaScript (node.js) is your choice.
Reply
#6
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
Reply
#7
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help with a Selenium coding problem - Clicking a button using XPath Avantika_Sharmaa24 2 7,311 Aug 21, 2023, 05:34 am
Last Post: Avantika_Sharmaa24
  Coding Practice Resource ankitdixit 2 25,757 Sep 26, 2021, 05:36 am
Last Post: ALEX1180
  Favourite software for webpage coding RobertX 2 19,545 May 02, 2017, 10:58 am
Last Post: jariceals



Users browsing this thread: 1 Guest(s)