Page 1 of 1

Pagination

Posted: Wed Dec 25, 2013 5:22 am
by jarrodatt
Hello,

So I created a db with user_name and user_email,

So I can manually add and delete records that display.

How can i set it so when index page comes up with list of names it also links email so just hovering over and/or clicking link (name) it shows email or opens email client to to: already filled in.

If that makes since.

I followed tut so that all works fine. Just issue adding email option

Thank you

Re: Pagination

Posted: Wed Dec 25, 2013 6:20 pm
by ScTech
So someone clicks a name, it should show the corresponding email to that person? You will need JavaScript for that with an onclick in your HTML to fire the JavaScript function such as:
<?php
// skipping to relative pagination while loop(it can be foreach as well)
while($row = mysql_fetch_array($query)) {

        echo "<a href='javascript:void(0)' onclick='showEmail(\"$row['email']\")'>$row['name']</a>";

}
?>
Of course you will need to add the corresponding JavaScript. With JQuery it would take 5 lines to make it work.

When sending an email on click you use mailto: but it does not work in all major browsers.