Jump to content


Photo

Stupid Question


  • Please log in to reply
9 replies to this topic

#1 grazzman

grazzman
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 26 July 2006 - 09:54 PM

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?


#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 26 July 2006 - 09:59 PM

Without refreshing = not PHP. Try Javascript or AJAX.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 grazzman

grazzman
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 26 July 2006 - 10:04 PM

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

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 26 July 2006 - 10:10 PM

I need to merge the gap from JavaScript and PHP..... and I dont even know were to start to look


Ajax!

#5 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 26 July 2006 - 10:18 PM

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 :)
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 26 July 2006 - 10:24 PM

Ajax really need'nt be as complicated as some big framework. Especially if you dont understand the basics its just bloat.

A simple ajax tutorial written by the guy who invented php.

#7 grazzman

grazzman
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 26 July 2006 - 10:26 PM

:( me no like ajax

#8 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 26 July 2006 - 10:29 PM

Well you dont really have much choice. Php runs on the server, javascript runs on the client.

#9 grazzman

grazzman
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 26 July 2006 - 10:35 PM

So, im guessing that I can not call a PHP function with Javascript either without Ajax?

#10 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 26 July 2006 - 10:45 PM

Not without refreshing the page.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users