Hi there, I have a Main page with a image that, once clicked, brings up a .php script using javascript (newwindow=window.open('thispage.php','name','height=200,width=300')) for the user to enter their email. Once the image is clicked the .php page loads fine but when I click the Submit button I get an error saying "can't find the file at /C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/site/<?php $_SERVER['PHP_SELF'] ?>."
Anyone know what could be wrong? I bet it's a really idiotic mistake on my part, and I don't know why HTML is treating the $_SERVER statement literally
EDIT: No PHP statement seems to work, it just displays the form by default 🙁
<html>
<head>
<title>Subscribe</title>
<style type="text/css">
<!--
body {
background-color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}
#container
{
height:200px;
width:300px;
color:#FFFFFF;
}
.style1 {
color:#999999;
font-size: 12px;
}
.style2 {color: #FFFFFF}
-->
</style>
</head>
<body>
<?php
if(!isset($_POST['submit']))
{
?>
<div id="container">
<h1 class="style1">Subscribe to our mailing list</h1>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
E-mail: <input type="text" name="email" />
<input type="submit" value="Subscribe" name="submit" />
</form>
</div>
<?php
}
else
{
$email = $_POST['email'];
echo "Your email is";
}
?>
</body>
</html>