2,113 Posted Topics

Member Avatar for toxicandy

> Is there anyway to replace the order by information with prepared statement attributes? Unfortunately this cannot be done with current drivers. You can use a whitelist approach, instead of rewriting the query you do: if(in_array($value, array('asc', 'desc')) $query = "SELECT * FROM `items` ORDER BY `date` $value"; Besides: `date` …

Member Avatar for cereal
0
407
Member Avatar for Kadence

Hi, you can check the **D3.js** project: * http://d3js.org/ * https://github.com/mbostock/d3/wiki/Tutorials And the **Charts.js** project: * http://www.chartjs.org/

Member Avatar for diafol
0
260
Member Avatar for christine06

Try `sudo su` then enter your password, as requested, it should log you as root. Also read this: https://help.ubuntu.com/community/RootSudo

Member Avatar for eroux
0
377
Member Avatar for WebMedia_1

Hi, you can do this in the select query, something like: SELECT * FROM `user` WHERE `username` = ? AND `expires_at` < NOW() The expression `expires_at < NOW()` will verify the date stamp with the current date. This requires that the column is datetime type, otherwise you have to cast. …

Member Avatar for WebMedia_1
0
2K
Member Avatar for Aeonix

By changing line 50 with: return array_map('trim', $z); you avoid new lines in the **ParseVariables()** generated array and let the regular expression match the pattern. A problem I see is an undefined index at line 60, which is: $toReplaceTemplate[$index] = str_replace($contentFrom, $replaceDict[$indexToGo], $toReplaceTemplate[$index]); And in particular is caused by `$replaceDict[$indexToGo]`. …

Member Avatar for cereal
0
135
Member Avatar for James_43

Hi, what is the error message? Have you tried by contacting their support service? From what I've seen you have to perform a curl request and get a response in JSON format: * https://www.swipehq.com/support/support_detail.php?cat=Developers&title=Example+Code But from the documentation I cannot see what would happen in case of error and what …

Member Avatar for cereal
0
411
Member Avatar for Aeonix
Member Avatar for paul.rothenberger

Hi, the insert query is missing the `VALUES` closing parenthesis: ... ADDDATE(NOW(), INTERVAL 1 MONTH)) When in doubt add `mysqli_error()`: * http://php.net/manual/en/mysqli.error.php Bye!

Member Avatar for Taywin
0
371
Member Avatar for Edwin_7

Hi Ed, so in local it logs out successfully and, instead, it does not work in production? No error codes? Have you changed the information to reflect the production URL in your application? In practice you have to change the URL in *My Apps > APP Name > Settings > …

Member Avatar for cereal
0
256
Member Avatar for AntonyRayan
Member Avatar for pritaeas
0
164
Member Avatar for James_43

Hi, what you got from: > See systemctl status nginx.service and journalctl -xe for details

Member Avatar for James_43
0
256
Member Avatar for Dani
Member Avatar for jeffersonalomia

No, not through `copy()`, that will change only the extension. You can try PHPOffice/PHPPresentation: * https://github.com/PHPOffice/PHPPresentation For example: $filename = '/path/to/file.pptx'; $new_name = '/destination/path/file.odp'; $phpPPTX = \PhpOffice\PhpPresentation\IOFactory::load($filename); $odpWriter = \PhpOffice\PhpPresentation\IOFactory::createWriter($phpPPTX, 'ODPresentation'); $odpWriter->save($new_name);

Member Avatar for cereal
0
722
Member Avatar for jkon

I think skilled programmers usually don't have problems with basic / general language issues and, when having some difficulties, they would search for help in appropriate places, like: bug lists, mailing lists, specific niche forums & blogs or support teams. In my activity I hardly ask for help, as I'm …

Member Avatar for Dani
3
1K
Member Avatar for janicemurby

Use `var_dump($val);` instead of `echo $val;` to see what is returned. If the form ends like this (with a `</form>`) and there aren't other input fields, then it should work fine. Also you could do `echo "<pre>". print_r($_POST, true) . "</pre>";` to see what is sent to the $_POST array.

Member Avatar for cereal
0
318
Member Avatar for SimonIoa

Do you need that row in the following loop? If not then do: $uid = mysqli_fetch_row($query, MYSQLI_ASSOC); echo $uid[0]['a_uid']; while($row = mysqli_fetch_assoc($query)) # and so on The loop will start from the second row in the result set. If you need that row in the loop then do: $results = …

Member Avatar for SimonIoa
0
651
Member Avatar for Thomasio
Member Avatar for cereal
0
502
Member Avatar for lewashby

Sure is not `$connection->query($sql)` with `->` instead of `-`? It seems you're calling a method, or an anonymous function, I think the former. In the latter case, then in PHP you cannot use the dash in the variable name, unless you use brakets, for example: ${'connection-query'} = function() { return …

Member Avatar for lewashby
0
507
Member Avatar for James_43

Look at the array through `var_dump()`, it may add some information about that index.

