Pagination

Post here is you are having problems with any of the tutorials.
Post Reply
jarrodatt
Posts: 13
Joined: Wed Sep 26, 2012 12:21 am

Pagination

Post 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
ScTech
Posts: 92
Joined: Sat Aug 24, 2013 8:40 pm

Re: Pagination

Post 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.
<?php while(!$succeed = try()); ?>
Post Reply