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>

Recommended Answers

All 5 Replies

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?

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

Where is the /Duplicate of Edited Site/ located?

can we view the code that actually submits the data?

This is the URL of the /Duplicate of Edited Site/:
http://localhost/Duplicate%20of%20Edited%20Site/

I placed under the c:/wamp/www/duplicate of edited site.

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.