example:
// this is page1.php
Expand|Select|Wrap|Line Numbers
- <head>
- function send() {
- var ajaxRequest;
- //javascript code over here.....
- //javascript code over here.....
- //javascript code over here.....
- //javascript code over here.....
- var name=document.getElementById('name').value;
- var file=document.getElementById('file_pic').value;
- var queryString = "?name=" + name + "&file_pic=" + file;
- ajaxRequest.open("GET", "page2.php" + queryString, true);
- ajaxRequest.send(null);
- }
- </head>
- <body>
- <input type="text" name="name" />
- <input name="file_pic" type="file" id="file_pic">
- <input type="button" name="submit" value="submit" onClick="send()">
- </body>
this is page2.php
[PHP]<?php
include('include/dbcon.inc');
$floor = trim($_GET['name']);
$file = $_FILES['file']);
move_uploaded_file($file['tmp_name'], "./uploaded_image/" .$file['name']);
?>
[/PHP]ok i will stop right here...this move_uploaded_file command wont work...it doesn't upload the image to upload_image folder but the text is ok..it is save in the database.. only the file is my problem..
text inputs can be pass like this, right? but i dont know i file field is capable in this kind of process..please help me sir...
please help me dear experts...
thank you for viewing...more power