Jump to content

[SOLVED] Forbidden/Don't have permission on this server


twilitegxa

Recommended Posts

I have the following form, and upon trying to submit, I receive the following error:

 

Forbidden

You don't have permission to access /< on this server.

 

Apache/1.3.39 Server at localhost Port 80

 

Here is the code for the page:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<?php

session_start();

//Access Tracking Snippet

//set up static variables
$page_title = "creationform.php";
$user_agent = getenv("HTTP_USER_AGENT");
$date_accessed = date("Y-m-d");

//connect to server and select database
$conn = mysql_connect("localhost", "root", "")
        or die(mysql_error());
$db = mysql_select_db("smrpg", $conn) or die(mysql_error());

//create and issue query
$sql = "insert into access_tracker values
        ('', '$page_title', '$user_agent', '$date_accessed')";
mysql_query($sql,$conn);

$gender = (!empty($_POST['gender']))?$_POST['gender']:""; //Male or female?
$status = (!empty($_POST['status']))?$_POST['status']:""; //Hero or villain?

if($status == "villain"){
        //Since you're a villain, we just redirect here to the villain page
        header("Location: villain.php");
        exit;
}elseif($status == "hero"){
        if($gender == "male"){
                //You are a male hero!
                header("Location: knight.php");
        exit;
        }elseif($gender == "female"){
                //You are a female hero!
                header("Location: scout.php");
        exit;
        }
}
?>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org">
<title>Sailor Moon RPG - Character Creation - Step 2: Character Outline</title>

<style type="text/css" media="screen">
/*<![CDATA[*/
@import url(global.css); 
/*]]>*/
</style>
</head>
<body>
<!-- HEADER -->
<h1 class="logo">Sailor Moon RPG</h1>
<!-- /HEADER -->
<?php include("topnav.php"); ?>
<div id="main"><?php include("mainnav.php"); ?>
<h1>Step 2: Character Outline - Creation</h1>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table>
<tr>
<td>Would you like to create a:</td>
<td><input type="radio" name="status" value="hero"> Hero or a <input type="radio" name="status" value="villain" class="input1"> Villain</td>
</tr>
<tr>
<td></td>
<td><input type="radio" name="gender" value="female"> Female or <input type="radio" name="gender" value="male"> Male</td>
</tr>
</table>
<br>
<input type="submit" name="submit" value="Create Character" class="button1"> <input type="reset" name="reset" value="Reset"></form>
</div>
<?php include("bottomnav.php"); ?><!-- FOOTER -->
<div id="footer_wrapper">
<div id="footer">
<p>Sailor Moon and all characters are<br>
trademarks of Naoko Takeuchi.</p>
<p>Copyright © 2009 Liz Kula. All rights reserved.<br>
A product of <a href="#" target="_blank">Web Designs By Liz</a> systems.</p>
<div id="foot-nav"><!-- <ul>
<li><a href="http://validator.w3.org/check?uri=http://webdesignsbyliz.com/digital/index.php" target="_blank"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a></li>
<li><a href="http://jigsaw.w3.org/css-validator/validator?uri=http://webdesignsbyliz.com/digital/global.css" target="_blank"><img class="c2" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" /></a></li>
</ul> --></div>
</div>
</div>
<!-- /FOOTER -->
</body>
</html>

Link to comment
Share on other sites

It's really too bad that there are so many tutorials out there that use short tags, because it teaches sloppy programming that causes problems like this for people. Although the other side of that is that for someone in the know, it can be a good way to filter out bad tutorials - if they are using short tags there is a good chance the rest of their coding isn't that great either.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.