- Create Account

htmlhttprequest with templates and php/mysql

Forums > Other DHTML / JavaScript > htmlhttprequest with templates and php/mysql
Author
Message

1) evang Group: Members
Posts: 1 Joined: 23 Apr 2006 Location: IP: 202.154.--.--
pardon me, i'm quite blind about javascript :( i create script with php and database mysql.. and my script has template. example:

//php file:

$output = $num1  - $num2;
$tp = ereg_replace("{CODE}", $output,  $tp);


//template  file:

<form ...>
{CODE}
</form>

so,  how to show the {CODE} with htmlhttprequest? could you give me suggestion, pls? thanks :)

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.173.--.--
Look at the Calculator example in the demo. Have the ONSUBMIT handler on your form, and make both the form and the PHP file as you normally do -- the cool thing about this script is that it doesn't require any changes to your CGI!

Good luck - Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.