2,113 Posted Topics

Member Avatar for Nunix

Hi, it seems you have `indexAction()` nested in the `_getTranslation()` method, fix the brackets and then see if it works.

Member Avatar for diafol
0
599
Member Avatar for Aeonix

Hi, you could use `filter_var()` with `FILTER_SANITIZE_NUMBER_INT`: filter_var($not_an_int, FILTER_SANITIZE_NUMBER_INT); filter_var($actual_int, FILTER_SANITIZE_NUMBER_INT); Will return string, that can be casted, se an example here: * http://ideone.com/J494Jp Docs: http://php.net/manual/en/filter.filters.sanitize.php

Member Avatar for diafol
0
328
Member Avatar for janicemurby

Hi, it seems fine. Are you sure `$_POST['age']` is set? Check the submit form or do a `var_dump($_POST);` to see what is really sent with the request, maybe is not `age` but `Age` or something similar.

Member Avatar for janicemurby
0
206
Member Avatar for janicemurby

The argument for `function_exists()` must be a string, so: if( ! function_exists(prepare_insert)) should be: if( ! function_exists('prepare_insert')) Docs: http://php.net/function-exists Bye!

Member Avatar for cereal
0
1K
Member Avatar for phpio

**@diafol** Actually it is possible and it is also possible to overwrite files or inject code into the RAM... honeypot? :D

Member Avatar for cereal
0
1K
Member Avatar for cereal

Hello, everytime I set the checkbox to get community related e-mails and update the profile, it seems to work and if it occurs an event I get the notification, but if I close the window and come back the option is again unchecked and I don't get anymore notifications. Dani, …

Member Avatar for cereal
0
607
Member Avatar for adebayo23

Hi, > Warning: mysqli_query() expects parameter 1 to be mysqli, null given means that `$connection` is `NULL`, you have to create the connection to the database. See: * http://php.net/manual/en/function.mysqli-connect.php

Member Avatar for diafol
0
695
Member Avatar for cereal

###Simple Advice This is just a reminder. When setting environment variables through **.htaccess**, **CLI** or **dotenv** use `filter_var()` to evaluate a boolean. For example, start the built-in PHP server with these variables: DEBUG=FALSE LOG=TRUE SMS=1 SMTP=0 CONNECT=yes BACKUP=no php -d variables_order=EGPCS -S localhost:8000 And then test through `boolval()`: if you …

0
288
Member Avatar for brianbabu

Try to increase the timeout. If you're using curl, then increase the values of `connect_timeout` and `timeout`, default should be 30 seconds.

Member Avatar for cereal
0
174
Member Avatar for v1shwa

Just an addition: you could use an sqlite3 database to store that amout of data and then retrieve it through a PHP script. Something like this example script: * https://www.daniweb.com/programming/databases/threads/499516/migrating-data-between-sqlite-and-mysql#post2184579 Or, if using MariaDB (MySQL fork), through the Connect engine which allows to open a sqlite3 database as resource and …

Member Avatar for Tomaski
0
441
Member Avatar for zebnoon1

In the insert query you can use the `DATE()` function, see: * http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date

Member Avatar for cereal
0
302
Member Avatar for canadafred

Hi, if you ever shared the videos on Twitter then check the Archive.org: * https://archive.org/details/youtubecrawl&tab=about Sincerly, I had difficult to find valid data in those copies but I'm probably doing something wrong. Ask to the archivists, maybe they can help you.

Member Avatar for happygeek
1
2K
Member Avatar for Reverend Jim

I have different results here: under the *All my conversations* tab I have only the messages of the last two months, starting from the switch. All previous messages never showed.

Member Avatar for Dani
0
385
Member Avatar for koneill

Hello, are you aware that the referrer can be spoofed? Simple test: 1. open a terminal and type: `nc -l 8000` 2. open another terminal and type: `curl --verbose --header --referer http://google.com/ http://localhost:8000/` You'll get: GET / HTTP/1.1 User-Agent: curl/7.35.0 Host: localhost:8000 Accept: */* Referer: http://google.com/ More information here: https://en.wikipedia.org/wiki/Referer_spoofing

Member Avatar for koneill
0
436
Member Avatar for Aeonix

If you like something like OneDrive then you could set up WebDAV, just make sure Apache is running with the `mod_dav` modul, see: * https://httpd.apache.org/docs/current/mod/mod_dav.html * https://en.wikipedia.org/wiki/WebDAV

Member Avatar for cereal
0
2K
Member Avatar for yvrej17

Hi, you can setup a replication model: master to master or master to slave. See: * http://dev.mysql.com/doc/refman/5.7/en/replication-howto.html I suggest you to do a research on Google about **MySQL Replication**, you will find a lot of tutorials and solutions.

Member Avatar for yvrej17
0
921
Member Avatar for AntonyRayan

