Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Oct 2011
    Thanked 1 Time in 1 Post

    MySql Connection

    Dear Sir,

    HTML file has following codes

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Connection Checking</title>
        <h1>Connection Checker</h1>
        <fieldset style=width:300px;background-color:#E0FFFF>
        <legend sytle=font-size:12;>Click Connect</legend>
        <form name="form1" action="connect.php" method="post">
        <tr><td></td><td align="center"><input type="submit" name="button1" value="Connect">
    and Connect.php has folllowing codes

        // Connection variables
        // Connect to database
        $con=mysqli_connect("$host", "$username", "$password");
        // Connect result
        die('Error Connecting to Database: ' . mysqli_error());
    echo '<script type="text/javascript">alert("Connected"). mysqli_error($con);</script>'; 
        //close the connection
    Both files have no problems and works fine.

    But I need following modifications:

    When connection is established then this line trigs from connect.php

    echo '<script type="text/javascript">alert("Connected"). mysqli_error($con);</script>';

    While standing on html page, I want to show a messagebox like this

    In other words:

    When I press Connect button then connection result must appear on same page not on other page.

    Please help
    Last edited by tqmd1; 11-09-2013 at 08:20 AM. Reason: edit


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts