I have my textbox named Title here!は、どのように私はタイトルが最上部のテキストボックスであるPHP
では、私のクエリにテキストボックスの値をコピーすることができます! は、私は私が、これはまさに私のコードです
ここ
$sql_query="SELECT * FROM tblpost WHERE Page = 'A' ";
私のクエリに「A」であるテキストボックスの値をコピーする必要があり、クエリを持っています!私は実際にPHPで新しいですので、これは私の全体のコード
<form method="post">
<div class="form-group">
<label>Page Title</label>
<input name="title" type="text" value="<?php echo $fetched_row['Title']; ?>" required class="form-control" placeholder="Page Title">
</div>
<div class="form-group">
<select class="form-control" name="active" id="active">
<option value="">~~SELECT~~</option>
<option value="Actived">Activated</option>
<option value="Deactivated">Deactivated</option>
</select>
</div>
<div class="form-group">
<label>Meta Tags</label>
<input type="text" value="<?php echo $fetched_row['Tags']; ?>" name="tags" required class="form-control" placeholder="Add Some Tags...">
</div>
<div class="form-group">
<label>Category</label>
<input type="text" name="description" value="<?php echo $fetched_row['Description']; ?>" class="form-control" required placeholder="Add Category...">
</div>
<table class="table table-striped table-hover" id="myTable">
<tr>
<th>Page Title</th>
<th>Status</th>
<th>Date Created</th>
<th></th>
</tr>
<?php
$sql_query="SELECT * FROM tblpost WHERE Page = //I think it's right here ";
$result_set=mysql_query($sql_query);
while($row=mysql_fetch_row($result_set))
{
?>
<tr>
<td><?php echo $row[1]; ?></td>
<td><?php echo $row[3]; ?></td>
<td><?php echo $row[6]; ?></td>
<td><a class="btn btn-primary" href="javascript:edt_id('<?php echo $row[0]; ?>')">Edit</a> <a class="btn btn-danger" href="javascript:delete_id('<?php echo $row[0]; ?>')">Delete</a></td>
</tr>
<?php
}
?>
<script>
function myFunction() {
var input, filter, table, tr, td, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</table>
<center> <button type="submit" class="btn btn-primary" name="btn-update"><strong>UPDATE</strong></button> <button type="submit" class="btn btn-default" name="btn-cancel"><strong>Cancel</strong></button></center>
</form>
あなたはtextboxの値をquery.riteにコピーしたいですか? – user3386779
@ user3386779はいあなたはまさに正しいです!私は昨日以来の問題を抱えています –
私はあなたが戻ってPHPにもっと読む必要があると思います。 PHPはサーバー側の言語であり、ユーザーがフォームを送信するまで、またはJavaScriptのデータがサーバーに返信されるまで、ユーザーがWebページに入力するデータには対応できません。 この例を見てくださいhttps://www.w3schools.com/php/php_form_complete.asp – scotty3785