2,113 Posted Topics

Member Avatar for RazorRamon
Member Avatar for minitauros
0
282
Member Avatar for wwefriend

Change it to: [code]$sub = $item->item_qty * $item->item_price * (($item->kilogram == 0) ?:$item->kilogram); # inside the array: 'item_subtotal' => $sub, 'item_total' => $sub[/code] bye :)

Member Avatar for cereal
0
92
Member Avatar for zrony

Are you using Full-text searches? Check this: [url]http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html[/url] bye.

Member Avatar for cereal
0
86
Member Avatar for Baburhytha
Member Avatar for pritaeas
0
1K
Member Avatar for Joe34

Try this: [code]<?php $a = array('test','text','ext','tex','deer'); # words to filter $b = array('e','s','t','d','r'); # letters to check function c($letter,$array) { $n = strlen($letter); $r = array(); for($i = 0; $i < $n; $i++) { if(in_array($letter[$i],$array)) { $r[] = true; } else { $r[] = false; } } return (in_array(null,$r)) ? …

Member Avatar for cereal
0
251
Member Avatar for smohhh

Change this line: [code]$array = array($first_name[$x]=>(explode(",",$last_name[$x])));[/code] to: [code]$array[$x] = array($first_name[$x]=>(explode(",",$last_name[$x])));[/code] This it should work. Remember to declare [icode]$array = array();[/icode] before the loop. Bye :)

Member Avatar for cereal
0
249
Member Avatar for ebanbury

As Pritaeas suggested here is an example code for MySQL shell: [code=mysql]mysql> select password('test'); +-------------------------------------------+ | password('test') | +-------------------------------------------+ | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 | +-------------------------------------------+ 1 row in set (0.00 sec) mysql> create user 'dreamsin'@'localhost' identified by '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; mysql> grant select, insert, update, delete, create, create view, drop, alter on db_name.* to …

Member Avatar for ebanbury
0
263
Member Avatar for Tssouthpark

That's normal, use [url]http://php.net/manual/en/function.urlencode.php[/url] Or replace the spaces with an underscore, you can use str_replace(), bye

Member Avatar for cereal
0
144
Member Avatar for danielbala

This is wrong: [code]$_EmpRole = mysql_real_escape_string($_EmpRole); $_EmpName = mysql_real_escape_string($_EmpName); $_EmpFatherName = mysql_real_escape_string($_EmpFatherName); $datepicker = mysql_real_escape_string($datepicker); $_EmpMaritalStatus = mysql_real_escape_string($_EmpMaritalStatus); $gender = mysql_real_escape_string($gender); $_EmpActivityRadio = mysql_real_escape_string($_EmpActivityRadio); $_EmpAddress = mysql_real_escape_string($_EmpAddress); $_EmpQuali = mysql_real_escape_string($_EmpQuali); $_EmpPhoto2 = mysql_real_escape_string($_EmpPhoto2); $_EmpBiodata = mysql_real_escape_string($_EmpBiodata); $_DOJoin = mysql_real_escape_string($_DOJoin); $_EmpIDproof = mysql_real_escape_string($_EmpIDproof); $_EmpMedIns = mysql_real_escape_string($_EmpMedIns); $_EmpSalary = mysql_real_escape_string($_EmpSalary);[/code] change each …

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

Set global both sides: [code]function a() { global $b; echo $b; } function c() { global $b; $b = 'hello world'; return $b; } c(); echo a(); [/code]

Member Avatar for Martin C++
0
126
Member Avatar for seacore

Yes it is possible. Just change VirtualHost and DocumentRoot directives inside each virtual host file, you can find them inside /etc/apache2/sites-available and sites/enabled. After that reload the server. You may want to move your thread to Hardware & Software > Linux and Unix > Linux Servers and Apache forum, to …

Member Avatar for cereal
0
62
Member Avatar for ayub05

The page is not blank, check the source, there is a script tag: [code]<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>[/code] is this yours? Check the access and error logs of your server and see if somebody is cracking into your website. Besides, sometime ago we suggested you to change the database password: [url]http://www.daniweb.com/web-development/php/threads/401905[/url] Because …

Member Avatar for cereal
0
193
Member Avatar for Karrashin

Try to add [icode]position: relative;[/icode] to #content rule and to .photo-link I think you can also remove height:100% from #content.

Member Avatar for asprin
0
232
Member Avatar for Joe34

stop condition is lenght: 4^1 + 4^2 + 4^3 + 4^4 = 340 possible combinations (or 336 if starting from 4^2) when the script collects 340 unique combinations then it can stop.

Member Avatar for pritaeas
0
2K
Member Avatar for Sabyre
Member Avatar for draven07

Check this: [url]http://www.yiiframework.com/doc/guide/1.1/en/database.dao[/url] bye.

Member Avatar for pritaeas
0
77
Member Avatar for issaru07
Member Avatar for cereal
0
366
Member Avatar for Octet

In addition search for "MySQL hardening" to enhance MySQL config and try RatProxy to test your application: [url]http://code.google.com/p/ratproxy/[/url]

Member Avatar for rubberman
0
244
Member Avatar for danielbala
Member Avatar for pritaeas
0
134
Member Avatar for degroundshaker

Check if the path is not wrong in the action attribute of the form tag, it seems the document is not found: [icode]Additionally, a 404 Not Found error...[/icode]

Member Avatar for pzuurveen
0
330
Member Avatar for Chub97

Are you sure exec() is enabled? In php.ini file you can set a list of functions to disable. Besides: +1 for linux ;p

Member Avatar for Chub97
0
608
Member Avatar for subrata_ushasi

Just a note the number sign # is a comment, if you want to enable listening on a specific ip you have to remove that. Bye.

Member Avatar for cereal
0
71
Member Avatar for issaru07

Remove the $ sign at lines 95 and 96: [code]$title = $row["searchtype"]; $price = $row["price"];[/code] bye

Member Avatar for cereal
0
240
Member Avatar for dkjuk

First file basing on what? Name, creation date, update date, extension? Why don't you add a "cover" field in the gallery table? So when inserting images the user can choose the image to display on top.

Member Avatar for cereal
0
147
Member Avatar for sesniel

Check /etc/mysql/my.cnf in the second server for bind-address option and change it from 127.0.0.1 to 192.168.0.16 after that reload or restart MySQL. Then make sure the firewall of that server is not blocking 3306 port (which is the default port form MySQL). bye.

Member Avatar for cereal
0
81
Member Avatar for eduard77

Check the JSON/Atom Custom Search API: [url]http://code.google.com/apis/customsearch/v1/overview.html[/url] bye

Member Avatar for cereal
0
126
Member Avatar for diafol

This article is a good start: [url]http://devzone.zend.com/1254/getting-started-with-openid-and-php/[/url] I did it once, for a project in which I adopted Janrain solution (most because I could not use the PEAR package): [url]http://www.janrain.com/[/url] This plugin remembers the user (even after logout) and when he comes back gives a suggestion. In that project, users …

Member Avatar for cereal
0
273
Member Avatar for ahromi

If you work in a chroot jail it is simple enough, configure and install apache and php, edit httpd.conf and php.ini and then just copy the jail where you want. Check this link for more information [url]https://wiki.ubuntu.com/DebootstrapChroot[/url] bye :)

Member Avatar for ahromi
0
238
Member Avatar for dualzNZ

I think you need to use imagesavealpha(): [url]http://php.net/manual/en/function.imagesavealpha.php[/url] Place it just before imagepng(). Bye :)

Member Avatar for cereal
0
131
Member Avatar for asif49

You have already asked this question here: [url]http://www.daniweb.com/web-development/php/threads/407319[/url]

Member Avatar for asif49
0
1K
Member Avatar for emannoor455

Are you using a database or is just a directory? If only a directory (images) and no database registration you can use glob(): [code]<?php # GLOB_NOSORT flag will help to go a bit faster $a = glob('a_*.jpg',GLOB_NOSORT); $b = glob('b_*.jpg',GLOB_NOSORT); echo count($a) . " " . count($b); ?>[/code] This can …

Member Avatar for emannoor455
0
1K
Member Avatar for Farhad.idrees

[code]<?php $brush_price = 5; $quantity = 10; $total = $brush_price * $quantity; echo "<table border=\"1\" align=\"center\"> <tr><td>Quantity</td><td>Price</td></tr> <tr><td>$quantity</td><td>$total</td></tr>"; ?>[/code] Bye.

Member Avatar for cereal
0
183
Member Avatar for jhbalaji

Just another version :P [code]<?php $a = array('/st/','/nd/','/rd/','/th/'); echo preg_replace($a,'<sup>$0</sup>',date('dS F Y')); ?>[/code]

