bonjour j essaye depuis plusieurs jours de faire fonctionner mon script pour ajouter un texte a une page rules.php Quand je mets un texte je reviens toujours sur ma mon cadre du textearea et rien ne s enregistre je vous remets le script d origine car toutes mes modifs ont ete vaines .
D avance merci
Code : Tout sélectionner
<?php
$sql = "SELECT * FROM rules";
$result = mysqli_query($database,$sql) or die(mysqli_error($database));
$rules = mysqli_fetch_array($result);
?>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane fade in active" id="general">
<div class="col-md-12">
<form action="components/update-rules.php" method="post" enctype="multipart/form-data" id="UploadForm">
<input type="hidden" name="rules_id" value="<?php echo $rules['rules_id'];?>"/>
<input type="hidden" name="user_username" value="<?php echo $current_user;?>"/>
<textarea id="post_body" class="form-control" name="rule_txt" value="" style="height:300px;"><?php echo $rules['rule_txt'];?></textarea>
</div>
</div>
</div>
<br>
<div class="submit">
<center>
<button class="btn btn-primary ladda-button" data-style="zoom-in" type="submit" id="SubmitButton" value="Upload" />Edit rules</button>
</center>
</div>
</form>
<script>
Code : Tout sélectionner
<?php include '_database/database.php' ?>
<?php include 'components/authentication.php' ?>
<?php include 'components/session-check.php' ?>
<?php include 'controllers/base/head.php' ?>
<?php include 'controllers/navigation/first-navigation.php' ?>
<div class="container" style="padding-top:50px;">
<h1 class="text-center profile-text profile-name">Edit Rules</h1>
<div class="no-gutter row">
<div class="col-md-12">
<div class="panel panel-default" id="sidebar">
<div class="panel-body">
<?php include 'controllers/form/edit-rules-form.php' ?>
</div>
</div>
</div>
</div>
</div>
et la page rules.php ou est sense s affiche le texte
Code : Tout sélectionner
<?php include '_database/database.php' ?>
<?php include 'components/authentication.php' ?>
<?php include 'components/session-check.php' ?>
<?php include 'controllers/base/head.php' ?>
<?php include 'controllers/navigation/first-navigation.php' ?>
<div class="container" style="padding-top:50px;">
<h1 class="text-center profile-name" style="margin-top:35;">Rules <br /><small> use them to be the best!</small></h1>
<div class="col-md-12 panel" style="border-radius: 20px; margin-top:20px; margin-bottom:20px; padding-bottom:20px; padding-top:20px;">
<?php
$rule = "SELECT * FROM rules ORDER BY rules_id DESC LIMIT 1";
$result = mysqli_query($database,$rule);
while($rule = mysqli_fetch_array($result,MYSQLI_BOTH)) {
?>
<P style="font-family:Verdana, Geneva, sans-serif">
<?php echo $rule['rule_txt'];?>
</p>
<br> <br> by <?php echo $rule['user_username'];?></address>
<?php
}
?>
</div>
</div>
</div>
merci pour votre aide
D avance merci
Code : Tout sélectionner
<?php
$sql = "SELECT * FROM rules";
$result = mysqli_query($database,$sql) or die(mysqli_error($database));
$rules = mysqli_fetch_array($result);
?>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane fade in active" id="general">
<div class="col-md-12">
<form action="components/update-rules.php" method="post" enctype="multipart/form-data" id="UploadForm">
<input type="hidden" name="rules_id" value="<?php echo $rules['rules_id'];?>"/>
<input type="hidden" name="user_username" value="<?php echo $current_user;?>"/>
<textarea id="post_body" class="form-control" name="rule_txt" value="" style="height:300px;"><?php echo $rules['rule_txt'];?></textarea>
</div>
</div>
</div>
<br>
<div class="submit">
<center>
<button class="btn btn-primary ladda-button" data-style="zoom-in" type="submit" id="SubmitButton" value="Upload" />Edit rules</button>
</center>
</div>
</form>
<script>
Code : Tout sélectionner
<?php include '_database/database.php' ?>
<?php include 'components/authentication.php' ?>
<?php include 'components/session-check.php' ?>
<?php include 'controllers/base/head.php' ?>
<?php include 'controllers/navigation/first-navigation.php' ?>
<div class="container" style="padding-top:50px;">
<h1 class="text-center profile-text profile-name">Edit Rules</h1>
<div class="no-gutter row">
<div class="col-md-12">
<div class="panel panel-default" id="sidebar">
<div class="panel-body">
<?php include 'controllers/form/edit-rules-form.php' ?>
</div>
</div>
</div>
</div>
</div>
et la page rules.php ou est sense s affiche le texte
Code : Tout sélectionner
<?php include '_database/database.php' ?>
<?php include 'components/authentication.php' ?>
<?php include 'components/session-check.php' ?>
<?php include 'controllers/base/head.php' ?>
<?php include 'controllers/navigation/first-navigation.php' ?>
<div class="container" style="padding-top:50px;">
<h1 class="text-center profile-name" style="margin-top:35;">Rules <br /><small> use them to be the best!</small></h1>
<div class="col-md-12 panel" style="border-radius: 20px; margin-top:20px; margin-bottom:20px; padding-bottom:20px; padding-top:20px;">
<?php
$rule = "SELECT * FROM rules ORDER BY rules_id DESC LIMIT 1";
$result = mysqli_query($database,$rule);
while($rule = mysqli_fetch_array($result,MYSQLI_BOTH)) {
?>
<P style="font-family:Verdana, Geneva, sans-serif">
<?php echo $rule['rule_txt'];?>
</p>
<br> <br> by <?php echo $rule['user_username'];?></address>
<?php
}
?>
</div>
</div>
</div>
merci pour votre aide