2,113 Posted Topics

Member Avatar for foxwizzy

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

Member Avatar for foxwizzy
0
117
Member Avatar for nadiam

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 …

Member Avatar for Lsmjudoka
0
354
Member Avatar for Karry.Stewart

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 …

Member Avatar for cereal
0
303
Member Avatar for João_5

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 …

Member Avatar for cereal
0
777
Member Avatar for ditty

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.

Member Avatar for mybids
0
173
Member Avatar for Ramesh Konda

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

Member Avatar for cereal
0
335
Member Avatar for dany12

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.

Member Avatar for dany12
0
3K
Member Avatar for janjini.10

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 …

Member Avatar for cereal
0
206
Member Avatar for kanoy83

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.

Member Avatar for kanoy83
0
3K
Member Avatar for karen.frias0316

Hi, are you using this sdk? https://github.com/facebook/facebook-php-sdk Do you get any errors?

Member Avatar for karen.frias0316
0
354
Member Avatar for freely.willy.3

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 …

Member Avatar for brandon66
0
3K
Member Avatar for CoolAtt

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 …

Member Avatar for CoolAtt
0
348
Member Avatar for phphp

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

Member Avatar for phphp
0
145
Member Avatar for diafol
Member Avatar for Jamblaster

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

Member Avatar for Jamblaster
0
7K
Member Avatar for cereal

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

Member Avatar for cereal
1
4K
Member Avatar for saadi06

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!

Member Avatar for saadi06
0
153
Member Avatar for saadi06

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 …

Member Avatar for cereal
0
359
Member Avatar for mmcdonald

Use `htmlspecialchars()` or `htmlentities()`: * http://php.net/manual/en/function.htmlspecialchars.php * http://php.net/manual/en/function.htmlentities.php

Member Avatar for mmcdonald
0
148
Member Avatar for dany12
Member Avatar for rhodoscoder

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.

Member Avatar for cereal
0
220
Member Avatar for cussel

@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)] = …

Member Avatar for cmps
0
358
Member Avatar for phpfreek2007

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 …

Member Avatar for mikepeal
0
367
Member Avatar for Ancient Dragon

@AD right now you can try with: member "dani" site:daniweb.com On the google search bar seems to work. Bye!

Member Avatar for Ancient Dragon
0
252
Member Avatar for Benjamin_4

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

Member Avatar for cereal
0
2K
Member Avatar for dyea.marcello

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.

Member Avatar for diafol
0
508
Member Avatar for Szabi Zsoldos

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

Member Avatar for Szabi Zsoldos
0
229
Member Avatar for elptuxman

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 …

Member Avatar for cereal
0
178
Member Avatar for faisal6621

Read this thread: http://www.daniweb.com/web-development/php/threads/398419/domain-availability-check Bye.

Member Avatar for cereal
0
89
Member Avatar for saravananosiz

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.

Member Avatar for saravananosiz
0
690
Member Avatar for Donima4u

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

Member Avatar for cereal
0
525
Member Avatar for gogs85

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.

Member Avatar for cereal
0
3K
Member Avatar for gtsiga

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.

Member Avatar for gtsiga
0
542
Member Avatar for chrisschristou

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 …

Member Avatar for chrisschristou
0
195
Member Avatar for Shikha_1
Re: Php

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 …

Member Avatar for bradly.spicer
-2
151
Member Avatar for venkyb47

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 …

Member Avatar for venkyb47
0
198
Member Avatar for blueguy777

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

Member Avatar for blueguy777
0
328
Member Avatar for davecoventry

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 …

Member Avatar for davecoventry
0
166
Member Avatar for prashant.tiwari.737

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 …

Member Avatar for cereal
0
198
Member Avatar for cgull

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

Member Avatar for cereal
0
290
Member Avatar for iamthwee

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.

Member Avatar for cereal
0
812
Member Avatar for wvoke9

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*

Member Avatar for cereal
0
296
Member Avatar for Shikha_1
Re: php

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.

Member Avatar for Shikha_1
0
103
Member Avatar for happygeek
Member Avatar for carolyn85

Hi, please be more specific about your issue, currently I don't see any attachment to your post.

Member Avatar for Nutster
0
130
Member Avatar for lewashby

Check if the file and also the directory containing the database, have read and write permissions.

Member Avatar for lewashby
0
4K
Member Avatar for toldav

**@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

Member Avatar for minitauros
0
295
Member Avatar for pritaeas

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 …

Member Avatar for Dani
0
1K
Member Avatar for pritaeas
Member Avatar for diafol
0
1K
Member Avatar for Mike_H

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

Member Avatar for pritaeas
0
308

The End.