**@Antony** try: SELECT * FROM `TABLENAME` ODER BY date_format(str_to_date(`TIME_COLUMN`, '%r'), '%T') ASC; This will convert the string to a timestamp that MySQL can parse, then use `%T` to get the order in the 24H format. But, as suggested, it's better to convert the existing rows into the 24H format and …

Member Avatar for cereal
0
580
Member Avatar for Saro_1

**@rproffitt** hi, that bit.ly points to http://renardwatches.com/ (it seems to work for me)

Member Avatar for Saro_1
0
484
Member Avatar for Mario A._1

Hi, in your method controller `data_fik()` replace this: print json_encode($result, JSON_NUMERIC_CHECK); $data['body'] = 'hchart_elec'; $this->load->view('main', $data); with: header('Content-Type: application/json; charset=utf8'); echo json_encode($result, JSON_NUMERIC_CHECK); You don't neet to load a view, because the method will return JSON content, so just set the correct content type header and print it. And it …

Member Avatar for Mario A._1
0
372
Member Avatar for rjusman90

Hello, in `./application/core/` create the file **MY_Controller.php** and extend it to `CI_Controller` and add a public (or protected) **$data**: class MY_Controller extends CI_Controller { public $data; public function __construct() { parent::__construct(); $this->data['menu'] = 'MENU DATA HERE'; } } Then extend your controllers to MY_Controller instead of CI_Controller and when you …

Member Avatar for cereal
0
1K
Member Avatar for saravind84

Hi, go to http://regexr.com/3eb88 and mousehover the components of the expression (or hit the Explain tab), it will explain the meaning of each block. If you have some sample data you can paste it in their form and see how it is applied. For example, try to change `[\W_]` to …

Member Avatar for cereal
0
137
Member Avatar for Amaina

Hello, so, standing at the original example you want two rows for each `date > item`, correct? Use `implode()` after each cycle, change this: # loop each date > item foreach($items as $item) # loop each date > item > item foreach($item as $elem) $r[] = sprintf('%s %s %s' , …

Member Avatar for Amaina
0
622
Member Avatar for Stefce

If you just need to remove what comes after the first occurrence of the bracket and display what is remaining, then you could basically loop the input into `strstr()`, like this: $line = 'Águila (El Salvador)'; $out = strstr($line, '(', TRUE) . '('; print $out; # Águila ( See: http://php.net/manual/en/function.strstr.php …

Member Avatar for cereal
0
377
Member Avatar for Amaina

It happens because you have to manually move to the next node, you can do like this: <?php $file = 'dates.xml'; $xml = simplexml_load_file($file); # loop each <date> node foreach($xml->date as $node) { $items = $node->children(); # loop each date > item foreach($items as $item) # loop each date > …

Member Avatar for Amaina
0
867
Member Avatar for zebnoon1
Re: php

Hello, you can use sessions to restrict the access only to authenticated users, see: * http://php.net/manual/en/book.session.php * http://php.net/manual/en/session.security.php

Member Avatar for cereal
0
104
Member Avatar for Ventech_IT

