₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,032 members, 8,448,285 topics. Date: Monday, 20 July 2026 at 07:04 AM

Toggle theme

D34lw4p's Posts

Nairaland ForumD34lw4p's ProfileD34lw4p's Posts

1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 (of 30 pages)

WebmastersLIVE: Ask Any Questions Relating To Blogging Here by D34lw4p(op): 3:31pm On May 15, 2016
Hi Nairalanders I am Dealwap the founder of Naija Coders Team (wwww.nct.com.ng).

LETS TALK ABOUT BLOGGING

Blogging has become very popular among Nigerians, especially after the news broke out that popular Nigerian blogger, Linda Ikeji, bought a 2015 Range Rover for 25 Million naira and a house in Banana Island for around 500 Million naira. It opened people’s eye to how lucrative blogging can be.

WHAT IS A BLOG?
A blog is a website or webpage that is regularly updated with information. The information can be on anything: entertainment, health, money, sports, education, etc. The information is usually written in a conversational style so readers can enjoy it.

HOW IS MONEY MADE FROM BLOGS?
You can make money from blogs in three ways: advertisement, sponsored posts and eBook sales. Let me explain this to you so you will understand.
If you are consistent with your blog and you are getting good traffic to it (traffic is number of visitors viewing your website), then advertisers will pay you to place adverts on the blog so that your site visitors can see it. The most popular of the advertisers is Google and it is called Google Adsense.
The adverts that will be placed on your website is always related to the type of content you post. This is to ensure it will catch the attention of those reading the contents of your blog.
The second revenue source which is through blog posts is simple: people pay you to write a particular content that will promote them. For instance, if you own a music blog, an upcoming artiste can pay you to write a biography or review of him and his music.
The third revenue source like stated above is by selling eBooks. If you are consistently blogging about a particular content, people begin to see you as an authority on the area. You can write an eBook on that area you are known as an authority and sell to your website visitors. Because they already trust you, they will buy from you since they know you cant sell junk to them. Example is a women’s health blog selling an eBook on how to increase your butt size naturally.

You can join my forum: www.nct.com.ng


HOW DO YOU GET STARTED?
First, you need to decide the niche you want to be blogging on. Being a jack of all trade will make you master of none and you will be swallowed in the pool of thousands of blogs in existence. So you should choose a particular area you will be consistently blogging on. Example of niches include: women’s health, entertainment, sports, politics, technology, etc. Just choose an area you are passionate about and will enjoy writing on.
Secondly, get a blog. You have two options ere. You can buy a domain and hosting from web hosting companies so you can build your blog on it. You can also go for a free blog where you don’t need to pay. Example is blogger.com and
If you are serious about blogging, you should go by the first option. This will enable you choose your own domain name like www.nct.com.ng instead of having a domain like www.nct. which is what you will get when you go by the free option.
Thirdly, create a social media page for your blog. This will enable you build a fan base from social media and drag the traffic on it to the blog page. If you will choose just two social media platforms to go, choose Facebook and Twitter.
Fourthly, start posting good quality content on the blog. Don’t just copy and paste content from other website. Write your own and if you must copy other site’s content, make sure you rewrite it so you can pass plagiarism test. Not doing this will make your ranking on search engines go low.
Also, be consistent with your posting. Posting once in a week will not take you anywhere. If you can, post new contents daily on the blog. That way, your readers will be coming back to see new content from your blog. It will also help your ranking on Google’s search engines.
Fifthly, promote your blog. Don’t believe anybody that tells you that you can grow very big on blogging without promotion. So you must promote it vigorously. Use the social media platforms to promote your content and post on popular forums. If you want to grow faster, pay Facebook and Google for adverts. They will make your blog more visible.
Sixthly, when you start having good traffic, begin to monetize the blog. By monetize, I mean placing adverts on it so you can make money. I have already described the sources of revenue above.
Please, don’t start a blog today and begin to monetize immediately. Build your traffic first, and then you can monetize it. If you have the traffic, then making the money will not be a problem.

HOW MUCH CAN YOU MAKE?
It depends on your traffic. You can make thousands of dollars monthly and you can also make hundreds of dollars. The bigger your traffic, the bigger the money you will make. This is my reason for telling you to build traffic first.

WHAT ELSE?
Now, lets get interactive. If you have any question, drop it in the comment box; i, or someone else will give you an answer!

