Page 348 - Computer Software Application TP - Volume 1
P. 348

COMPUTER SOFTWARE APPLICATION - CITS



                     echo “New record created successfully”;
                 } else {

                     echo “Error: “ . $sql . “<br>” . $conn->error;
                 }
                 $conn->close();
                       ?>
              </body>

              </html>
           3  Save the program in C:\Apache24\htdocs in a folder with .php extension
           4  Run the Apache services from windows services
           5  Open the browser and type the following address

              http://localhost/foldername/
           6  Click the php file to run and verify the output







































           TASK 3: Connect to MySQL database from PHP and insert data using prepare statement
           i  Create an HTML form in the webpage (index.html) to collect the data from the user
              1  Open the text editor

              2  Write the following codes
                       <html >
              <head> HTML form </title>
              </head>
              <body>





                                                           333

                               CITS : IT & ITES - Computer Software Application - Exercise 61
   343   344   345   346   347   348   349   350   351   352   353