harshpandya Posted February 11, 2009 Share Posted February 11, 2009 Hi guy, I want to include PHP file only when the button is clicked otherwise done include. what should i do ?Thanks, Link to comment Share on other sites More sharing options...
justsomeguy Posted February 11, 2009 Share Posted February 11, 2009 Add a $_GET variable to the URL to tell whether or not to do the include. Link to comment Share on other sites More sharing options...
harshpandya Posted February 11, 2009 Author Share Posted February 11, 2009 Add a $_GET variable to the URL to tell whether or not to do the include.I am sorry but we are not reloading the page. we are trying to connect stream with it. so we need to include PHP file only when we click on small button. which should call the javascript function which uses that PHP file so we have to include that PHP file but we do not know howThanks, Link to comment Share on other sites More sharing options...
morrisjohnny Posted February 11, 2009 Share Posted February 11, 2009 Tried Using AJAX to load the data once a button is clicked?Not sure code wise how to do it as i'm still learning but it seems like it would work. without reloading the page. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 11, 2009 Share Posted February 11, 2009 I am sorry but we are not reloading the page. we are trying to connect stream with it.Javascript code cannot use PHP code. You can't open a file, or open a database connection, or a server connection, in PHP, and then use that connection in Javascript. PHP and Javascript are not related in that way.If you just want to run some PHP code by clicking a button, but not have Javascript use the PHP resources, then AJAX is the way to do that. Link to comment Share on other sites More sharing options...
harshpandya Posted February 12, 2009 Author Share Posted February 12, 2009 Thanks for the information - I tried that, works Thanks guys Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.