Member Avatar for James_43
0
278
Member Avatar for James_43

Hi, the undefined offset is probably given by: $rawData[$i + $backdate] Check if the index key exists: $key = $i + $backdate; if(array_key_exists($key, $rawData)) $pTimeseries[$i][1] = $rawData[$key][0];

Member Avatar for James_43
0
128
Member Avatar for diafol

> I'm going for NZ. > France Argentina or Ireland in final Almost my same choices but, as said by HG, South Africa has good choices too, I would add it in replace of Argentina. Here support is splitted between Ireland and France, but I'm not sure about France preparation, …

Member Avatar for diafol
0
244
Member Avatar for shany0786

Hi, the `set_rules()` method requires three arguments: * field name * label * rules See documentation at: * https://codeigniter.com/user_guide/libraries/form_validation.html#CI_Form_validation::set_rules So your rules would look like: $this->form_validation->set_rules('email', 'email', 'required|valid_email'); $this->form_validation->set_rules('password', 'password','required');

Member Avatar for cereal
0
178
Member Avatar for lewashby

Hi, from what I've understood you have only to set the path of the libraries, follow the instructions in this tutorial and it should work fine: * http://www.sfml-dev.org/tutorials/2.3/start-linux.php

Member Avatar for mike_2000_17
0
409
Member Avatar for SimonIoa

About the function issue: the form will send strings, so `filter_input()` will return strings or: * **FALSE** when condition fails * **NULL** when variable name is not set, i.e. when submitting a form with wrong/missing field name so the `is_int()` check will always return boolean **FALSE**. You can convert the …

Member Avatar for SimonIoa
0
724
Member Avatar for davy_yg

If linking a stylesheet then you have to define the correct path, not just the file name, unless this is in the same path of the requesting page. In practice change: $("link").attr("href", "blue.css"); To something like: $("link").attr("href", "/css/blue.css"); **But** it's worth to follow previous suggestions and apply a class or …

Member Avatar for davy_yg
0
933
Member Avatar for shashigowda

Hi, use **prepared statements**, start from here: * http://php.net/manual/en/mysqli.prepare.php * http://php.net/manual/en/mysqli.quickstart.prepared-statements.php Look at the first example in the first link, I'm not converting the code directly for you, because it's more important that you understand how it works and how the methods/functions are used.

Member Avatar for shashigowda
0
376
Member Avatar for Sophia_1

Hi, sure there is no `%` in front of `20`? Can you show us more details of the script in which you create the date? Have you tried the above in a separated script: a simple `<?php echo date('d-m-Y'); ?>` file, in this case do you get the same results?

Member Avatar for diafol
0
372
Member Avatar for shany0786

And how would you know which result sets belongs to what? If you're expecting a row for each table, then you could add empty columns: select id, name, lastname from users where id = 1 union all select user_id, email, '' as dummy_3 from addresses where user_id = 1; But …

Member Avatar for shany0786
0
18K
Member Avatar for FarrisFahad

