.

Wednesday, 22 October 2014

How to prevent your webpage content being copied ?

No Copy and Paste Script

Did you know that you can disable the copy and paste function on your web pages? Of course you did, that's why you're here, to see how it's done. Call me a cwazy wabbit for asking.

This little JavaScript snippet will prevent someone from highlighting your text and using the copy function to copy it and rip it off. It also prevents them from using Ctrl + A to select all the text, or using the right-click menu to Select All. Go ahead, try to copy the text on this page . . . I'll wait.

Of course, since it is JavaScript, it doesn't work if the visitor has JavaScript disabled or has a browser that doesn't support JavaScript. That isn't very many users, but anyone with some experience would know a way around this trick. It will stop most new users though, and at least make it harder for everyone else. That may be all the discouragement they need to move on to easier pickings.

Just add the following code to the HEAD tag of your web page:
 
 <pre>
&lt;script type="text/JavaScript"&gt;
//courtesy of BoogieJack.com
function killCopy(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=killCopy
document.onclick=reEnable
}
&lt;/script&gt;
</pre>

Good thing that's a short bit of code to type isn't it, since you can't copy and paste from this page where the code is being demonstrated? Just kidding&mdash;if you view the source code you can copy and paste it from there.

How can I copy something from a web page to my web page?


Yes. Below is break down of how to copy information or code from one web page to another.

Plaintext
HTML and web scripts
Images, sounds, or movies
Embedded objects
Server scripts or programs

Plaintext

If you are not familiar with how to copy text, see the copy definition for additional help.

HTML and web scripts

Users who visit a page that performs a special feature, such as displaying the current date or a countdown for example, may want to incorporate that feature on their web page. To do this, view the web page's source code.
In the page's source code locate the code required for this script to work. This may be difficult for users who are unfamiliar with HTML code or the language the script was written in. However, most web scripts will be enclosed in the <script> and </script> tags, and copying these tags as well as all the information in-between these tags allows the script to work on your web page.
Finally, if you're designing your web page in a WYSIWYG editor such as Microsoft FrontPage, you need to make sure you're pasting the HTML code into the HTML portion of the program. Many WYSIWYG editors have different views, a section to create and view a page without worrying about the code and another that allows code edits. In the case of Microsoft FrontPage, a user can get into the HTML portion by clicking the HTML tab at the bottom left hand side of the window.

Images, sounds, or movies

Users who want to use another site's images, sounds, or movies can do so by using one of the below suggestions.

Copy image, sound, or movie to your computer or server and use
Almost all images, sounds, and movies can be copied to your computer and then viewed on your web page.

Images
Images can be copied from a webpage by right-clicking an image and selecting "Save Picture as" or "Save Image as", depending on the browser you're using.
Once selected, you should be prompted with a location with where you want to save the image, specify the location of where you want to save the file. Keep in mind if this web page is going to be posted online, you also need to upload this image when you upload the web page.
Note: Although almost all images can be saved using the above method, some websites may prevent images from being copied to your computer because they are copy protected. Computer Hope will not assist users in copying these images as it is obvious that they do not have permission from the site hosting the pictures.

Sound and movies
Unless the sound or movies file has a direct link to download and save the file to a specified location on your hard drive, it can be a little trickier to copy another web page's sound or movie file. However, the easiest method would be to view your Internet browser's cache and locate the sound or movie file saved in the cache.
  • How do I clear my Internet browser history?
  • How do I download or save a YouTube video to my computer?
If you're not aware of what the movie or sound file's name is, view the web page's source to get that information.
Note: The above instructions are for copying sound or movie files that are not streaming. Some sites have streaming audio and video, which can be even trickier to copy.

