HOW TO RESET PASSWORD IN MAGENTO WHILE WORKING IN LOCALHOST

This tutorial help you how to reset your magento password when you are working in localhost

  • You need to go to phpmyadmin
  • Select the particular database where you have installed magento.
  • Then select table named admin_user

By default magento uses md5 algorithm to store the password.

Click edit button find the password field listed and then change the function to md5 then enter your desired password  .

And you can login now.

MAIN 5 FACTORS TO CONSIDER WHILE CREATING A WEBSITE



1.Choosing your color

The colors to be used in the website should look pleasant and matched perfectly; a bad color combination will tend to make the user move away from the website. Choose lighter colors so that it will not distract the user. Refer various color combination charts to get the best one.

2. Choosing your font

Choosing your font is very important, you may choose font based on the website theme if you are designing a professional website for a company, you can go for sans serif fonts which look truly professional, and using a retro type of fonts for a professional website makes a bad impression of the site. And also try to use web safe fonts which make the website load faster and the font look similar in all the devices.

3. Representing your images

Using images to your website should look relevant to your theme/business where the user would be able to understand your business concepts just by looking at the image.

4. Using font hierarchy

Use correct font hierarchy for headings use font will bigger size  main heading and for sub headings use a font which is less than the main heading also try to differentiate with colors so that it will be clear for the user to understand clearly.

5. Have a sitemap

A site map for the website is very important it makes the user to have a clear look what pages does your website contains and which page lies under which main page heading.

SHOW/HIDE INPUT BOX ON CLICK USING JQUERY



Welcome to learnwebscripts in this tutorial we are going to learn about SHOW/HIDE INPUT BOX ON CLICK USING JQUERY.

Using prefilled value in a input box has now become a innovative form design which minimizes the space in the web page.

In jquery we have two functions focusin and focusout to solve this.

