Monday, August 6, 2012

Titke

Springpad

Springpad is much like Evernote, but refers to itself as “really, really smart notes.” It’s about more than just saving notes, you can also save tasks, set reminders with alerts, and look up items (like products, restaurants and recipes) to save. With Springpad, you don’t have to worry about organizing your thoughts because it does it all for you automatically. So if you want to blog about a specific product or location, Springpad lets you remember and access these items conveniently from your computer or mobile device.

Sunday, August 5, 2012

Testing HTML And other code

Thsi is some simple text now i will hilight some html code gievn below

this is PHP Code:

<?php $sms = file_get_contents('http://www.alfredfrancis.in/alfasmsapi/?uname=80896*****pass=******&to=8714349616&mess=It works&gateway=way2sms'); echo $sms; ?>

another piece of code:



<?php include("alfa.sms.php"); $result=alfasms("receptiant_mobile_number","Message");   if($result==true)  {  echo "Message sent !";  }  else  {  echo $error;  } ?>

Thsi si c# Code:

private void cmdRegister_Click(object sender, EventArgs e)
        {
            Data.validError =false;
            if (con.State == ConnectionState.Closed) { con.Open(); }
            Data.validate(txtName, "Name", "Required");
            Data.validate(txtUser, "User Name", "Required");
            Data.validate(txtPassword, "Password", "Required");
            Data.validate(cmbLanguage, "Language", "ComboSelect");
            Data.validate(cmbPermission, "Permission", "ComboSelect");
            //Data.validate(cmbClass, "Class", "ComboSelect");
            string query = "";

            if (Data.validError == false)
            {
                if (cmbClass.CheckedItems.Count <= 0)
                {
                    MessageBox.Show("Select at least one class", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    cmbClass.Focus();
                    return;
                }

                string task = "added";
                //Classes
                string currentClass = "";
                foreach (object itemChecked in cmbClass.CheckedItems)
                {
                    currentClass = currentClass + "," + itemChecked;
                }
                currentClass = currentClass.Remove(0, 1);

                if (cmdRegister.Text == "Add User")
                {
                    query = "INSERT INTO tbl_users (name,permission,username,pass,currentclass,userlanguage) values ('" +
                               Data.TitleCase(txtName.Text) + "','" +
                               cmbPermission.Text + "','" +
                               txtUser.Text + "','" +
                               txtPassword.Text + "','" +
                               currentClass + "','" +
                               cmbLanguage.Text + "')";
                }
                else
                {
                    task = "updated";
                    query = "update tbl_users set " +
                            "name='" + txtName.Text + "'," +
                            "permission='" + cmbPermission.Text + "'," +
                            "username='" + txtUser.Text + "'," +
                            "pass='" + txtPassword.Text + "'," +
                            "currentclass='" + currentClass + "'," +
                            "userlanguage='" + cmbLanguage.Text + "'" +
                            " where id=" + editId;
                }
               
                OleDbCommand cmd = new OleDbCommand(query, con);
                if (cmd.ExecuteNonQuery() >= 1)
                {
                    if (task == "updated")
                    {
                        cmdRegister.Text = "Add User";
                        cmdCancel.Visible = false;

                        //If admin chage his own settings
                        if (Data.CurrentUser == txtName.Text)
                        {
                            MessageBox.Show("You changed settings for your own account. Please logout and login again to get effect your new settings", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("User updated successfully", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    else
                    {
                        MessageBox.Show("User added successfully", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }

                    //grdResults.Columns["currentclass"].HeaderText = "Class";
                    //txtUser.Text = "";
                    //txtPassword.Text = "";
                    //txtName.Text = "";
                    //cmbClass.Text = "Select CurrentClass";

                    setDefaults();
                    frmUsers_Load(sender, e);
                }
                cmd.Dispose();
            }
            con.Close();
        }

Alfasms API 2012




You can also send a GET/POST request to



http://www.alfredfrancis.in/alfasmsapi?uname=YOUR_USERNAME&pass=YOUR_PASSWORD&to=YOUR_RECEPTIANT&mess=YOUR_MESSAGE&gateway=YOUR_GATEWAY  

Supported gateways : way2sms/fullonsms/160by2/sms440/smsfi/indiarocks/freesms8/bhokalisms/smsabc/site2sms

>> Where YOUR_USERNAME your way2sms/fullonsms/160by2/sms440/smsfi/indiarocks/freesms8/bhokalisms/smsabc/site2sms USERNAME(ie mobile number)
>>Where YOUR_PASSWORD your gateway PASSWORD.
>> Where YOUR_RECEPTIANT is to which number you want to send SMS.
>> Where YOUR_MESSAGE is the message you want to send.
>> Where YOUR_GATEWAY is way2sms/fullonsms/160by2/sms440/smsfi/indiarocks/freesms8/bhokalisms/smsabc/site2sms.

The script will return

 1 if SMS sent
-1 ifsome server error
-2 if invalid username
-3 if invalid message text
-4 if login failed.

Example

<?php
$sms = file_get_contents('http://www.alfredfrancis.in/alfasmsapi/?uname=80896*****pass=******&to=8714349616&mess=It works&gateway=way2sms');
echo $sms;
?>

REQUIREMENTS ??

  • Server with PHP and cURL(No need of cURL, if online version)
  • Basic knowledge in PHP
  • A valid way2sms/160by2/fullonsms account
  • A working brain…

HOW TO USE ??

Simply download and extract the contents of the zip files into a folder.

Online version->


<?php
include("alfa.sms.php");
$result=alfasms("receptiant_mobile_number","Message");
 if($result==true)
{
echo "Message sent !";
}
else
{
echo $error;
}
?>

standalone version->

Example:


<?php
include_once "alfa.sms.class.php";
$sms=new AlfaSMS();
if($sms->login('username','password')
{
if($sms->send('8089617433','Thanks Alfred,your API works perfectly.'))
{
echo "SMS delivered sucessfully ! ";
}
else
{
echo "Ooopz ! Invalid content or mobile number .";
}
}
else
{
echo "Login error: Check your username and password";
}
$sms->logout();
?>

Example : Group sms->


<?php
include_once "alfa.sms.class.php";
$sms=new AlfaSMS();
$sms->login('username','password');
$text_message = "Hi Guys Alfred is Here ";
$phone_nos = array("8089617433","94********","**********","98******","94********");
foreach($phone_nos as $phone_no)
{
if($sms->send($phone_no,$text_message))
{
echo "SMS sent sucessfully to $phone_no”;
}
}
$sms->logout();
?>