2,113 Posted Topics
Re: You can use a loop with `in_array()`: foreach($db2 as $key) { echo in_array($key, $list) ? "<input type='checkbox' checked value='$list' />$list" : "<input type='checkbox' value='$list' /> $list"; } More information: http://php.net/in_array | |
Re: In addition to AARTI suggestions, you can do this task with one single query: insert into jannuary (ejant) select (htotal + ptotal + ttotal) as total from house, personal, transport; Consider also to switch to PDO or MySQLi, since MySQL is deprecated and will be removed by the incoming versions … | |
Re: This is created by the Apache Auto-Index module: * http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#query You can disable it by using `Options -Indexes`, or by placing an `index.html` (or `index.php`) into each directory. In alternative, if you need to create directory indexes, you should be able to stop the column sorting by using: Options +Indexes … | |
Re: Hmm, have you tried with another browser? The message can be due to an encoding problem of the page, it is not sure it's related to the server settings. Can you telnet from the clients to `10.5.135.75 80`: telnet 10.5.135.75 80 GET / HTTP/1.1 And then send two returns, if … | |
Re: What do you mean? Do you get some kind of errors or the rules are not applied? Give us more information and post your .htaccess contents here. Bye. | |
Re: Just to answer to the question, the `getAll()` method will return a multidimensional array so, if you want to print the results, you have to loop it as an associative array: foreach($rows as $author) { echo $author['first_name']; } When you apply the `convertToBeans()` method you get an array of objects: … | |
Re: At line `19` close the tag `</Directory>`. Then reload Apache and it should work. Also consider to enable the [`ServerName`](http://httpd.apache.org/docs/2.2/mod/core.html#servername) at line 9. | |
Re: In addition, check the documentation: http://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html Especially: > Indexes are less important for queries on small tables, or big tables where report queries process most or all of the rows. When a query needs to access most of the rows, reading sequentially is faster than working through an index. Sequential … | |
Re: You can use an the `md5()` MySQL function and do everything within the query: "select id from table where md5(title) = md5({$newtitle}) limit 1" Then just check with `mysql_num_rows() > 0`. Or better: create a unique index for the `title` column. | |
Re: Hi, are you using this sdk? https://github.com/facebook/facebook-php-sdk Do you get any errors? | |
Re: One of the emails is not a valid, but I think this is related to your example here. At line `16` you must use an array to set the name of the sender: $message->setFrom(array('email@here.tld', 'Name')); I do not understand this part: > Of course I paste email in the textbox … | |
Re: Add `1` after `FORWARD`, that will put the rule in the first place of the chain, otherwise the firewall applies the first matching rule. > The number given after the chain name indicates the position before an existing Rule. So, for example, if you want to insert a Rule before … | |
Re: The `die` (aka `exit`) construct requires parenthesis when you send a status, so this is wrong: die 'error here'; The correct version is: die('error here'); Reference: http://php.net/manual/en/function.exit.php | |
![]() | |
Re: Try with a pipe: exec('echo "password" | runas /user:<Computer>\User "notepad.exe"'); *Reference: [http://technet.microsoft.com/en-us/library/bb490982(en-us).aspx](http://technet.microsoft.com/en-us/library/bb490982(en-us).aspx)* | |
Hello, so I was trying few relations between tables and I noted an unexpected behaviour when using `group_concat()`. Let say I have three tables: fruits, fruitstock and fruitprices. These are the structures: create table fruits ( id tinyint unsigned not null auto_increment primary key, name varchar(50) not null, quality varchar(50) … | |
Re: Use the `t` option to limit the transcoding: ffmpeg -t 15 -i file.wav -f mp3 file.mp3 For more information type `man ffmpeg` or read this link (it's the same manual): * http://manpages.ubuntu.com/manpages/precise/man1/ffmpeg.1.html bye! | |
Re: Maybe you can add the `base64` option to the openssl command, unfortunately I cannot try right now but follow this: * http://www.vanemery.com/Linux/Apache/openSSL.html otherwise you can use `base64` command from the command line: base64 --decode source.txt > Abc.xml But in this last case, as with `base64_decode()` in PHP, you have to … | |
Re: Use `htmlspecialchars()` or `htmlentities()`: * http://php.net/manual/en/function.htmlspecialchars.php * http://php.net/manual/en/function.htmlentities.php | |
Re: Have you tried to change the type, in the ajax call, to `DELETE`? | |
Re: Consider to use **HTML Purifier** in your application: http://htmlpurifier.org/ It will give you the ability to whitelist the tags that you want to allow and, most important, it will validate the attributes, removing the javascript included. | |
Re: @cussel try this: <?php $data = array( array("1" => "12306"), array("0" => "12106"), array("1" => "12770"), array("3" => "12770"), array("3" => "12306"), array("3" => "12770") ); $newdata = array(); $result = array(); $i = 0; # reduce and reverse the $data array foreach($data as $key => $value) { $newdata[][current($value)] = … | |
Re: You need to extract them before you can work on it. Use imagemagick: [code]convert multi.tif file%d.tif[/code] When you finish you can merge them with this command: [code]convert file0.tif file1.tif file2.tif -adjoin multi.tif[/code] On PHP there's a library for that, IMagick: [url]http://php.net/manual/en/book.imagick.php[/url] but I prefer to work directly with ImageMagick, it … | |
Re: @AD right now you can try with: member "dani" site:daniweb.com On the google search bar seems to work. Bye! | |
Re: > example:monthly depreciation is 40 and accumulated value is 0 the result for accumulated value should be 40 when the value for monthly depreciation is 60 the accumulated value should add 40+60=100. So when the new monthly depreciation is `20` the new accumulated depreciation becomes `120` because the previous accumulated … | |
Re: If you change `die("Could not connect database");` with: die(mysql_error()); You should get the error code, if this does not help then paste the error here. ![]() | |
Re: So if `$camp['pozitie']` has a specific value and `$camp['cod_garantie']` is empty, you have to alter all the following positions, correct? You can add a counter and add it to the position key, here's an example: <?php $datum[] = array('name' => 'sun', 'pos' => 1, 'magnitude' => '-26.74'); $datum[] = array('name' … | |
Re: Aside note: when you go to an internet cafe here in Italy, bring an ID document with you: the operator has to register each user, this is requested by our legislation. For this reason, you cannot use your own laptop, nor your usb distribution: because in these cases the user … | |
Re: Read this thread: http://www.daniweb.com/web-development/php/threads/398419/domain-availability-check Bye. | |
Re: Hello, If I understood your problem you want to know how to connect your PHP script to Cassandra, correct? Check these links: * http://wiki.apache.org/cassandra/ClientOptions06 * http://wiki.apache.org/cassandra/ThriftExamples If you still have doubts, please post your code or at least add some details about your issue. | |
Re: It seems that `$_GET['id']` on line 5 expects the value as `id=bar/foo`, then this is rewritten by splitting the string to `id` and `p` keys on line 7 and 8. **@Donima4u** you can replace this: $id = explode('/',$_GET['id']); $_GET['id'] = $id[0]; $_GET['p'] = $id[1]; if(empty($_GET['id'])) $_GET['id']='twitter'; With this: $id = … | |
Re: Can you explain better? Are you referring to the `css` directory? You can disable the rewrite for some directories by adding this rule above yours: RewriteRule ^(css|images|js|fonts) - [L] If this does not solves then paste the entire rewrite rule and explain the issue, bye. | |
Re: I'm not sure if you're using a backtick at the end of the command to wrap `\r\n`, you have to use single quotes instead, so the correct command should be: LOAD DATA LOCAL INFILE 'C:\\temp\\test.csv' INTO TABLE bd_george.test FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' (id,name); Bye. | |
Re: An auto increment column MUST be integer, so you cannot use `cc123`, but you can create composite indexes, so you can create unique content, for example: create table mytest( id int unsigned auto_increment, code varchar(3) not null, message text, primary key (code, id) ) engine = myisam default charset=utf8; insert … | |
Re: Shikha_1 you're continuing to ignore forum rules: > Create a meaningful thread title. So you've searched and haven't found anything that fits your problem? Great! We can help, but you need to peak our interest with a thread title that briefly describes your problem. Many members browse the topic list … | |
Re: Not sure what you asking for, provide your code. Anyway you could use `mod_alias` module in Apache: * http://httpd.apache.org/docs/2.2/mod/mod_alias.html * http://httpd.apache.org/docs/2.2/mod/core.html#location That way you can return data from from server2 without actually seeing it, for example set this in **server1** config file: Alias /remotefiles http://server2.tld/files <Location /remotefiles> Order allow,deny Deny … | |
Re: As the others I've some difficult to understand the result you want to get, to me it seems a compare between A/B arrays, when the values of the correspondent keys are the same, then return `000000`, in the other cases return the value of A, unless A is `000000` itself, … | |
Re: Yup, try with a loop and ksort, an example: <?php $weightings = array(7 => 1,3 => 2,1 => 10,2 => 10,10 => 10,6 => 10,4 => 15,5 => 15,8 => 20,9 => 20); $revised_date = array(1 => 1378652385,2 => 1378654024,3 => 1378654113,4 => 1378654151,5 => 1378654201,6 => 1378654239,7 => 1378654273,8 … | |
Re: Start by removing this at line 26 remove: $data = fgetcsv($getfile, 1000, ","); You don't need it because the same runs on line 27, in the `while` statement. Remove also line 42, since the previous query is already using `mysql_query()`. Two suggestions: 1. avoid using MySQL library, and move to … | |
Re: Hi, This should do what you want: <?php $a = array( 0 => array( 'question_title' => 'Question 8', 'question_description' => '', 'type_id' => 1, 'type_title' => 'Yes/No', 'question_number' => 8 ), 1 => array( 'question_title' => 'Question 9', 'question_description' => '', 'type_id' => 1, 'type_title' => 'Yes/No', 'question_number' => 9, … | |
![]() | Re: Hi, check the Apache log files, 5xx errors are related to the server, so it can be a misconfiguration of .htaccess or something related to write permissions. |
Re: Yes you can, as sample: DELIMITER // CREATE PROCEDURE mytest(IN name VARCHAR(200)) BEGIN select * from results where candidate = name; END// DELIMITER ; Then you just need to pass the parameter name: call mytest('Sarah Smith'); *Reference: http://dev.mysql.com/doc/refman/5.5/en/create-procedure.html* | |
Re: Use trim to remove empty spaces: $cls=trim($_GET['class']); If you see, there is an empty space in your link between `class=` and the value, the spaces are encoded with `%20`. *Ref: http://php.net/manual/en/function.trim.php* **Note** next time follow the rules of the forum, use a more appropriated title. Bye. | |
Re: Hi, please be more specific about your issue, currently I don't see any attachment to your post. | |
Re: Check if the file and also the directory containing the database, have read and write permissions. | |
Re: **@toldav** the main problem is that this directive cannot be used inside the .htaccess file, you have to place it in the configuration file, check this for more information: http://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias | |
Re: Hello there! I'm occasionally experiencing some problems with the new layout: Primarly the text of the post overflows outside the right border, and if I use inline code the previous word is covered. I'm attaching an image with the different problems. In the case of the inline code the word … | |
Re: Hey Dany the `Bookmark Post` feature is awesome, great add! :) ![]() | |
Re: Also, try to trim `$email_address` value, if there is a space at the beginning or at the end you get an empty result set: $email_address = trim($_POST['email_address']); |
The End.