Page 218 - Open Soource Technologies 304.indd
P. 218

Web Technologies-I



                   Notes                 {
                                             $value = stripslashes($value);
                                         }



                                         // Quote

                                         $value = “,” . mysql_real_escape_string($value) . “,”;
                                         return($value);
                                     }
                                 ?>

                                 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.
                                 w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

                                 <html>
                                 <head>
                                         <title>PHP Form processing example</title>
                                 <!-- define some style elements-->

                                 <style>
                                 label,a
                                 {
                                         font-family : Arial, Helvetica, sans-serif;
                                         font-size : 12px;
                                 }
                                 </style>
                                 </head>



                                 <body>
                                        <?php
                                                    if(!empty($errorMessage))
                                                    {
                                                           echo(“<p>There was an error with your form:</p>\n”);
                                                           echo(“<ul>” . $errorMessage . “</ul>\n”);

                                             }
                                         ?>
                                                <form  action=”<?php  echo  htmlentities($_SERVER[‘PHP_SELF’]);  ?>”
                                 method=”post”>

                                                       <p>
                                                              <label for=’formMovie’>Which is your favorite movie?</
                                 label><br/>
                                                              <input type=”text” name=”formMovie” maxlength=”50”



        212                               LOVELY PROFESSIONAL UNIVERSITY
   213   214   215   216   217   218   219   220   221   222   223