ManOnScooter Posted October 22, 2007 Share Posted October 22, 2007 Hi, I have this unique problem, ok, lemme get into the history.. When any user connected to the mainpage(index.php) page of the application, he should should see all the number of users logged on to the application and login-IDs. Now I understand I cant have the javascript onLoad function to call any PHP method, so what can i do to make the database connection and read data from the database and display even before any action is taken. i.e. any onLoad or similar function?? So the objective here is as follows.. As soon as the user is on the mainpage(index.php) the php page should read data from database and display on the index.php page. Any suggestion?? Regards, Man On Scooter!! Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/ Share on other sites More sharing options...
MadTechie Posted October 22, 2007 Share Posted October 22, 2007 ~Sighs~.. Using AJAX.. See here Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375532 Share on other sites More sharing options...
ManOnScooter Posted October 22, 2007 Author Share Posted October 22, 2007 Is it the same XMLHTTP server thing?? I duno, it sounds kinda complex... is it complex or do you think there is an easier way?? Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375536 Share on other sites More sharing options...
trq Posted October 22, 2007 Share Posted October 22, 2007 As soon as the user is on the mainpage(index.php) the php page should read data from database and display on the index.php page. Then simply query the database and display the data you want. I don't see the problem here. Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375537 Share on other sites More sharing options...
only one Posted October 22, 2007 Share Posted October 22, 2007 Javascript is clientside, PHP is server side, AJAX is the only langauge that can communicate with a serverside and clientside langauge, just read a tutorial. Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375539 Share on other sites More sharing options...
ManOnScooter Posted October 22, 2007 Author Share Posted October 22, 2007 Thorpe, The idea of a simple query to the database would be fine if any action/event was taken on the index.php page. But, here the only event is onLoad() (javascript), no other event.. Only the Page is being loaded.. Man On Scooter!!! Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375542 Share on other sites More sharing options...
ManOnScooter Posted October 22, 2007 Author Share Posted October 22, 2007 thorpe, Guess i dint get you rite maybe... would you have any sample code to explain?? Man On Scooter!! Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375545 Share on other sites More sharing options...
php4ever Posted October 22, 2007 Share Posted October 22, 2007 Thats good stuff. I love the tutorials, thanks for posting. ~ Jared Quote Link to comment https://forums.phpfreaks.com/topic/74327-anyway-substitute-for-onload-javascript-method-in-php/#findComment-375555 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.