Jump to content

[SOLVED] Please help me to do AJAX


shamsuljewel

Recommended Posts

Hello everybody,

I am trying to do this...

 

I hava a page with different tab....

          1. Myfriend list

          2. My pictures

          3. My Top 10 Friends...etc

I do this by useing AJAX.....its simple

<LI id=navFrndlist><A title="Friend List" onClick="makeRequest('frnd_list.php');">Friend 
          List</A></LI>
        <!-- use class="active" -->

        <LI id=navTop10><A title="Top 10 Friends" onClick="makeRequest('top_10.php');">Top 
          10</A></LI>

        <LI id=navPic><A title="Pictures" onClick="makeRequest('gallery.php');">Pictures</A></LI>

         <DIV id="content" align="center"><?php require_once "frnd_list.php"; ?></DIV>

 

 

in my friendlist there are many friends in database..so I need to show first 1-10 of 25 like this.

and a next>> to show next 11-20.

so I use this line in friend_list.php

 

for($i=0; $i*$limit < $total_frnd; $i++)
		{
				if($s != $i)
					echo "  <a href='index.php?action=friends_main&s=$i'>".($i+1)."</a>";
					//echo "  <a onClick=\"makeRequest1('gallery.php','$i');\" href='#'>".($i+1)."</a>";

				else
					echo "  ".($i+1);
		}

this works fine but I use that way when I don't use AJAX..this is a normal way this refresh all the page......so I need the way to do this by using AJAX.

 

this friend_list.php page is now shown in content <div>...so I now need when I click on 2 (page) the next friend list will display in same content <div> thats why I actuall need to pass the value of $i and it will GET from this friends file... so how can I do it?

 

Any sugestions .....:) :)

 

Link to comment
https://forums.phpfreaks.com/topic/77263-solved-please-help-me-to-do-ajax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.