Jump to content

Recommended Posts

No matter what I've tried, my if statement from loanapp6.php won't work.  I'm trying to filter out people who have more than 2 homes.  No matter what I select it ALWAYS performs the IF statement.  I only want it to perform the if statement when the value from loanapp5.php is 3.  Here are the two pages of code.

 

loanapp5.php

<?php
session_start();
print $name;
$value = $_POST['value'];
$_SESSION['value'] = $value;
print $_SESSION['value'];
?>
<html>
<head><title>1003 App</title></head>
<body>
<h2>Do you have multiple houses or one residence?</h2><p>
<form action="loanapp6.php" method="post">
<select name="nhouses"  size="1">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3 or More</option>
        </select>
<input type="submit" value="Next">
</form>
</body>
<p>
<a href="dnc.php">
Add To Do Not Call List</a>
</p>
<p>
<a href="lacontinue.php">
Continue Another Time</a>
</p>
</html>

 

loanapp6.php

<?php
session_start();
print $name;
$nhouses = $_POST['nhouses'];
IF ($nhouses  = 3) {
PRINT "I can't help you.";
}
ELSE {
$_SESSION['nhouses'] = $nhouses;
print $_SESSION['nhouses'];
?>
<html>
<head><title>1003 App</title></head>
<body>
<h2>Do you have two loans like a first mortgage and a home equity loan or do you just have one loan?</h2><p>
<form action="loanapp7.php" method="post">
<select name="nmort"  size="1">
        <option value="1">1 Mortgage</option>
        <option value="2">2 Mortgages</option>
        <option value="3">More Than 2 Mortgages</option>
        </select>
<input type="submit" value="Find Now">
</form>
</body>
<p>
<a href="dnc.php">
Add To Do Not Call List</a>
</p>
<p>
<a href="lacontinue.php">
Continue Another Time</a>
</p>
</html>
<?
}
?>

Link to comment
https://forums.phpfreaks.com/topic/65854-if-statements-not-working/
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.