grazzman Posted July 26, 2006 Share Posted July 26, 2006 This should be an easy on. I have a from in HTML that is inside a Print statment. What I need is when they click on SUBMIT for it to call a PHP Function and to take the value of 2 text boxes and make them into $something for php... I need to do this without the page refreshing or reloading... Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/ Share on other sites More sharing options...
effigy Posted July 26, 2006 Share Posted July 26, 2006 Without refreshing = not PHP. Try Javascript or AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64355 Share on other sites More sharing options...
grazzman Posted July 26, 2006 Author Share Posted July 26, 2006 Ok, forget the form part.... Can I just set a php $variable to a HTML Textbox? Then I will just make a button that will call the function that has the code to set the value......Does that make sense? It does not need to be a form, or a post, just something like $phpVariable = document.getElementById('textbox').value;I know that is Javascript, but I need to merge the gap from JavaScript and PHP..... and I dont even know were to start to look Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64358 Share on other sites More sharing options...
trq Posted July 26, 2006 Share Posted July 26, 2006 [quote]I need to merge the gap from JavaScript and PHP..... and I dont even know were to start to look[/quote]Ajax! Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64359 Share on other sites More sharing options...
ryanlwh Posted July 26, 2006 Share Posted July 26, 2006 Prototype.js library has a neat AJAX class. I don't know if there are other better AJAX frameworks... anyway, you can write your own if all fails :) Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64364 Share on other sites More sharing options...
trq Posted July 26, 2006 Share Posted July 26, 2006 Ajax really need'nt be as complicated as some big framework. Especially if you dont understand the basics its just bloat.[url=http://marc.theaimsgroup.com/?l=php-general&m=112198633625636&w=2]A simple ajax tutorial[/url] written by the guy who invented php. Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64366 Share on other sites More sharing options...
grazzman Posted July 26, 2006 Author Share Posted July 26, 2006 :( me no like ajax Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64369 Share on other sites More sharing options...
trq Posted July 26, 2006 Share Posted July 26, 2006 Well you dont really have much choice. Php runs on the server, javascript runs on the client. Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64370 Share on other sites More sharing options...
grazzman Posted July 26, 2006 Author Share Posted July 26, 2006 So, im guessing that I can not call a PHP function with Javascript either without Ajax? Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64371 Share on other sites More sharing options...
trq Posted July 26, 2006 Share Posted July 26, 2006 Not without refreshing the page. Quote Link to comment https://forums.phpfreaks.com/topic/15745-stupid-question/#findComment-64375 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.