PHP/Java Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

CrazyPHPMan
Forum Newbie
Posts: 12
Joined: Sat Aug 12, 2006 4:14 pm

PHP/Java Question

Post by CrazyPHPMan »

Hello people of the forum,

I been messing with php for a while and came accross alot of stuff to do. Now i desided to try and get into making a game but only thing is i want it to be php/java setup now for php it will be login, and chat and getting the User's Stats now for the java it will be a text/button based it will be so users can fight one another now thats the part that i dont get.. i dont know if im on the right thread for this or not but i need help on making a java based text/button game that will be interlinked with php so that when a user wins a fight it will show..

You recieved 200 exp and 50 gold.

now if someone can help me with this please leave a post please

Thank you
CrazyPHPMan
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

why not just use php for the whole project? I don't see where java is necessary.
CrazyPHPMan
Forum Newbie
Posts: 12
Joined: Sat Aug 12, 2006 4:14 pm

Post by CrazyPHPMan »

Well for one there would be 15 second lag in php for the fight part. for 2 it will be live fighting not no lag if i use java and 3 im not sure on how to do php text/button based gaming all i know in php is to do websites and stuff like that :S i know pathatic right :S.

Thank you
CrazyPHPMan
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

I don't understand why there would be lag could you explain that more. And php is pretty robust so it should be able to manage.
CrazyPHPMan
Forum Newbie
Posts: 12
Joined: Sat Aug 12, 2006 4:14 pm

Post by CrazyPHPMan »

Well see php only way you can make refresh page is if you put a html tag in there to refresh it or a javascript one or whatever in java they got one in there that auto refreshes every second and doesnt show that it refreshes like the html and the javascript ones do..
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Image ... ajax ...
CrazyPHPMan
Forum Newbie
Posts: 12
Joined: Sat Aug 12, 2006 4:14 pm

Post by CrazyPHPMan »

never really hear or figured out how to work with ajax
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

php refreshes and you can add a delay just use header:

Code: Select all

header( 'refresh: 5; url=http://yoursite.com' );
This refreshes to yoursite.com with 5 second delay.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The refresh header is not supported on many web servers. The meta tag version works in most browsers however.
CrazyPHPMan
Forum Newbie
Posts: 12
Joined: Sat Aug 12, 2006 4:14 pm

Post by CrazyPHPMan »

thats the reason why i want the fight part in java so it can have its own refresh script i would like to do the whole thing in java but never can find a tutorial that will help me learn how to build a java chat room :S unless one of you all know one good tutorial.. then all i would need is some help on making the fight script..
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

feyd wrote:The refresh header is not supported on many web servers. The meta tag version works in most browsers however.
why is that?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

ityd wrote:why is that?
Non-standard response header.
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

CrazyPHPMan wrote:thats the reason why i want the fight part in java so it can have its own refresh script i would like to do the whole thing in java but never can find a tutorial that will help me learn how to build a java chat room :S unless one of you all know one good tutorial.. then all i would need is some help on making the fight script..
You can find a simple example of Java Chat System in Java programming books. A reference I've once used: Java 5, The Complete Reference. I am not saying that you have to buy the book, you could go to the library.

If I may suggest you, if you're going to create a game in a website, use Flash instead. Java takes more time to load rather than Flash Applications. PHP and Flash are somehow easier to connect.
CrazyPHPMan
Forum Newbie
Posts: 12
Joined: Sat Aug 12, 2006 4:14 pm

Post by CrazyPHPMan »

Well i dont like using flash because for one alot of users are dial up users and flash it tends to get really laggy becuase of the the dial up speed and why would you use flash to make a small game thats only going to be used in one little spot where users fight each other? and anyways java really doesnt take that long to load and also it doesnt get laggy much as flash does when users are using dial up.. now i played alot of java games and a lot of flash and in my opinion flash sucks for games..
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

CrazyPHPMan wrote:Well i dont like using flash because for one alot of users are dial up users and flash it tends to get really laggy becuase of the the dial up speed and why would you use flash to make a small game thats only going to be used in one little spot where users fight each other? and anyways java really doesnt take that long to load and also it doesnt get laggy much as flash does when users are using dial up.. now i played alot of java games and a lot of flash and in my opinion flash sucks for games..
Fine, then, use Java....

games in yahoo! use Applet, but it takes long to load. In my opinion, dial up sucks.
Post Reply