Member Avatar for diafol
0
196
Member Avatar for Farhad.idrees

Add a loop: [code]$Families = array ( "Farhad" =>array("Ali","Haider","Kashan"), "Sufyan" => array("Shahbaz","Ali2","Azaan")); foreach($Families as $key2=>$values3) { foreach($values3 as $v) { echo "$key2 $v"; { }[/code] bye :)

Member Avatar for Farhad.idrees
0
168
Member Avatar for tarunfuture

You have to use switch() inside your index.php, an example: [code]<?php $action = $_GET['action']; switch($action) { case 'login': # code for login page break; case 'index': default: # code for home page } ?>[/code] [url]http://php.net/manual/en/control-structures.switch.php[/url]

Member Avatar for diafol
0
174
Member Avatar for sidra 100
Member Avatar for sacarias40
Member Avatar for sacarias40
0
131
Member Avatar for clerisy

You need array_reverse(): [url]http://php.net/manual/en/function.array-reverse.php[/url]

Member Avatar for cereal
0
56
Member Avatar for glut

This will display user IP: [code]<?php echo $_SERVER['REMOTE_ADDR']; ?>[/code] Then use GD library or imagemagick to create an image from that text, for example with imagemagick from command line it will be: [code]<?php $ip = $_SERVER['REMOTE_ADDR']; exec("convert -pointsize 30 -label '$ip' image.gif"); ?>[/code] Anyway a section for .htaccess is in …

Member Avatar for cereal
0
168
Member Avatar for ItecKid

Change addslashes() with mysql_real_escape_string() at line 16. But you should also move file somewhere else with move_uploaded_file() and check for mime-type match. Bye.

Member Avatar for cereal
0
2K
Member Avatar for BenzZz

Why don't you set a random password and send that to the user via email? That way the user will change it after he logs to his own profile.

Member Avatar for BenzZz
0
192
Member Avatar for manc1976

Why all those quotes? Rewrite your statements: [code]if($_POST['type_id'] == FALSE && $_POST['location_id'] > 0 && $_POST['bedroom_id'] > 0 && $_POST['price_id'] > 0)[/code]

Member Avatar for cereal
0
260
Member Avatar for atp_mqk

The query is wrong, you wrote: [code]mysql_query("insert into exp values('$org','$des','$stat','$duty','$from','$to')");[/code] But the database table does not know in which order and which fields you are requesting to be written, so change your code with this, or similar adapting to your database table: [code]mysql_query("insert into exp ('org','des','stat','duty','from','to') values('$org','$des','$stat','$duty','$from','$to')");[/code] bye :)

Member Avatar for cereal
0
280
Member Avatar for Xufyan

Set the same name attribute to both input: [code]<input type="radio" name="button1" value="on" /> on <input type="radio" name="button1" value="off" /> off[/code] And in PHP side check for $_POST['button1'] value, bye.

Member Avatar for aadesh.aakash
0
1K
Member Avatar for asif49

Almost there, you don't need create function but getElementsByTagNameNS(): [url]http://www.php.net/manual/en/domdocument.getelementsbytagnamens.php[/url] [code]$i = $xmlDoc->getElementsByTagNameNS('http://search.yahoo.com/mrss/"','thumbnail'); echo $i->item(0)->getAttribute('url'); [/code] bye :)

Member Avatar for asif49
0
1K
Member Avatar for Aamit

Use json_decode() [url]http://www.php.net/manual/en/function.json-decode.php[/url] bye

Member Avatar for cereal
0
99
Member Avatar for karthik_ppts

This is not hacking but vandalism by some people who define themselves hackers and have fun doing these kind of messes.. read here: [url]http://en.wikipedia.org/wiki/Website_defacement[/url] You may need to check the code of your website and filter any input received by GET and POST forms and links. Bye.

Member Avatar for karthik_ppts
0
232
Member Avatar for davy_yg
Re: xml

You write book but in your xml the correspondent is buku, so change all them to match your xml: [code]$books = $doc->getElementsByTagName( "buku" );[/code] Also consider to use SimpleXML: [url]http://php.net/manual/en/book.simplexml.php[/url] bye :)

Member Avatar for cereal
0
108
Member Avatar for bflack
Member Avatar for bflack
0
209
Member Avatar for BenzZz
Member Avatar for BenzZz
0
271

The End.