Hi there,
I am having a little trouble with an IF statement and PHP, I can't show you want I am doing as its being done locally but I will post the code.
The problem is, that whenever I run the IF statement, under both conditions (yes and no) it runs whats in the If Statement if the condition is yes.
Here is the posting page (I know its not valid because i quick coded it but im sure that isnt the problem)
Here is the processing PHP page
What's the problem as it is not obvious to me?
Thanks...
I am having a little trouble with an IF statement and PHP, I can't show you want I am doing as its being done locally but I will post the code.
The problem is, that whenever I run the IF statement, under both conditions (yes and no) it runs whats in the If Statement if the condition is yes.
Here is the posting page (I know its not valid because i quick coded it but im sure that isnt the problem)
index.html said:<html>
<head>
<title>Title</title>
</head>
<body>
<div>
<h1>Header</h1>
<form method="POST" action="proc.php">
<p>S1*: <input type="text" name="s1" size="40" maxlength="40"></p>
<p>S2: <input type="text" name="s2" size="40" maxlength="40"></p>
<p>S3: <input type="text" name="s3" size="40" maxlength="40"></p>
<p>S4: <input type="text" name="s4" size="40" maxlength="40"></p>
<p>S5: <input type="text" name="s5" size="40" maxlength="40"></p>
<p><input type="submit" value="Submit" name="sumbitted" /></p>
</form>
<p>Fields marked (*) are required</p>
<p><a href="../index.php">Back to Navigation</a></p>
</div>
</body>
</html>
Here is the processing PHP page
proc.php said:<?php
if($s1=='')
{
echo "Nothing Typed In!";
exit;
} else {
echo "Do Stuff";
}
?>
What's the problem as it is not obvious to me?
Thanks...