Link to the image, sound, or movie from your website to the other server
In addition to copying the files directly to your computer or server, a user could also link directly to the image, sound, or movie from another page. However, we do not recommend this method as it will slow down the load time of your web page because it's coming from another server; it is also likely to become lost because it may move on the other server, which would cause your link to become bad; and finally, causes additional bandwidth usage on the site you're linking to, which may cause your server to become blocked or reported because you're stealing bandwidth.
However, users who are still interested in doing this can copy the HTML source code for the image, sound, or movie to their web page and have it work on their webpage without having to upload the image, sound, or movie to their server.
Keep in mind that many pages do not specify the complete URL, so you may need to change the path of the file so the browser knows how to load it. For example, an image link from Computer Hope may look like the example below.
<img src="image.gif">
Because this above example does not specify a domain or path of the file when this code is copied to your web page, it will not load because the browser is attempting to load the image from your computer and not where the image.gif is located. If this code was copied from Computer Hope, you would likely need to change it to the example below.
 <img src="http://www.computerhope.com/image.gif">
If you need to know the complete path to an image, you can also right-click the image and click "Properties" to view the complete path to the file.

Embedded objects

Some files such as Macromedia Flash files are embedded web objects, which means not only will you have to copy the file or link to the file on the other server, but you also need to copy the HTML used to display the file. In this case, we suggest looking at the source code of the object to determine the name of the file and how it is loaded, and copy both the code and the file.

Server scripts or programs

Server scripts, SSI, or other web programs are almost always protected or set to execute and not to be read. This means programs such as polls, search engines, forums, chat, etc. cannot be copied and used on your own page.
For these programs or scripts to become functional on your website, you would need to download the program, install it, and set it up for your own computer or server. Many sites use open source or free programs that can be downloaded for free or for a small fee. For example, many forums at the bottom of each of the pages will list the forum as well as a link to where to download it.

Friday, 17 October 2014

How can I send out an HTML email in Gmail, Yahoo, or Hotmail ?


1. Use an html editor (like DreamWeaver, TextWrangler, Coda, or whatever you may have) and create the email in the editor. Then save the file with a “.html” extension. Where you save the file does not matter at all, but it’s probably easiest just to save the HTML file on your desktop so you can easily access it in step 2. 

2. Open that html file in an internet browser – Firefox, Safari, Internet Explorer, Google Chrome, etc. If you just click on the file it should just directly open up in a browser, since your computer is smart enough to know that a “.html” file should be opened in a browser. If the file does not open directly in a browser, simply open a browser window, and then in the browser menu go to “File->Open File”, and choose the .html file.

3. In your browser menu, go to Edit, and then “Select All” or Ctrl+A ( or Command + A if you are on a Mac) to select everything that is displayed in the browser. This is the magic step that stores all the HTML onto your clipboard – so make sure you get this one right!

4. Paste (CTRL + V or Command +V) the html to the Gmail or Yahoo Mail message. Then you are done! This should work like a charm – and you should be able to see the HTML message directly in your message before you send it.

Diwali Dhamaka Offer : Website Development @ Rs. 4999/-

Webdec :
Web Designing & DevelopmentE-Commerce Solutions
Diwali Dhanaka Offer : Responsive website @ Rs. 4999/- Only
Website Designing Development



We webdec Technologies provides web development services across india having head office in Ranchi Jharkhand .For this Diwali we providing web designing at very low cost that is Rs.4999/- only.This offer expires on 31st October 2014.If you need any assistance about web development then contact us or revert me back.
Facility we provide with a responsive website development
>Domain Name (eg : www.example.com)
>4 Emil Ids (eg :i nfo@example.com)
>5gb of hosting space
Contact Details:
Email : info@webdec.co.in
contact number : 7070126810



Thursday, 16 October 2014

Internal Server Error

How You Might See the 500 Error

The 500 Internal Server Error message might be seen in any number of ways because each website is allowed to customize the message. Here are several common ways that you might see the HTTP 500 error:
  • "500 Internal Server Error"
     
  • "HTTP 500 - Internal Server Error"
     
  • "Temporary Error (500)"
     
  • "Internal Server Error"
     
  • "HTTP 500 Internal Error"
     
  • "500 Error"
     
  • "HTTP Error 500"
     
  • "500. That's an error."
