Archive for April 2011

Codeigniter session issue fixation

 Codeigniter session issue fixation

I have a codeigniter site with a shopping cart and it is using database to store session values. But the session is going out when I add hundreds of products in it.

I have spent two days checking about it and finally find out the issue in it. It was failing to unserialize the session data stored in the ci_sessions table in the field 'user_data'.

After checking sometime I found that the field(user_data) is failing to store all serialized data in it. So when unserializing it is failing.

So I have changed the field type of 'user_data' from 'text' to 'longtext' and now it is able to store more data and my problem fixed. Now the session is not breaking.

Hope this info will help somebody else :)

Php Web Design Website Development Company in India

Php Web Development India - PHP Website Designers Developers and Programmers have started Outsourcing PHP Projects and IT Services with Web Designing Company in Rajkot Ahmedabad Gujarat India.

Expertise of WeTheDevelopers allow us to offer multimedia services that will capture the attention of our USA UK Australia GB Europe India Overseas clients target market and communicate their message effectively.

WeTheDevelopers.com has Expertise in

PHP Web Development India

Website Designing Company

Outsourcing PHP Projects

Php MySql Web Development


In Conclusion we can say, there is most advantageous opportunity for business development by utilizing the services of PHP development in India. Also With specific web solutions for all business development requirements PHP web development Company in India can help you harvest engaging fruits of success promptly.


Thanks & Regards

WeTheDevelopers.com - Php Web Development Company in India

301-Golden Plaza, Tagore Road, Rajkot Gujarat India

Phone +91 281 662 6667 / +91 98257 65089

admin@wethedevelopers.com

www.WeTheDevelopers.com

www.PhpWebDevelopmentIndia.com

Web design blogs

Flyg köpenhamn

Print Output

PHP is giving some sting functions to printing output into browser and we are often using print() and echo() function. Both of those functions are not real function but a language construction. print() and echo() function have same goal, but there are some essential different that must to pay attention.

Print() function behavior like the other function in common and having return value integer 1. Thus, print() can used as part of expression which more complex. Meanwhile, echo() is able to accept more than one parameters all at once, and does not having return value.

print() ‘string 1’;
echo ‘string 1’;
// using some parameters
echo ‘string 1’, “string 2”, ‘…’;

echo() function string will execution more faster than print(). This differentiate caused by will return status (integer) which expose what process has done or not.

On the other side, echo() just displaying output only and do anything. At implementation, return value status from using function string almost never needed.

Javascript Key code

Key Pressed Key Code
backspace 8
tab 9
enter 13
shift 16
ctrl 17
alt 18
pause/break 19
caps lock 20
escape 27
page up 33
page down 34
end 35
home 36
left arrow 37
up arrow 38
right arrow 39
down arrow 40
insert 45
delete 46
0 48
1 49
2 50
3 51
4 52
5 53
6 54
7 55
8 56
9 57
a 65
b 66
c 67
d 68
e 69
f 70
g 71
h 72
i 73
j 74
k 75
l 76
m 77
n 78
o 79
p 80
q 81
r 82
s 83
t 84
u 85
v 86
w 87
x 88
y 89
z 90
left window key 91
right window key 92
select key 93
numpad 0 96
numpad 1 97
numpad 2 98
numpad 3 99
numpad 4 100
numpad 5 101
numpad 6 102
numpad 7 103
numpad 8 104
numpad 9 105
multiply 106
add 107
subtract 109
decimal point 110
divide 111
f1 112
f2 113
f3 114
f4 115
f5 116
f6 117
f7 118
f8 119
f9 120
f10 121
f11 122
f12 123
num lock 144
scroll lock 145
semi-colon 186
equal sign 187
comma 188
dash 189
period 190
forward slash 191
grave accent 192
open bracket 219
back slash 220
close braket 221
single quote 222

How to hack a facebook account

Hacking Procedure This is one of the most popular questions which I'm asked via my email.And today I'm going to solve this problem one it for all.Even though i have already written a few ways of Hacking a Facebook Password.Looks like i got to tidy up the the stuff here.The first thing i want to tell is.You can not hack or crack a facebook password by a click of a button.That's totally impossible and if you find such tools on the internet then please don't waste your time by looking at them! They are all fake.Ok now let me tell you how to hack a facebook account.
This is one of the most easiest ways of hacking.If your good at human manipulation and extracting information out of a conversion between you and your victim then this is the best trick for you.Go to and check out exactly what information you need to extract from your victim in the conversion.The most basic things would include "Birthday,Secret Question etc".Make sure you don't bump into a stranger and directly ask him the details.Drag the conversation for a while.Make yourself look trust able and then extract one by one slowly


Keylogging has always been my favourite(Because i coded a few keyloggers :p).This is the most stealthy and easiest way to hack.Once your keylogger has been injected its up to the program to get the passwords that are enetered on a computer.The tricky part of keylogging is "How to inject a Keylogger".But you can always use email attachments or even use something like "Money.exe" as your keylogger.If you want free keyloggers,you can try some of mine or others.

This is one of the most popular questions which I'm asked via my email.And today I'm going to solve this problem one it for all.Even though i have already written a few ways of hacking a facebook password.Looks like i got to tidy up the the stuff here.The first thing i want to tell is.You can not hack or crack a facebook password by a click of a button.That's totally impossible and if you find such tools on the internet then please don't waste your time by looking at them! They are all fake.Ok now let me tell you How to Hack a Facebook Account. Here’s how to hack facebook:

