Posts by GWER • 2,242 points
54 posts
-
2
votes1
answer1159
viewsQ: Changing modal content with Javascript
Good morning, I know very little about Jquery and Javascript (almost nothing) and I have a problem. Is the following: On my site I have two buttons, which open a modal (generated with css). The…
-
2
votes3
answers55998
viewsQ: Run php function with onclick
I want to know how I can run a php function with the onclick event on an element a, taking as an example: <a href="">Teste onclick</a> And the function: function testeOnclick() { echo…
-
2
votes3
answers1490
viewsQ: Changing the modal content
I have this html: When I click on saiba mais, a modal is opened with the information according to the plan. The html and modal content is basically this: <div id="abrirModal"…
-
1
votes1
answer70
viewsA: Slider with views(?)
I decided as follows: <script type="text/javascript"> function simpleSlider(type){ var sliderActive = $("#slider .sliderActive"); if(type == 'prev') { var sliderPrev =…
-
0
votes1
answer84
viewsQ: Interactive title in a Modal
Well, I have this html: <div> <span class="upgrade_description"> Upgrade 1 Segunda a Sexta das 20h às 02h</span> <a href="#abrirModal" rel="modal" class="button">R$…
-
3
votes2
answers1223
viewsQ: Transition effects on a slider
How can I apply transition effects to a slider? Using the following code as an example: function simpleSlider(type){ var sliderActive = $("#slider .sliderActive"); if(type == 'prev') { var…
-
2
votes0
answers40
viewsQ: Modal without Javascript usage
How can I make a Modal without using Javascript? It could be with CSS for example.
-
0
votes1
answer85
viewsQ: Problem with Javascript button
A while ago I did this question, to know how could add a button to go back and pass a slide. Anyway, I managed to make the buttons, but now I’m having a problem. When clicking the buttons for the…
javascriptasked GWER 2,242 -
0
votes1
answer513
viewsA: Forward button - back on a slide
I decided as follows: function simpleSlider(type){ var sliderActive = $("#slider .sliderActive"); if(type == 'prev') { var sliderPrev = sliderActive.prev().length ? sliderActive.prev() : $("#slider…
-
0
votes1
answer513
viewsQ: Forward button - back on a slide
Well, I slided it and it’s working. But it advances automatically, so I want to know how I can add a button to pass and to return to the previous slide. function simpleSlider(){ var sliderActive =…
-
5
votes2
answers1913
viewsQ: Remove space between span and input
I want to know how I can remove these spaces: So that the spanand the inputstay together, like here: My CSS: input, textarea { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #C9C9C9;…
-
3
votes1
answer532
viewsQ: How do I apply CSS to my form?
How can I make my form look like this? I have this code ready (without CSS), but I don’t know how I can make it look like this. <form> <input type="hidden" name="form_input"…
-
1
votes1
answer157
viewsA: Functions - Model, Controller
I believe that the simplest solution in your case is to create a Model and maintain the standard you have made in others. But as was said in the comments by @Papacharlie you could create a Helper…
-
2
votes1
answer132
viewsQ: Put stretch between parentheses
I have this code: if(isset($params['bedrooms']) && is_numeric($params['bedrooms']) && $params['bedrooms'] > 0){ $what['bedrooms >= ?'] = $params['bedrooms']; $what_or['suites…
-
2
votes3
answers4198
viewsQ: Align image with text
How can I have a result like this? I need to add those lines like in the image, and leave Tags (which is an image) aligned with the text, as in the example. <div> <img src="<?php echo…
-
1
votes1
answer70
viewsQ: Slider with views(?)
At the bottom of the site I have a view call: <?php $this->load->view('frontend/'.$this->domain.'/services/box_crm'); ?> She is the description of a service: I left the content out of…
-
1
votes2
answers2501
viewsQ: How to style only an excerpt of a text?
I want to know how I can have a result like this in my text: I want to highlight certain excerpt and put in bold. <p> A ferramenta é 100% online, desenvolvida com as mais modernas tecnologias…
-
1
votes1
answer3380
viewsQ: Assign null value to a field
I was doing some tests in the local database, and for them I ended up modifying a field that was null, assigning a value to it. Now that I’ve done the tests, I want to re-assign the value null to…
-
6
votes1
answer575
viewsQ: Backup in Mysql Workbench
I need to make a modification to the database. I wanted to know how to backup in Mysql Workbench, and how do I restore it later in case of errors. Also if possible I would like some tips of good…
mysql-workbenchasked GWER 2,242 -
2
votes2
answers164
viewsQ: Check if a value exists but print another
I have the following code: <span class="end"><h1><?php echo $this->seo_tags->h1spam; ?></h1><h2><?php echo $this->seo_tags->spam;…
-
3
votes5
answers4587
viewsQ: How to remove ddd from a number
For example, I have a phone number saved in a variable: $numero = 5198765432 However, now I need to remove the ddd from it (51) to save it in another variable. How could I do this?…
-
1
votes1
answer886
viewsQ: Function http_build_query
I wonder what the function is for http_build_queryin php. I read the manual, but it was vacant for me. http_build_query It is correct to use it within this context? $cURL =…
-
3
votes2
answers5350
viewsQ: How do I send data to a form using Curl?
I was reading about Curl, and I saw that I can use it to send data to a form (as if I was typing the data and giving Submit). How could I do this in php?
-
0
votes1
answer565
viewsA: Integration with Mailchimp
I solved using this code : require('src/Mailchimp.php'); $apikey = '6db8ab94ce74d88a289f9068768d7179-us9'; $merge_vars = array('MERGE1' => 'testando'); $email = '[email protected]'; $listid =…
-
0
votes1
answer565
viewsQ: Integration with Mailchimp
Well I’m doing an integration with Mailchimp, using this code: require('src/Mailchimp.php'); define('MAILCHIMP_API_KEY', '6db8ab94ce74d88a289f9068768d7179-us9'); // Mailchimp API KEY…
-
9
votes1
answer8470
viewsQ: What is Curl/curl_setopt
I’m doing an integration with Mailchimp, and I came across this code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $submit_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,…
-
7
votes3
answers1170
viewsA: How to format title to url format?
There is, use it strtolowerand url_title. strtolower : Returns string with all characters converted to lowercase. url_title : Takes a string as input and creates a friendly URL string. Example :…
-
4
votes3
answers1170
viewsQ: How to format title to url format?
For example, I have a title : 'Test Title Url'. But I need to leave it in url format, there is some function that does this?
-
7
votes5
answers31170
viewsA: What are Try/Catch Blocks for and when should they be used?
When to use You will use this block when you use some method that launches a Checkedexception and when you want to give some treatment to Exception. A "Try" block is called a "protected" block…
-
27
votes5
answers31170
viewsQ: What are Try/Catch Blocks for and when should they be used?
I’ve been looking for some explanations on the subject, but I couldn’t find one that was simple and straightforward. My question is : What Try/Catch Blocks are for and when they should be used?…
-
24
votes2
answers24948
viewsQ: What is the difference between Switch, Case and If, Else?
I’d like to know the difference between switch .. case and if .. else. Which offers a better "performance"?
-
2
votes1
answer319
viewsA: Create routes - Codeigniter
I decided as follows : $route["(.*)-catid-(:num)"] = "blog/post_list/$2";
-
0
votes1
answer319
viewsQ: Create routes - Codeigniter
Well, I have this route set in my Routes file : $route['novidades-e-estrategias-de-marketing-digital-em-nosso-blog/(.*)/(.*)'] = "blog/post_list/$1"; This is the url :…
-
1
votes1
answer177
viewsQ: Managing Composer Dependencies
Well, I started using the dependency manager for PHP Composer. I already downloaded it and it’s working. But I added a dependency to the file composer.json, and need to do an update. How can I do…
-
26
votes6
answers12868
viewsQ: What’s the difference between Isis and elseif?
I wanted to know the difference between else and elseif in PHP, and when should I use one or the other.
-
2
votes1
answer229
viewsQ: Routes - Codeigniter
I wonder what this $ means in defining routes, for example : route["(.*)-sid-(:num)-(:num)"] = "services/service/$2/$3"; What it represents $2and $3?…
-
2
votes1
answer157
viewsQ: Functions - Model, Controller
In my model I have this function that defines the url format : public function url_format_category($category, $lang_domin) { if (lang('abbr') == 'en_US') $lang_domin = 'en/'; else if (lang('abbr')…
-
1
votes2
answers865
viewsQ: How to use data from an Array without foreach
I have a function in my Model: public function get_learning_category_list() { $categorias = $this->db->select('t1.id, t1.title, t1.metadata, t1.meta_title, t1.description, t1.meta_description,…
-
1
votes3
answers86
viewsA: Using variables in the Model
I solved using: $categorias = $this->learn->get_learning_category_list(); foreach($categorias as $cat){ $cat = (object) $cat; if($cat->title != '') { $return =…
-
1
votes1
answer170
viewsQ: Url forwarding
Well, it’s been a few days since I’ve encountered any problems on an assignment. What I need to do is : Check if the url is in the right format, and if it is not, redirect to the correct url. In the…
-
0
votes3
answers86
viewsQ: Using variables in the Model
Well, I have the following function in my Model : public function get_learning_category_list() { $categorias = $this->db->select('t1.id, t1.title, t1.metadata, t1.meta_title, t1.description,…
-
28
votes4
answers35105
viewsQ: Use of ? and : in PHP
Can you explain to me what it’s for ? and : in PHP? For example in this case: public function url_format($post,$extra=FALSE) { $title = isset($post->post_title) ? $post->post_title :…
-
0
votes1
answer394
viewsQ: Check if URL in the correct format
I need to check if the url is in the right format, and if it is not, redirect to the right url. In another Controller already has a code that does what I need, I just need to adapt it to another…
-
0
votes2
answers196
viewsA: Using data saved in a Session
You can subscribe to the values like this: $session = $this->session->userdata('click2call'); if($session != FALSE){ if(isset($session['color'])) { $client->click2call_color =…
-
0
votes2
answers196
viewsQ: Using data saved in a Session
I modified my question because I was able to solve the problem of the session. But now I have another question. I have this code in Controller to capture the data passed by parameter and save them…
-
1
votes1
answer1341
viewsQ: Check if a parameter passed by the url exists within the View
I have this following code in my Controller: public function SetImageAndColor($client_id) { if(isset($_GET['color']) AND isset($_GET['image'])) { $dados['click2call'] [$client_id] ['image'] =…
-
0
votes3
answers877
viewsA: Doubt in Insert, update and delete with Codeigniter Framework?
Try to use the last_insert_id(); The function of Mysql last_insert_id() returns the last integer created for a column auto_increment of a table. This integer is available in the memory cache that…
-
1
votes1
answer131
viewsQ: How to use error_reporting
I’ve been having a problem on my page for some time. I’ve reviewed my Model, Controller and View and nothing. Simply the screen turns white (but no error appears) and nothing works. I want to know…
-
0
votes2
answers917
viewsQ: How to insert an image by parameter in the url and display it on the screen
I need the code to check if this parameter with the image exists, if it exists, I have to display it on the screen. How can I do? Note: The parameter with the image should be passed by the user in…
-
2
votes1
answer2051
viewsQ: How to check if a session exists (Codeigniter)
I have the following function in my Controller: private function SetImageAndColor($client_id) { if (isset($_GET['color']) AND isset($_GET['image'])) { $dados['click2call'][$client_id]['image'] =…