Использование prototype.js для добавления информации в базу данных с использованием AJAX.
Оригинал статьи здесь
In the past weeks I wrote several posts about how to use ajax to add, modify, delete records from a database using ad hoc JavaScript functions.
Now I want to use ajax requests using a very useful JavaScript framework called
prototype.js.
This tutorial explains how to use prototype.js framework to enable a simple ajax request which add a new record (an user name) into a database table using
PHP like server side language.
Step 1: include prototype.js Download prototype.js and create a new page (index.php).
Add this line of code in the <head> tag onf index.php to include prototype framework:
We pass to index.php the value we want to save using this simple code:
$('user_name').serialize(true)
...if you have familiarity with javascript, this is equal to declare this code:
document.getElementById('user_name');
... where in both cases "user_name" is input field ID we want to save into database. We pass this value to insert.php like a POST variable (see step 3).
- Осуществить ввод вебмани
- интернет реклама 508-77-37