phprockers-logo

Whats are the differences between Get and post methods in php?

0 comments
GET method have not security because of data view in addressbar.
POST method have security of data.

With GET we can send only 4 kb data but with POST there is no limit and also it is secure than GET.

What is the difference between mysql_fetch_object and mysql_fetch_array?

0 comments
Mysql_fetch_object returns the result from the database as objects while mysql_fetch_array returns result as an array. This will allow access to the data by the field names.

E.g. 
using mysql_fetch_object field can be accessed as $result->name &
using mysql_fetch_array field can be accessed as $result[name]

Explain the ternary conditional operator in PHP?

0 comments
Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. 

if(exp1?exp2:exp3 )

If exp1 condition is true, exp2 will be print. If exp1 is false, exp3 will be print.

What is meant by urlencode and urldecode?

0 comments
string urlencode(str)

Where str contains a string like this “hello world” and the return value will be URL encoded and can be use to append with URLs, normaly used to appned data for GET like someurl.com?var=hello%world


string urldocode(str)


This will simple decode the GET variable’s value

Like it echo (urldecode($_GET_VARS[var])) will output “Hello world”

How To Get the Uploaded File Information in the Receiving Script?

0 comments
$_FILES[$fieldName]['name'] - The Original file name on the browser system.

$_FILES[$fieldName]['type'] - The file type determined by the browser.

$_FILES[$fieldName]['size'] - The Number of bytes of the file content.

$_FILES[$fieldName]['tmp_name'] - The temporary filename of the file in which the uploaded file was stored on the server.

$_FILES[$fieldName]['error'] - The error code associated with this file upload.

How can we retrive value from one database server and store them another database server using php?

0 comments
$db=mysql_pconnect("host","username","pssword"); 
mysql_select_db("dtabase name",$db); 
$query="select * from the table"; 
$res=mysql_fetch_object(mysql_query($query)); 
mysql_close($db);

//second Database
$db=mysql_pconnect("secondhost","username","pssword"); mysql_select_db("dtabase name",$db); 
$query="insert into tablename values($res)";
mysql_query($query); 
mysql_close($db);

What is the difference between ereg_replace() and eregi_replace()?

0 comments
ereg_replace() is case sensitive like “phprockers” cannot be treated as “PhpRockers” and eregi_replace() is not case sensitive where “test” could be treated as “PhpRockers”.

eregi_replace() function is same as ereg_replace() except that it ignores case distinction when matching alphabetic characters.

Notice: Undefined index: view in C:\xampp\htdocs\vsl\components\com_content\views\article\view.html.php on line 156Notice: Undefined index: view in C:\xampp\htdocs\vsl\components\com_content\views\article\view.html.php on line 158

0 comments
Notice: Undefined index: view in C:\xampp\htdocs\vsl\components\com_content\views\article\view.html.php on line 156Notice: Undefined index: view in C:\xampp\htdocs\vsl\components\com_content\views\article\view.html.php on line 158

I get this error when i click on a listing, but it still shows the listing. Any ideas?

from this code .... change to

if($menu && $menu->query['view'] != 'article')
{
switch ($menu->query['view'])

this...

if($menu && isset($menu->query['view']) && $menu->query['view'] != 'article')
after you replace this code ... then you get good answer.
 


 


 

What is the difference between require() and include() in PHP?

0 comments
if you require() a file that can't be loaded,if it isn't there, then it generates a fatal error which will halt the execution of the page completely.Then no more output will be generated. 
if you include() a file that can't be loaded, if it isn't there, then it generates a warning error and continue building the page.

How to create a forum and give the permission for that forum in phpBB3?

0 comments
1) Login to Admin

2) In bottom of the page click "Administrator Control Panel".

3) In top of the page, Go to Forums tap.

4) Click Manage forums -> create new category for create a new forum.

5) Then create new forum under the category.

Modules vs Components

0 comments


 Modules   Components 
Complexity  Low  Usually medium to high
Visibility  Various   Single Page
Position   Various   Main Body only
Configuration   Low  Extensive

Difference between component, module & plugin in joomla

0 comments
A Plugin will manipulate output already generated by the system. It typically does not run as a stand-alone piece but takes data from other sources (i.e. the content) and manipulates it before outputting to the user window. A plugin typically does not display directly to a user but does it's work behind the scenes.

A module is typically considered to be an add-on to the site that extends the functionality of another part of the system. It usually has fewer options that are configurable by the end user and most of the time does not handle any storing of information into the database. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page.

Why you should use Drupal?

0 comments
  1. Easy to use (even if you don't know html, php)
  2. Lots of modules
  3. Lots of themes
  4. You can make a website in terms of hours, even minutes 

What can you create with Drupal?

0 comments
  1. Simple n-number-of-pages static website
  2. Simple personal homepage
  3. Company website
  4. Weblog
  5. Dating website
  6. Myspace-like website
  7. (insert your favorite type of website here) 

Drupal Means:

0 comments
Drupal is CMS - Content Management System. It means you somehow "manage content" with it.The important thing to understand is that most of the content in Drupal is made up of nodes. Nodes can have comments, and comments can be submitted by users. 

Define PHP

1 comments
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.Rasmus Ledorf is the father of PHP

Best Seller Module Uses in Magento

1 comments
In Magento Admin,

CMS->Manage Pages -> create home page and add a below code in this page.

{{block type="bestsellers/list" name="home.bestsellers.list" alias="product_homepage" template="catalog/product/list.phtml"}}

Then you put the link and execute "http://localhost(your domain name) /magentosample (your magento folder name) /index.php/bestsellers-list"...... it will show which one sold more in products. It will appear in your magento home page.

How to solve "click to this page and activate this control" for flash files integrated to joomla in IE7?

0 comments
1) create sample.js file in root path.
2) Then you put following code in this page.
fls = document.getElementsByTagName("object"); for (var a = 0; a < fls.length; a++){fls[a].outerHTML = fls[a].outerHTML;}
3) Then write a script in footer file or <div class="footer">,
<script type="text/javascript" src="http://www.yourwebsite (or) your domain.com/iefix.js"></script>
then you get good result....