file upload problem
Posted: Tue May 29, 2012 9:37 pm
Hi everyone,
I'm trying to setup a basic file uploader for my page using http://malsup.com/jquery/form/ , jquery and codeigniter 2.1.
Following the directions on http://malsup.com/jquery/form/#getting-started, I have this form:
I have created a file called comment.php , and put in the assets folder. The directory structure is:
[text]
application
assets
-- css
-- images
-- img
-- js
system
index.php
[/text]
When I load a and fill the form it appears to work and firebug shows:
Thank you,
KC
I'm trying to setup a basic file uploader for my page using http://malsup.com/jquery/form/ , jquery and codeigniter 2.1.
Following the directions on http://malsup.com/jquery/form/#getting-started, I have this form:
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="<?=base_url();?>">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="assets/jquery.form.js"></script>
<script>
// wait for the DOM to be loaded
$(document).ready(function() {
// bind 'myForm' and provide a simple callback function
$('#myForm').ajaxForm(function() {
alert("Thank you for your comment!");
});
});
</script>
</head>
<body>
<div>TODO write content</div>
<?php chmod("assets/comment.php", '777') ?>
<form id="myForm" action="assets/comment.php" method="post">
Name: <input type="text" name="name" />
Comment: <textarea name="comment"></textarea>
<input type="submit" value="Submit Comment" />
</form>
</body>
</html>
[text]
application
assets
-- css
-- images
-- img
-- js
system
index.php
[/text]
When I load a and fill the form it appears to work and firebug shows:
when I look in comment.php there is nothing in it. why is the comment not posted to it? I have changed permissions in the form to '777'POST http://localhost/upload1/assets/comment.php 200 OK 79ms
Thank you,
KC