How I Teach
Thursday, November 29, 2018
Monday, March 31, 2014
Saturday, March 29, 2014
Friday, March 14, 2014
2013 December 31st PHP Class
On 2013 December 31st [last day of that year] I conducted a full day "PHP Advance Class" session with my BIT Semester 5 - IAD Students in Esoft Metro Campus Negombo. Some of the comments are as follows.
"First of all thank you very much sir as I got many things about php stuff on that day.I can't explain actually many of my unclear points become cleared.Now I can manage js and php much better than before.Better if you can arrange classes like that in future sir because it really helpful for me."
[TD Samarasinghe]
"Sir I am really happy about the class u have done on 31 st. Since it was a full day class could grab lots of things. If u have more time. we all are looking for another php session.
Happy New Year sir!!"
[Jeewanthi Marasinghe]
"First of all thank you very much sir as I got many things about php stuff on that day.I can't explain actually many of my unclear points become cleared.Now I can manage js and php much better than before.Better if you can arrange classes like that in future sir because it really helpful for me."
[TD Samarasinghe]
"Sir I am really happy about the class u have done on 31 st. Since it was a full day class could grab lots of things. If u have more time. we all are looking for another php session.
Happy New Year sir!!"
[Jeewanthi Marasinghe]
Wednesday, March 12, 2014
අන්තර්ජාල වේගය වැඩි කිරීම
One of my Student on Saturday Feb 8, 2014 at Night
10 messages
________________________________________
Jeewanthi Marasinghe <j-------------@gmail.com> Sat, Feb 8, 2014 at 9:33 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
sir here i cn't get the desired output. when i enter username, password and type only i need to redirect the page to profile.php. Can u help me to correct this code.
login.zip
3K
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 9:45 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
OK I will chk. Pls send me the Database also.
Thanks and Regards.
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 9:54 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
Found the sql.
No need to resend.
Thanks and Regards.
Rukshan Edirisinghe
Jeewanthi Marasinghe <j-------------@gmail.com> Sat, Feb 8, 2014 at 10:03 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
yes sir i snt u everything
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 10:25 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
Found one error in index file.
Two forms.
Both has action and methods.
But last one has submit button. so that form will submit. But that form will not have user name ,pass .. etc.
Thanks and Regards.
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 10:33 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
<body>
<form id="myform" action="login.php" method="POST">
Username: <input name="username" type="text" id="username" value="Jeewa"></br>
Password: <input name="password" type="password" id="password" value="jeewa123"></br>
Login Type:
<select name="type">
<option value="admin">admin</option>
<option value="Staff">Staff</option>
<option value="Student">Student</option>
<option value="Parent">Parent</option>
</select>
<div id="ack"></div>
<button id="submit">Login</button>
</form>
Thanks and Regards.
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 10:37 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
Again the logic should changed as follows.
check if already a logged user
otherwise
check the post values first with db
and then set sessions
then redirect to required page.
E.g.:
else{
$sql = "SELECT * FROM users WHERE (username= '$username' AND password = '$password' AND type = '$type')";
$log = mysql_query($sql);
$rows = mysql_num_rows($log);
echo $sql;
if($rows>0){
$_SESSION['user'] = $username;
$_SESSION['type'] = $password;
header("Location: profile.php");
/* Make sure that code below does not get executed when we redirect. */
exit;
}
else
echo "You have no access";
Thanks and Regards.
________________________________________
Jeewanthi Marasinghe <j-------------@gmail.com> Sun, Feb 9, 2014 at 7:39 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
sir still it's not working da thing is jeewa can't b da default value for username. It shud vary according to da way of inserting values. I modified da code. didn't gt any meaningful output. It shows Username, Password and Type Are Mandotory
________________________________________
Jeewanthi Marasinghe <j-------------@gmail.com> Sun, Feb 9, 2014 at 7:45 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
No sir it's working. Thank u sir :))
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sun, Feb 9, 2014 at 10:09 PM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
OK. don't put more time on php. focus on semester 5.
After that we may have a time to deal with this.
Thanks and Regards.
Rukshan Edirisinghe
Senior Trainer,
Intel® Teach Program,
P.O.Box. 35, Kandana, Sri Lanka.
Phone & Fax : 11-2242504 Mobile : 77-7597015
www.intel.com/education/lk |www.iteach.schoolnet.lk | www.dnrlk.com
________________________________________
Jeewanthi Marasinghe <j-------------@gmail.com> Sat, Feb 8, 2014 at 9:33 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
sir here i cn't get the desired output. when i enter username, password and type only i need to redirect the page to profile.php. Can u help me to correct this code.
login.zip
3K
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 9:45 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
OK I will chk. Pls send me the Database also.
Thanks and Regards.
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 9:54 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
Found the sql.
No need to resend.
Thanks and Regards.
Rukshan Edirisinghe
Jeewanthi Marasinghe <j-------------@gmail.com> Sat, Feb 8, 2014 at 10:03 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
yes sir i snt u everything
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 10:25 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
Found one error in index file.
Two forms.
Both has action and methods.
But last one has submit button. so that form will submit. But that form will not have user name ,pass .. etc.
Thanks and Regards.
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 10:33 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
<body>
<form id="myform" action="login.php" method="POST">
Username: <input name="username" type="text" id="username" value="Jeewa"></br>
Password: <input name="password" type="password" id="password" value="jeewa123"></br>
Login Type:
<select name="type">
<option value="admin">admin</option>
<option value="Staff">Staff</option>
<option value="Student">Student</option>
<option value="Parent">Parent</option>
</select>
<div id="ack"></div>
<button id="submit">Login</button>
</form>
Thanks and Regards.
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sat, Feb 8, 2014 at 10:37 AM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
Again the logic should changed as follows.
check if already a logged user
otherwise
check the post values first with db
and then set sessions
then redirect to required page.
E.g.:
else{
$sql = "SELECT * FROM users WHERE (username= '$username' AND password = '$password' AND type = '$type')";
$log = mysql_query($sql);
$rows = mysql_num_rows($log);
echo $sql;
if($rows>0){
$_SESSION['user'] = $username;
$_SESSION['type'] = $password;
header("Location: profile.php");
/* Make sure that code below does not get executed when we redirect. */
exit;
}
else
echo "You have no access";
Thanks and Regards.
________________________________________
Jeewanthi Marasinghe <j-------------@gmail.com> Sun, Feb 9, 2014 at 7:39 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
sir still it's not working da thing is jeewa can't b da default value for username. It shud vary according to da way of inserting values. I modified da code. didn't gt any meaningful output. It shows Username, Password and Type Are Mandotory
________________________________________
Jeewanthi Marasinghe <j-------------@gmail.com> Sun, Feb 9, 2014 at 7:45 AM
To: Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com>
No sir it's working. Thank u sir :))
________________________________________
Rukshan Edirisinghe <rukshan.edirisinghe@gmail.com> Sun, Feb 9, 2014 at 10:09 PM
To: Jeewanthi Marasinghe <j-------------@gmail.com>
OK. don't put more time on php. focus on semester 5.
After that we may have a time to deal with this.
Thanks and Regards.
Rukshan Edirisinghe
Senior Trainer,
Intel® Teach Program,
P.O.Box. 35, Kandana, Sri Lanka.
Phone & Fax : 11-2242504 Mobile : 77-7597015
www.intel.com/education/lk |www.iteach.schoolnet.lk | www.dnrlk.com
Wednesday, January 16, 2013
Subscribe to:
Posts (Atom)