Posts

Showing posts from June, 2015

Dislay PHP Array data in User understandable Form or in table form

Array $booking_array = array( "slots_booked" => $slots_booked, "booking_date" => $booking_date, "cost_per_slot" => number_format($cost_per_slot, 2), "name" => $name, "email" => $email, "phone" => $phone ); using print_r() <?php print_r('<pre>'); print_r($booking_array); print_r('</pre>'); ?> output : Array ( [slots_booked] => 13:00:00| [booking_date] => 2015-06-28 [cost_per_slot] => 20.50 [name] => sdsafd [email] => ssiii@gmail.com [phone] => 9898989898 ) In User Understandable table form <?php echo 'Your Deatils'. '<br/><br/>'; echo 'Appointment Time' . $slots_booked .'<br/>'; echo 'Appointment Date' . $booking_date .'<br/>'; echo 'Appointment Cost' . $cost_per_slot .'<br/>'; echo &

Remove .html extensions from url

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.html [L]

How to Remove .html, .php, .html extensions using .htaccess

An  .htaccess  file is a simple ASCII file that you create with a text editor like Notepad or TextMate. It provides a way to make configuration changes on a per-directory basis. Please note that  .htaccess  is the file’s extension. It isn’t  file.htaccess , it is simply  .htaccess . .htaccess  files affect the directory in which they are placed and all sub-directories. For example if there is one  .htaccess  file located in your root directory of yoursite.com, it would affect yoursite.com/content/, yoursite.com/content/images/, etc. It is important to remember that this can be prevented — for example if you don’t want certain .htaccess commands to affect a specific directory — by placing a new  .htaccess  file within the directory you don’t want affected with the changes, and removing the specific command(s) from the new .htaccess file that you do not want affecting this directory. Features With an  .htaccess  file you can: Redirect the user to different page Password

Set Relative URLs With the “base” Tag

The  <base>  tag in HTML is a relatively little known element, having become a fully fledged  part of HTML5  quite recently. It enables you to do two things: Set any URL you choose as the base for all relative URLs. Set default link targets. The Base-ics The  <base>  element is defined in the  <head>  section and you can only use it once per document. You should place it as early as possible in your head section so you can use it from that point on. Its two possible attributes are  href  and  target . You can use either of these attributes alone or both at once. Example 1: Asset Loading Shortcut Let's say you have a site which stores all its images and CSS in a folder named "assets". You might define your  <base>  tag like so: 1 2 3 < head >      < base href = " http://www.myepicsite.com/assets/ " > </ head > This would then allow you to load in any images or CSS like this: 1