Aiken Full Member
  
![[Avatar]](http://uploads.virtualforums.co.uk/forums/support/me-yat.jpeg) Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | Javascript + PHP (27th Feb 10 at 5:39am UTC) | | 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 | |
vF forums: Perfect World RP BLEACH Universe - Under Construction / Testing Phase Xen Qarna RP - Stage I Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled the Final Anime Hideout |
|
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Javascript + PHP (27th Feb 10 at 7:55am UTC) | | Using AJAX is the best way, although it depends what it is that you're trying to do! | |
|
Aiken Full Member
  
![[Avatar]](http://uploads.virtualforums.co.uk/forums/support/me-yat.jpeg) Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | |
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Javascript + PHP (27th Feb 10 at 10:19am UTC) | | AJAX can't go cross domain, that's the problem. What do you want this battle system to do? O.o | |
|
Aiken Full Member
  
![[Avatar]](http://uploads.virtualforums.co.uk/forums/support/me-yat.jpeg) Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | |
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Javascript + PHP (27th Feb 10 at 11:11am UTC) | | Nope, as far as I know. AJAX can't. | |
|
Aiken Full Member
  
![[Avatar]](http://uploads.virtualforums.co.uk/forums/support/me-yat.jpeg) Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | |
Ross Administrator
    
![[Avatar]](http://uploads.virtualforums.co.uk/forums/pokemon/vforums-qr1.png) Posts: 3,709 Status: Offline Gender: Male Age: 9 1⁄4 Joined:
Additional Groups: Support Team
  
pmwwwgtalkvForum | Re: Javascript + PHP (27th Feb 10 at 2:17pm UTC) | |
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); | |
|
|
Aiken Full Member
  
![[Avatar]](http://uploads.virtualforums.co.uk/forums/support/me-yat.jpeg) Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | |
indu New Member

Posts: 4 Status: Offline Joined:
pm | Re: Javascript + PHP (9th Mar 10 at 9:33am UTC) | | hai i dn't know
| |
|
dog199200 Guest | Re: Javascript + PHP (9th Mar 10 at 10:26pm UTC) | | yea aiken, this was the problem I was having with getting the IM system working the 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. | |
|
Marc vChat Developer
     I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 32 Joined:
Additional Groups: Coding Team
  
pmwww | Re: Javascript + PHP (9th Mar 10 at 10:49pm UTC) | |
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! | |
rroll.to— Shorten a link, rickroll your friends. |
|
indu New Member

Posts: 4 Status: Offline Joined:
pm | Re: Javascript + PHP (26th Mar 10 at 8:19am UTC) | | what is html
| |
|
indu New Member

Posts: 4 Status: Offline Joined:
pm | Re: Javascript + PHP (26th Mar 10 at 8:19am UTC) | | html is | |
|
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: Javascript + PHP (26th Mar 10 at 9:12am UTC) | | indu: Please read the PM that I have sent you.
| |
|