-1

Hi guys, i don't know what 's causing this php error:

403 Forbidden. You don't have permission to access /Duplicate of Edited Site/< on this server.

Need help. This problem actually occured when i clicked the submit button from a certain form.

Thanks in advance.

This is code:

<html>
<head></head>
<body>

<?php
	if (isset($_POST["submit"]))
	{
		if (!$_POST['name'] || !$_POST['email'] || !$_POST['question'])
		{
			echo "Required fields not completed, please input the required fields.";
		}
		else
		{
			$name = $_POST['name'];
			$email = $_POST['email'];
			$question = $_POST['question'];
			$message = wordwrap("Message from $name \n Message: $question", 70);
			if(!mail('little_saint1321@yahoo.com',"Inquiry",$message,"Cc: $email\r\n"))
			{
				echo "Sending failed, please input the required fields.";
			}
			else
			{
				echo "Message sent.";
			}
		}
	}
?>

<form name="FAQ" method="post" action='<?php echo $_SERVER["PHP_SELF"]; ?>'>
	<table cellpadding="0" cellspacing="5" border="0" width="500" align="center">
		<tr>
			<td width="150">Name: * </td>
			<td width="350"><input type="text" name="name"></td>
		</tr>
		<tr>
			<td width="150">Email Address: * </td>
			<td width="350"><input type="text" name="email"></td>
		</tr>
		<tr>
			<td width="150" colspan="2">Question: * </td>
		</tr>
		<tr>
			<td width="350" colspan="2"><textarea cols="59" rows="5" name="question"></textarea></td>
		</tr>
		<tr>
			<td colspan="2" align="right"><input type="submit" value="Send" name="submit"></td>
		</tr>		
	</table>
</form

</body>
</html>

Edited by JerieLsky: n/a

2
Contributors
5
Replies
7
Views
8 Years
Discussion Span
Last Post by ivatanako
0

Hi guys, i don't know what 's causing this php error: Need help. This problem actually occured when i clicked the submit button from a certain form.

Thanks in advance.

Where is the /Duplicate of Edited Site/ located?

can we view the code that actually submits the data?

0

by default, php does not parse .html files as php

so you need to create a .htaccess file where you store your files.

then put this values

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
0

Ah, how do i do that? Any samples? Not yet familiar with that .htaccess thing.

0

Ah, how do i do that? Any samples? Not yet familiar with that .htaccess thing.

open notepad

then enter this values

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

then save it as ".htaccess" to where you store your html files

with quotes by the way

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.