0

This is my first PHP script, so please excuse my clumsiness. I have a HTML page which consists of a form and a PHP page which deals with the variables that are outputted. The HTML page functions as a small box that asks to input an email account/password, and the PHP page simply echoes the results.

My HTML page:

<html>
<form action="emailresults.php" method="post">
        <p>
                Email address:<br />
                <input type="text" name="email" size="20" maxlength="50" value="" />
        </p>
        <p>
                Password:<br />
                <input type="password" name="pswd" size="20" maxlength="15" value="" />
        </p>
        <p>
                <input type="submit" name="subscribe" value="subscribe!" />
        </p>
</form>
</html>

My "emailresults.php":

<?php
      echo "The email you entered is $_POST['email'].";
      echo "The password you entered is $_POST['pswd'].";
?>

When I arrive at my PHP page, I get the error "Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING" for line 2.

What can I do to fix this?

Thanks in advance.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by SoulMazer
0

Try making your php page the following:

<?php
echo 'The email you entered is '.$_POST['email'].'.';
echo 'The password you entered is '.$_POST['pswd'].'.';
?>

And other than that your code should be fine unless there is other code in the php file that may be causing the problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.