Du verwendest ja Bootstrap und das macht es schon mit Javascript.
Ich habe das Ganze mal auf das Wesentliche reduziert und ein Demo gemacht, dort kannst Du ablesen, wie die Übergabe über ein data-Attribut funktioniert:
<!doctype html>
<html>
<head>
<title>test</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js" integrity="sha384-pjaaA8dDz/5BgdFUPX6M/9SUZv4d12SUPF0axWc+VRZkx5xU3daN+lYb49+Ax+Tl"
crossorigin="anonymous"></script>
</head>
<body>
<div>Hallo wie geht es dir?
<a style='margin-top: -2px; margin-bottom: -2px; width: 100px;' class='btn btn-raised bg-red btn-block btn-xs waves-effect'
data-toggle='modal' data-target="#modal" data-message="Hallo wie geht es dir?" name=''>
Editieren</a>
</div>
<div>Hallo wie geht es Ihnen?
<a style='margin-top: -2px; margin-bottom: -2px; width: 100px;' class='btn btn-raised bg-red btn-block btn-xs waves-effect'
data-toggle='modal' data-target="#modal" data-message="Hallo wie geht es Ihnen?" name=''>
Editieren</a>
</div>
<div class="modal fade" id="modal" tabindex="-1" role="dialog">
<form method="post">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="text-align: center">
<h4 style="display: block; margin: 0 auto;" class="modal-title" id="largeModalLabel">Testmodal für Nachricht.</h4>
</div>
<hr style="width: 90%; margin-left: 25px;">
<div class="modal-body" style="margin-top: -30px">
<div class="form-group">
<br>
<p id="p-username" style="font-weight: bold">Die Nachricht:</p>
<div class="form-line">
<input id="input-message" type="text" name="message" class="form-control" value="" autocomplete="off">
</div>
</div>
<br>
</div>
<div class="modal-footer" style="display: block; margin: 0 auto;">
<button name="submit" class="form-control btn btn-primary btn-link waves-effect" style="color: white; width: 250px">E-Mail Adresse ändern</button>
</div>
<br>
</div>
</div>
</form>
</div>
<script>
$('#modal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var msg = button.data('message') // Extract info from data-* attributes
var modal = $(this)
modal.find('#input-message').val(msg);
})
</script>
</body>
</html>
Alles anzeigen
Wenn Du es mit PHP machen möchtest, so ist das auch möglich, indem Du für jede Nachricht ein eigenes Modal definierst und über dessen ID und data-target jeweils das richtige öffnest, so wie ich es ebenfalls in dem vorigen Thread beschrieben hatte.