Training in Web Technologies Blog

How to Unzip Files using php?

<?php $zip = zip_open(“zip.zip”); if (is_resource($zip)) { while ($zip_entry = zip_read($zip)) { $fp = fopen(“zip/”.zip_entry_name($zip_entry), “w”); if (zip_entry_open($zip, $zip_entry, “r”)) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp,”$buf”); zip_entry_close($zip_entry); fclose($fp); } } zip_close($zip); } ?>

HTML Interview Questions and Answers -10

When I try to upload my site, all my images are X’s. How do I get them to load correctly? They are a few reasons that this could happen. The most common are: 1....

HTML Interview Questions and Answers -08

Is it possible to make the HTML source not viewable? In short, there is no real method or script for making standard HTML source code not viewable. You may consider doing any of the...

HTML Interview Questions and Answers -07

Which should I use, &entityname; or &#number; ? In HTML, characters can be represented in three ways: 1. a properly coded character, in the encoding specified by the “charset” attribute of the “Content-type:” header;...

HTML Interview Questions and Answers -06

How do I specify a specific combination of frames instead of the default document? This is unfortunately not possible. When you navigate through a site using frames, the URL will not change as the...

CSS Interview Questions and Answers -13

Border around a table? Try the following: .tblboda { border-width: 1px; border-style: solid; border-color: #CCCCCC; } /*color, thickness and style can be altered*/ You put this style declaration either in an external stylesheet, or...

CSS Interview Questions and Answers -12

What is value? Value is a ‘physical’ characteristic of the property. Property declares what should be formatted, e.g. FONT while value suggests how the property should be formatted, e.g. 12pt. By setting the value...

How to Replace the Image in an ‘img’ with CSS?

I just wanted to share something I found really cool about using CSS box-sizing. Chris wrote a really good introduction a few years back if you’re not familiar with the property. It makes things a lot more...

CSS Interview Questions and Answers -09

How do I make my div 100% height? You need to know what the 100% is of, so the parent div must have a height set. One problem that people often come up against...

CSS Interview Questions and Answers -08

How do I have a non-tiling (non-repeating) background image? With CSS, you can use the background-repeat property. The background repeat can be included in the shorthand background property, as in this example: body {...

CSS Interview Questions and Answers -07

How do I get rid of the gap under my image? Images are inline elements, which means they are treated in the same way as text. Most people kind of know this – they...

Samsung tech working on way for 5G in 2020

Existing 4G networks for mobile devices still have limited global reach, but that’s not going to keep 5G technology waiting in the wings. Samsung announced Monday that it has developed some transceiver technology that...

Facebook Launching Graph Search in mobiles soon

New Delhi: A senior Facebook executive said that the Graph Search, which debuted on the website in March, would soon come to mobile phones. Voughan Smith, vice president of mobile partnerships at Facebook, refused...

Google Drive increased free storage limit up to 15GB

(Credit: Google) Google’s capacity to store your files will jump by a factor of three, the company said Monday, rising from 5GB to 15GB shared across Google+, Drive, and Gmail. Google made the announcement...

Php Interview Questions and Answers -05

Why doesn’t the following code print the newline properly? <?php $str = ‘Hello, there.\nHow are you?\nThanks for visiting techpreparation’; print $str; ?> Because inside the single quotes the \n character is not interpreted as...

Php Interview Questions and Answers -04

What is the difference between ereg_replace() and eregi_replace()? eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters. How do I find out the number of parameters passed...

Php Interview Questions and Answers -03

Would I use print “$a dollars” or “{$a} dollars” to print out the amount of dollars in this example? In this example it wouldn’t matter, since the variable is all by itself, but if...

Php Interview Questions and Answers -02

How do you define a constant? Via define() directive, like define (“MYCONSTANT”, 100); What are the differences between require and include, include_once?  Anwser 1: require_once() and include_once() are both the functions to include and...

Php Interview Questions and Answers -01

What’s PHP ? The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. What...

CSS Interview Questions and Answers -06

Why call the subtended angle a “pixel”, instead of something else (e.g. “subangle”)? In most cases, a CSS pixel will be equal to a device pixel. But, as you point out, the definition of...

HTML Interview Questions and Answers -06

Can I have two or more actions in the same form? No. A form must have exactly one action. However, the server-side (e.g., CGI) program that processes your form submissions can perform any number...

CSS Interview Questions and Answers -05

How do I combine multiple sheets into one? To combine multiple/partial style sheets into one set the TITLE attribute taking one and the same value to the LINK element. The combined style will apply...

HTML Interview Questions and Answers -05

How do I align a table to the right (or left)? You can use <TABLE ALIGN=”right”> to float a table to the right. (Use ALIGN=”left” to float it to the left.) Any content that...

CSS Interview Questions and Answers -04

How do I place text over an image? To place text or image over an image you use the position property. The below exemple is supported by IE 4.0. All you have to do...