I am using the following to show up the thank you message in my contact us form. I need to show up a separate thankyou.html page. What should I define for that in the code? Thank you. vivido if(isset($_POST["commit"])) {?> Thank you for contacting us. We will revert back to you soon. <? }?> <form action="<? print $_SERVER["PHP_SELF"] ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two"> PHP:
<?php if(isset($_POST["commit"])) { include "thankyou.html"; } ?> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two"> PHP: just a tip: Use <?php instead of <? ... some PHP servers needs it ... And also echo is better than print
Your code won't work. Mine will though: <?php if(isset($_POST["commit"])) { include("thankyou.html"); } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two"> Code (markup):
WTF? include "thankyou.html"; works the as well as include("thankyou.html"); .... you should try it before you post this comment ...
And why is that? @OP: You should use $_SERVER['SCRIPT_NAME'] instead of $_SERVER['PHP_SELF'] because $_SERVER['PHP_SELF'] is liable to XSS.
Erm excuse me! <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two"> Code (markup): Which will produce an unexpected error because of your quotes. It is you that should try it before you comment!
Some people should really think and then read what they type and more importantly test their own code before posting. tut tut tut.
lmao sorry, I have no idea why I thought it would produce an error Oh well, everyone makes mistakes lol.
Exactly. Everyone makes them then reads the error logs and fixes them right! Now if there was only an error log for "life" Hmmmm Next project....