Posts by pc_oc • 3,530 points
91 posts
-
2
votes1
answer297
viewsQ: Open email client with attachment file
I am trying to open my email client (for example Outlook) with the following: <a href="mailto:[email protected]?subject=Assundo email&body=Corpo de email"> Send mail</a> Now I’d…
-
2
votes1
answer200
viewsQ: Alternative money_format in php in windows
When using money_format in windows, the function does not work because the function is only compatible with strfmon systems. $number = 1234.56; setlocale(LC_MONETARY, 'en_US'); echo…
-
1
votes2
answers120
viewsQ: Sum of values taking into account 3 table fields
I have the following table quotations that serves to fetch the totals of various budgets. And each budget has one piece (part_id) which can have several:…
-
1
votes1
answer603
viewsQ: retrieve all records from the last 12 months including zero
I have my table bud_quotations and I want to retrieve all the records that have been entered in the last 12 months, including the months that have no record. Now the count is not working, always…
-
0
votes0
answers781
viewsQ: SQLSTATE[HY000]: General error: 2053 when do I call a Stored Procedure?
I’m using Laravel 4.2 and I’m calling one Stored Procedure of a database on the server. Locally everything works fine, but on the server, using the same BD, gives error. The call is as follows:…
-
3
votes3
answers310
viewsQ: Add variables to Auth 4.2
I have my Auth session, which returns user data: print_r(Auth::user()); In this section, I want to add the company data associated with the user. In my model User, added the following: public…
-
0
votes2
answers178
viewsQ: Fetch content from a td from a class
I have the following lines within a table: <table id="table_marcas"> <tr> <td>Nome</td> <td class="template">Óleos</td> <td…
javascriptasked pc_oc 3,530 -
2
votes1
answer138
viewsQ: Search name region/city php
I am using Yahoo’s Weather API. The point is I want the time to be displayed for the user’s location. Considering I’m wearing the following: $BASE_URL = "http://query.yahooapis.com/v1/public/yql";…
-
6
votes3
answers878
viewsQ: sort multidimensional array php
I have the following array returned from a webservice (in the image I identify what I want, below the text for copy): Array ( [DataTable] => Array ( [ID] => STOCK [Line] => Array ( [0]…
-
4
votes2
answers1261
viewsQ: Do not insert zeros to the left of a number
I have n inputs, which are created dynamically. What happens is that they cannot accept zeros left on the following occasions: 0.24 -> The system accepts 00.24 -> The system automatically…
javascriptasked pc_oc 3,530 -
4
votes2
answers545
viewsQ: Find string inside a php tag
When using in various types of embed from various websites, go only search for the link. For example: Youtube: <iframe width="420" height="315" src="https://www.youtube.com/embed/HLhuNbO0egU"…
-
7
votes4
answers327
views -
3
votes2
answers1665
viewsQ: edit docx file and save to PDF in php
I have a docx file, my goal is to edit docx, edit a specific string (do something like str_replace), and finally save the file in PDF. docx as an xml zipped file, I’m thinking of editing from there.…
-
3
votes2
answers581
viewsA: Retrieve PHP combobox information
Quite possibly your header is poorly built and select is not closed: <form name="contactForm" method="post" enctype="multipart/form-data" action="cadastrojogador.php"> <select…
-
4
votes1
answer1705
viewsQ: Limit the number of characters of javascript decimals
You can enter values into an input text. What happens is that I want to limit the number of characters after the point. Valid example: 2.324 2343423.432 That is, the user cannot enter more than…
-
7
votes2
answers400
viewsQ: use regex in php explode function
I’m doing a query on my DB, and we can do an identical query on this: "hello world" "pacific ocean" What happens is that I can search for several strings at the same time: Expected result: String1:…
-
2
votes1
answer2301
viewsQ: Not receiving negative numbers in an input
I have the following code: http://jsfiddle.net/ntywf/1987/ $(document).ready(function () { $('input').keyup(function() { var $th = $(this).val(); $th = $th.replace(/[-]/g, ""); $(this).val($th)…
-
0
votes2
answers2260
viewsQ: Fill div with ajax result
I have an ajax request with the following code: <script type="text/javascript"> function AddVoto() { $.ajax({ type: "POST", url: "{{url('votos/adicionar/')}}/{{{$postagem->id_postagem}}}",…
-
1
votes2
answers55
viewsA: tooltip always present
I resolved so: $(function() { $('input.age').mouseleave(function(e) { e.stopImmediatePropagation(); }).tooltip({ content: function() { return $(this).attr('title'); } }).tooltip('open') }); <link…
-
1
votes2
answers55
viewsQ: tooltip always present
I have the following code: http://jsfiddle.net/56bv52us/ What I’m trying to do is the message keeps popping up, which means you don’t have to mouse over it to get the message out, it’s always there.…
-
0
votes1
answer2825
viewsQ: query between 2 tables
I have the product tables(tbl_products) and the categories table(tbl_categories): - tbl_produtos - id_produto nome id_categoria - tbl_categorias - id_categoria nome What I want is to present in the…
-
2
votes3
answers140
viewsQ: Search results in 3 tables with the date of the last 5 days
I have the following tables: What I’m trying to do is get the user name that has no record on tbl_votos and no recourse in tbl_recursos in the latter 5 days. I’m using php and mysql.…
-
1
votes0
answers107
viewsQ: Gmail blocks server when trying to log in
I am using a google Analytics api in php to show my site the data of Analytics. What happens is, when you authenticate, google blocks access to the server. I had this problem a long time ago with…
-
3
votes1
answer2044
viewsQ: query by day number of Mysql week
The week has 7 days, so I want to be able to make a query that the user according to the day of the week you choose presents the result: mysql_query("SELECT * FROM tbl_eventos WHERE WEEK(data) =…
-
2
votes1
answer325
viewsQ: change page 10 query in 10 seconds
I have a page that lists all my events from the event table (tbl_eventos). I want to list all the events of the first week of the year, last 10 seconds, list all the events in the second week of the…
-
5
votes1
answer1390
viewsQ: How to insert into a database with special characters?
Here’s what I’m doing INSERT: $result = mysql_query("INSERT INTO tbl_livro VALUES (NULL, '$titulo', '$autor_livro')"); What happens is that there are authors who have names with special characters,…
-
4
votes1
answer162
viewsQ: Query to sort by two Mysql dates
I have my table tbl_noticias with two dates of the type date: data_criacao_noticia and data_atualizada_noticia. The aim is for the listing to be ordered as follows: if the data_atualizada_noticia is…
-
7
votes2
answers7907
viewsQ: Convert XML to PHP array
I’m fetching article names by this link:…
-
6
votes3
answers1870
viewsQ: Search book details with Google Books API in PHP
I’m using the Google Books API to get the details of a book: And to get the details of a book, by searching for the name, I’m using the following example provided by them, of this case the file…
-
0
votes2
answers2173
viewsA: Change "with.example" from an android app
I solved the problem as follows: I opened a file with Notepad++ I have searched all files by "com.example" and replaced by another name I saved changes and it worked…
-
3
votes2
answers2173
viewsQ: Change "with.example" from an android app
I am trying to put an application in the Playstore, but the following error appears: "You have to use a different package name because "com.example" is restricted." The thing is, I’ve already…
-
5
votes1
answer11223
viewsQ: Blocked cross-origin request
I am using an Elsevier API to fetch a book listing. To do this, I am using an example of them present at this link: http://apihtmlgen.elasticbeanstalk.com/sd_search.html I made my registration, I…
-
2
votes1
answer454
viewsQ: Search results for an API in php/json
I am using the following API: http://api.elsevier.com/documentation/SCIDIRSearchAPI.wadl It is a database of books/ documents and I need to access there to get some records. I already have the…
-
2
votes3
answers1873
viewsA: if condition with Javascript inside PHP
Try it like this: <?php echo "<SCRIPT> string_patr = ".$string_patr."; string_seri = ".$string_seri."; if(string_patr == null){ vv_patr = string_seri; } else{ vv_patr = string_patr+','+…
-
1
votes3
answers415
viewsA: Use PHP variable in JS file
If you are trying to write PHP code inside a file .JS is not possible. Since the server will not read the PHP inside. If you only have that code in that file, I advise you to put the code inside the…
-
1
votes2
answers215
views -
1
votes2
answers215
views -
1
votes3
answers615
viewsQ: Save file name with empty spaces html/php
I have the following button that goes to a file: <a href="download_file.php?file=ficheiro_xls/BD%20Fugas%20Gespost.xls">Download XLS</a> In the file download_file.php I have the…
-
2
votes1
answer668
viewsA: Create xls file and store in a folder
HTTP headers are part of the HTTP requests and responses that are sent when communicating over a network. They hold information about the client, the server, the information to be sent and more. If…
-
3
votes1
answer668
viewsQ: Create xls file and store in a folder
I have my file gerar_xls.php and is creating a file .xls and I want to keep it in a folder. What you are doing now is downloading the file. I have the following: header("Content-type:…
-
2
votes1
answer161
viewsQ: jQuery File Upload - Angularjs
I have moved a site from one server to the other. I am using this tool to upload files: here. Now on the new server, when selecting more than one file I cannot upload the image, that is, it is not…
-
2
votes1
answer64
viewsQ: Search all records for a respective year and month
In my BD I have the date field of type date (YYYY-mm-dd). What happens is I want to fetch all the records for a given year and month. For example, I want to get all the records for 2014 of the month…
-
1
votes3
answers591
viewsQ: Find joomla session variables for php
A client has a site made in joomla, and I have to integrate the login that he does on his site to my site in php. But I don’t know how to get joomla session variables. How can I get them? Or how can…
-
8
votes3
answers3330
viewsQ: Convert a date to the name of the day of the week
I am receiving from my database several dates entered by the user (the field is of the date type (yyyy-mm-dd)). What I want is to take that date and convert it to the name of the week day. For…
-
5
votes2
answers15380
viewsQ: open new php window
On the site I have several advertising banners. When I click on a banner, I am redirected to a page that counts clicks on the banner. After this count I am redirected to the page before the banner…
-
1
votes1
answer116
viewsA: Search 3 results from the same table grouped by the same id
$result = mysql_query("SELECT * FROM tbl_ocorrencias GROUP BY id_viatura ORDER BY data, hora DESC",$conn); while($row = mysql_fetch_assoc($result)) { $id_viatura = $row['id_viatura']; $sql1 =…
-
1
votes1
answer116
viewsQ: Search 3 results from the same table grouped by the same id
I have the tbl_ocorrencias which records occurrences of a particular vehicle. That is, the table consists of the following: - tbl_ocorrencias - id_ocorrencia id_viatura data hora In this case, an…
-
2
votes2
answers4811
viewsA: Create CSV file from PHP
I ended up doing it this way: <?php $table = 'nome_tabela'; $outstr = NULL; header("Content-Type: application/csv"); header("Content-Disposition: attachment;Filename=cars-models.csv"); $conn =…
-
3
votes2
answers4811
viewsQ: Create CSV file from PHP
I want to create an XSV file from PHP. What I want is to be able to create columns and give background color to an element for example. I have the following: <?php header("Content-type:…
-
1
votes1
answer149
viewsA: Php missing dates 10 days
Let’s imagine that the date is 2014-07-29, to fetch 10 days behind this date just do the following: <?php //Precisa de definir a função abaixo para evitar warnings…