Posts by Cassiano José • 1,385 points
46 posts
-
0
votes1
answer28
viewsQ: Replace value after tag, but inside div
I have the HTML code, and I need to replace the decimal value at the end of the div, the project is doing a reverse proxy of a site, and I have to put the value of the tag "changed" in the place…
-
0
votes1
answer114
viewsQ: Select result, and show only if all are equivalent
I’m maintaining a database, and I’m in the next situation; in the bank I have 5 columns in a table, are: ID(PK)|Idticket|Result|Prestadoconta|Date I have to filter for the user to see, only the…
-
-1
votes1
answer102
viewsQ: Calculate miscellaneous percentages
I have a sales system, where each user has an X percentage on their sale, at the moment I have 15 users, 10 of them with 5% profit on each sale, and the other 5 have 8% profit on each sale. So I…
mathematicsasked Cassiano José 1,385 -
15
votes6
answers2755
viewsQ: Is it bad practice to use only static methods in a class?
I was studying further sinking the OOP, learning more advanced concepts such as Polymorphism, Override, Classes and final methods, abstraction, namespace and etc... I learned about static methods,…
-
2
votes2
answers162
viewsQ: Automatic line break with regex
I have the following string: $var = "Saudi Arabia U23 x South Korea U23"; I want to divide the names that are separated by "x", I did the following: $arr = preg_split('/[v|x]/', $var); I used "V e…
-
0
votes1
answer120
viewsQ: Open only one instance
I’m in trouble, I want to open a window with window.open in a chat, this is how, when a user sends a message, the main panel receives the message by socket using websocket.onmessage, then opens a…
-
3
votes1
answer739
viewsQ: How to show the number of Mysql repetitions?
I have a bank in which are registered names and surname, I can group the results as follows: SELECT DISTINCT * FROM usuarios GROUP BY sobrenome So if you have 80 records repeated of the surname…
-
3
votes1
answer2393
viewsA: ERROR " Call to a Member Function setCodigo() on a non-object in"
I don’t know what your entire code looks like if you use require correctly, but from what I saw, you didn’t start the class using new, and is already using the variable $usuario . You have to…
-
2
votes1
answer110
viewsQ: How to group values and process them for the comic?
I have a BD that contains 16 fields of information, this BD keeps bets placed on a system, to later be able to process the result and payment of the customer’s ticket. In the administration part,…
-
0
votes2
answers447
viewsA: I cannot read the json PHP-encoded array
The @Guilherme Reply is plausible, apparently this is the problem. As he may have already solved his problem, I rewrote his code without using the $.ajax because it is not the best solution, I did…
-
1
votes0
answers84
viewsQ: How to obtain and modify an AJAX request?
I’m creating a supplement to my own study for the Chrome, in the add-on I modify several parts of a website. But now I need to modify a request ajax, the site makes the request before the extension…
-
1
votes1
answer91
viewsQ: How to group comic book values?
I am rephrasing this question more clearly. I have the following challenge; I have a BD that contains 16 fields of information, this BD keeps bets placed in a system, to later be able to process the…
-
1
votes1
answer402
viewsQ: How to create functions for extension
I’m creating an extension, my first extension for Google Chrome, the extension consists of changing elements of any page and change things, but wanted to put a function to a button via onclick, but…
-
3
votes1
answer164
viewsQ: How can I decrease HTML field values with jQuery?
I have a class in PHP who captures the URL from an external site, this site itself returns me a HTML on the model: <div id="isOffered"> <a class="price " href="javascript:;"> <span…
jqueryasked Cassiano José 1,385 -
2
votes1
answer578
viewsA: HTML input showing PHP result
For you to do this, it would be ideal to use jQuery/Ajax, because it would become more dynamic. It would look something like this in HTML: <html> <title>Meu site</title>…
-
2
votes3
answers2002
viewsA: Block access to pages containing ". php" with HTACCESS
options +FollowSymLinks -MultiViews RewriteEngine On RewriteRule ^([^\.]+)$ $1.php [NC,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}\.php…
-
3
votes2
answers1523
viewsA: Parse error: syntax error, Unexpected 'mysql_query' (T_STRING)
You did not assign the variable $sql, forgot the =, to leave working properly use $sql = mysql_query(, don’t use @ before, this will omit the errors, you have to treat them properly not to be with a…
-
3
votes1
answer3079
viewsA: Generating HTML Page by PHP from the database
Well, I’ll give you an example of how more or less I would do, don’t worry about functions you don’t know, and then taking advantage, when you ask here have a code half done, it will make it easier…
-
3
votes1
answer129
viewsA: MVC/ OO events system
You are setting an attribute public and within this attribute, is setting another attribute which is the private, this cannot happen, you cannot define an attribute for a function and within it…
-
3
votes3
answers4057
viewsQ: Get content that is in parentheses using regex
I’ve been studying quite the regex, but I found myself trying to "clear" a text, leaving only the first occurrence, and the data in parentheses, the string is like this: $string = "Mais de - valor:…
-
3
votes2
answers208
viewsA: With or without Wordpress
I would particularly create my own program, with the features I wish for, where I wish. But as you said you are still "studying" PHP, Wordpress should fall like a glove, because it will greatly…
-
1
votes1
answer974
viewsQ: How can I remove the "Inspect element" from Chromium Portable
I am creating a PHP application that will run exclusively with Chromium, this comes from the project php desktop Chromium v1 which can be conferred here. My project is a simple store program running…
-
3
votes1
answer480
viewsQ: How to replace <script> tag data with jQuery?
I’m trying to replace a certain value within a HTML parseado, using the following function I can override values that are within inputs tags, css and etc:…
jqueryasked Cassiano José 1,385 -
6
votes3
answers5382
viewsA: capture information from websites
There are several forms and techniques that can get information from other sites, the name given to this technique is 'parse', many programmers here speak erroneously 'website parsing', if the…
-
0
votes1
answer544
viewsQ: How to update Curl request when calling script
I have a system, which opens an external site inside it, only I have a small obstacle; every time the page is accessed for the first time, the data obtained from the external page are not updated,…
-
4
votes2
answers1907
viewsQ: Pick date and time from a string
I’m looking to "filter" the string to obtain only the date that is on it, the string is in that format: SSC Napoli v Dnipro - Thursday 07/05/2015 16:05 Hours The I want to take is just the…
-
1
votes1
answer1577
viewsA: Check if information already exists in the database
Well, I’m not sure how mysqli works, so I will display a practical method that I would use using the UNIQUE that Bruno said there, I’ll do in PDO, but you adapt to your way! $fone = $_POST["fone"];…
-
0
votes1
answer49
viewsA: Duplication of generated HTML code
If it contains more than one occurrence in while, it will repeat itself twice, causing it to be shown twice its HTML code. You can use the SELECT DISTINCT with the GROUP BY to select only one…
-
5
votes1
answer281
viewsQ: Is it possible to use the "break" argument on a "switch" to interrupt a loop?
When I want to interrupt a loop of one for, while or foreach always use the break; within a if with the following structure: $teste = array(1,2,3,4,5); foreach($teste as $t){ if($t == 3){ echo…
-
4
votes2
answers716
viewsQ: How to prevent POST from outside the server?
I’m creating an app and I didn’t want some smart-ass thinking about changing the path of a POST html to send the values he wants, so I used a method in PHP: $referral=$_SERVER['HTTP_REFERER'];…
-
0
votes0
answers91
viewsQ: Slow parser in PHP
I’m making a parser complete of a website, to change all the hrefs and src, is part of a system that I am developing, today I went to the home of a friend who has the internet of 1Mega only, here…
phpasked Cassiano José 1,385 -
1
votes0
answers400
viewsQ: How to allow javascript content in an iframe?
I need to show a iframe within an HTML page, the problem is that the content Javascript generally does not work: <iframe src="minhapasta/minhapagina.php?url=exemplo.com" width="1600"…
-
8
votes1
answer3746
viewsQ: How to save multiple inputs with the same "name"?
I need to save several input that contains the same "name", but the problem is that it only saves one single result for several. Example: <form method="post" action="guardar.php"> <input…
-
2
votes1
answer997
viewsQ: How to save Cookies from a remote site with Curl?
I’m having trouble saving and reading cookies from a remote site I’m opening with Curl: $cr = curl_init($this->_URL); curl_setopt($cr, CURLOPT_RETURNTRANSFER, true); curl_setopt($cr,…
-
2
votes1
answer69
viewsQ: How to obtain a limited number of occurrences with DOM?
I’m parsing from a website, I want to get some data from it, the data is structured as follows: <div class="interesses"> <span class="tipo" >Tipo 1</span> <span class="tipo"…
-
3
votes1
answer106
viewsQ: What is Javascript Override?
I’m working on a project where I have to do the 'parser' from a remote site to change various contents of it, everything is fine, except the functions that involves javascript/ajax. Functions do not…
-
0
votes0
answers394
viewsQ: How to hide an entire ID-based DIV with PHP?
How can I hide a div entire using PHP? Assuming the HTML file: <div id="e_4046058" class="event active"> <div class="columns"> <div class="eventInfo"> <span…
phpasked Cassiano José 1,385 -
3
votes1
answer209
viewsQ: Recover Javascript-updated HTML using DOM
Is there any way to recover an updated HTML using DOM? The original HTML page is from a remote site, which I don’t have internal access to, and that’s how it is: <div class="content"…
phpasked Cassiano José 1,385 -
2
votes2
answers330
viewsQ: Capture and decrease values of multiple Ivs and inputs
I got it with the help of @Qmechanic73 , make a parser on a remote site, and capture the values between the tags span that is within several div with his determined id, and the span with their class…
-
6
votes4
answers361
viewsQ: Decrease span field value with preg_replace
I am trying to change all the values of the fields it contains span class. Example the site is like this: <div id="isOffered"> <a class="price addBetButton footballBetButton"…
-
8
votes1
answer3373
viewsQ: How to change content on a page?
I’m trying to change some fields of a site, what I want is to open this site at my address, only with some of its contents changed. I’m using the file_get_contents to open the site, but I face two…
-
1
votes1
answer705
viewsA: How to change href by select and onchange using javascript
I got friends! I did something basic: <script type="text/javascript"> window.onload = function(){ mudaLink(); } function mudaLink(){ var selected = document.getElementById(\'lista\').value…
-
2
votes1
answer705
viewsQ: How to change href by select and onchange using javascript
My code is to change the url of 'href' every time the user changes the select. I did once to alter the 'src' of an image, but when I used href it just didn’t work out! <script…
-
2
votes8
answers6579
viewsA: Check user browser in PHP
You can use the $_SERVER['HTTP_USER_AGENT']; and create a verification function: function navegador($user_agent){ if(preg_match('/rv:9.0/i',$user_agent)) { return "ok"; } } With this done, just…
-
6
votes2
answers14096
viewsQ: How to display echo quotes in PHP?
I am developing an application that uses PHP + AJAX and I came across an annoying problem. AJAX only recognizes the function if it is like this: onclick="remover_musica_ftp('0','Deposito de bebida'…
-
2
votes3
answers319
viewsQ: How to display an ajax error through a url?
I have a login/password field, when some user does not fill in one of the inputs, I display a message using ajax like this: $('#loginform').submit(function(event) { // Values var login =…