shreyaskudav Posted May 20, 2014 Share Posted May 20, 2014 I want to implement the same concept as it is in ajax! like there would be a server, request and response! But I want to use only PHP! not Ajax! Battleserver.php will act as a server and battle.php will be at the client side...! I can send data from battle.php to battleserver.php by using POST method! But I don't want to make user know that data is send to battleserver.php...! It should not appear in the URL! How can I do that! ?? Link to comment Share on other sites More sharing options...
thescientist Posted May 20, 2014 Share Posted May 20, 2014 you'll have to use a proxy srcipt then. if you don't want to use Ajax, your form will have to POST to someother-file.php, which can do all the stuff you need under the hood. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 20, 2014 Share Posted May 20, 2014 Why exactly do you not want to use ajax? Link to comment Share on other sites More sharing options...
shreyaskudav Posted May 20, 2014 Author Share Posted May 20, 2014 (edited) coz I am not use to it.. so I will have to study it deep from the beginning....! And I am quiet good in handling PHP! atleast I know it better the Ajax.. And also its not like that..I never tried it..! last time I tired...but it increased my complication Edited May 20, 2014 by shreyaskudav Link to comment Share on other sites More sharing options...
justsomeguy Posted May 20, 2014 Share Posted May 20, 2014 I suppose you could submit a form to an iframe or something, although the point of ajax is to solve all of those problems. If you're going to use Javascript to populate a form and submit it, might as well just use Javascript to send the actual request. That way you can handle the response. Link to comment Share on other sites More sharing options...
davej Posted May 20, 2014 Share Posted May 20, 2014 Are you trying to avoid Javascript or are you trying to avoid Ajax? Link to comment Share on other sites More sharing options...
Ingolme Posted May 21, 2014 Share Posted May 21, 2014 PHP doesn't run on the client side. In order to get a PHP script to execute you have to load the page again. Javascript is constantly running on the client side which is what allows AJAX to work. There is no client-side PHP. Link to comment Share on other sites More sharing options...
shreyaskudav Posted May 21, 2014 Author Share Posted May 21, 2014 @davej : I am trying to avoid Ajax..! @justsomeguy : If its possible with javascript.. do you have any example..or any link that would demonstrate it?? so i can understand it better! Link to comment Share on other sites More sharing options...
Ingolme Posted May 21, 2014 Share Posted May 21, 2014 If the reason you don't want to use AJAX is because you're not good at it you're going about the problem the wrong way. An engineer (or developer) has to use the proper tools to get the job done. You should learn to use AJAX, it's not that difficult. Link to comment Share on other sites More sharing options...
shreyaskudav Posted May 21, 2014 Author Share Posted May 21, 2014 Ohkk I try again! But if you have understood what I actually want to do...! What would benefit me.. jQuery or Ajax? Link to comment Share on other sites More sharing options...
Ingolme Posted May 21, 2014 Share Posted May 21, 2014 You haven't described what your application is supposed to do. Link to comment Share on other sites More sharing options...
davej Posted May 21, 2014 Share Posted May 21, 2014 I think he wants to write a two-player game such as tic-tac-toe or battleship. Link to comment Share on other sites More sharing options...
thescientist Posted May 21, 2014 Share Posted May 21, 2014 for a game, you might want to look into the HTML5 websockets API http://www.html5rocks.com/en/tutorials/websockets/basics/ Link to comment Share on other sites More sharing options...
MrFish Posted May 24, 2014 Share Posted May 24, 2014 (edited) shreyaskudav, You have to understand the difference between "client-side" and "server-side". A client is your computer. You see a web page and you click a button. Only your computer knows you clicked the button until you send it to the server (where your PHP lives). The server handles the request and sends a response. When a response is sent the client updates to reflect that response. Shorts of writing a working client side and serve side example there is probably a lot you need to learn if you don't understand this. Keep writing your game (that's how I learned) but you haven't got the knowledge to write it yet (let alone patients). Javascript sends (using ajax) data to your server. PHP handles the ajax request and sends a response back. AJAX updates the browser so players can see what they've done. Keep on keeping on. Good luck. Edited May 24, 2014 by MrFish Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now