Dear developers
How to show contact details while clicking the particular name from <li> list
Contact_list.php

<?php
$con=mysqli_connect("localhost","user","pass","nilambu1_mydb");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT * FROM n_info ");

while($row = mysqli_fetch_array($result))
{
echo "<li><a href='contact.php' data-transition='slidedown'> <img src='images/calling.png'/> <h2> " . $row['first_name'] . " " . $row['last_name'] . "</h2> <p >Mobile : " . $row['mobile1'] . "  ,  " . $row['mobile2'] . "</p></a></li>";
}

mysqli_close($con);

?>

viewcontact.php

<div id="restau" data-role="page" data-add-back-btn="true">

    <div data-role="header"> 
        <h1> Nilambur Info</h1>
    </div> 

    <div data-role="content">
    <div class="ui-grid-a" id="restau_infos">   
        <div class="ui-block-a">
        <h1> Worker Name</h1>
        <p><strong>  Worker role/job</strong></p>
        <p> Contact Details </p>
            <ul> 
                <li> Mobile:99xxxxxxxx</li>
                <li> Whatsapp :99xxxxxx</li>
                <li> Land Phone : 04931 xxxxxx </li>
            </ul>           
        </div>      
        <div class="ui-block-b">
        <P>Optional Photo </p>
        </div>
    </div><!-- /grid-a -->
    <hr/>
    <!-- =========================
    <div class="ui-grid-a" id="contact_infos">  
        <div class="ui-block-a">
        <h2> Contact us</h2>
        <p>30 Rue des Tonneliers</p>
        <p> 67000 Strasbourg    </p>        
        </div>      
        <div class="ui-block-b">
        <img src="01_maps.jpg" alt="plan jeanette"/>
        </div>
    </div><!-- /grid-a -->

    <div id="contact_buttons">  
        <a href="tel:9946045045" data-role="button" data-icon="tel"> Call us</a>    
        <a href="whatsapp://send?text=http://www.nilamburinfo.com/dial/index.php"  data-role="button" data-icon="tel"> Share Via Whatsapp </a>  
        <a href="index.php"  data-role="button" > Back to Home </a>

    </div>  

Recommended Answers

All 2 Replies

How to show contact details while clicking the particular name from <li> list

What exactly do you want to happen?

I have contact book in my sql database. After my basic coding i got conact name via <li> list.
my html output

<ul>
<li>Faisal</li>
<li>Jovesh</li>
<li>Arsal</li>
</ul>

So next step, While clicking this name I want show full conatct details in my second page

My sql database table name "n_info"
My sql database table columns
id, first_name, last_name, mobile1, mobile2, land_line, address

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.