Hi, you can create a method in your controller, search the database table and use the Download helper, for example: public function download($id) { # load download helper $this->load->helper('download'); # search for filename by id $this->db->select('filename'); $this->db->where('id', $id); $q = $this->db->get('tablename'); # if exists continue if($q->num_rows() > 0) { $row …

Member Avatar for cereal
0
1K
Member Avatar for Aarav

Hello, I have not tested but check this module, it seems interesting: * https://www.npmjs.com/package/simplecrawler * https://github.com/cgiffard/node-simplecrawler

Member Avatar for cereal
0
90
Member Avatar for cereal

Hello, on Hotmail/Outlook webmail, when I receive an email message in the spam folder (formally Junk), I can mark the message as **Not Junk**. The server will then start to deliver the messages from that source, directly into the Inbox, working like a whitelist. Is it possible to do the …

Member Avatar for cereal
0
2K
Member Avatar for Natsu123

Hi, see example #4 in the PHP documentation for the `mail()` function: * http://php.net/manual/en/function.mail.php however, there are some libraries that can help when you want to add other features, like sending through an SMTP server. Check PHPMailer: * https://github.com/PHPMailer/PHPMailer

Member Avatar for cereal
0
248
Member Avatar for AntonyRayan

Hi, you can convert the XLS to a CSV file and then import. Some forks of MySQL allow connection to outer data sources, through ODBC, so you can open an XLS or an MDB file and query it through the database interface, from there then you can copy it very …

Member Avatar for urtrivedi
0
301
Member Avatar for Usman_10

In addition: if 2FA is enable the script will need an **application password.** See: https://support.google.com/mail/answer/185833?hl=en

Member Avatar for cereal
0
132
Member Avatar for kingwash

Hi, the file does not get into the database or it is just corrupted? A blob type column of which size? If you are using, say `BLOB`, then it can store only 65kb, the query will work but a big image will return corrupted. Also it could be an issue …

Member Avatar for AndrisP
0
357
Member Avatar for Amaina

Hi, I have an idea for this. You could write a sequencer function, to keep track of the count. You need InnoDB tables to do this, transactions and a function: DROP FUNCTION IF EXISTS `seq`; DELIMITER // CREATE FUNCTION seq(`pID` INT UNSIGNED, `lID` INT UNSIGNED) RETURNS INT DETERMINISTIC READS SQL …

Member Avatar for cereal
0
247
Member Avatar for phphp

Hi, you have to fetch results, see the following thread for details, it seems the same issue: * https://www.daniweb.com/programming/web-development/threads/504502/only-first-sql-row-is-getting-understood

Member Avatar for cereal
0
123
Member Avatar for Erik_8

Hi, it seems you're trying to access the variables, sent by the POST request, through the `register_globals` directive, which initialize new variables basing on what is sent to the script, which was a very dangerous practice and has been removed from PHP 5.4. If you're using a previous version, leave …

Member Avatar for AndrisP
0
432
Member Avatar for chandnee

Hi, according to FPDF manual the `Output()` arguments must be reversed, instead of: $pdf->Output('newpdf.pdf', 'D'); Do: $pdf->Output('D', 'newpdf.pdf'); Documentation: * http://www.fpdf.org/en/doc/output.htm Also, if you want to force the download, then change the **Content-Disposition** header to `attachment`.

Member Avatar for cereal
0
799
Member Avatar for can-mohan

Hi, try the `CHECK()` constraint, for example: CREATE TABLE test ( number SMALLINT CHECK(number BETWEEN 0 AND 65535) ); When you try to insert something out of that range, it will raise an error. See also: * https://www.sqlite.org/lang_createtable.html#constraints

Member Avatar for cereal
0
162
Member Avatar for zebnoon1
Member Avatar for Stefce

I have some questions to ask here: * is the database in your location? * can the database accept remote connections? * can you define which IPs are allowed to connect the database? * can you create database users? In reference to the last, if you can create new users, …

Member Avatar for cereal
0
409
Member Avatar for lewashby

Hi, in the first line (`drop ...`) is missing the separator (the semi-colon in this case), so all the following falls into a syntax error.

Member Avatar for cereal
0
546
Member Avatar for SimonIoa

Hi, remove the `;` from this line: always_populate_raw_post_data = -1 semi-colons, in the PHP configuration files, are used to comment lines and exclude them from the parsing. //Edit And remember to reload the server.

Member Avatar for SimonIoa
0
3K
Member Avatar for Jiby_1
Member Avatar for CreatorZeus

*// ops! I just saw your reply Diafol! :D* Hi, can you share the error with us? Also: are you using MySQLi or PDO? The former returns boolean TRUE for successful inserts, the latter instead will return an object and your **IF** statement would fail because you're using the identical …

Member Avatar for diafol
0
425
Member Avatar for spluskhan

Hello all! **@spluskhan** you can do that, but by increasing the number of bills to process, the script may crash for timeout or for memory issues, for this reason you were requested to provide more details. To keep it simple: you can start the *bill generation process* by pressing a …

Member Avatar for diafol
0
912
Member Avatar for jkon
Member Avatar for jkon
2
664
Member Avatar for rajesanthu

> I realize it is not secure and as you stated in the beginning, it was just for beginners [...] Some of us appreciate someone taking the time to try and help us newbs out with a concept. Hi! That's ok, but if this approach was not discouraged, what you …

Member Avatar for nate_2
0
137K
Member Avatar for zelrick

Hi, in the **dbconnect.php** file you have this line: $conn = new mysql($servername, $username, $password); which is wrong. In PHP there are three APIs that you can use: mysql, mysqli and PDO. The first is deprecated in PHP 5.* and removed from the latest version (7). I think here you …

Member Avatar for cereal
0
711
Member Avatar for ecinevenice

Not tested, could be the encoding? Try, for example, to add `;charset=utf-8` to the content type header.

Member Avatar for cereal
0
249
Member Avatar for Rahul_56

Hi, it happens because in `<140/90 mmHg OR <130/80 mmHg)` there is the `<` character that has a special meaning in the HTML parsing. Example: <?php $html = '<p>Hello < 140 / 32 World</p>'; $dom = new DomDocument(); $dom->loadHTML($html); print $dom->saveHTML(); It returns `<p>Hello </p>` (I've stripped the rest of …

Member Avatar for cereal
0
408
Member Avatar for Cody_4

Reverse: * remove the short PHP tags `<?`; * remove the shorthand `=` for echo as this string is already in a print construct; * leave the curly brackets in order to parse the variable. So: echo "<form action='{$_SESSION['PHP_SELF']}' method='post'>"; Better (IMHO): $form = '<form action="%s" method="%s">'; echo sprintf($form, $_SESSION['PHP_SELF'], …

Member Avatar for Cody_4
0
398

The End.