получение переменной $i = $_POST['rrr'];? верно?
суть такая, вот файл index.php
<meta charset="utf-8">
<title>Convertor IDEF0/3-->DiagramUML</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<?php include 'loadXML.php'; include 'ffff.php' ?>
<h1 align="center"><i>Конвертор диаграмм</i></h1>
<div class="main">
<div class="navigation_head">
<form class="XML" method="post" enctype="multipart/form-data">
<input type="file" name="xmlFile" accept="text/xml">
<input type="submit" name="buttonImport" value="Загрузить" accept="text/xml">
<input type="submit" name="Refresh" value="Отчистка БД" accept="text/xml">
</form>
</div>
<div class="bar">
<?php include 'radiobut.php';?>
</div>
<div class="content">
<iframe src='drawline.php' frameborder="1" height="670" width="1280" name="one" id="one">
</iframe>
</div>
<div class="navigation_footer"></div>
</div>
</body>
файл radiobut.php
<?php
$con = mysql_connect("localhost","root","");
mysql_select_db("convertor", $con) or die(mysql_error()); //не вываливайте ошибки sql на страницу
$result = mysql_query("SELECT * from diagram ORDER BY diagramnumber");
if (mysql_num_rows($result) > 0) {
$i==0;
?><script src='https://code.jquery.com/jquery-3.1.1.min.js'></script>
<form id="form_id"><?
while($row = mysql_fetch_assoc($result)):
?>
<input type="radio" name="rrr" value="<?=$i++?>"><?=$row['name']?>
<br>
<?
endwhile
?>
<input type="submit" name="znach" value="Построить график" accept="text/xml" onClick="document.getElementById('one').contentWindow.location.reload(true);">
</form>
<script type="text/javascript">
$(function() {
$('#form_id').submit(function(e) {
e.preventDefault();
var form = $(this);
if (!form.find('input:checked').length) {
alert('Выберите вариант ответа');
return;
}
$.ajax({
type: 'post',
url: 'drawline.php',
data: form.serialize(),
success: function(result) {
$('#form_id').html(result);
}
});
});
});
</script>
<?
}
else echo '-Нет диаграмм';
?>
и вот исходя из значения радиобаттона, по нажатию кнопки обновлялся фрейм. Кажется, я не понимаю чего то банального