How do I get Javascript to communicate with a PHP file?
I think it is Ajax but I'm not sure how to do it
And how do I get PHP to create/modify txt files to use as basic databases
The answers will help me with an idea I have for one of my forums
Using AJAX is the best way, although it depends what it is that you're trying to do!![]()
Basically I want to be able to build a battle system for one of my forums
AJAX can't go cross domain, that's the problem. What do you want this battle system to do? O.o
Battle between 2 users, I thought Ajax could go cross domain
Nope, as far as I know. AJAX can't.
Than what can I do?
Than what can I do?
You could use something sometimes referred to as "Poor Mans AJAX" - you can use Javascript to load additional Javascript files to the page.
I don't remember exactly how it works (I think you need some funny onload events to get it working in IE) but the idea is that you create and append a script tag which loads a PHP file on your server, you would pass parameters to this file in it's URL so that it can do something on your server. The file can then return javascript to execute on the page. eg.
var s = document.createElement('script');
s.type = "text/javascript";
s.src = "http://yoursite.com/battle.php?user=admin&action=something&bar=foo";
document.getElementsByTagName('head').item(0).appendChild(s);
Ah, I see
hai
i dn't know
yea aiken, this was the problem I was having with getting the IM system workingthe Ajax didn't like the cross domain. Though as for your flat file question
you can use php function fileopen with the function fileread and filewrite *I think thats what they are called* you'd have to google how the functions work, but you could also look into setting up a flat file database with PHP, but i can tell you know, it depends on how advanced you want to go, it might be better to just use mysql to store the information then storing it as a fiat file system.
hai
i dn't know
Hello there, welcome to vForums!![]()
To introduce yourself to fellow members, please visit the Introductions board.
Please take the time to have a read over our Global Forum Rules & Info to get to know our rules and regulations.
We hope you enjoy your time here!![]()
what is html
html is
indu: Please read the PM that I have sent you.
you can use php function fileopen with the function fileread and filewrite *I think thats what they are called* you'd have to google how the functions work, but you could also look into setting up a flat file database with PHP, but i can tell you know, it depends on how advanced you want to go, it might be better to just use mysql to store the information then storing it as a fiat file system.
I am unable to use MySQl in PHP, I have tried many, many times, always failed
PM me exactly what you need help with and i'll see what I can do to help you alongI have been working with PHP and SQL a lot here lately and have become quite adept at it XD