500 Internal Server Error messages can show up in any browser in any operating system.
In Internet Explorer, the message The website cannot display the page often indicates an HTTP 500 Internal Server Error. A 405 Method Not Allowed error is another possibility but you can be sure by looking for either 500 or 405 in the IE title bar.
Most of the time, a 500 Internal Server Error displays inside the Internet browser window, just as web pages do.
When Windows Update reports an Internal Server Error, it appears as aWU_E_PT_HTTP_STATUS_SERVER_ERROR message or as the 0x8024401F error code.
When Google services, like Gmail or Google+, are experiencing a 500 Internal Server Error, they often report a Temporary Error (500) or simply 500.

Cause of HTTP 500 Errors

The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the web site's server but the server could not be more specific on what the exact problem is.
Most of the time, "gone wrong" means an issue with the page or site's programming, nothing you have anything to do with.
Note: More specific information about the cause of a particular HTTP 500 error is often provided when it occurs on a server using Microsoft IIS software. Look for numbers after 500 as in HTTP Error 500.19 - Internal Server Error which means Configuration data is invalid. You can see a complete list here.

How To Fix the 500 Internal Server Error

Like I alluded to above, the 500 Internal Server Error is a server-side error, meaning the problem probably isn't with your computer or Internet connection but instead is a problem with the web site's server.
While not probable, it is possible that there's something wrong on your end and we'll look at some things you can try.
  1. Reload the web page. You can do that by clicking the refresh/reload button, pressing F5, or trying the URL again from the address bar.

    Even if the 500 Internal Server Error is a problem on the web server, the issue may only be temporary. Trying the page again will often be successful.

    Note: If the 500 Internal Server Error message appears during the checkout process at an online merchant, be aware that duplicate attempts to checkout may end up creating multiple orders - and multiple charges! Most merchants have automatic protections from these kinds of actions but it's still something to keep in mind.
     
  2. Clear your browser's cache. If there's a problem with the cached version of the page you're viewing, it could be causing HTTP 500 issues.

    Note: Internal Server Errors are not often caused by caching issues but I have, on occasion, seen the error go away after clearing the cache. It's such an easy and harmless thing to try so don't skip it.
     
  3. Delete your browser's cookies. Some 500 Internal Server Error issues can be corrected by deleting the cookies associated with the site you're getting the error on.

    After removing the cookie(s), restart the browser and try again.
     
  4. Troubleshoot as a 504 Gateway Timeout error instead.

    It's not very common, but some servers produce a 500 Internal Server Error when in reality the more appropriate message based on the cause of the problem is 504 Gateway Timeout.
     
  5. Contacting the website directly is another option. Chances are good that the site's administrators already know about the 500 error but if you suspect they don't, letting them know helps both you and them (and everyone else).

    See my Website Contact Information list for contact information for popular websites. Most sites have support-based social network accounts and a few even have email and telephone numbers.

    Tip: If it looks like the site is down completely and you can't find a way to report the 500 Internal Server Error message to the website, it might help your sanity to keep up with the outage on Twitter. You can usually do this by searching for #websitedown on Twitter, as in#gmaildown or #facebookdown.
     
  6. Come back later. Unfortunately, at this point, the 500 Internal Server Error is no doubt a problem outside your control that will eventually get fixed by someone else.

    If the 500 Internal Server Error message is appearing at check out during an online purchase, it might help to realize that sales are probably being disrupted - usually a great incentive to the online store to fix the issue very quickly!

    Even if you're getting the 500 error on a site that doesn't sell anything, like YouTube or Twitter, as long as you've let them know about the problem, or at least tried, there's little more you can do than wait it out.


Monday, 13 October 2014

Editing compiled CSS

1. NEVER edit files in the compiled-css folder.
You will loose all changes when you change the template settings.

2. Use a custom-css or less file for your custom-code.
If you want to add a custom css file just add a file called gantry-custom.css in the css folder of your template. The name of the file follows this pattern: [template-name]-custom.css.
For Fracture this would be: rt_fracture-custom.css for example.

