2,113 Posted Topics
Re: Hi, it seems you have `indexAction()` nested in the `_getTranslation()` method, fix the brackets and then see if it works. ![]() | |
Re: 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 ![]() | |
Re: 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. | |
Re: 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! | |
Re: **@diafol** Actually it is possible and it is also possible to overwrite files or inject code into the RAM... honeypot? :D | |
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, … | |
Re: 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 ![]() | |
###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 … | |
Re: Try to increase the timeout. If you're using curl, then increase the values of `connect_timeout` and `timeout`, default should be 30 seconds. | |
Re: 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 … | |
Re: 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 | |
Re: 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. | |
Re: 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. | |
Re: 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 | |
Re: 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 | |
Re: 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. | |
Re: **@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 … | |
Re: **@rproffitt** hi, that bit.ly points to http://renardwatches.com/ (it seems to work for me) | |
Re: 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 … | |
Re: 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 … | |
![]() | Re: 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 … |
Re: 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' , … | |
Re: 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 … | |
Re: 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 > … | |
Re: 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 | |
Re: 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 … | |
Re: Hello, I have not tested but check this module, it seems interesting: * https://www.npmjs.com/package/simplecrawler * https://github.com/cgiffard/node-simplecrawler | |
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 … | |
Re: 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 | |
Re: 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 … | |
Re: In addition: if 2FA is enable the script will need an **application password.** See: https://support.google.com/mail/answer/185833?hl=en | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: 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`. | |
Re: 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 | |
Re: 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, … | |
Re: 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. | |
Re: 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. | |
Re: Do you mean like a shell execution? | |
Re: *// 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 … ![]() | |
Re: 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 … ![]() | |
Re: Hi, so it's like the [`parse_url()` function](http://php.net/parse-url), correct? | |
Re: > 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 … | |
Re: 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 … | |
Re: Not tested, could be the encoding? Try, for example, to add `;charset=utf-8` to the content type header. | |
Re: 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 … | |
Re: 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'], … |
The End.