Jump to content

shamsuljewel

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Everything posted by shamsuljewel

  1. Hello everyone I can parse word by php using strpos and explode. How can I do this by javascript? suppose I have a string s = "abc&bcd&boddy"; so now I want to parse the words and save in an array[0] = abc array[1]=bcd and array[2] = boddy. so how can i do it?
  2. suppose I use this line in my code <a onClick=\"makeRequest3('add_frnds.php','running','$query','1');\" href='#'>Accept</a> So by ajax add_frnds.php will execute and show result in a div. its ok but I am now use a alert() in the add_frnd.php....but the alert() didn't worked..? But when I open the add_frnd.php normally it works..but in the div it don't...is it possible to work in the div???
  3. Hi there, I need two different div in one page will be refreshed when I clicked on hyperlinked. I don't understand how will I do it...any idea?
  4. can you please clear me the last sentense? "when you make the ajax request in that function change the display property of that div to none that will hide the div "
  5. ok here is the code this is frnd_req.php file <DIV id="running"></DIV> <div id="req"> <table width="100%"> <?php $ro=0; if($total_pending > 0){ while($row = mysql_fetch_array($q_pending1)) { $q_search = "SELECT user_name,email,user_id FROM user_info WHERE id='$row[pending_user_id]'"; $q_search1 = mysql_query($q_search) or die(mysql_error()); $q_search2 = mysql_fetch_array($q_search1); //if($ro%2==0) $s_id = $row['s_id']; $query = "frnd_id=".$row[pending_user_id]."&s_id=".$s_id; $dt=date("M d, H:iA", $row['req_date']); echo "<tr>"; echo "<td><table width='100%' border='0'> <tr> <td height='65' rowspan='3' width='70'><div align='center'><img src='pic/images.jpg'/></div></td> <td width='200'>".mysql_result($q_search1,0,'user_name')."</td> <td rowspan='2' align='center'><a onClick=\"makeRequest3('add_frnds.php','running','$query');\" href='#'>Accept</a> | <a onClick=\"makeRequest3('invite_success.php','running','$query');\" href='#'>Reject</a></td> </tr>............................................ it shows some friends requests...now if accept is click then <a onClick=\"makeRequest3('add_frnds.php','running','$query');\" href='#'>Accept</a> add_frnds.php runs <?php session_start(); if($_SESSION['normal_user'] !="") { include("../dbconnect.php"); $id_me = mysql_fetch_array(mysql_query("SELECT id FROM user_info WHERE user_id='$_SESSION[normal_user]'")) or die(mysql_error()); $user_id = $id_me['id']; $tim = time(); if($_GET['frnd_id']) $frnd_id = $_GET['frnd_id']; //echo $frnd_id; if($_GET['s_id']) $s_id = $_GET['s_id']; //echo $s_id; $q_delete = "DELETE FROM frnd_pendinglist WHERE s_id='$s_id'"; $q_detele1 = mysql_query($q_delete) or die(mysql_error()); $q_add = "INSERT INTO frnd_list(user_id,frnd_id,create_date) VALUES('$user_id','$frnd_id','$tim')"; $q_add1 = mysql_query($q_add) or die(mysql_error()); $message = $frnd_id." is added to your friend list"; echo $message; } ?> so the message is shows in the running div. the database is changed..the accepted friend id is added to the friend list and from the pending table the request deleted. so now I want to reload the "req" div.
  6. so how do i handle it? If i delete a list item i just want to reload the div. so that the update database info shows.
  7. can any one tell me how to refresh a div id of a page using ajax...?
  8. I have a friends list getting from database. When I click a link delete that call a ajax function name request3 which delete the specific data from the database...and show the information in top div. but in the below div the deleted data still remains unchanged cos the page didn't refreshed. so how do i do that the below div will also refreshed so that it shows the current data? any help please..??
  9. HI all I want to use dynamic div where the change of page occures and use different php file to send to the ajaz function...how do i do it please give me an example....
  10. only thinks I see the progress bar gif...
  11. Hi all I am trying to do this... mouse click $div_id = "running"; <a onClick=\"makeRequest3('invite_success.php','$div_id');\" href='#'>sent invitation</a> in ajax file function makeRequest3(url,div_id) { //document.write(des_div); try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { xmlhttp = false; } } if(!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } xmlhttp.onreadystatechange = populateDIV2(div_id); xmlhttp.open('GET', url, true); xmlhttp.send(null); } function populateDIV2(div_id) { var MyHttpLoading = '<img src="pic/progressbar_long_green.gif" border="0" alt="running" />'; document.write(div_id); if(xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { document.getElementById(div_id).innerHTML = xmlhttp.responseText; } else { alert('There was a problem with the request'); } } else { document.getElementById(div_id).innerHTML = MyHttpLoading; // still working //setTimeout('content',2000); //document.write("ok"); } } but the program doesnot work...only thing I see the progress bar gif(progressbar_long_green.gif)
  12. Ohhhh I m mistaken in the ajaxfunction to handle the paramentes... Just changed to currect I soved it...:)
  13. how to pass the $i variable to AJAX function and then the variable again sent from to the php file by GET method.
  14. 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 ..... :)
  15. I am using a list. In firefox the distence between list item is very close on the other hand in IE the difference is far. Is there anything that fixed the distance of the list items.
  16. please submit ur code in the code block..that will help others to read and easily understandable you code...
  17. thanks for ur help....U solved my problems..thanks rajivgonsalves
  18. so If I want to add a new user_id to the column? can u please show me the query?
  19. that is I put some user_id those who are my friends in the column. So if I delete a user_id from the list then I just want to delete the specific user_id all the other remains same.
  20. I want to change each value conditionally.
  21. no col1 doesnot contain only jewel but jewel,alam,etc so this query doesnot match or find the jewel at col1
  22. I hv a table name table1 and column name col1 which contain data jewel,alam,etc so if i want to change jewel to shah that is col1 data will be shah,alam,etc how do I do it? what is the query?
  23. I am use this code while(($row=mysql_fetch_array($q1)) && $c < $limit) { echo "<tr><td width='1%' colspan='20'><input type='checkbox' name='contact_select[]' value='$row[id]'> $c++; } set of contact list from database I want to check all or uncheck all by button click I am using <input type="button" name="CheckAll" value="Check All" onClick="checkAll(document.action.contact_select)"> <input type="button" name="UnCheckAll" value="Uncheck All" onClick="uncheckAll(document.action.contact_select)"> this does not work but if I just remove the [] <input type='checkbox' name='contact_select' value='$row[id]'> it works but I need [] for delete the particular item...so how do I select all ..any idea?
  24. I want to move 2 col after 5th col how do I do it? please let me know..
×
×
  • 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.