我有这些HTML代码,它们可以从数据库中获取数据。我将数组设置为HTML输入。
HTML代码
<table>
<thead>
<tr>
<th>Category</th>
<th>January</th>
<th>February</th>
</tr>
</thead>
<tbody>
<?php
$sql = DB::getInstance()->FetchArray("select * from table");
if(count($sql) > 0)
{
foreach($sql as $row)
{
$i = 0;
if($i == 0)
{?>
<tr>
<td><input type="text" class="cat1" id="cat1" name="cat1[]" value="<?php echo $row['CATEGORY']; ?>" placeholder="" readonly></td>
<td><input type="text" class="jan1" id="jan1" name="jan1[]" value="<?php echo (($row['MONTH']=='JANUARY')? $row['TOTAL']:''); ?>" placeholder="" readonly></td>
<td><input type="text" class="feb1" id="feb1" name="feb1[]" value="<?php echo (($row['MONTH']=='FEBRUARY')? $row['TOTAL']:''); ?>" placeholder="" readonly></td>
</tr>
<?php
}
else
{?>
<tr>
<td></td>
<td><input type="text" class="jan1" id="jan1" …Run Code Online (Sandbox Code Playgroud) 我在这里需要帮助。我在我的 RHEL 8 服务器中安装了 Laravel
但我收到这个错误。我知道这个问题已经发布了很多次,但我试图遵循这个建议,但到目前为止我没有运气。我不知道为什么。
The stream or file "/var/www/html/vpa/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied
Run Code Online (Sandbox Code Playgroud)
sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache
sudo chmod -R 755 storage
sudo chmod -R 755 bootstrap/cache
sudo setenforce 0
sudo chcon -t httpd_sys_rw_content_t storage
php artisan config:clear
php artisan config:cache
composer dump-autoload
sudo systemctl restart httpd
sudo reboot
Run Code Online (Sandbox Code Playgroud)
似乎没有什么对我有用。我不知道还能做什么。请帮我
目前,我所拥有的是使用 jQuery 的。
代码.html
<input type="text" class="inputnumber" name="inputnumber" value="" placeholder="">
Run Code Online (Sandbox Code Playgroud)
代码.js
$('input.inputnumber').keyup(function(event) {
if(event.which >= 37 && event.which <= 40) return;
$(this).val(function(index, value) {
return value
.replace(/\D/g, "")
.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
;
});
});
Run Code Online (Sandbox Code Playgroud)
现在,我只能在输入字段中添加带有千位分隔符的数字。
1,000,000
Run Code Online (Sandbox Code Playgroud)
但我的目标是允许用户添加带有 2 位小数的千位分隔符,如下所示。
1,000,000.00
Run Code Online (Sandbox Code Playgroud)
我怎样才能在我的代码中实现它?感谢有人可以帮助我解决这个问题。
提前致谢。
需要有人帮我解决这个问题。Laravel 圣所
我已经在我的本地服务器上安装了基本的默认 laravel 8++。
我遵循 Laravel Sanctum 的指示。但我坚持获得HasApiTokens
1. composer require laravel/sanctum
2. php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
3. php artisan migrate
Run Code Online (Sandbox Code Playgroud)
我在我的kernel.php 中添加如下
use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful;
'api' => [
EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
Run Code Online (Sandbox Code Playgroud)
在config>auth.php 中,我将驱动程序更改为“sanctum”
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'sanctum',
'provider' => 'users',
'hash' => false,
],
],
Run Code Online (Sandbox Code Playgroud)
这是我的composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [ …Run Code Online (Sandbox Code Playgroud)