2,113 Posted Topics
Re: An alternative solution: use filectime(), each file saves 3 different dates: created, modified and access, with touch() or file_put_contents() you can change "modified" date without changing contents. Here is an example: [code]<?php $a = glob('*.jpg', GLOB_NOSORT); $b = array(); print_r($a); # all images for($i = 0; $i < count($a); $i++) … ![]() | |
Re: Use floor() or ceil(), floor will output 12 no matter if it is 12,2 or 12,9, ceil is different, since 12,51 will output 13 instead of 12. [code]$filesize=floor($size/1000000);[/code] | |
![]() | Re: Like Veedoo I'm not sure of the question but I started playing around with HanDeDict dictionary (1) and came up with a script to search "rapidly". I don't know if this can be helpful for you. I'm using memcached to load data in memory and igbinary as serializer to save … |
Re: In a project I used CodeIgniter as main framework integrated with Zend to deal with their Gdata library and worked pretty well. I prefer CI. Bye. | |
Re: Try: [code] <?php echo date('Y-m-d- G:i:s'); # systme date_default_timezone_set("GMT"); echo date('Y-m-d- G:i:s'); # GMT ?>[/code] ![]() | |
Re: Are you using a CMS? Can you check the logs of your website? Which version of PHP are you using? Are you in a shared hosting or dedicated? What they did? Just defacement? Let us know, bye. | |
Re: The simplest way, for me, is to use array_filter and preg_match, set null on the array you want to remove and then filter the array, at the end reindex, otherwise you get discontinuous keys: [code]<?php $a = array( array('name' => 'MHK VL', 'PTID' => 'bab'), array('name' => 'nbn', 'PTID' => … | |
Re: imo the best exercise is to try to solve problems here in the forum ;) | |
Re: This should work: [code]<?php # ... # connection code # ... $q = mysql_query('select defect_code, total from grandTotal'); $a = array(); while($row = mysql_fetch_object($q)) { $a[$row->defect_code] = $row->total; } print_r($a); # display array ?>[/code] bye :) ooops ardav, I just saw your reply, sorry.. :D | |
Re: Hm, with null/false/-1/'' as value you can display the array: [code]$a = array('a' => false, 'b' => '', 'c' => '1a'); print_r($a);[/code] Just make sure to not run array_filter() against this array or those will be removed. | |
Re: Try add the url to the URLRequest: [code]var myRequest:URLRequest = new URLRequest("http:/your_server/test.php");[/code] bye. | |
Re: Together with chrishea suggestions you can: 1. cache queries on mysql 2. run tables in memory engine (a copy of the original) 3. cache result to a file or better cache php 4. cache results to memory through memcached For reference: 1. [url]http://dev.mysql.com/doc/refman/5.1/en/query-cache.html[/url] 2. [url]http://dev.mysql.com/doc/refman/5.5/en/memory-storage-engine.html[/url] 3. [url]http://php.net/manual/en/book.apc.php[/url] 4. [url]http://php.net/manual/en/book.memcached.php[/url] bye … | |
Re: Well I use CodeIgniter :p To me the must important thing is the knowledge of the framework you decide to use, so what I look for is a good community and clear documentation, if you have them you can do everything. What are you looking for? There are many frameworks: … | |
Re: You can see other entries by using mysql_data_seek(): [url]http://www.php.net/manual/en/function.mysql-data-seek.php[/url] When using while() with mysql_fetch_array() there will be a move of the internal row pointer for the query result, so it moves from one key to another, automatically: [code] <?php $result = mysql_query("SELECT * FROM post_categories"); $row = mysql_fetch_array($result); echo $row['Name']; … | |
Re: Yes, you can use file_get_contents(): [url]http://php.net/manual/en/function.file-get-contents.php[/url] Or you can use cURL if you need authentication. If remote data is XML than use SimpleXML. Bye. | |
Re: You can try array_intersect_key(): [url]http://www.php.net/manual/en/function.array-intersect-key.php[/url] bye | |
Re: cPanel is not a CMS (Content Management System), what you're looking for is something like joomla, drupal, mambo... ![]() | |
Re: Change line 12 with [icode]mysql_query($sql, $con) or die(mysql_error());[/icode] and see what it happens, bye. | |
Re: In your code the mode is set by the link, so it's $_GET but you should not use it to change data, you should use $_POST. Bye. | |
Re: Add strtotime(): [icode]date('j-M-Y',strtotime($data['tgl_masuk']))[/icode] bye :) | |
Re: It's related to objects, in PHP you can write something like this: [code]<?php $obj = (object) array("a" => "hello", "b" => "world"); echo $obj->a . ' '. $obj->b; echo "\n"; ?>[/code] Source: [url]http://php.net/manual/en/language.types.object.php[/url] bye :) | |
Re: @gikonyo you could do the same: [url]http://www.swreg.org/getting_started_guide.htm[/url] | |
Re: I never tried that but it's interesting how, in ez_sql_core.php, he writes cache to disk, he is using error_log(), but as stated in error_log() function page: the maximum length that you can pass as the $message is limited by [b]log_errors_max_len[/b], which is 1024 bytes by default in php.ini. So, if … | |
Re: Just as side note, if you can't join two tables but still need to print through php, you can use mysql_data_seek(): [code]<? # ... # connect to db # ... $q1 = mysql_query("select * from table_name"); $q2 = mysql_query("select * from table_name_2"); $a = mysql_num_rows($q1)-1; $b = mysql_num_rows($q2)-1; $c = … | |
Re: It seems you are using a function [icode]secure_form_data()[/icode], did you included that in your online code? What it does? If you try to echo $pass which output you get? ![]() | |
Re: Maybe I'm wrong but searching on web I came up with a thread discussing of that obfuscated js code, and it seems to match an injection attack, here's the link: - [url]http://www.reddit.com/r/javascript/comments/mk1u8/i_found_code_in_my_files_i_did_not_add_what_does/c31jt8k[/url] | |
Re: Perhaps you could use federated tables: - [url]http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html[/url] but if the connection goes away you get an empty set from the federated table, that because on each query you get results from remote, in this case you should update a second table so you can retain data locally. | |
Re: Have you tried explain? For example: [code=mysql]mysql> explain users; +---------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+----------------+ | id | int(9) | NO | PRI | NULL | auto_increment | | fname | varchar(50) | NO | | NULL | | | lname … | |
Re: Check the user guide: [url]http://codeigniter.com/user_guide/general/views.html[/url] bye :) | |
Re: You can only use yum into another box to download the needed package, so you can copy that into a usb flash drive as it seems that repositories are not public available (but I'm not sure about this since I don't know RedHat and CentOS policies): [code]yum install yum-downloadonly php-xml[/code] … | |
Re: I can't help but it seems to depend on the Client behavior: [quote="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10#section-4.3"]The client MUST mask all frames sent to the server. A server MUST close the connection upon receiving a frame with the MASK bit set to 0. In this case, a server MAY send a close frame with … | |
Re: Change that query to: [code]$result = mysql_query("SELECT * FROM customers WHERE customerID = '$customerID'") or die(mysql_error());[/code] If there is a problem you will get the error, bye. | |
Re: Change this: [code]$categories = $row[/code] with: [code]$categories = $row;[/code] ;D | |
Re: On the administration side you need a form to create an instance for each word associated with the English translation and an audio file that can be mp3, wav or ogg, depends on you. Something like an email an his attachments. Here I would use two tables for the words, … ![]() | |
Re: Something like this should work, where the name has the format status_"id_user": status_1, status_2 ... status_23. [code]<input type="radio" name="status_1" value="to be" /> to be <input type="radio" name="status_1" value="not to be" /> not to be <input type="radio" name="status_2" value="to be" /> to be <input type="radio" name="status_2" value="not to be" /> not … | |
Re: Here's an example: [code] ------------ file: a.xml ------------ <xml> <channel> <item> <title>a title 1</title> <link>a_link_1</link> </item> <item> <title>a title 2</title> <link>a_link_2</link> </item> <item> <title>a title 3</title> <link>a_link_3</link> </item> </channel> </xml> ------------ file: b.xml ------------ <xml> <channel> <item> <title>b title 1</title> <link>b_link_1</link> </item> <item> <title>b title 2</title> <link>b_link_2</link> </item> <item> <title>b … | |
Re: In CI you should use a model to do this kind of tasks, but you can pack the result to a string and return that, just use [icode]true[/icode] as third parameter in [icode]$this->load->view[/icode]: [code]$string = $this->load->view('my_view',$data,true);[/code] A full example would be: [code]public function test() { $data['a'] = 'hello world!'; $string … | |
Re: Size and width/height are two different things, you can have an image of 800x600 and 1.2MB and another of the same width and height but only 200KB, depends on colors, on format and compression. So, if the user is uploading a file of 800KB, you can't be sure that with … | |
Re: On ezImage() you are specifing an url, maybe you need to set an absolute path, like: [icode]/var/www/your_website/system/images/logo.jpg[/icode] bye :) | |
Re: In order to access from the virtual server you need to change a setting on the database config file. Search for my.cnf and change this line: [code]bind-address = 127.0.0.1[/code] Set the ethernet IP of the host machine. By default MySQL listens only on localhost. When you done restart MySQL server … | |
Re: Add a new var on line 17: [code]var check = true;[/code] And for each [icode]if[/icode] statement, replace [icode]return (false);[/icode] with [icode]check = false;[/icode] At the end, where you wrote [icode]return true;[/icode] write: [code]if(check == true) { return true; // send form } else { return false; }[/code] | |
Re: change it with this: [code]echo '<img src="'.$data['gambar'].'"><br>';[/code] bye :) | |
Re: You should post your update query and the form used. Without code we can't tell you where mistakes are. | |
Re: Maybe you can use memcached. When Post does an operation you save a value on memcached, Get will do a loop in search of that value (stored in RAM), this will not affect the database until the condition is true. Example: [code]<?php # Post $query = mysql_query("INSERT INTO your_table () … | |
Re: This is called Method Chaining and yes, you can use it whenever you want if the class is built in the right way. Check this comment on PHP Manual: [url]http://www.php.net/manual/en/language.operators.php#87904[/url] bye. | |
Re: Line 15:[code]Ext.form.Field.prototype.msgTarget = "side";[/code] That means you need a container where to write the form:[code]<div id="side"></div>[/code] | |
Re: Check the quotes on line 5: [icode]$this->set_session('logged', true);[/icode] | |
Re: Apparently there's nothing wrong. Which error are you receiving? [b]$product[/b] is defined like: [icode]$product = $_POST['product'];[/icode]? | |
Re: [icode]beep_multiple_beep_action_form()[/icode] is a function to build an array, you can use print_r to display the array: [code]$a = beep_multiple_beep_action_form($context); print_r($a);[/code] But you need to search where this function is used, in order to see the original array. This code [icode]$beeps = $form_state['values']['beeps'];[/icode] instead is used to display part of a … |
The End.