Ask your questions here I will answer all ASAP!
WebmastersRe: Open Message To All Upcoming Nigeria Bloggers by D34lw4p(op): 3:01pm On May 15, 2016
SlimHan:
by redesign do u mean "changing of theme?" Can u pls elaborate? I browse it using phones just that it is slow. Still expecting ur reply. Thanks a lot.
You need a responsive theme dear, a theme that is clean and fits to any screen, you can join my forum (www.nct.com.ng) where I share blogging tips n ideas.
WebmastersRe: Open Message To All Upcoming Nigeria Bloggers by D34lw4p(op): 1:30pm On May 14, 2016
SlimHan:
Thanks for sharing op. I have a question, how can a blogger stop people from copying posts originally written by him/her? Pls review my blog www.farjetbest.
Your site needs redesign, not responsive on mobile phone...you can't stop people from copying your posts...tho there are some js u can use but that will only be effective on PC and the post can still be copied with mobile phone.
WebmastersRe: Open Message To All Upcoming Nigeria Bloggers by D34lw4p(op): 10:51pm On May 13, 2016
exactly @Sugarcious
PhonesRe: Make Your Phone Battery Last Longer With This Tips by D34lw4p(op): 10:48pm On May 13, 2016
Cc: lalasticlala
PhonesMake Your Phone Battery Last Longer With This Tips by D34lw4p(op): 6:15pm On May 13, 2016
Hi! How would you feel after taking hours to charge your phone and you make use of it within minutes the battery is low? sad right! More power more fun ...take your time to read the article below.

I will be taking my time to explain to you what are consuming your battery and what you can do to make it better.

1. Your Battery May Be Fake!
Yes! i mean it! it may be fake! i didnt say its fake so dont hold that against me, you see your phone has a specific voltage of battery that can power it efficiently, if your phone battery fails to meet up to this then it will get drained faster even if it takes 24hours to become fully charged.

Do This
Get a new battery and before you buy make sure it really matches your phone requirements.

Weak Battery
Are you doubting if your battery can ever get weak? sure it can! below are things that can weak the battery:
*Charging and Operating the phone.
*The phone indicates low battery and shuts down itself before you charge it.
*Using powerbank with low output voltage, i once charged my phone with a powerbank and withing 30minutes it displays 100% Charged, not knowing it was just fake charging cheesy
*E.T.C


You Can Join Our Forum by visiting: http://www.nct.com.ng

Do this
-Avoid operating the phone while charging it.
-Avoid Using a powerbank with low voltage output, it may not give your phone the required power, thereby killing the battery tongue.
-Charging with a fake charger or charger with low output.

Idle Network Access
Some Network functionality on the phone can really lynch your battery life, you wanna know how? lets assume you open your browser and visit www.nct.com.ng,facebook or any other website then after doing all that you fail to turn off your Mobile Data!

It will not only drain the battery it will also make you loose your subscribed data while running some background app.

Do This
-Make sure you turn off your mobile data after browsing.
-Put the phone in Airplane Mode while charging(it speeds up the charging).
-Reduce the phone screen brightness.
-You may not necessarily need the 3G/4G Service so turn it off. The 2G should serve you unless you're in an enviroment with poor network.

***
This post will be updated With more tips so always check back.
***

NOTE: Incase you want to copy this article or any other article on this forum to your blog or website, please make sure you link back to us as the source, Thanks


Have you got more tips not added here? pls comment them below lets learn!

Source: http://nct.com.ng/Thread-The-Ultimate-Guide-To-Make-Your-Phone-Battery-Last-Longer
WebmastersRe: Open Message To All Upcoming Nigeria Bloggers by D34lw4p(op): 6:10pm On May 13, 2016
Cc: lalasticlala
WebmastersOpen Message To All Upcoming Nigeria Bloggers by D34lw4p(op): 6:06pm On May 13, 2016
Hello! I am Abdulrasaq Nasirudeen(Dealwap) The Founder Of Naija Coders Team (www.nct.com.ng), Today i would be writing an open message to all Upcoming Nigerian Bloggers, dont worry i would try to make it short as possible as i can.