With our Facebook Hacking software called “Facebook Hack Automator”, you can simply enter and account username/ID and it will hack it in just a while. At this moment it has a 99.8% success rate, and we do our best to get it even higher. You do not need ANY technical knowledge requirements whatsoever. Forget about hiring a personal hacker or maybe even spending months and thousands of dollars for studying to become one yourself. If a human can do it, our software can do it (thus its name)

This facebook password retrieval software works with all facebook accounts, no matter when they were created or what e-mail service the user is using. After research, lots of clients have discovered that our program is the only reliable software in the net to hack facebook accounts.
Hack Facebook FOR FREE!

A couple of month's ago I wanted to check my old FaceBook account but forgot what email and password I had used to sign up, I sent an email to their technical support but they didn't reply so I decided to put my geek skills to good use and find a way to get my login information back by writing a facebook account hacking code or exploit as they are called.
Looking to hack Facebook? If you then you have come to the right place. Hack Facebook Password is the only site on the web which will grant you access to any Facebook account absolutely free of charge.
Hack That Account NOW!

Creating a constructor in PHP class

Sometimes you need to initialize class object before call them. So before using our object we can initialize our object using PHP constructor. PHP constructor just initialize object, not allocate object. To allocate object we use new keyword.

Step to write constructor:

Write function then writes double underscore __ and then write name constructor.   See the example below

function __constructor()
{
}

Constructor body is enclosed by curly braces.

Now we write a constructe for Myclass

<?php
class Myclass{
function __constructor()
{
echo “This is PHP constructor”;
}
}
$obj=new Myclass();
?>

See the output. One important thing that in this class we just create a new object of this class but it print “This is PHP constructor”  because we initialize object before use. 

form with html entities in php

<?php

if(isset($_POST['name'])&&isset($_POST['age']))
{
  $name=$_POST['name'];
  $age=$_POST['age'];
  if(!empty($name)&&!empty($age))
  {
   echo '<center>name :<b>'.$name.'</b> age :<b>' .$age.'</b><br><br></center>';
  }
  else
  {
   echo '<center><b>you not filled both fields</b><br><br></center>';
  }

}

?>
<center><form action="form.php" method="POST">

               NAME :<input type="text" name="name">

               AGE  :<input type="text" name="age">

                <input type="submit" value="submit">
</form></center>

output :

1)if you  filled all fields output displays that is  you entered data

other wise it gives a message as " you not filled both fields "
2) if you give html entities then it also displays as it is

Sorting a multidimensional array in PHP - intelligent method

It is not at all easy to sort a multidimensional array.. After spending hours of time we have find out a solution for it.. check the following:


Array
(
[0] => Array
(
[message_email] => test3@test.com
[message_subject] => p message2
[message_date] => 2011-06-02 00:00:00
[message_id] => 4
[message_name] => test name2
[user_id] => 26
[user_display] => Administrator
)

[1] => Array
(
[message_email] => test@test.com
[message_subject] => test product sub1
[message_date] => 2011-06-01 00:00:00
[message_id] => 3
[message_name] => tet name1
[user_id] => 26
[user_display] => Administrator
)

)

For eg: I need to sort this multidimensional array based on the message_name
in ascending order.

So I put

$sort = "message_name";
$order_by = "asc";

$asc = create_function ('$a,$b','return strcasecmp($a["'.$sort.'"], $b["'.$sort.'"]);');

$desc = create_function ('$a,$b','return strcasecmp($b["'.$sort.'"], $a["'.$sort.'"]);');

if($order_by=="asc")

usort($rows,$asc);

else

usort($rows,$desc);




print_r($rows)




Hope this will help some one.. :)

understanding JSON

JSON stands for JavaScript Object Notation.It's lightweight data interchange format.It is a text-based, human-readable format for representing object and other data structures and is mainly used to transmit such structured data over a network connection (in a process called serialization).It is based on subset of javascript.

JSON is a self-contained unambiguous data representation format, and since it carries no executable or algorithmic meaning it is inherently secure by itself. However security issues may arise if a program incorrectly processes JSON-formatted data as if it were something else. Since the JSON syntax is by design a subset of the Javascript syntax, most security concerns involve having a Javascript interpreter directly process JSON text as if it were Javascript source code.

The following example shows the JSON representation of an object that describes a employe. The object has string fields for first name and last name,company name,designation contains an object representing the person's address, and contains a list of phone numbers (an array).


{
   "firstName": "Uttam",
   "lastName": "Kumar", 
   “companyName” :”magnet”, 
   “designation”:”Sr. web Developer”,
   "address": {      
     "streetAddress": "Patankar street", 
            "city": "Nsp(w)",
             "state": "MH",
            "postalCode":401203     
               },
 "phoneNumbers": [ "212 732-1234","646 123-4567"]
 }

Suppose the above text is contained in the JavaScript string variable employee. Since JSON is a subset of JavaScript's object literal notation, one can then recreate the object describing Uttam Kumar with a simple eval() function which is as follows

 var emp = eval("(" + employee + ")");  Now we can access firstName,city,phone number by the following. 
emp.firstName //property of object
emp.address.city //sub property of object 
emp.phoneNumbers[0]//array
 similerly we can access all the values.

include() in php

liclude.php :

<?php

mysql_connect('localhost','root','') or die('not connected');
echo '<center>database connected</center>';

?>
=================================================================

index.php :

<?php

@include 'include-page.php';

echo '<br>';
echo 'home page';


?>
output :

database connected

home page=================================================================

sub-page.php :

<?php

@include 'include-page.php';
echo 'sub page';

?>

output :


database connected
sub page
=================================================================

note :

 ' @ ' use for don't  display errors related to php

if there is no  ' include-page.php ' page then on problem , remaining all are worked

here ' index.php ' , ' sub-page.php ' pages  are run