Hi! Bit border line, but I suggest you to learn also how to build raw HTTP requests and parse responses to understand: how to deal with RESTful APIs, how to build them, how mails are sent, how (chunked) uploads are performed and in general how [socket programming](http://php.net/manual/en/intro.sockets.php) and web servers …

Member Avatar for V3N0M
0
349
Member Avatar for jwausi

Hi! Check the documentation: * http://ellislab.com/codeigniter/user-guide/general/managing_apps.html In particular: >**Note:** Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want. So, in the main **index.php** file change the application path, i.e. change this: $application_folder = 'application'; To: …

Member Avatar for diafol
0
4K
Member Avatar for tgreiner

Hi, by using four spaces or one tab, the system will set the paragraph into a block code. For more information check the syntax helper: * https://www.daniweb.com/community/syntax#code

Member Avatar for cereal
0
808
Member Avatar for Aeonix

Something like this will fit? <?php $tests = file("php://stdin", FILE_IGNORE_NEW_LINES); foreach($tests as $test) { for($i = 0; $i <= $test; $i++) { $size = 9283412; $isEven = (($test % 2) != 0 ? true : false); if($test == 0) { $size = 1; break; } elseif($isEven) $size *= 2; else …

Member Avatar for cereal
0
235
Member Avatar for praba_web

In addition: so what you're searching for is a client to query remote services? Have you considered Guzzle? * https://github.com/guzzle/guzzle * http://docs.guzzlephp.org/en/latest/index.html You can integrate it into CI3 by using composer: composer require guzzlehttp/guzzle:~6.0 And modifying the `composer_autoload` variable in `application/config/config.php` into: $config['composer_autoload'] = FCPATH . 'vendor/autoload.php'; Then in your …

Member Avatar for cereal
0
446
Member Avatar for iamthwee

I would choose **Laravel**, I actually switched my new projects to that in April. I was going to start a new one and I was thinking to go back to Ruby on Rails, but then I decided to try Laravel and I like it, very much. I've been using CodeIgniter …

Member Avatar for diafol
0
778
Member Avatar for gianx80

Hi, I'm not sure I've understood what are you trying to do. The `http-equiv` meta: > it is a pragma directive, i.e. information normally given by the web server about how the web page should be served. *Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta* So, it defines the rendering of the page, not the header …

Member Avatar for cereal
0
570
Member Avatar for UK-1991

Hi, have you tried this? > The SDK is contained in the lib/ folder in the zip file so copy lib/ into your project and name it dropbox-sdk/ and include it in your app: require_once "dropbox-sdk/Dropbox/autoload.php"; Source: https://www.dropbox.com/developers-v1/core/sdks/php

Member Avatar for cereal
0
294
Member Avatar for Testt

So, all you want is to prevent hotlinks? Why don't you use **.htaccess**? It works without involving Javascript: if the request referer is your domain, then the server will give access to the protected files, otherwise it will deny. You can try this: RewriteEngine on RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] RewriteRule …

Member Avatar for gentlemedia
0
573
Member Avatar for phoenix254

Hi, it happens because of the [variable scope](http://php.net/manual/en/language.variables.scope.php), `$conn` is defined outside the function, so or you pass it as parameter, or you set it as global, or you use an anonymous function. Example: $getUsers = function() use($conn) { $getAllUsers = mysqli_query($conn,"SELECT * FROM login"); if($getAllUsers === FALSE) return FALSE; …

Member Avatar for cereal
0
12K
Member Avatar for LibraryCode

Model name is `BooksModel` (plural), in that method controller you're calling `BookModel`, (singular). Bye ;)

Member Avatar for cereal
0
170
Member Avatar for Amaina

Hi, it happens because `fwrite()` is outside the loop and will write the last vallue assigned at `$line`. Use `fputcsv()`: * http://php.net/manual/en/function.fputcsv.php Look at the first example, it does what you need.

Member Avatar for Amaina
0
3K
Member Avatar for Amaina

Hi, it happens because both tables will return the same column name `tableA_id`, since you're fetching as assoc, it will create an array in which the first index will be rewritten by the second column value. You see how it works by playing this: <?php $stmt = $conn->prepare("select * from …

Member Avatar for Amaina
0
300
Member Avatar for gogs85

Hi, can you format code properly? At the moment it's very hard to read. Regarding the user picture, have you tried the `/{user-id}/picture` endpoint? * https://developers.facebook.com/docs/graph-api/reference/user/picture/ * https://developers.facebook.com/docs/graph-api/reference/profile-picture-source/

Member Avatar for cereal
0
362
Member Avatar for thirsty.soul

Hi, I don't understand what it should do your script, tested with a ciphered string and prints only `====`. If you are searching for character frequency, then look at `count_chars()`: * http://php.net/manual/en/function.count-chars.php For example: <?php $message = 'pda sknhz eo behhaz sepd oaynapo wjz iuopaneao fqop swepejc pk xa zeoykranaz'; …

Member Avatar for cereal
0
1K
Member Avatar for nullptr

Cache: probably the new thread was appended to the index cache and was not updated after user's edit.

Member Avatar for nullptr
0
337
Member Avatar for blueguy777

Hi, you are enclosing the query into single quotes: $a = 'apples'; $b = 'oranges'; So in order to append another variable you have to use the dot operator: $c = 'list '. $b . ' and ' .$a; Basically is this. You have done that when defining the table …

Member Avatar for pritaeas
0
252
Member Avatar for jeffersonalomia

Sometimes it happens that the corrupted file will return the server side error instead of the contents, so you end to download a text file with the wrong extension: jpg, pdf, doc... Try to open the corrupted file with your editor, if it gives problems then change the extension to …

Member Avatar for cereal
0
153
Member Avatar for davy_yg

> What's the difference between other website and my website? That's all what I need to know. That's the knowledge they are suggesting you to learn. It's not just keywords. You can start from Google suggestions: * https://support.google.com/webmasters/answer/35291?hl=en

Member Avatar for diafol
0
215
Member Avatar for UK-1991

Can you show users table? I don't understand which values will assume `uid`, to me it should be an integer, but looking at your code it seems it would be a string, like `user 1`, otherwise those conditional statements are wrong: if($user["user_1"] == $_SESSION["uid"])

Member Avatar for UK-1991
0
432
Member Avatar for jeffersonalomia

Or **fileinfo**: $mime = (new finfo(FILEINFO_MIME_TYPE))->file('/path/to/file.ext'); Docs: http://php.net/manual/en/function.finfo-open.php

Member Avatar for jeffersonalomia
0
463
Member Avatar for ita_info

Hi, few questions: * the data is correctly inserted in the database? * if, in view, you do `var_dump($datame);` what you get? * have you tried to remove the error control operators `@` in your `getdata()` method? In this stage it's more important to get debug information rather than hiding.

Member Avatar for ita_info
0
156

The End.