Jump to content

Archived

This topic is now archived and is closed to further replies.

grazzman

Stupid Question

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Without refreshing = not PHP. Try Javascript or AJAX.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[quote]I need to merge the gap from JavaScript and PHP..... and I dont even know were to start to look[/quote]

Ajax!

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Well you dont really have much choice. Php runs on the server, javascript runs on the client.

Share this post


Link to post
Share on other sites
So, im guessing that I can not call a PHP function with Javascript either without Ajax?

Share this post


Link to post
Share on other sites
Not without refreshing the page.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.