Protected: Ramraj
Enter your password to view comments.
Posted in Uncategorized
Questions
Drupal:
1. Features
1. Create / Update the pages easily with desired type of user defined content type like news, page, articles, etc
2. Easily combined the created pages with a common name using “Views” that have some filters, sorting our data
3. User, Roles and Permissions
4. SEO friendly URLs, meta data, title for each conent
5. Easily understandable Admin Panel
6. Multi Language
7. Flexible Theming
8. Rich User Experience.
9. Search
10. Revision Control – Take a revision for each update and we can easily go back to old content
11. Taxonomy – Powerful category system
12. PHP Templates – Enabled PHP template to use our PHP code in our content.
2. How to enable clean url
1. Drupal 7 – Admin -> Configuration -> Server & Meta Data -> Clean URLs. Check the checkbox and click the “Enable Clean URL” button.
2. Drupal 6 – Admin -> Configuration -> Clean URLs. Choose the Enabled radio button and click the “Enable Clean URL” button.
3. Core Required Modules list
block
node
filter
user
system
4. Patch
Patches are pieces of code that solve an existing issue. In fact, patches describe the changes between a before and after state of either a module or core. By applying the patch the issue should no longer exist.
Patches are used to maintain control-ability over the entire Drupal project.
MySQL:
1. MySQL Tables
ISAM
MyISAM
InnoDB
Merge Table
Memory / Heap
BDB [BerkleyDB]
Blackhole
2. Diff between MyISAM & InnoDB
MyISAM
Pros
Fulltext search is currently only available with MyISAM tables
Geometric datatypes
Sometimes faster reads
All numeric key values are stored with the high byte first to allow better index compression
Internal handling of one AUTO_INCREMENT column per table is supported. MyISAM automatically updates this column for INSERT and UPDATE operations. This makes AUTO_INCREMENT columns faster (at least 10%)
Cons
Table (not row) level locking only
No foreign keys contraints (but planned for MySQL 6.x)
Slower table checking and restarts after power loss, an issue for those who need high availability
InnoDB
Pros
Provides MySQL with a transaction-safe (ACID compliant) storage engine that has commit, rollback, and crash recovery capabilities
XA transactions
Foreign keys
Row level locking
Maintains its own buffer pool for caching data and indexes in main memory
Faster for some workloads, particularly those where physical ordering by primary key helps or where the automatically built hash indexes speed up record lookups
Tables can be of any size even on operating systems where file size is limited to 2GB.
Fast and reliable recovery from power loss.
Cons
Data takes more space to store
ACID guarantee requires full sync to disk at transaction commit, can be turned off where speed is more important than full ACID guarantees.
Data Versioning and transactions add overhead to table management.
They can lead to high memory requirements to manage large numbers of locks used in row locking.
Indexes are slow to build when they’re added after a table has been created.Indexes should therefore be created when data is bulk-loaded.
Overall, InnoDB should be used for with applications that rely highly on data integrity or need transactions, while MyISAM can be used where that is not required or where fulltext indexing is needed. Where speed is more important, both should be tried because which is faster depends on the application.
3. How to get the last autoincrement of table
select auto_increment from information_schema.tables where table_name=’sample’ and table_schema=database();
show table status like ‘sample’
4. Return 100 records from starting 25th
select * from test limit 24,100
PHP:
1. How to configure in Zend Engine -
HTML:
1. DOC types
HTML 4.01 Strict
HTML 4.01 Transitional
HTML 4.01 Frameset
XHTML 1.0 Strict
XHTML 1.0 Transitional
XHTML 1.0 Frameset
XHTML 1.1
2. Define Head tag
1. Head tag is used to provide the inforation about the HTML document.
2. “title” tag is the required tag in the head section.
3. base, meta, link, style, scirpt, noscript are the optional tags.
4. We must use the head tag for only one time for one html document.
5. We must start the head tag after the html tag and ends before the body tag.
CSS:
1. Paragraph – Old brower Red, IE6 color, IE7 color, New browser colo
<style type=”text/css”>
#test {
font-weight:bold;
font-size:14px;
background-color:BlueViolet;/*IE 5 for PC only*/
background-color:GreenYellow;//*IE8 only*/
background-color:CornflowerBlue;
background-color:orange;/*for chrome*/
}
@-moz-document url-prefix() {
#test
{
background-color:Yellow;/*for mozillaFireFox*/
}
}
*+html #test {
background-color:Blue;/*ie7 only*/
}
* html #test {
background-color:green;/*ie6 only*/
}
/* html #test:first-of-type {
background-color:red;/*for opera*/
} */
</style>
<p id=’test’>Background Color Change in Differnt browser.</p>
<!–[if !IE6]–>
<link href=”" rel=”sytlesheet” type=”text/css”>
<![end if]–>
Posted in Uncategorized
MySQL – Rearrange auto increment column values
In MySQL table have 10 rows with 1 to 10 as primary key value with auto-increment. We delete the fourth row in the table. I this situation, if we need to rearrange the auto-increment value that is 1 to 9 for already available rows, the following queries do this job:
ALTER TABLE <<table>> DROP <<column>>;
ALTER TABLE <<table>> AUTO_INCREMENT = 1;
ALTER TABLE <<table>> ADD <<column>> bigint UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
Posted in MySql | Tags: auto increment, delete, primary key, queries, rearrange
Delete all Duplicate Rows except for One in MySQL?
For example: my table: “sample”, “empname” column contains duplicate values.
I want to keep the first inserted rows and delete the duplicated values, the query is:
DELETE t1 FROM sample t1, sample t2 WHERE t1.id > t2.id AND t1.empname = t2.empname
KRDS
Which function does return the number of seconds elapsed since the 1st January 1970?
What will be displayed in the following case:
- No content has been previously sent to the client
- You decide to use in your script the PHP header() function to send a 404 error code
- You write exit(); just after this function.
* A blank page with “HTTP/1.1 404 Not Found”
* A PHP error
* A blank page
* The normal page
* A customized error page
What is the effect of the “return” instruction when used in a included PHP script?
* Return to the parent script while ignoring the rest of the included file
* A PHP error
* The script stops (same as exit());
* Nothing, it is ignored
* It depends if the file is included with include() or require()
Assuming that the client browser is never restarted, how long after the last access will a session “expire” and be subject to garbage collection?
* After exactly 1,440 seconds
ans * After the number of seconds specified in the session.gc_maxlifetime INI setting
* It will never expire unless it is manually deleted
* It will only expire when the browser is restarted
* None of the above
http://phponweb.wordpress.com/
Posted in Uncategorized
EDL2Excel
http://phpcodesearch.files.wordpress.com/2011/11/edl2excel.doc
Posted in Uncategorized
stdClass: Storing Data in an Object Instead of an Array
Create new object:
$phone = new stdClass;
$phone->id = “10″;
$phone->title = “Nokia 5800″;
$phone->make = “Nokia”;
Create new object from array:
$phone = array(
“id” => “10″,
“title” => “Nokia 5800″,
“make” => “Nokia”
);
$phone = (object)$phone;
Posted in PHP | Tags: Object, PHP, PHP Array, PHP Object, PHP stdClass, stdClass, stdClass Object
PHP – Get current URL with querystring values
function getCurrentURL() {
$protocol = “http”;
if($_SERVER["SERVER_PORT"]==443 || (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"]==”on”)) {
$protocol .= “s”;
$protocol_port = $_SERVER["SERVER_PORT"];
} else {
$protocol_port = 80;
}
$host = $_SERVER["HTTP_HOST"];
$port = $_SERVER["SERVER_PORT"];
$request_path = $_SERVER["PHP_SELF"];
$querystr = $_SERVER["QUERY_STRING"];
$url = $protocol.”://”.$host.(($port!=$protcol_port && strpos($host,”:”)==-1)?”:”.$port:”").$request_path.(empty($querystr)?”":”?”.$querystr);
return $url;
}
echo “Path: “.getCurrentURL();
Posted in PHP, Querystring | Tags: current page, get current page, PHP, Querystring, url
Skype / Xampp Port Conflict – How to overcome the problem
XAMPP is a software package which installs a copy of the Apache Server, Mysql, PHP and Perl onto a Windows computer and allows for local development of PHP and Mysql scripts without the need for uploading onto your Hosting account to test for errors, etc. A really simple to install set of softwares for those who need it. The manual install of all of these softwares can be difficult, but the Installer supplied by XAMPP reduces the difficulty factor down to a single download and essentially a one-click install.
SKYPE is a software which allows using the Internet to make phone calls and also offers a Chat service within the same software package. Works well. For a small fee, you can also have Skype become your phone provider, somehow, I am not exactly certain how it all works but apparently it is cheaper than a land line and works for cell phones, too.
Now, the purpose of this Tutorial is to explain that I have had XAMPP installed for a couple of months now, and have never had any problems with it that weren’t my own doing, sort of. Like when you delete a folder and those scripts won’t run any more isn’t really a software issue, is it.
Recently, I have not been able to use the Apache Server on my machine and have been perplexed by why it didn’t work. I un-installed, downloaded a new version, re-installed, etc, several times, but nope, no go… Today it became an absolute neccessity that I test a script so I really needed the Xampp to be properly functioning, so away I go to the Google thing and try to find the problem.
Well… I have only had Skype for a couple of weeks now, and it works terrific, BUT, by searching out this problem, I discovered that Skype uses PORT 80 on the Computer as a secondary PORT for communicating with the Main Server. Guess which PORT Apache uses??? Right, PORT 80… CONFLICT…
The fix is as simple as firing up Skype, selecting TOOLS > OPTIONS > Connections and un-checking the use of PORT 80 as an alternative port for incoming calls. Then close and re-open Skype. Simple, easy and quick.
So save yourself a bunch of headaches and if you have an Apache Server installed and also want Skype to run along side it, this is the fix…
Thanks to http://www.knowledgesutra.com/forums/topic/47591-skype-xampp-port-conflict/
Access Apace folder with Virtual directory port
1. Open the “httpd.conf” file
2. Add the below code at the end of file.
Listen 82
<VirtualHost localhost:82>
DocumentRoot C:/xampp/htdocs/test
<Directory “C:/xampp/htdocs/test”>
allow from all
Options +Indexes FollowSymLinks +ExecCGI
</Directory>
</VirtualHost>
3. Save the file and restart the Apache and enjoy with port.
4. Output is:
http://localhost/test/ or http://localhost:82
In the above ex:
Port: 82
Virtural host: Localhost with 82 port. We can map any port number above the 80. Ex: localhost:85 [or] 127.0.0.1:85 [or] 192.150.0.12:85
Document root: where the port need to map. In the above example, we mapped the “C:/xampp/htdocs/test”. We also map the linux directory as “/var/www/html/test”.
Directory: same as Document root
httpd.conf path:
XAMPP: C:\xampp\apache\conf\httpd.conf
Fedora linux: /etc/httpd/conf/httpd.conf
WAMP: c:\wamp\Apache2\conf\httpd.conf
WAMP user please refer this link: http://www.dennisplucinik.com/blog/2007/08/16/setting-up-multiple-virtual-hosts-in-wamp/
Posted in Apache, PHP, Port, Virutal directory | Tags: Apache, Port, Virutal directory
Categories
- add www
- Ajax
- Ajax POST
- Apache
- Array
- Autocomplete Off
- change mode
- chmod
- Clean URL
- clone dropdown
- clone selectbox
- CMS
- copy dropdown
- copy selectbox
- Date
- Disable Copy Paste
- Drupal
- Dynamic CSS
- Dynamic Javascript
- Dynamic TR add/remove
- Export to Word
- Font
- Font-face Generator
- htaccess
- HTML
- javascript
- Joomla
- jQuery
- MySql
- Node id
- Paypal
- PHP
- PHP Export
- Port
- print_r
- Query
- Querystring
- Quiz
- Remove null
- remove www
- SHELL Command
- Shell Commands
- Skype
- smarty
- SVN
- Uncategorized
- Virutal directory
- Word
- Wordpress
- XAMPP
- xcart