[button color=”light” link=”http://demos.learnwebscripts.com/inputbox” target=”_black”]DEMO[/button][button color=”light” link=”http://demos.learnwebscripts.com/inputbox.rar”]DOWNLOAD[/button]

Our idea is for each input box we use one hidden input box .

<input type=”text” id=”email” class=”inputclear” value=”Enter Email Address” style=”width: 400px;” />
<input type=”hidden” id=”email_txt” class=”inputclear” value=”Enter Email Address” />
For the first input box we give one id and the value and a class name inputclear and for the another input box we make it hidden and we give the id as the main inputbox id and postfix the value _txt to it and its value .

This is our preparation.

Now when the user clicks on the input box we get the id and its value and its corresponding hidden box id and its value when both of the value is same we make the textbox value empty.


<input type="text" id="email" class="inputclear" value="Enter Email Address" style="width: 400px;" />
<input type="hidden" id="email_txt" class="inputclear" value="Enter Email Address" />
<br /><br />
<input type="text" id="phone" class="inputclear" value="Enter your phone" style="width: 400px;" />
<input type="hidden" id="phone_txt" class="inputclear" value="Enter your phone" />
<br /><br />
<input type="text" id="username" class="inputclear" value="Enter your username" style="width: 400px;" />
<input type="hidden" id="username_txt" class="inputclear" value="Enter your username" />
<br /><br />
<input type="text" id="password" class="inputclear" value="Enter your password" style="width: 400px;" />
<input type="hidden" id="password_txt" class="inputclear" value="Enter your password" />
<br /><br />
<input type="text" id="conformpass" class="inputclear" value="Enter confirm password" style="width: 400px;" />
<input type="hidden" id="conformpass_txt" class="inputclear" value="Enter confirm password" />

Our jquery file

</pre>
$('.inputclear').live('focusin',function(){
 var current= $(this).attr('id');
 var current_value = $('#'+current).val();
 var hidden_value = $('#'+current+'_txt').val();

 if(current_value==hidden_value)
 {
 $('#'+current).val('');
 }
 return false;
});
$('.inputclear').live('focusout',function(){
 var current= $(this).attr('id');
 var current_value = $('#'+current).val();
 var hidden_value = $('#'+current+'_txt').val();

 if(current_value=='')
 {
 $('#'+current).val(hidden_value);
 }
 return false;
});
<pre>

Cheers

HOW TO READ CSV FILE USING PHP



Dear all  in this tutorial we are going to learn how to read a csv file using PHP. PHP has inbuilt libraries which makes  to read a csv file easier which is usually used to read and process bulk records.

[button color=”light” link=”http://demos.learnwebscripts.com/readcsv” target=”_black”]DEMO[/button][button color=”light” link=”http://demos.learnwebscripts.com/readcsv.rar”]DOWNLOAD[/button]

First i like to prepare a CSV file which i like to read  let me list my favorite team, its jersey and my favorite player.

</p>
$file = 'cricket.csv';

 //The delimiter that is used in csv file.
 $delimiter = ',';

 //Open the cricket.csv file for reading.
 $handle = fopen($file, "r");

 if($handle)
 {
//Read each line and print the line out.
 while (($line_array = fgetcsv($handle, 40000, $delimiter)) !== false) {

 //Do something to each line.
 // print_r($line_array);

echo $line_array['0'].'--'.$line_array['1'].'--'.$line_array['2'].'<br/>';

 }
 fclose($handle);

 }
<p style="text-align: left;">

Here is the output

HOW TO VERIFY PAYMENTS HAS BEEN MADE IN PAYPAL


Hi welcome to learnwebscripts.com. This article is a continuation of the following http://learnwebscripts.com/paypal-sandbox-payment-gateway-integration-tutorial.

If you are setting a auto return to your site once the user completes his payments you need to check the payment has been  made successful or not. This article helps you to solve.

Importantly this works only if auto return is on in your PayPal website preferences settings.

[button color=”light” link=”http://demos.learnwebscripts.com/success.php”]DOWNLOAD[/button]

Before that you need the following values to add to your code.

  1. You need paypal identity token.
  2. You need to change the value to sandbox or live.

The following code helps you to verify PayPal payments is been made or not.

</pre>
<?php
session_start();
$_CONFIG_URL['paypal_identitytoken_pdt']='';//enter your identity token
$_CONFIG_URL['paypal']=''; //set $_CONFIG_URL['paypal']='live' when making it live. Make it empty when it is a sandbox account
$_SESSION['orderno']=$_GET['item_number'];//Get the item number and store it in the session variable
if($_SESSION['orderno'])
{

 $this_url = $_SERVER["REQUEST_URI"];
 $var_set = explode("?", $this_url);
 $paypal_transaction_token = $_GET['tx'];
 $payment_status = $_GET['st'];
 $payment_amount = $_GET['amt'];
 $payment_currency = $_GET['cc'];
 $payment_item = $_GET['item_number'];

 if(count($var_set) > 1) {
 $paras = explode("&",$var_set[1]);
 for($i = 0; $i < count($paras); $i++) {
 $tmp_vals = explode('=', $paras[$i]);
 if($tmp_vals[0] == 'tx') {
 $paypal_transaction_token = $tmp_vals[1];
 }
 if($tmp_vals[0] == 'st') {
 $payment_status = $tmp_vals[1];
 }
 if($tmp_vals[0] == 'amt') {
 $payment_amount = $tmp_vals[1];
 }
 if($tmp_vals[0] == 'cc') {
 $payment_currency = $tmp_vals[1];
 }
 if($tmp_vals[0] == 'item_number') {
 $payment_item = $tmp_vals[1];
 }
 }
 }

 /* Part - 1 */
 $indentitytoken= $_CONFIG_URL['paypal_identitytoken_pdt'];
 $req = 'cmd=_notify-synch';
 $req .= "&tx=$paypal_transaction_token&at=$indentitytoken"; // test key

 /* Part - 2 */

$ipnexec = curl_init();

 if($_CONFIG_URL['paypal']=='live')
 {
 curl_setopt($ipnexec, CURLOPT_URL, 'https://www.paypal.com/cgi-bin/webscr'); // live url
 }
 else
 {

 curl_setopt($ipnexec, CURLOPT_URL, "https://www.sandbox.paypal.com/webscr&"); // test url
 }

 curl_setopt($ipnexec, CURLOPT_HEADER, 0);
 curl_setopt($ipnexec, CURLOPT_USERAGENT, 'Server Software: '.@$_SERVER['SERVER_SOFTWARE'].' PHP Version: '.phpversion());
 curl_setopt($ipnexec, CURLOPT_REFERER, $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].@$_SERVER['QUERY_STRING']);
 curl_setopt($ipnexec, CURLOPT_SSL_VERIFYHOST, 0);
 curl_setopt($ipnexec, CURLOPT_SSL_VERIFYPEER, 0);
 curl_setopt($ipnexec, CURLOPT_POST, 1);
 curl_setopt($ipnexec, CURLOPT_POSTFIELDS, $req);
 curl_setopt($ipnexec, CURLOPT_FOLLOWLOCATION, 0);
 curl_setopt($ipnexec, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ipnexec, CURLOPT_TIMEOUT, 30);
 $ipnresult = trim(curl_exec($ipnexec));
 $ipnresult = "status=".$ipnresult;
 curl_close($ipnexec);

 /* Part - 3 */
 $parameter_value_array = explode("\n", $ipnresult);
 $value_array =array();
 foreach ($parameter_value_array as $key=>$value) {
 $key_values = explode("=", $value);
 $value_array[$key_values[0]] = $key_values[1];
 }
 if(array_key_exists("status", $value_array) && $value_array['status'] == 'SUCCESS') {

 echo 'Your payment has been processed successfully';
 }
 else
 {
 echo 'Payment has not been processed';
 }
 unset($_SESSION['orderno']);
}
else
{
 header('Location:index.php');
}

?>

Cheers. Please add you comments below if you need any help.