Site logo

Archived topic

503 error when I tried to retrieve submitted form data in PHP

1 reply · Started by Jessica on October 21, 2022

Viewing posts 1–2 of 2

Hi,

I created a form to ask a user to enter their name and email address (form.php) and when the user submit the form, it sends to form.php and I tried to retrive the name and email entered by the user. However, I always got a 503 error: "Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."

HOWEVER, using exactly the same form.php, but when I place it outside of my WordPress site, just some folder on my web host, it works! I can retrieve the form info and display it on screen after submission.

May you please show me what should I do to get this form submission working WITHIN my wordpress site? Thanks!!!

Here's the link to both pages:
1. form.php that does NOT work (This is a WordPress site using GeneratePress theme Premium)
https://siervasdelplandedios.org/wp-content/uploads/customCode/form.php

2. same form.php but outside of WordPress site
https://comunicaciones.siervasdelplandedios.org/form.php

Code of form.php

<!DOCTYPE html>
<?php
if(isset($_POST['submit'])) {
	$name = $_POST["name"];
	$email = $_POST["email"];
}
?>
<html>
<head>
    <title>Contact</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
</head>
<body>
    <h1>Contact</h1>
    
	 <form method="post" action="form.php">
		<input type="text" name="name" id="name" value="" required>
		<input type="text" name="email" id="email" value="" required>
		<input type="submit" name="submit"/>
	</form>
    
	<?
	echo $name."\nemail is: ".$email;
	?>
</body>
</html>

Hi Jessica,

Unfortuanly this is out of the scope of GP's support forum.
I would recommend reaching out to WordPress's support for this.

This archived topic is closed to new replies.