2,113 Posted Topics
Re: Read this guide: [url]http://phpsec.org/projects/guide/[/url] Bye. | |
Re: 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 :) | |
Re: Are you using Full-text searches? Check this: [url]http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html[/url] bye. | |
Re: Please use CODE tags and tell us in which line you get the error. Bye. | |
Re: 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)) ? … | |
Re: 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 :) | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: Set global both sides: [code]function a() { global $b; echo $b; } function c() { global $b; $b = 'hello world'; return $b; } c(); echo a(); [/code] | |
Re: 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 … | |
Re: 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 … | |
Re: Try to add [icode]position: relative;[/icode] to #content rule and to .photo-link I think you can also remove height:100% from #content. | |
Re: 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. | |
![]() | Re: Check this: [url]http://www.yiiframework.com/doc/guide/1.1/en/database.dao[/url] bye. |
Re: define $total outside the loop: [icode]$total = '';[/icode] bye. | |
Re: 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] | |
Re: The table name is "database"? check if your query is right. Bye. | |
Re: 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] | |
Re: Are you sure exec() is enabled? In php.ini file you can set a list of functions to disable. Besides: +1 for linux ;p | |
Re: 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. | |
Re: Remove the $ sign at lines 95 and 96: [code]$title = $row["searchtype"]; $price = $row["price"];[/code] bye | |
Re: 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. | |
Re: 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. | |
Re: Check the JSON/Atom Custom Search API: [url]http://code.google.com/apis/customsearch/v1/overview.html[/url] bye | |
![]() | Re: 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 … |
Re: 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 :) | |
Re: I think you need to use imagesavealpha(): [url]http://php.net/manual/en/function.imagesavealpha.php[/url] Place it just before imagepng(). Bye :) | |
Re: You have already asked this question here: [url]http://www.daniweb.com/web-development/php/threads/407319[/url] | |
Re: 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 … | |
Re: [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. | |
Re: Just another version :P [code]<?php $a = array('/st/','/nd/','/rd/','/th/'); echo preg_replace($a,'<sup>$0</sup>',date('dS F Y')); ?>[/code] ![]() | |
Re: 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 :) | |
Re: 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] ![]() | |
Re: Which one are you using? There are different kinds of nosql databases.. bye :) | |
Re: You need array_reverse(): [url]http://php.net/manual/en/function.array-reverse.php[/url] | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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] | |
Re: 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 :) | |
Re: 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. | |
Re: 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 :) | |
Re: Use json_decode() [url]http://www.php.net/manual/en/function.json-decode.php[/url] bye | |
Re: 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. | |
Re: 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 :) | |
Re: Add imagejpeg(): [url]http://php.net/manual/en/function.imagejpeg.php[/url] bye :) | |
Re: On last file try to move [icode]session_start();[/icode] at very top of the file. Bye. |
The End.