2,113 Posted Topics
Re: Also, while trying your download link, I got this: [1] 27470 HTTP/1.1 200 OK Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Content-Encoding: gzip Content-Length: 254 Content-Type: text/html Date: Wed, 04 Sep 2013 21:57:30 GMT Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache Server: Apache/2 Set-Cookie: PHPSESSID=[REMOVED]; path=/ Set-Cookie: =1; expires=Wed, … | |
Re: Does the table `comment` exists? The complete error should be something like: > mysql_fetch_array() expects parameter 1 to be resource, boolean given Which means the query on line `19` returned false. In addition from line `12` to `14` you're not executing any query. So if the table does not exists … | |
Re: You can change `$data` to a property of the class, so you can do: class Page extends CI_Controller { // declare property protected $data; public function __construct() { parent::__construct(); // define the property $this->data['assets'] = array( 'style' => base_url().'assets/css/style.css', 'connection' => base_url().'assets/images/connection.jpg', 'collaboration' => base_url().'assets/images/collaboration.jpg', 'solution' => base_url().'assets/images/solution.jpg', 'connectionUrl' => … | |
Re: `assets` is outside the application directory? What do you get from CI logs? | |
Re: Line 8, change it to: if($db = sqlite_open('./ET')) I suppose `ET` is the name of the database file. | |
Re: I'm not sure why this happens, but **increment** and **decrement** methods seems to be buggy: the library is still using a deprecated function to retrieve results: `memcached_fetch` instead of `memcached_fetch_result`. On github there are few pull request that solves most of the open issues with the increment function, but it … ![]() | |
Re: > Could a problem unserializing() be caused by a session cookie size that is too big (and therefore the serialized version wasn't fully writen)? I think this could still be a valid reason, because in `sess_read()` there is: // Decrypt the cookie data if ($this->sess_encrypt_cookie == TRUE) { $session = … | |
Re: If you're using Google Chrome, open the page of your script, then open the Javascript Console (CTRL+Shift+J), open the `Network` tab and try select an option from the form, if the AJAX works fine you will see a POST request, by clicking on the `Name` (probably the url of the … | |
Hello, I'm wondering if I can get help to understand the behaviour of a PHP function: `dns_get_record()`. This returns an array with DNS records for the given domain name, here is an example of the output: php > print_r(dns_get_record('php.net', DNS_TXT)); Array ( [0] => Array ( [host] => php.net [type] … | |
Re: The problem in your script seems related with this `$data['logo_image']->logo_image`, the script tries to get an object from an array, you should get an error for this. Anyway change this block: if ($result) { if ($result['file_name']) { $data['logo_image'] = $result['file_name']; if ($data['logo_image']->logo_image) { unlink($data['logo_image']->logo_image); } $data['user_id'] = $this->session->userdata('user_id'); $this->user_admin_model->saveProfilelogo($data); // … | |
Re: Looking at the code you could get your result just by replacing: return $file; With: return $file . image_type_to_extension($image_info[2]); But you should already get this, since it is used between line `61` and `80`. | |
Re: You can use `find` or `tree` for example, or `mc` to use something interactive. But if you explain why you cannot use `ls` maybe we can suggest the best solution for you. | |
Re: Hi, late reply, but it can still be useful for people searching. At line 19 you wrote: $link = 'http://search.twitter.com/search.rss?geocode=' . $lat . $sp . $long . $sp . $radius; which it may be valid in API 1.0, but in Twitter API 1.1 the link changes to: $link = "https://api.twitter.com/1.1/search/tweets.json?geocode=$lat,$long,$radius&q=pizza"; … | |
Re: Currently it runs twice. Change line 10 to: $sent = mail($email, $subject, $message, $headers); And line 13 to: if($sent === TRUE) { # success } else { # failure } | |
Re: Show the query that you use to select. Also, to remove white space use `trim()`. This function exists in PHP and MySQL, so when you insert from PHP you can just do something like this: $var = trim($var); if you want to fix the rows in your table, you can … | |
Re: You will probably need to perform a subquery in order to get the results of the cases, and then sum the results in the main query, this should work: SELECT s.soldby AS 'sales person', SUM(sub.packages) AS packages, SUM(sub.sales) AS total FROM sales AS s, (SELECT id, soldby, CASE WHEN package … | |
Re: Basically when you register the data sent by the registrant, you have to use the E-mail library: * http://ellislab.com/codeigniter/user-guide/libraries/email.html If you're still in doubt show your code. | |
Re: `News` is a subdirectory? CodeIgniter is installed there? Try: http://localhost/index.php/pages/create | |
Re: It seems a method of the class `FGMembersite()` to start a database connection, check in `./include/fg_membersite.php` for more details. | |
Re: Add mysql_error() to your execution: mysql_query($query) or die(mysql_query()) This will output the error, it should help you to solve the problem. | |
Re: So, a part the name of the function that is wrong `upolad()` instead of `upload()` what's the problem with your script? | |
Re: **@szabizs** You don't need to add `ALL` to retrieve complete entries from those arrays, just: print_r($this->input->get()); Same applies to `post()` method. | |
Re: Have you tried the `Model::find()` method? As example: $row = $this->Test->find('first', array( 'conditions' => array('Test.username' => 'jimmorrison') )); print_r($row); More info: http://book.cakephp.org/2.0/en/models/retrieving-your-data.html | |
Re: If you want to use a link identifier as second paramenter you should remove the closing quote, so from this: $email = mysql_query("myquery, $connectmysql"); to this: $email = mysql_query("myquery", $connectmysql); Also you have to use `mysql_fetch_*` functions before you can access the resource results: * row: http://www.php.net/manual/en/function.mysql-fetch-row.php * assoc: http://www.php.net/manual/en/function.mysql-fetch-assoc.php … | |
Re: Are you also storing the path in which the file is saved? | |
Re: Works fine for me. Probably it depends by your DNS, try to run this from a terminal: dig www.kovaidonbosco.com and then: dig @8.8.8.8 www.kovaidonbosco.com and: dig www.kovaidonbosco.com.cdn.cloudflare.net In the first two cases, if cloudflare is off, you should get your server IP. For more information check: https://support.cloudflare.com/entries/22066298-Hosting-Partner-Troubleshooting | |
Re: Not sure if this helps, I checked the source of `thr_lock.c` as suggested here: http://dev.mysql.com/doc/refman/5.5/en/table-locking.html It seems this depends on [`max_write_lock_count`](http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_write_lock_count), once reached the limit, all the pending read locks are released. But it appears possible to change the behaviour of the queue system. This is what is written in … | |
Re: It depends on remote websites, something like facebook allows remote logins only with OAuth methods, this means a user of facebook doesn't need to share his own credentials (as the password) with your service, check this for more information: https://developers.facebook.com/docs/facebook-login/ In other cases (HTTP Basic Authentication & Co.) you can … | |
Re: You can do that throught the `attach()` method: http://swiftmailer.org/docs/messages.html#attaching-files If you still don't solve the problem post an example of the code here, bye. | |
Re: Try to remove `['Post']` from the variables, for example: `$post['title']` instead of `$post['Post']['title']`. | |
Re: Change this line: $srclocation = $_SERVER['SERVER_NAME']."/includes/key.php"; With: $srclocation = $_SERVER['DOCUMENT_ROOT']."/includes/key.php"; `SERVER_NAME` will return the domain name, not the path. | |
Re: That loop will generate: $hrs = array("2013-07-27 13:00", "2013-07-27 13:49", "cucu"); If you need a multidimensional array an easy solution is to start like this: $result = array(); $hrs = array(); And after the loop: $result[] = $hrs; var_dump($result); If you don't have other segments to add, i.e.: $result = … | |
Re: Try **igbinary** instead of serialize/unserialize, it is faster. Also you can try to store these objects to memory, through **Memcached**. Since session files will be written to disk you get high I/O activity and this, if session directory is in the same disk of the web server, can decrease performance. … | |
Re: This is MySQL forum, not MS-SQL, also you're cross-posting: http://www.daniweb.com/web-development/databases/ms-sql/threads/459794/daily-backup-from-sql-server | |
Hello, I've an array with different type of values: int, null, strings, arrays. I'm trying to remove nulls and empty strings, but I want to save ints, even when it equals to zero, so I tried with `array_filter()`, by default it will remove `0`, `''` and `null`, but by applying … | |
Re: That means you are using FastCGI, you can also use `echo PHP_SAPI;` | |
Re: I usually use text editors like gedit, jEdit (which is cross-platform and my choice in Windows environments) and nano when working without a gui. ![]() | |
Re: If there aren't any `NULL` values you could use `CONCAT()`. For example you have a table like this: create table posts( id auto_increment primary key not null, title varchar(255) not null, body text not null, created_at datetime not null, updated_at datetime not null ) engine = myisam default charset=utf8; Now … | |
Re: Hi, on line 59 change this: $result=mysql_query($qry); to: $result=mysql_query($qry) or die(mysql_error()); This will display the details of the error, check if it helps to solve the problem, bye! | |
Re: First, remove `global $userInfo;` from line `33`, and set it as public/protected/private variable at the top of the class: class Action { public $userInfo; So, at line `47` you can write: $this->userInfo = $stmt->fetch_array(MYSQLI_ASSOC); | |
Re: Not tested, but if I'm not wrong this `$cmd->bind_param("s", $where);` will insert the value of **$where** as a string, so: 'autod.mark=7' instead of: `autod`.`mark`=7 If you try to display the error of the query you should get something like: Warning | 1292 | Truncated incorrect INTEGER value: 'autod.mark=7' | |
Re: `use` is a [reserved word](http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html) so, or you use backticks around the word or you alter the table. In addition: the methods available for the form are POST, GET, PUT and [other methods](http://tools.ietf.org/html/rfc2616#section-9.1). REQUEST is a generic method used to retrieve data in PHP, don't use it in the method … ![]() | |
Re: Yes. The RFC cited in PHP documentation explains that the semicolon is used to separate groups of mails, for example: To: list-a: abc@localhost.tld, cba@localhost.tld;, list-b: admin@localhost.tld, info@localhost.tld; | |
Re: Hi, so, the folder of the subdomain (dev) is inside the `DocumentRoot` of the main domain? Can you show the configuration? The folder structure is something like below? c:\sites\mysite c:\sites\mysite\application c:\sites\mysite\system c:\sites\mysite\public_html\index.php c:\sites\mysite\public_html\dev c:\sites\mysite\public_html\dev\public_html\index.php c:\sites\mysite\public_html\dev\application c:\sites\mysite\public_html\dev\system | |
Re: Hi, the config seems fine, so it can be a permission issue or the mime-type (each CGI needs the mime-type declaration at the top of the script), check this link for more information: http://httpd.apache.org/docs/2.2/howto/cgi.html#writing Also, check Apache error logs to get more details about the issue. Hope it helps. | |
Re: What it does `$this->data['new_comment'] = $this->blog_comment_m->get_new();` ? I see it's used in two cases: 1. GET request, no form submit; 2. and when validation is true, rewriting a previous setting of `$this->data['new_comment']`. In the first case the objects should return null/false, so that the default value for `set_value('name', $default)` is … | |
Re: This is not related to PHP. Search for `jquery sidebar` or `javascript sidebar` in Google, there are many examples. | |
Re: Works fine for me, what error you get? Here's my test, based on your scripts: <?php session_start(); ?> <form method="post"> Validation code: <img src="captcha.php?rand=<?php echo rand();?>" id='captchaimg'><br /> <label for='6_letters_code'>Enter the code above here:</label> <input type="text" name="6_letters_code" /> </form> <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { echo 'POST: '; print_r($_POST); echo '<br … | |
Re: @Atli One to take in account is this: http://www.php.net/archive/2012.php#id2012-05-03-1 It referes to 5.3 and previous versions. Here's some info: http://www.daniweb.com/web-development/php/threads/422387/vulnerability-in-php-cgi | |
Re: If you want something that runs on background you can consider a [MySQL trigger](http://dev.mysql.com/doc/refman/5.0/en/triggers.html) and Gearman, check the example about URL Processing [in these slides.](http://assets.en.oreilly.com/1/event/21/Map_Reduce%20and%20Queues%20for%20MySQL%20Using%20Gearman%20Presentation.pdf) Bye. |
The End.