因此,我有一个按钮可以在同一页面中提供指向模式的直接链接。
这是按钮和网址
<a data-toggle="modal"
href="main_user.php?user_id=<?php echo $user['user_id']; ?>#myModal"
class="btn btn-warning">
Run Code Online (Sandbox Code Playgroud)
(我试着重复$user_id之前的内容#modal)是吗?
单击按钮后,将出现模式。这是带有形式的模态。
<form class="form-login" action="action/doEditUserStatus.php" method="post">
<div class="login-wrap">
<div class="changestatus">
<p>Banning or Activing User Status</p></div>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-success active">
<input type="radio" name="options" value="1" autocomplete="off" checked> Actived
</label>
<label class="btn btn-primary">
<input type="radio" name="options" value="2" autocomplete="off"> Banned
</label>
</div>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Cancel</button>
<button class="btn btn-theme" name="modalSubmit" type="submit">Submit</button>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
然后我尝试提交模态表单,但该操作无法读取$user_id我之前放置的内容#modal。
更新:表代码:
这是我的桌子:
<tr class="success">
<th …Run Code Online (Sandbox Code Playgroud) 我这里有点问题.我尝试将图像转换为字符串base64,之后我想将字符串保存到MySQL中的blob中.因此,blob可以显示在移动应用程序上.
这是我的代码:
$data = file_get_contents($_FILES["picture"]["tmp_name"]);
$image = base64_encode($data);
Run Code Online (Sandbox Code Playgroud)
我已经成功将blob保存到MySQL中,但我无法在网站上显示图像.
<td> <img src="<?php echo base64_decode($user->getPicture()); ?>"></td>
Run Code Online (Sandbox Code Playgroud)
因为结果是: ??????? and many more
我错了吗 ?请纠正我:)