I normally like to use hyphens than underscores in URL. It looks more easier to read I think. But in CodeIgniter normally we can’t use hyphens in URL as hyphens isn’t allowed in function name or class name. To solve this in CodeIgniter, so the correct function name is found from the uri segment, only… Continue reading Use hyphen in CodeIgniter URL
Category: PHP
Removing index.php in codeigniter
Hey Folks, most of the new CodeIgniter developers face a problem to remove index.php from the URL. It’s pretty simple. Just write the following code in notepad and save as .htaccess. Put this file in the root folder where application, system folders are. .htaccess code: RewriteEngine on #remove access to system folder RewriteCond %{REQUEST_URI} ^system.*… Continue reading Removing index.php in codeigniter
Create a dynamic image gallery using ajax, jquery and php (XML also)
This is a tutorial to create a dynamic image gallery using jQuery ajax and php mainly. To reduce burden, I added a normal script to read directory. In gallery.php file it will read the directory and will generate a xml file which will be thrown directly to the index file (actually ajax in index file… Continue reading Create a dynamic image gallery using ajax, jquery and php (XML also)
PHP: Convert number into Text (Amount into words)
This is a php function which converts number into text. This function is developed in respect of Bangladeshi Currency (Bangladeshi Taka), but if you know a little php, you can convert it into your currency. Just call the function as [php] [/php] You will get the result. Code: [php] <?php function convert_number($number) { if (($number… Continue reading PHP: Convert number into Text (Amount into words)
PHP: Find maximum odd number of sequence in an array
This is php program that finds the maximum odd number of sequence in an array. By editing, in case of even number also be found out. Code: [php] <?php $x = array(1,7,4,5,7,5,6,3,4,6,87,53,45,567,45,43,66,56,57,5); $tot = count($x); $y = $res = array(); $y[0] = array(); $k = $j = 0; for($i = 0; $i $val) if($max ==… Continue reading PHP: Find maximum odd number of sequence in an array
A little trick to store data into mysql database from a large form
Sometimes we feel boring to write mysql insertion query to store data into database from a large form where are too many input fields (such as about 50 fields). We face problem to handle all the fields, sometimes we miss the field name. Here is a small trick to store data from such a large… Continue reading A little trick to store data into mysql database from a large form
Setup a web server in Linux Ubuntu
Try the following code in terminal: sudo apt-get install apache (For installing Apache web server) sudo apt-get install php (Install the latest version of PHP) sudo apt-get install mysql-server (Install the latest version of MySQL server) sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin (To link phpmyadmin in your webserver’s root directory) sudo /etc/init.d/apache2 force-reload (To force restart… Continue reading Setup a web server in Linux Ubuntu
Some Security Issue (php)
Never, Ever, Trust Your Users It can never be said enough times, you should never, ever, ever trust your users to send you the data you expect. I have heard many people respond to that with something like “Oh, nobody malicious would be interested in my siteâ€. Leaving aside that that could not be more… Continue reading Some Security Issue (php)
header() function in the middle of a php page
We can’t use header() function in the middle of a page in php. header() function is used for redirection. If the page prints something before this function then we get a message like “header already sent by….blablablaâ€. But we have another way to use header() function in anywhere of a page. We have to use… Continue reading header() function in the middle of a php page