Jump to content

shreyaskudav

Members
  • Posts

    83
  • Joined

  • Last visited

Everything posted by shreyaskudav

  1. I am writing a simple code to select a radio button and pass the value of the selected radio to php code, through ajax! Heres my code for ajax: function sendid(attack){var att;var xmlhttp;if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safarixmlhttp=new XMLHttpRequest();}else{// code for IE6, IE5xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){document.getElementById("result").innerHTML=xmlhttp.responseText;}}xmlhttp.open("POST","battlephp.php",true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.send("att="+attack+"");}</script></head><body><input type="radio" value="10" name="attack" onclick="sendid('this.value')"/> Attack 1<input type="radio" value="20" name="attack" onclick="sendid('this.value')"/> Attack 2 And my php code: $attack = intval($_POST['att']);echo "Working ".$attack; And the Error I am getting is: ( ! ) Notice: Undefined index: att in C:wampwwwbattlephp.php on line 5Call Stack# Time Memory Function Location1 0.0003 247432 {main}( ) ..battlephp.php:0Working 0 Surely its not identifing the att which is pass through the ajax..! But how should I handle it now?? I am newbie to ajax!
  2. Ohkk.. I will try with some simple mathematical calculation..so to check whether its taking ips and displaying ops or not!.. Thnks.. anyways... Foxy and Davej!
  3. So if I am using Ajax! so I will be using xmlhttprequest objects!.. But should declare 2 objects.. 1 for each user! or array of httprequest?? Which will be better?? OR Is it possible to use the same object for both the users???
  4. Yes... thats what I tried to understnd!! but was not able!! Should I use sessions?? for it??if yes!! can u tell me the basic logic of it??
  5. Sorry..I am not that familiar to ajax! But the first thing I need is to know is,... how can I take 2 request from different users...! Should I declare 2 objects of Httprequest or I should use it array of Httprequest??
  6. not more then 10 secs..! users are usually impatient..and horribly in the case of a game!!
  7. Yup! davej! exactly!! If http do not support it?? what should I use?? And also tic tac toe is usually a flash based..! mine is Browser Based Game.. !
  8. I want to pass 2 values (integer type) from 2 different users at the same times... and process the result back to both the user.!! and this will go on... till a certain condition is satisfied!
  9. Sorry! i am not that familiar with ajax! so i don't know whats limit access and load page! But I want multiple pair of users to get access to the same server at the same time.
  10. How can I connect 2 users to access a single server, which would be a PHP code or an algorithm. I think it should be related to AJAX or Javascript! But Don't know what exactly How should I implement it!
  11. CREATE PROCEDURE getID(IN username VARCHAR(50))BEGINSELECT idFROM usersWHERE username = username;END This is my stored procedure.. how to call it in my PHP code?
  12. I think stocklist_id would become your foreign key.. Try changing the name of the column stocklist_id to something else!
  13. I am trying to make an online game, where i would be requiring the users to make a team for 6 pokemons! (They are nothing but combination of images and text, which I have already stored in database) From all the pokemon the user has, he has to select 6 durning playing the game! I just want to know the concept or mechanism which will help me to do so! Like, arrays could help me, or variables?? or modifications of table?!
  14. no...i just gave on example....describing the 2 methods of defining....
  15. class { void func(){} }; AND class myclass{void func();};class myclass::func(){//body} WHAT IS THE DIFFERENCES??? Why are there 2 methods...while any one of them would work efficiently??
  16. no need for answering my questions...:|

  17. hi....

    I am Shreyas.....too from India, Mumbai....

    I need some guidance about scripting....can i PM you...

×
×
  • Create New...