I am trying to create a simple payment.php file that handles form posting from a buyaticket.html file.
I need to write an if statement, so that the website will display this:`
<h1>Thanks, customer!</h1>
<p>Your information has been recorded.</p>
<dl>
<dt>Name:</dt>
<dd><?php print $_POST['name']; ?></dd>
<dt>Seat:</dt>
<dd><?php print $_POST['seats']; ?></dd>
<dt>Credit Card Type:</dt>
<dd><?php print $_POST['cardtype']; ?></dd>
<dt>Credit Card Number:</dt>
<dd><?php print $_POST['creditcardnumber']; ?></dd>
</dl>`
if all of the names (name, seats, cardtype, creditcardnumber) are filled out. In addition, the creditcardnumber must be an int.
if they are not filled out (i.e. empty or null), then i need to display a simple html tag stating that you haven't filled out the form correctly.
Can anyone help me with my problem? I need to know how to write an IF statement that will show an error message if the inputs (name, credit card number, etc) are left blank, and if they are filled out i will show the above mentioned code showing all of the users input information.
this is what i was playing with (not my actual code. just thoughts):
if empty('name') or empty('cardtype') or empty('seats') or empty('creditcardnumber')
<h1>You have filled out the form incorrectly</h1>
else
<dl>
</dl?
but i don't know how to check for creditcardnumber being an integer, as well.
Thanks in advance for any help!