Posts by user1811893 • 609 points
18 posts
-
2
votes2
answers1136
viewsA: Update echo on a page every minute
PHP does not refresh on the page so You can initialize your javascript with the server date: <?php date_default_timezone_set('America/Sao_Paulo'); ?> <div class="date">BR, <span…
-
1
votes2
answers739
viewsA: How to add +10 whole seconds to date in a loop in PHP
I don’t understand exactly what you’re trying to do. But this code will list exactly what you want. Let me know if it’s not what you need. Please publish some excerpt of your code so I know better…
-
0
votes2
answers956
viewsA: PDF Decode Base64
By its code, php would force a download, even if the pdf was corrupted, I believe your problem is the "ajax-link". If you try to pick up the content using ajax, you will get the raw pdf content.…
-
1
votes1
answer651
viewsA: How do I insert variables from a select query into a database on a different server?
At this point in the competition you shouldn’t be using mysql_*, it’s depreciated, php7 no longer works, you should be using Pdo, mysqli_ or some framework. But if you insist on using mysql_…
-
3
votes3
answers1284
viewsA: Compare accented letters with accented letters
There is no native function that does this. What I would say to do is to create a function that takes out the accents before comparing. example found here function tirarAcentos($string){ return…
-
2
votes2
answers213
viewsA: Erase everything except the smallest one per day
I don’t know about performing, but sql will delete all prices that are not the lowest price of each product on smaller days than today. Some Where should improve performance. DELETE `precos` FROM…
-
1
votes3
answers425
viewsA: Get the first 3 results in a query mysql_query
I took the liberty of making some changes to your code. Note, you should not use mysql_, they are deprecated functions and will no longer work in future versions of php. Use mysqli_. Note: Test the…
-
2
votes2
answers148
viewsA: (if/if) with check box
if(in_array("Teste",$_POST["membroarray"]) && in_array("Léo",$_POST["membroarray"])){ } elseif(in_array("Teste",$_POST["membroarray"]) xor in_array("Léo",$_POST["membroarray"])){…
-
1
votes2
answers506
viewsA: Autoload of Models in Laravel 5.1
The autoload is still there, it just depends on how you want to call the class Normal namespace App\Http\Controllers; class UsersController extends App\Http\Controllers\Controller { public function…
-
2
votes1
answer43
viewsA: Function similar to strip_tags
I don’t quite understand what you need, you just want to allow span in any case or have rule? Do you still want content within the P? What’s wrong with strip_tags($string, '<span>'), I think…
phpanswered user1811893 609 -
2
votes1
answer133
viewsA: use COUNT and insert X DIV in X quantity
<div class="inserida_pela_php"> <?php $count = 9; for ($i = 1; $i <= $count; $i++) { echo '<div class="div_qualquer">' . $i . '</div>' . "\n"; if ($i % 3 == 0 && $i…
phpanswered user1811893 609 -
2
votes4
answers7856
viewsA: Calculate Total Hours by identifying Equal Time Intervals
You can create a process and in this process calculate the time. I have never worked with sql server, so I don’t know how to create this Procedure and most likely my query is not the most…
-
1
votes2
answers560
viewsA: Select 2 related and 1 unrelated tables in a query
This query will list all products/vehicles with all schedules SELECT p.*, v.*, ags.* FROM produtos AS p JOIN veiculos AS v ON p.id_veiculo = v.id_veiculo and v.id_transfer = p.id_transfer JOIN…
-
1
votes1
answer3353
viewsA: Opening new page and then running header
I believe you don’t need PHP for this function. send your post to a new tab. <form action="pagina.php" type="post" target="_blank"> <input name="test" value="1" /> <input…
-
1
votes1
answer539
viewsA: How to upload using php without forms
I found reading the file unnecessary, here a simple example. of a set in your code, this should work. <?php if(!empty($_FILES) || !empty($_POST)){ var_dump($_FILES, $_POST); die; } $ch =…
-
2
votes2
answers2142
viewsA: Problem when comparing hours
Dude, analyze your code. You open at 14 and close at 2. You have to consider this. 14 is greater than 2. <?php $horario = strtotime('1:00'); $abertura = strtotime('22:00'); $fechamento =…
-
1
votes3
answers1072
viewsA: Regex pick certain digit size and or symbol
Adir’s solution is good, just one small detail, should be \b\d{9}\b!? to display yes or no !
phpanswered user1811893 609 -
3
votes1
answer1674
viewsA: image extension check for upload with php
I don’t know for sure, but it seems your code is with I invalid. // errado if (!preg_match('/^îmage\/(pjpeg|jpeg|png|gif|bmp|jpg)$/', $foto['type'])) { echo 'errado'; } // certo if…
phpanswered user1811893 609