.php
with method load
, its problem is that when I give include
to something it should be include './dir/arquivo.php';
after load
loads the page % is forced to stay this way to work include
, plus some elements do not work.
But when I use only ../dir/arquivo.php
direct, without JS to call, it works perfectly, I'd like a way to make JS (or even PHP) run include
( or some form that is not include 'arquivo.php'
) when the button is pressed.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script><scriptsrc="http://malsup.github.com/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#button").click(function(){
$("#div").load('arquivo.php');
});
});
</script>
<input type="button" id="button">
<div id="div"></div>
Sample code that does not work:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script><scripttype="text/javascript">
$(function()
{
var bar = $('.bar');
var percent = $('.percent');
var status = $('#status');
var upload = $('form').ajaxForm(
{
beforeSend: function()
{
},
uploadProgress: function(event, position, total, percentComplete)
{
//aumenta barra de progresso
},
complete: function(xhr)
{
}
});
});
</script>
<form enctype="multipart/form-data" method="post" id="formSendTorrent" name="formSendTorrent">
<input type="file" multiple name="inputfileSendTorrent[]" id="inputfileSendTorrent">
<input type="submit" name="submitSendTorrent" value="Enviar">
</form>
<?php
if(isset($_POST['submitSendTorrent']))
{
header('Location: index.php');
}
?>