Posts by Marcos • 1,407 points
59 posts
-
1
votes1
answer1688
viewsA: How to get the URL or anchor on a One-page
You can make the link like this: <a href="#depoimentos">Depoimentos</a> And you mark the position on the page like this: <a id="depoimentos"></a> So when someone clicks on…
-
1
votes3
answers327
viewsA: Fatal error: Maximum Execution
Your loop is wrong. In the second parameter of for utilize == instead of =. The way you did it is always changing the value of the variable $contador to 1 and never leaves the for, generating an…
-
8
votes3
answers759
viewsA: Comparison between a numeric string and an alphanumeric string
To avoid confusion at the time of comparison use === instead of ==, so beyond the content PHP will compare the type too. var_dump("1" === "1e0"); // false String "1" is different from string "1e0"…
-
0
votes5
answers1501
viewsA: How to take the name of the variable used in the function argument?
Try it like this: script1.php $data['variavel'] = 1; getData($data); or else getData(array('variavel'=>1)); script2.php function getData($arr){ extract($arr); include 'script3.php'; } script3.php…
-
2
votes2
answers196
viewsA: How to write this Mysql code correctly?
Without the error it is difficult to help, but it seems that you are using the wrong function to go through the result. Try to change the $resultado->fetch_array() for…
-
5
votes2
answers86
viewsA: PHP Application Class
No, PHP handles each request in isolation, the only way to exchange data between sessions are cookies, Sessions or an external data source (database, files, etc). More information in the…
-
0
votes6
answers261
viewsA: Parser Bbcode ignore what is inside [code]
You can do with regular expression like this: <?php function removeBB($texto) { $regex = '|[[\/\!]*?[^\[\]]*?]|si'; return preg_replace($regex, '', $texto); } $s =…
-
1
votes2
answers387
viewsA: Field validation Yiiframework
Apparently your model is not validating the phone field. Check if in the method rules() from your model there is the validation rule for the phone field. It would be something like this:…
-
2
votes2
answers327
viewsA: syntax criteria using Yii framework
You can do it like this: $criteria->compare('caminho', $_POST['busca']); This way Yii already filters against SQL Injection. In the form below - as the milz response - the system is vulnerable to…