2,113 Posted Topics

Member Avatar for m2z

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++) …

Member Avatar for diafol
0
801
Member Avatar for mehdi.yazdani

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]

Member Avatar for cereal
0
167
Member Avatar for Malaoshi

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 …

Member Avatar for cereal
0
329
Member Avatar for devchawla69

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.

Member Avatar for skraps
0
121
Member Avatar for saybabs

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]

Member Avatar for diafol
0
358
Member Avatar for rajandass65

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.

Member Avatar for rayidi
0
138
Member Avatar for tgr0ss83

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' => …

Member Avatar for cereal
0
94
Member Avatar for rotten69

imo the best exercise is to try to solve problems here in the forum ;)

Member Avatar for rotten69
0
213
Member Avatar for shamsidah

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

Member Avatar for shamsidah
0
121
Member Avatar for vedro-compota

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.

Member Avatar for cereal
0
96
Member Avatar for aaloo

Try add the url to the URLRequest: [code]var myRequest:URLRequest = new URLRequest("http:/your_server/test.php");[/code] bye.

Member Avatar for aaloo
1
1K
Member Avatar for cmps

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 …

Member Avatar for cmps
0
130
Member Avatar for SarenaWilliam

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: …

Member Avatar for cereal
0
73
Member Avatar for Martin C++

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']; …

Member Avatar for cereal
0
3K
Member Avatar for trektrak

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.

Member Avatar for trektrak
0
77
Member Avatar for stanley87

You can try array_intersect_key(): [url]http://www.php.net/manual/en/function.array-intersect-key.php[/url] bye

Member Avatar for stanley87
0
191
Member Avatar for DarkBerzerk

cPanel is not a CMS (Content Management System), what you're looking for is something like joomla, drupal, mambo...

Member Avatar for diafol
0
111
Member Avatar for bibiki

Change line 12 with [icode]mysql_query($sql, $con) or die(mysql_error());[/icode] and see what it happens, bye.

Member Avatar for bibiki
0
153
Member Avatar for jacob21
Member Avatar for davy_yg

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.

Member Avatar for simplypixie
0
80
Member Avatar for davy_yg
Re: Date

Add strtotime(): [icode]date('j-M-Y',strtotime($data['tgl_masuk']))[/icode] bye :)

Member Avatar for davy_yg
0
122
Member Avatar for bossie09

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 :)

Member Avatar for simplypixie
0
80
Member Avatar for gikonyo

@gikonyo you could do the same: [url]http://www.swreg.org/getting_started_guide.htm[/url]

Member Avatar for gikonyo
0
111
Member Avatar for extjac

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 …

Member Avatar for cereal
0
80
Member Avatar for gunnerone

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 = …

Member Avatar for cereal
0
296
Member Avatar for rohit.k2903

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?

Member Avatar for diafol
0
127
Member Avatar for theophalus

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]

Member Avatar for cereal
0
290
Member Avatar for mrhankey

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.

Member Avatar for cereal
0
187
Member Avatar for bbman

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 …

Member Avatar for cereal
0
94
Member Avatar for daniel36
Member Avatar for cereal
0
53
Member Avatar for sugumarclick

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] …

Member Avatar for cereal
0
945
Member Avatar for sbhatt

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 …

Member Avatar for cereal
0
104
Member Avatar for kay19

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.

Member Avatar for cereal
0
135
Member Avatar for geneh23

Change this: [code]$categories = $row[/code] with: [code]$categories = $row;[/code] ;D

Member Avatar for geneh23
0
132
Member Avatar for tanha

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, …

Member Avatar for diafol
0
101
Member Avatar for 54uydf

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 …

Member Avatar for cereal
0
184
Member Avatar for hotice47

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 …

Member Avatar for cereal
0
208
Member Avatar for mangel.murti

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 …

Member Avatar for cereal
0
99
Member Avatar for ebanbury

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 …

Member Avatar for ebanbury
0
252
Member Avatar for mwenyenia07

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 :)

Member Avatar for cereal
0
1K
Member Avatar for BlurrieBlue

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 …

Member Avatar for BlurrieBlue
0
753
Member Avatar for jacob21

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]

Member Avatar for cereal
0
159
Member Avatar for davy_yg

change it with this: [code]echo '<img src="'.$data['gambar'].'"><br>';[/code] bye :)

Member Avatar for cereal
0
4K
Member Avatar for morrisproject

You should post your update query and the form used. Without code we can't tell you where mistakes are.

Member Avatar for morrisproject
0
134
Member Avatar for SmallCucumber

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 () …

Member Avatar for SmallCucumber
0
237
Member Avatar for minitauros

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.

Member Avatar for minitauros
0
477
Member Avatar for xavialonso

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]

Member Avatar for cereal
0
103
Member Avatar for newprimitive
Member Avatar for mschroeder
0
425
Member Avatar for eve_moore

Apparently there's nothing wrong. Which error are you receiving? [b]$product[/b] is defined like: [icode]$product = $_POST['product'];[/icode]?

Member Avatar for cereal
0
94
Member Avatar for onus

[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 …

Member Avatar for cereal
0
125

The End.