Dear Nigerian Bloggers,
Who is a blogger?
A person who owns or manages a blog is called a blogger. This term is sometimes misspelled (or maybe ‘creatively spelled as bloger.

Blogging is becoming popular these days and it’s a way to publish your writing, share your ideas, connect with people and learn new things along the way.

Some Nigerian Bloggers are really getting this wrong! Ask most of them why they started blogging they will all say because they have passion for writing! Alas! How can that be!.

I would be taking my time to critically analyze some wrong doings of this novice and how thay can improve.

#1 Copying Other People's Post
Can you imaging you publishing the same post with other top blogs in your niche, how do you intend to grow when you are hiding under the umbrella of plagiarism? For you to surpass other blogs in the same niche with you, you need to publish unique post that cant be directly seen anywhere else.

Imagine those blogs you are copying from are also copying from other blogs, who will provide unique contents for readers to read?

If your Niche is 'News' you have more responsibilities as you need tobethe early news breaker. The moment you copied news from another website automatically marks your blog as an option to users 'cos you are providing an already provided contents. It wouldnt only chase users away it will also lower your search engine rank. tongue

#2 Poor Design
Making your bloglook like other blogs is a turn down,want to know how?

Can you use a new social network that has exactly the same features like facebook? absolutely NO! you wouldnt want another 'cos you already have facebook and for a new social social network to drag your attention you require it to have all the features of facebook and some extra ordinary features. I think with that example you should grab my point cheesy.

#3 Monetizing Too Early
hey dont quote me wrong, i didnt say making money with your blog is a bad idea but thinking of money too early is bad for the growth of your blog, relax and do the right thing, Money will surely come

Imagine! Just imagine a new blogger of 1 month old requesting for ads placement to generate income. Haba! Thats obviously a failure, it wont work that way!

You Can Join My Forum By Visiting: http://nct.com.ng/ Where we share real blogging tips and tutorials.

Take some times to gently analyze your blog, publish lot of contents(unique posts not copy and paste) before you think of generating income with it.

My Dear Bloggers, i think you should have gained one or more ideas from my little message to you. Please i always want you to be successful in every area that is why i took my time to write this to you. Please i beg of you help pass this message to your friends, you can copy the url in your address bar then paste on your facebook status. Thanks.

WHAT DO YOU THINK? Comment below!

Source: http://nct.com.ng/Thread-Advice-To-All-Nigerian-Bloggers-Open-Message
WebmastersHow To Secure Web Applications Against SQL INJECTION by D34lw4p(op): 10:54am On Mar 13, 2016
SQL injection is one of the most common vulnerabilities in applications on the web today.

This article will show you how to 100% prevent SQL injection on your website using Prepared Statements in PHP.


Method One
What is SQL Injection?
SQL Injection is a type of vulnerability in applications that use an SQL database.

The vulnerability arises when a user input is used in a SQL Statement.

Like Below:

$name = $_GET [ 'username' ] ; $query = "SELECT password FROM tbl_user WHERE name = ' $name ' " ;

As you can see the value the user enters into the URL variable username will get assigned to the variable $name and then placed directly into the SQL statement.

This means that is possible for the user to edit the SQL statement.


$name = "admin' OR 1=1 -- " ; $query = "SELECT password FROM tbl_user WHERE name = ' $name ' " ;


The SQL database will then receive the SQL statement as the following:


SELECT password FROM tbl_users WHERE name = 'admin' OR 1 = 1 -- '


Which is valid SQL, and instead of returning one password for the user, the statement would return all the passwords in the tabletbl_user. This is not something anyone wants in their web applications. This article will show you how to prevent this type of vulnerability.


Method Two

Use Prepared Statements
To prevent SQL injections we will have to use something called prepared statements which uses bound parameters. Prepared Statements do not combine variables with SQL strings, so it is not possible for an attacker to modify the SQL statement.

Prepared Statements combine the variable with the compiled SQL statement, this means that the SQL and the variables are sent separately and the variables are just interpreted as strings, not part of the SQL statement.


Method Three

Prepared Statements with mySQLi.
Using the methods in the steps below, you will not need to use any other SQL injection filtering techniques such as mysql_real_escape_string().

This is because with prepared statements it is not possible to do conventional SQL injection.

mySQLi SELECT Query.

The below script is how to SELECT data from a table using mySQLi Prepared Statements.


$name = $_GET [ 'username' ] ; if ( $stmt = $mysqli -> prepare ( "SELECT password FROM tbl_users WHERE name=?" ) ) { // Bind a variable to the parameter as a string. $stmt -> bind_param ( "s" , $name ) ; // Execute the statement. $stmt -> execute ( ) ; // Get the variables from the query. $stmt -> bind_result ( $pass ) ; // Fetch the data. $stmt -> fetch ( ) ; // Display the data. printf ( "Password for user %s is %s \n " , $name , $pass ) ; // Close the prepared statement. $stmt -> close ( ) ; }



Note: The variable $mysqli is the mySQLi Connection Object.

mySQLi INSERT Query.
The below script is how to INSERT data into a table using mySQLi Prepared Statements.



$name = $_GET [ 'username' ] ; $password = $_GET [ 'password' ] ; if ( $stmt = $mysqli -> prepare ( "INSERT INTO tbl_users (name, password) VALUES (?, ?)" ) ) { // Bind the variables to the parameter as strings. $stmt -> bind_param ( "ss" , $name , $password ) ; // Execute the statement. $stmt -> execute ( ) ; // Close the prepared statement. $stmt -> close ( ) ; }


Note: The variable $mysqli is the mySQLi Connection Object.

mySQLi UPDATE Query.
The below script is how to UPDATE data in a table using mySQLi Prepared Statements.



$name = $_GET [ 'username' ] ; $password = $_GET [ 'password' ] ; if ( $stmt = $mysqli -> prepare ( "UPDATE tbl_users SET password = ? WHERE name = ?" ) ) { // Bind the variables to the parameter as strings. $stmt -> bind_param ( "ss" , $password , $name ) ; // Execute the statement. $stmt -> execute ( ) ; // Close the prepared statement. $stmt -> close ( ) ; }


Note: The variable $mysqli is the mySQLi Connection Object.


mySQLi DELETE Query.
The below script is how to DELETE data from a table using mySQLi Prepared Statements.



$name = $_GET [ 'username' ] ; $password = $_GET [ 'password' ] ; if ( $stmt = $mysqli -> prepare ( "DELETE FROM tbl_users WHERE name = ?" ) ) { // Bind the variable to the parameter as a string. $stmt -> bind_param ( "s" , $name ) ; // Execute the statement. $stmt -> execute ( ) ; // Close the prepared statement. $stmt -> close ( ) ; }



Note: The variable $mysqli is the mySQLi Connection Object.

Join the Nigeria Webdevelopers and Programmers Forum: http://nct.com.ng
ProgrammingJava Program To Solve Quadratic Equation-dealwap by D34lw4p(op): 6:39pm On Mar 07, 2016
Hello coders i was actually writing some codes to solve quadratic equation with JAVA, below is what i came up with.


public class QuadraticEquationSolver
{
public static void main(String[] args)
{
/*Suppose our Quadratic Equation to be solved
* is 2x2 + 6x + 4 = 0 .
* (Assuming that both roots are real valued)
*
* General form of a Quadratic Equation is
* ax2 + bx + c = 0 where 'a' is not equal to 0
*
* Hence a = 2, b = 6 and c = 4.
*/
int a =2;
int b =6;
int c =4;
//Finding out the roots
double temp1 = Math.sqrt(b * b -4* a * c);
double root1 = (-b + temp1) / (2*a) ;
double root2 = (-b - temp1) / (2*a) ;
System.out.println( "The roots of the Quadratic Equation \"2x2 + 6x + 4 = 0\" are "+root1+" and "+root2);
}
}
WebmastersRe: Advice To All Nigerian Bloggers (open Message) by D34lw4p(m): 5:20pm On Mar 07, 2016
Cool cheesy
WebmastersAdvanced Plugin To Protect Your Wordpress Site From Spammer by D34lw4p(op): 8:55pm On Feb 25, 2016
Stop Spammers is an aggressive website spam defence against comment spam and login attempts.

It is capable of performing more than 20 different checks for spam and malicious events and can block spam from over 100 different countries.

There are 12 pages of options that can be used to configure the plugin to your needs.

In cases where spam is detected, users are offered a second chance to post their comments or login. Denied requests are presented with a captcha screen in order to prevent users from being blocked.

The captcha can be configures as OpenCaptcha, Google reCaptcha, or SolveMedia Captcha. The Captcha will only appear when a user is denied access as a spammer.

The plugin is designed to work with other plugins like Gravity Forms. It looks at any FORM POST such as BBPress or other addons that use access controls.

THe plugin implements a fuzzy search for email and user ids in order to check for spam.

There are free add-ons available that check some special cases.
The Stop Spammers Plugin has been under development since 2010.

Click Here To Download Wordpress Anti-Spam Wordpress Plugin For Free

Don't forget to join the webmasters and programmers forum: www.nct.com.ng Thanks!
Jokes EtcWhen She Tell You She Only Date Cool Guys by D34lw4p(op): 2:41pm On Feb 13, 2016
lolzz

WebmastersRe: 10 Things You Must Know And Have Before Creating A Blog by D34lw4p(m): 2:33pm On Feb 06, 2016
JackBizzle:
Nice points but only number 6 is wrong. With wordpress and its themes, you dont need a single line of code.
You are wrong bro! If you dont have atleast few knowledge of the afore mentioned? Have you forgoten about Styling where you work with html color codes? What if some error occured due to plugins issue and it needs you to edit the php codes?
Music/RadioRe: Music: Thaynin - Believe In Yourself by D34lw4p(op): 8:01pm On Feb 03, 2016
@Lalasticlala @Seun please help a brother, help move my song to front page.
WebmastersRe: Google Adsense Will Ban You If Guilty Of This by D34lw4p(op): 3:00pm On Jan 30, 2016
Dani4tech:
please i'm really confused,i have a hosted google adsense account but whenever i create an ad unit in it, and paste the code in my blog it won't display any ad but whenever i get the code from somebody else and replace his PUBLISHER ID with mine,the ad displays.
PLEASE I NEED TO KNOW THE POSSIBLE CAUSE OR SOLUTION.
Cc: D34lw4p
it means two things, either
you have not been fully approved, or you have been approved and you abuse google adsense policy so the delete their live ads from ur site.
WebmastersRe: Secret LEAKED: Some Tips To Help Boost Your Website Traffic by D34lw4p(m): 12:22pm On Jan 30, 2016
WebmastersRe: Google Adsense Will Ban You If Guilty Of This by D34lw4p(op): 12:16pm On Jan 30, 2016
2kaybiel:
I have AdSense but 0. 00 na in dey there
its either you have not been fully approved or you have not start placing live ads on your site.
WebmastersRe: Google Adsense Will Ban You If Guilty Of This by D34lw4p(op): 11:57am On Jan 30, 2016
Lalasticlala
WebmastersGoogle Adsense Will Ban You If Guilty Of This by D34lw4p(op): 11:44am On Jan 30, 2016
Hi Nairalanders! Today i would be telling you some reasons why google adsense may ban your account from their adserver,are you with me?

Then read on, Outlined below are reasons google adsense may ban your account.

Click Coercion:
You are not supposed to fool visitors into clicking on your ads by mistake, or by chance. Yes, I’m talking about overly ads, movable ads, jumping ads, or any form of ads which makes your visitors to clicks ads by mistake.

Click Fraud:
Click Fraud is just like it sounds. You shouldn’t click on your own ads, or getting others to click on them. Understand that Google algorithms are very intelligent and smarter than you think, and may not require much time to catch you.

You cannot fool Google for much longer, as they know how it actually works for you and for them.

Made For AdSense (MFA) Sites:
Made For AdSense websites doesn’t add any value to their readers, or which have very little content in their websites These websites are created with the sole purpose of hosting ads in various pages, and make the visitors to click on ads.

Always make sure to create high value informational sites for people, which can get your some money and online authority.

There are many scraped or copied content websites in Internet, but not all are fortunate enough to experience the real money from AdSense. Remember that if your site has no value, it might be considered as MFA and end up with suspension.

Incentivized Traffic:
You are not supposed to send incentivized traffic to AdSense enabled pages.

This means you cannot use paid traffic such as PPC as well as traffic exchanges, to send visitors to read your content. Many people sign up for paid traffic websites, where you need to check out each others pages for traffic.

Avoid these kinds of cheap techniques to get money from AdSense, as you will not be entertained for much longer.

Low Quality Websites:
Google has become smart in penalizing AdSense accounts on the basis of individual sites.

If any of your websites have low quality content, autoblogging, single keyword focused sites, then confirm your Google AdSense suspension instantly. This happens to most Affiliate marketers, as they generate websites using single keyword phrases like weight loss, yeast Infections and other micro niche sites. If any of your websites fall under these categories, its better to remove them asap and focusing on quality content and authority.

Note:If you use both AdSense and AdWords account at a time, there is risk of getting banned in both the networks at a time. So if your AdWords account is banned, it wont take much time to ban your AdSense too. Be careful in maintaining two different accounts for your AdWords and AdSense services.

Content Violations:
There are many types of categories and content which will get you banned from AdSense instantly. Avoid publishing pornography, hate, drugs, cheating, hacking aids, weapons, alcohol, tobacco content in your website.

Copyrighted Material:
According to Google AdSense TOC, you cannot use copyrighted content in your website. So don’t use content which you don’t own, or which you don’t have rights to. Many people either try to steal the data directly, or rewrite the copied content with little modifications. Both these practices should be avoided, as quality is the most important factor to rank high in Google.

Advice:
Gone are the days where you can earn money from autoblogs and low quality content. Now its time to generate high quality websites and content.

You have to understand the sole concept of long term approach in AdSense business, and make sure to follow the above mentioned guidelines to be successful in your online business. My personal advice to all of you is to follow few simple do’s and don’ts of Google AdSense.

Do’s:
*.Do build websites of high quality and content.

*.Build your sites using positive practises

*.Build your business with sustainability strategies

*.Build more websites that add value in some manner

Don’ts:
*.Don’t invest your time on short term goals like auto blogging.

*.Don’t invest your time to find loopholes, as they will be resolved very quickly

*.Avoid using black hat and grey hat techniques while using AdSense.

*.Don’t forget about the fact of getting banned from all the AdSense enabled websites with your single low quality website.

*.Don’t purposely game the AdSense system for additional clicks or views.

By following these above guidelines, I’m sure you’ll never complain about Google suspending your AdSense accounts. I hope this article will surely help you to understand the core concepts of Google AdSense Terms of Conditions, and also guide you to focus on making an online authority.

Please leave your valuable comments and queries in the below section.

What Do You Think?

Join This Tech Discussion Forum:

http://www.nct.com.ng

Proudly Nigerian!
Music/RadioRe: Music: Thaynin - Believe In Yourself by D34lw4p(op):
Please download.
ProgrammingRe: PHP Functions To Clean Database Inputs by D34lw4p(op): 5:27pm On Jan 26, 2016
DonSegmond:
This is terrible advice. Never do this. Sanitizing your own input will get you in trouble in some many ways.
There are so many creative ways to inject malformed and evil input into a database for SQL injection.

The best way to handle untrusted inputs is to delegate to the Database driver. Use prepared statements, with parameters

With PHP, you can get the benefit of that using PDO.
lolzz you are saying rubbish man! total junk!!!
Music/RadioMusic: Thaynin - Believe In Yourself by D34lw4p(op): 5:18pm On Jan 26, 2016
Nairalanders please download my song titled [b]believe in yourself.[/b]

This song is passing a message to all aspiring musicians. Telling them never to give up, continue striving and believe in themselves.

Please download and listen then drop your reviews as comments.

Thanks!!!

Click Here To Download
ProgrammingSending E-maill With JAVA by D34lw4p(op): 7:54am On Jan 26, 2016
Sending Email from Java Code

Sending email from Java is simple.

We need to install Java Mail Jar and set its path in our program’s classpath.

The basic properties are set in the code and we are good to send email as mentioned in the code below:


import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class SendEmail
{
public static void main(String [] args)
{
String to ="recipient@ gmail.com";
String from ="sender@ gmail.com";
String host ="localhost";
Properties properties = System.getProperties();
properties.setProperty("mail.smtp.host", host);
Session session = Session.getDefaultInstance(properties);

try{
MimeMessage message =newMimeMessage(session);
message.setFrom(newInternetAddress(from));
message.addRecipient(Message.RecipientType.TO,newInternetAddress(to));
message.setSubject("My Email Subject"wink;
message.setText("My Message Body"wink;
Transport.send(message);
System.out.println("Sent successfully!"wink;
}
catch(MessagingException ex) {
ex.printStackTrace();
}
}
}




Join the coders forum: www.nct.com.ng
ProgrammingPHP Functions To Clean Database Inputs by D34lw4p(op): 7:42am On Jan 26, 2016
1) Function for stripping out malicious bits


<?php
functioncleanInput($input){
$search =array('@<script[^>]*?>.*?</script>@si',// Strip out javascript
'@<[\/\!]*?[^<>]*?>@si',// Strip out HTML tags
'@<style[^>]*?>.*?</style>@siU',// Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@'// Strip multi-line comments
);
$output =preg_replace($search,'', $input);return $output;}?>


2) Sanitization function

Uses the function above, as well as adds slashes as to not screw up database functions.


<?php
functionsanitize($input){if(is_array($input)){foreach($input as $var=>$val){ $output[$var]=sanitize($val);}}else{if(get_magic_quotes_gpc()){ $input =stripslashes($input);} $input =cleanInput($input); $output =mysql_real_escape_string($input);}return $output;}?>


Usage


<?php
$bad_string ="Hi! <script src=' http://www.evilsite.com /bad_script.js'></script> It's a good day!"; $good_string =sanitize($bad_string);// $good_string returns "Hi! It\'s a good day!"
// Also use for getting POST/GET variables
$_POST =sanitize($_POST); $_GET =sanitize($_GET);?>



Join The Coders Forum www.nct.com.ng

1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 (of 30 pages)