Wednesday, February 13, 2013

how to add _s-xclick product in paypal

Generate the button code for each item you sell:
  1. If you are not a registered PayPal user sign up for an account.
  2. Once you've logged to your account click 'Merchant Services' tab on top, and then click 'Buy Now Buttons' link.
  3. Enter the item details, then select a button image or choose your own image.
  4. Click 'Customize advanced features (optional) ' button to enter the page users are sent to after the payment is completed and other optional details. Otherwise, click directly 'Create Button Now' button.
  5. PayPal now generated the HTML code you need to place to display a 'Buy Now' button.

Backup Your MySQLi Database Using PHP

$user = “yourusername”;
$pass = “yourpassword”;
$host = “localhost”;
$db = “yourdatabase”;
$con = mysqli_connect($host,$user,$pass,$db);
// let’s get the variable $con from our included config file instead…
*/
include ‘../inc/config-db.php’;
backup_tables($con);
/* backup the whole db (‘*’) OR specific table(s) (‘tableName’ or ‘tableOne, tableTwo’) */
function backup_tables($con,$tables = ‘categories, customers, dispatch, freight, location_rates, notes, quotes, text_boxes, variables’)
{
// $link = mysql_connect($host,$user,$pass);
// mysql_select_db($name,$link);
//get all of the tables
if($tables == ‘*’)
{
$tables = array();
$result = mysqli_query($con,’SHOW TABLES’);
while($row = mysqli_fetch_row($result, MYSQLI_NUM))
{
$tables[] = $row[0];
}
}
else
{
$tables = is_array($tables) ? $tables : explode(‘,’,$tables);
}
//cycle through
foreach($tables as $table)
{
$result = mysqli_query($con,’SELECT * FROM ‘.$table);
$num_fields = mysqli_num_fields($result);
$return.= ‘DROP TABLE IF EXISTS ‘.$table.’;';
$row2 = mysqli_fetch_row(mysqli_query($con,’SHOW CREATE TABLE ‘.$table));
$return.= “\n\n”.$row2[1].”;\n\n”;
for ($i = 0; $i < $num_fields; $i++)
{
while($row = mysqli_fetch_row($result))
{
$return.= 'INSERT INTO '.$table.' VALUES(';
for($j=0; $j<$num_fields; $j++)
{
$row[$j] = addslashes($row[$j]);
$row[$j] = ereg_replace("\n","\\n",$row[$j]);
if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }
if ($j<($num_fields-1)) { $return.= ','; }
}
$return.= ");\n";
}
}
$return.="\n\n\n";
}
//save file
$handle = fopen('rvg-db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql','w+');
fwrite($handle,$return);
fclose($handle);
$filename = 'rvg-db-backup-'.time().'.sql';
Header("Content-type: application/octet-stream");
Header("Content-Disposition: attachment; filename=$filename");
echo $return;
}
mysqli_close($con);