Posts by pc_oc • 3,530 points
91 posts
-
4
votes1
answer3697
viewsQ: make payment in paypal without requiring the customer to register without account
I am using the following API to make payment via paypal. http://www.webmaster.pt/formulario-recebimento-paypal-4281.html What I see when I make the payment is this:: That is, I do not want to force…
-
0
votes2
answers181
viewsA: Relation between 3 tables and find the result of last week mysql
I ended up using the following solution: <?php date_default_timezone_set('Europe/Lisbon'); $data_actual = date("Y-m-d"); $data_last_week = date('Y-m-d', strtotime($data_actual. ' - 7 days'));…
-
2
votes4
answers2195
viewsQ: Fetch date 7 days before current php date
In PHP I wanted to fetch the first day and the last day of the last 7 days. I have the current date: $data_actula = date("Y-m-d"); Now I want to get the date 7 days ago. For example, today is day…
-
1
votes2
answers181
viewsQ: Relation between 3 tables and find the result of last week mysql
I have three tables, the tbl_recursos, tbl_categorias and the tbl_categoria_recurso. To tbl_recursos is the listing of resources posted by the user. A tbl_categorias are the categories a resource…
-
2
votes1
answer569
views -
0
votes1
answer39
viewsQ: Change a relation between two mysql fields
I have my event schedule (tbl_eventos), where I am going to find the id_contact field of the contacts table (tbl_contactos). To create this link, I used the following: ALTER TABLE `tbl_eventos` ADD…
-
4
votes2
answers7318
viewsQ: show a div depending on the selected select
I have a select, and depending on the choice of that same select, a form will be shown to insert a contact. I have to bear in mind that the first option of select already has the form to be shown by…
-
17
votes3
answers7027
viewsQ: Match php variable to javascript variable
I’m trying to do something like this: <script type="text/javascript"> function guardar_alteracoes(){ <?php $nome = ?>$('#nome').val();<?php; ?> } </script> That is, I want to…
-
2
votes1
answer3086
viewsQ: Fullcalendar fetch data from php database
I’m generating a calendar for a website, and I’m obligated to use the tool fullCalendar. The point is to fetch the events by php from my database. In js, the data is listed in the following…
-
3
votes4
answers425
viewsQ: Query BD and show all results except the first
I have the table tbl_galeria, what happens is that I want to make a consultation, but the consultation cannot show the first result. That is, the query will return all values except the one with the…
-
3
votes1
answer556
viewsQ: Find character in a php array
Imagining that I have the following array: $o_meu_array = array("123_rui", "125_joao", "287_manuel"); Now I want to find inside my array "123". When I find 123, I want to replace 123 with another…
-
3
votes2
answers742
viewsQ: Ajax does not return text in utf-8
By ajax, I am making a query the Database, but if the field has special characters, they appear badly. I am ordering in the following JS function, the result is shown in a div with id="txtHint"…
-
1
votes1
answer147
viewsQ: Error posting to a facebook fanpage using php
I have on two servers exactly the same php code. The code shares content from my site on a fanpage. The point is that on one of the servers the code stopped working and the following image error…
-
7
votes1
answer41918
viewsQ: Traverse string and replace a specific PHP character
I wanted to replace, in a string, all character occurrences & by a e (or remove it). The character may be in the middle of a word or appear several times in the same string. Example: Original…
-
3
votes2
answers923
viewsQ: utf-8 encoding in XML file to generate RSS
On a news site I want to generate an RSS page with the news of the day. The page is well generated, but if when generating there is a news with accents or special characters the generation fails. In…
-
8
votes1
answer1520
viewsQ: Automatically publish to Twitter from the PHP website
I’m developing a backoffice in PHP. And every time the administrator adds a product, that product will be automatically published on Twitter. On Twitter will appear: the name of the product your…
-
5
votes2
answers1644
viewsQ: How to store files in the browser cache
I tried a Google tool to test the speed of my site. http://developers.google.com/speed/pagespeed/insights/ I was shown several points that need to be corrected, such as "Take advantage of browser…
-
4
votes2
answers275
viewsA: Dar height and overflow-y in a div
You have the height(height) in %. Experiment in px: <div id="divListaEstabs" style="height: 60px; overflow-y: scroll;"> <input type="checkbox" id="selectall">Seleccionar todos <br…
-
0
votes1
answer1926
viewsQ: validate php image size
I’m getting an image $image which has the image path (Ex: ./files/full/image.png). What I want to do is search the size of the same, height and width, and validate if it is greater than a predefined…
-
1
votes3
answers5992
viewsQ: submit form from a select
I have a <select> with several options, when selecting an option, I want the form to be submitted to the same page and I will fetch the value by php on the same page. For that, I have the…
-
2
votes1
answer422
viewsQ: Match javascript variable to php variable
I have a form, and before the form is submitted I want to validate if the field nome_carro exists the same in the database. To do this validation I am using javascript. On the form I have the…
-
11
votes1
answer21808
viewsQ: E-mail with PHP attachments
I am sending an email, everything works fine. Now I wanted to add some files as an attachment. I have the following code: $from = $_SESSION['email_cliente']; $email_destino = "[email protected]";…
-
5
votes4
answers6094
viewsQ: Side banner that accompanies the scroll
I wanted to add a side banner, depending on the scroll, the banner would accompany the page. The picture shows what I want to do: But the banner can never cross some boundaries, IE, can not go over…
-
8
votes2
answers27342
viewsQ: Submit form with <a href=""> instead of <input="Submit">
I was given a layout of a form: <form method="post" action="" id="mail_form"> <div id="newsletter"> <input type="text" name="email_newsletter" /> <div class="newslink">…
-
2
votes5
answers5103
viewsA: Mail() function does not send email
Try this (keeping in mind that the SMTP service is working correctly on the server): $name = $_POST['name']; $email = $_POST['email']; $carga_type = $_POST['carga_type']; $weight = $_POST['weight'];…
-
2
votes3
answers2432
viewsA: List months by year in mysql
I got there this way: <?php $sql = mysql_query("SELECT DISTINCT YEAR(data) AS ano, id AS id FROM tbl_noticias GROUP BY ano"); while($row = mysql_fetch_array($sql)) { $ano = $row['ano']; echo…
-
5
votes3
answers2432
viewsQ: List months by year in mysql
Here’s what I’m trying to do php and mysql: What is in parentheses is the number of results within each month. For this, I am saving in my database, in the table tbl_noticias the field data of the…
-
5
votes2
answers178
viewsQ: Absolute ordering by data returned from DB
In PHP I am making a query to my database using Mysql. In my database I have the table fotos_album and inside I have the name of the photo. I want to sort the table by field nome. We imagine that…
-
19
votes3
answers32219
viewsQ: Fetch last 7 days data from current date
I’m making a BD query, and I want to receive results from the last 7 days from the current date. For that, I have a field data of type DATA (yyyy-mm-dd) in table. I am doing the query in php, in…
-
5
votes2
answers97
viewsQ: Remove banner depending on window size
I’m using a template with the Responsive layout. I have a banner on the right side of a website. What I’m doing is scrolling the page and the banner goes with the page. When I scroll down, the…
-
2
votes2
answers1657
viewsQ: How to display Google Analytics results on the website?
I’ve been using Google Analytics for some time, but now I wanted to show the results on a page. I have some problems understanding how it works. I would like you to advise me a guide/tutorial or…
-
9
votes3
answers465
viewsQ: Hide image generated by Javascript
I am using the sharethis plugin to share content on social networks. For this I am making the following call: <script type="text/javascript"…
-
1
votes2
answers1217
viewsA: Error forcing download: Cannot Modify header information
Create the pdf_server.php file with: <?php header("Content-Type: application/octet-stream"); $file = $_GET["file"] .".pdf"; header("Content-Disposition: attachment; filename=" .…
-
2
votes2
answers1217
viewsQ: Error forcing download: Cannot Modify header information
By clicking a link, I wanted to download a file. The file path comes from the database. The file download path is correct, something like "catalogo/catalogo_janeiro.pdf". <?php $sql =…
-
23
votes2
answers29551
viewsQ: Simple paging in jQuery/Javascript
I’m looking for a simple pagination, no CSS styles, nothing like that. Only with the buttons below to change page and with the elements on top. I’m asking because the examples I find are a little…
-
6
votes4
answers6021
viewsQ: Exchange text by clicking on it to display/hide an element
I have the following example done in Javascript, of which is a text written "See more", that when you click on it you can see more text: Example in Jsfiddle Code <head> <title>…
-
-1
votes2
answers93
viewsQ: Refresh a window when I close another
I have a page with a list of photos. When the user clicks on "add photos", another tab opens in which the user can add photos. But at the end of inserting them, this tab is closed. What I wanted,…
-
8
votes4
answers3248
viewsQ: How to implement a textarea responsibly?
I want to use a <textarea>, but instead of using rows="4" cols="100", wanted to wear something like this: style="width: 80%" so that the layout is responsive. But since this does not work, IE,…
-
2
votes1
answer1213
viewsQ: conflict with jquery googleapis
I am importing several Aces to the same site, the problem is some stop working. For example, one api to make an autocomplete, another to make an effect in the menu and another to a feedback box. Is…
-
3
votes3
answers2188
viewsQ: Use symbol in input text, and disappear when typed
I have a text box, a input type text. And I wanted to insert an image in the corner, for example, a magnifying glass. And when the user starts writing, that magnifying glass disappears. It is…
-
3
votes8
answers4914
viewsQ: Do not allow saving image of a web page
I don’t want the "save image as.." option to appear when I right-click an image on an HTML page. That is, it will be impossible to save images from the site. How can I do this check?