A typical workflow for this would be to copy the rule from Firebug for example and paste it into this custom css file and change the property you want. Also add some css specificity.
(.logo-block #rt-logo {...} will be overriden by a rule div.logo-block a#rt-logo {...})

See the gantry-framework.org for more information.

3. That long winding line in the masterfiles is the result of the less-css-compression.
You can turn that off in the template settings > advanced

For example

 bootstrap.css (compiled css) includes... 

img { 
border: 0 none;
 height: auto; 
max-width: 100%;
vertical-align: middle; 
}

and I want it to be... 

img { 
border: 0 none;
 height: auto; 
/* max-width: 100%; */
 vertical-align: middle;
}

Solution :
use css in a custom css file to reset that value (instead of changing core files ... wich is always bad).

img {
max-width: none !important;

Thursday, 25 September 2014

PHP Mailer Script Step by Step

Introduction

This tutorial describes how to use PHPMailer and explains the use of the class functions. by Tom Klingenberg

Contents

  1. #PHPMailer: What is it? What does it do? Who needs it? Brief examples of PHPMailer's features.
  2. #First_time: Sending your first email with PHPMailer. Tells you how to start. Anyone who completely understands the source on the PHPMailer homepage or README can skip this section.
  3. #Using_Attachments: Sending mails with file attachments: filesystem, database or inline.
  4. #Using_HTML_Mail: Using the class' integrated HTML Email features.
  5. #Support: Where do I get help?: How to find support resources: PHPMailer website, mailing list etc.
  6. #Other_Resources: Email and PHP Resources: There is a lot of information in the net about email, php and PHPMailer.

PHPMailer

PHPMailer is a PHP class for PHP (www.php.net) that provides a package of functions to send email. The two primary features are sending HTML Email and e-mails with attachments. PHPMailer supports nearly all possiblities to send email: mail(), Sendmail, qmail & direct to SMTP server. You can use any feature of SMTP-based e-mail, multiple recepients via to, CC, BCC, etc. In short: PHPMailer is an efficient way to send e-mail within PHP.
As you may know, it is simply to send mails with the PHP mail() function. So why use PHPMailer? Isn't it slower? Yes that's true, but PHPMailer makes it easy to send e-mail, makes it possible to attach files, send HTML e-mail, etc. With PHPMailer you can even use your own SMTP server and avoid Sendmail routines used by the mail() function on Unix platforms.
This tutorial explains how to implement the class into your script or website and how to build an e-mail application. If you just want to send simple e-mail and you have no problems with the mail() function, it's suggested that you continue to use mail(), instead of this class.

First time

For those who have not used PHP's mail() function before, this section will provide information about email and e-mailing in general, in addition to explaining how to get started with PHPMailer.
Before continuing, please be sure that PHPMailer is installed correctly. If you feel uncertain, please read the installion instructions that accompany the package. If you're still not sure, you can verify that you've installed PHPMailer correctly with this little script:
<?phprequire("class.phpmailer.php");
$mail
= new PHPMailer();
?>
Save it as a PHP document in the same directory where you've saved class.phpmailer.php. If no errors result from running the script, your installation has been done correctly. If you switched error messages and warnings off, then go ahead and set it on; refer to your PHP manual for more on this topic.
This snippet of code is also the start of any use of PHPMailer. require("class.phpmailer.php"); includes the source code of the class and $mail = new PHPMailer(); creates a new instance of the class the class as $mail. All features, functions and methods of the class maybe accessed via the variable (object) $mail.
Merely creating an instance of the class is only the first step, of course. Let's go ahead and send out the first mail. For this you'll require the basics: An recipient address, a from address, a subject and the text of the message (called "mail-body" or simply "body" for short).
You will also need to select a method of delivering the message. We need a program to communicate with an SMTP server which, in turn, sends the mail out to the internet. In the Unix world, Sendmail is very popular and used widely.
PHPMailer provides several methods of sending mail. It's best to start with SMTP, though (as mentioned above) the mail() function, Sendmail or qmail are also possible. When using SMTP, you'll need a valid SMTP server; this may well be the same one that you use in your personal mail client.
Having gathered the necessary information to send your first e-mail, you'd use that information in place of the example information provided here:

<?php
require("class.phpmailer.php");

$mail
= new PHPMailer();

$mail
->IsSMTP();  // telling the class to use SMTP
$mail
->Host     = "smtp.example.com"; // SMTP server

$mail
->From     = "from@example.com";
$mail
->AddAddress("myfriend@example.net");

$mail
->Subject  = "First PHPMailer Message";
$mail
->Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail
->WordWrap = 50;
if(!$mail->Send()) {
  echo
'Message was not sent.';
  echo
'Mailer error: ' . $mail->ErrorInfo;
} else {
  echo
'Message has been sent.';
}
?>
Save this as a php file and change the values to your values, of course. Here is an explanation of what each stanza in this script does:
$mail->IsSMTP();
This sets up STMP-Server as method to send out email(s).
$mail->Host = "smtp.example.com";
Setting smtp.example.com as the SMTP server. Just replace it with your own SMTP server address. You can even specify more then one: just separate them with a semicolon (;): "smtp.example.com;smtp2.example.com". If the first one fails, the second one will be used, instead.
Enter the address that the e-mail should appear to come from. You can use any address that the SMTP server will accept as valid.
$mail->From = "from@example.com";
If displaying only an e-mail address in the "From" field is too simple, you can add another line of code to give the address an associated name. This will add 'Your Name' to the from address, so that the recipient will know the name of the person who sent the e-mail. The following line
$mail->FromName = "Your Name";
Andy Prevost: with PHPMailer version 5.0.0, you can now achieve this with one command:

$mail->SetFrom("from@example.com","Your Name");
The following will add the to address, the address to which the e-mail will be sent. You must use a valid e-mail here, of course, if only so that you can verify that your PHPMailer test worked. It's best to use your own e-mail address here for this inintial test. As with the "From" field, you may provide a name for the recipient. This is done somewhat differently:
$mail->AddAddress("myfriend@example.net","Friend's name");
$mail
->AddAddress("myfriend@example.net");
Setting the subject and body is done next. $mail->WordWrap = 50; is a feature of PHPMailer to word-wrap your message limiting all lines to a maximum length of X characters, even if not set as body= .... Admittedly, there's not much point in wrapping the text in a message as brief as the one in this example.
Finally, we send out the e-mail, once all necessary information has been provided. This is done with $return = $mail->Send();. In this example script, it's combined with an error message; if Send() fails, it'll return false and you can catch it and display an error message. This is done in the last lines. Or, in case of success, it displays a kind of "done " message.

Using Attachments

Sending plain text e-mails is often insufficient. Perhaps you need to attach something to your mail, such as an image or an audio file. Or perhaps you need to attach multiple files.
There are two ways of attaching something to your mail: You can simply attach a file from the filesystem or you can attach (binary) data stored in a variable. The latter is called Stringattachment. This makes it possible put extract data from a database and attach it to an e-mail, without ever having to actually save it as a file.

File Attachments

The command to attach a file can be placed anywhere between $mail = new PHPMailer(); and !$mail->Send(); and it's called AddAttachment($path);. This single line will add the attachment to your mail.
$path is the path of the filename. It can be a relative one (from your script, not the PHPMailer class) or a full path to the file you want to attach.
If you want more options or you want to specify encoding and the MIME type of the file, then you can use three more parameters, all of which are optional:
AddAttachment($path,$name,$encoding,$type);
$name is an optional parameter, used to set the name of the file that will be embedded within the e-mail. The person who will recieve your mail will then only see this name, rather than the original filename.
$encoding is a little more technical, but with this parameter you can set the type of encoding of the attachment. The default is base64. Other types that are supported include: 7bit, 8bit, binary & quoted-printable. Please refer to your SMTP documentation about encoding and the differences between types. In general, mail servers will convert encodings they don't want to handle into their preferred encoding type.
$type is the MIME type of the attached file. Content types are defined not necessarily by file suffixes (i.e., .GIF or .MP3), but, rather, a MIME type (MIME = Multipurpose Internet Mail Extensions) is used. This parameter makes it possible change the MIME type of an attachment from the default value of application/octet-stream (which works with every kind of file) to a more specific MIME type, such as image/jpeg for a .JPG photo, for instance.

String Attachments

String attachments have been supported since PHPMailer version 1.29. This method works much like AddAttachment(), and is called with AddStringAttachment($string,$filename,$encoding,$type). The string data is passed to the method with the first parameter, $string. Because the string will become a standard file (which is what the attachment will be when received via e-mail), the $filename parameter is required. It's used to provide that filename for the string data.
The rest is just the same as described in detail above.
So, why use AddStringAttachment() instead of AddAttachment()? Is it for text-only files? No, not at all. It's primarily for databases. Data stored in a database is always stored as a string (or perhaps, in the case of binary data, as as a BLOB: Binary Large OBject). You could query your database for an image stored as a BLOG and pass the resulting string to the AddStringAttachment().

Inline Attachments

There is an additional way to add an attachment. If you want to make a HTML e-mail with images incorporated into the desk, it's necessary to attach the image and then link the tag to it. For example, if you add an image as inline attachment with the CID my-photo, you would access it within the HTML e-mail with `&ltimg src="cid:my-photo" alt="my-photo" />.
In detail, here is the function to add an inline attachment:
$mail->AddEmbeddedImage(filename, cid, name);
By using this function with this example's value above, results in this code:
$mail->AddEmbeddedImage('my-photo.jpg', 'my-photo', 'my-photo.jpg ');
For more Information about HTML Email, see the section Using HTML E-Mail.

Handling Attachments

If you want to attach multiple files (or strings), just call AddAttachment() or AddStringAttachment() multiple times. All attachments (file, string, and inline) may be stripped from an e-mail by invoking ClearAttachments().

Using HTML Email

Sending out HTML e-mail is a simple enough task with PHPMailer, though it can require significant knowledge of HTML. In particular, mail clients vary greatly in their rendering of HTML e-mail, with some refusing to show it entirely. For those mail clients which are not able to display HTML, you can provide an alternate e-mail body containing the message as plain text.
First we'll create a basic HTML message:

<?php
require("class.phpmailer.php");

$mail
= new PHPMailer();

$mail
->IsSMTP();  // telling the class to use SMTP
$mail
->Host     = "smtp.example.com"; // SMTP server

$mail
->From     = "from@example.com";
$mail
->AddAddress("myfriend@example.net");

$mail
->Subject  = "An HTML Message";
$mail
->Body     = "Hello, <b>my friend</b>! \n\n This message uses HTML entities!";
?>
   
It's as easy as creating a plain text e-mail. Simply use a string with embedded HTML for $mail->body.
Before sending this out, we have to modify the PHPMailer object to indicate that the message should be interpreted as HTML. Technically-speaking, the message body has to be set up as multipart/alternative. This is done with:
$mail->IsHTML(true);
To make ensure that the recipient will be able to read the e-mail, even if his e-mail client doesn't support HTML, use $mail->AltBody="Hello, my friend! \n\n" This message uses HTML entities, but you prefer plain text !"; to set the alternative body (AltBody in short). If you use this feature, the mail will be automatically set as multipart/alternative, making it unnecessary to specify $mail->IsHTML(true);.
And that's how to create an HTML email. Simply apply the send command and the mail will be sent. It's recommended that you avoid using HTML messages, because these messages are often used for viruses and exploits, they are much larger than plain text mails, and they're not standarized in the way the plain text mail is. On the other hand, even attachments are used for viruses, but nobody would propose that we stop sending mails with attachments. Do what fits your needs: PHPMailer can be your solution, whatever you decide.
If you want to send out a HTML email with pictures, Flash animations or whatever else, PHPMailer supports this as well.
Andy Prevost: Please note that it is not possible to send anything but pure W3C compliant HTML inline with your emails. That means no scripts, no Flash, etc. ... these can be included as attachments, but not as inline viewable objects – other than images (JPG, JPEG, PNG, & GIF). While some email clients may be able to display some objects such as other image types, the vast majority of email clients will either block them, crash, or remove them entirely as inline objects.
Adding an inline picture to your HTML e-mail, for example, is explained in the Inline Attachments section. Briefly, here are 2 lines of code you'd use to insert an image before sending out an e-mail:
 
$mail->AddEmbeddedImage("rocks.png", "my-attach", "rocks.png");
$mail
->Body = 'Embedded Image: <img alt="PHPMailer" src="cid:my-attach"> Here is an image!';

.

Popular Posts

Powered by Blogger.