Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
NURSING , CAREGIVER , HOTEL & BEAUTY COURSES
IVA Para Medical Campus
Updated:
Yesterday at 9:24 AM
Handmade Character Soft Toys Peppa Pig Family
anil1961
Updated:
Wednesday at 9:58 PM
Ad icon
Video Content Creator
pramukag
Updated:
Sunday at 6:10 AM
Ad icon
QA Engineer Intern
pramukag
Updated:
Sunday at 6:07 AM
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Jun 25, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
What is the most useless thread on Elakiri?
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Lakshan-Seram" data-source="post: 18399788" data-attributes="member: 358904"><p>uba code liyanne ajax.php ekemada? mama nam tikak wenas method ekak use karanne..</p><p></p><p>ajax.php</p><p>[PHP]<?php</p><p>/*</p><p> * Application: My Reminders (NCC Level 5 June 2014).</p><p> * Author: ******* (www.*******.com).</p><p> * Ajax call file.</p><p> */</p><p>define('_VALID', true); // Hack for the security check. Make this accessible.</p><p>require_once('includes/process.php');</p><p>?>[/PHP]process.php</p><p>[PHP]<?php</p><p>/*</p><p> * Author: ******* (www.*******.com).</p><p> * Main process file used to process data sent though ajax requests.</p><p> * Posted action is used to switch the action of processing.</p><p> */</p><p>defined('_VALID') or die('Restricted Access!'); // Preventing direct access of the file for security.</p><p>require_once(dirname(__FILE__).'/config.php'); // Including the main configuration file.</p><p></p><p>/*</p><p> * Main processing script switched by the action.</p><p> */</p><p>if(isset($_POST['action'])){</p><p> </p><p> if($_POST['action']=='login'){</p><p> </p><p> /*</p><p> * Processing the user login.</p><p> */</p><p> $username = stripslashes(strip_tags($_POST['username']));</p><p> $password = stripslashes(strip_tags(md5($_POST['password'])));</p><p> </p><p> if(checkUsername($username)==false){ // Check for the already registered email addresses.</p><p> die('Account with provided username is not available');</p><p> }</p><p> $role = authenticateUser($username, $password);</p><p> if($role!=false){ // Authenticating the user.</p><p> $userinfo = array();</p><p> $userinfo = getUserInfoByUsername($username, $role);</p><p> if($role=='std'){</p><p> $uid = $userinfo['stId'];</p><p> }elseif($role=='stf'){</p><p> $uid = $userinfo['staffId'];</p><p> }</p><p> </p><p> if(isset($_POST['remember'])){</p><p> if(!isset($_COOKIE['USR']))</p><p> setcookie("USR", $role.'_'.$uid, time()+172800); // Setting user remind cookie.</p><p> }</p><p> else{</p><p> if(!isset($_SESSION))</p><p> session_start(); // Starting the session.</p><p> if(!isset($_SESSION['USR']))</p><p> $_SESSION['USR'] = $role.'_'.$uid; // Setting the session variable.</p><p> }</p><p> echo 'true';</p><p> exit;</p><p> }else{</p><p> die('Either username or password does not matched');</p><p> }</p><p> mysql_close($connect); </p><p> }else{</p><p> die('Restricted Access!');</p><p> }</p><p>}</p><p>else{</p><p> die('Restricted Access!');</p><p>}</p><p>?>[/PHP]meka mama me awrudakata witara kalin liwwa ekak yaluwek ge assignment ekakata.. den nam thawath tikak wenas widihata liyanne..</p></blockquote><p></p>
[QUOTE="Lakshan-Seram, post: 18399788, member: 358904"] uba code liyanne ajax.php ekemada? mama nam tikak wenas method ekak use karanne.. ajax.php [PHP]<?php /* * Application: My Reminders (NCC Level 5 June 2014). * Author: ******* (www.*******.com). * Ajax call file. */ define('_VALID', true); // Hack for the security check. Make this accessible. require_once('includes/process.php'); ?>[/PHP]process.php [PHP]<?php /* * Author: ******* (www.*******.com). * Main process file used to process data sent though ajax requests. * Posted action is used to switch the action of processing. */ defined('_VALID') or die('Restricted Access!'); // Preventing direct access of the file for security. require_once(dirname(__FILE__).'/config.php'); // Including the main configuration file. /* * Main processing script switched by the action. */ if(isset($_POST['action'])){ if($_POST['action']=='login'){ /* * Processing the user login. */ $username = stripslashes(strip_tags($_POST['username'])); $password = stripslashes(strip_tags(md5($_POST['password']))); if(checkUsername($username)==false){ // Check for the already registered email addresses. die('Account with provided username is not available'); } $role = authenticateUser($username, $password); if($role!=false){ // Authenticating the user. $userinfo = array(); $userinfo = getUserInfoByUsername($username, $role); if($role=='std'){ $uid = $userinfo['stId']; }elseif($role=='stf'){ $uid = $userinfo['staffId']; } if(isset($_POST['remember'])){ if(!isset($_COOKIE['USR'])) setcookie("USR", $role.'_'.$uid, time()+172800); // Setting user remind cookie. } else{ if(!isset($_SESSION)) session_start(); // Starting the session. if(!isset($_SESSION['USR'])) $_SESSION['USR'] = $role.'_'.$uid; // Setting the session variable. } echo 'true'; exit; }else{ die('Either username or password does not matched'); } mysql_close($connect); }else{ die('Restricted Access!'); } } else{ die('Restricted Access!'); } ?>[/PHP]meka mama me awrudakata witara kalin liwwa ekak yaluwek ge assignment ekakata.. den nam thawath tikak wenas widihata liyanne.. [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom