User Profile

Collapse

Profile Sidebar

Collapse
Fareast Adam
Fareast Adam
Last Activity: Dec 5 '07, 09:51 AM
Joined: Feb 21 '07
Location: malaysia
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    I have try using session live time to kill the session within 2 hours to prevent forgot logout something like this; Thanks again

    [PHP]
    #session live time is 2 hours
    setcookie(sessi on_name(), $_COOKIE[session_name()], time()+7200, '/');
    [/PHP]


    Fareast adam
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    Anyway thank nathj for ur time and idea! I sense that i must try another method also.

    Fareast Adam;
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    But what about genereting a new session_id() for each new different user's account such as this;

    [PHP]
    #login.php
    session_start() ;

    $_SESSION['usr'] = $username;
    $_SESSION['loggedin'] = md5($username.$ password.$salt) ;
    if(session_id() =='')
    {
    setcookie(sessi on_name(), session_id(), time()+7200, '/');
    }
    else
    {
    session_regener ate_id();
    setcookie(sessi on_name(),...
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    Is it guess sufficient if I use the following code to examine uer session whose registered? I put on the top on every pages...

    [PHP]
    require('check. php');
    [/PHP]
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    Actually I have using database to keep all user information such as username and password. These program are just sample only. I think i have problem on page check.php where i will include check.php in every pages as in page home.php. The problem is when I login on second time the first account will be replaced to the other new account. I am not know what i'am wrong. Please help me, I'am really need you help.

    Fareast Adam
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    Hi nathj, thanks for ur appreaciate... Actaully I want to make a login for portal but I has no idea where to start. Can u give me some simpler example to do that..thanks
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    I've tried this code and put in login.php. But the problem happened is when i login more than one account either an account will replace all the registered account. I really don't know what i'am gonna do right now. I really need ur help.

    [PHP]
    #login.php

    session_start() ;

    $i = 0;
    $_SESSION['sess'] = array();

    if(sizeof($_SES SION['sess'])==0)
    {
    $_SESSION['sess'][$i]...
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    replied to How to restrict multiple login in a time?
    in PHP
    Please help me! I currently got stuck. Is it possible to register different session_id() for each different user?
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    started a topic How to restrict multiple login in a time?
    in PHP

    How to restrict multiple login in a time?

    I want to make sure all users those login are different in a time either on the same or different computer or web browser. Following are sample of my program which consist 4 different pages;

    [PHP]
    #users.php

    $users = array(
    'user1' => md5('password1' ),
    'user2' => md5('password2' )
    );
    $salt = substr(md5(date ('F')), 8);
    [/PHP]

    [PHP]
    <?php
    ...
    See more | Go to post

  • Fareast Adam
    started a topic How to sort array values
    in PHP

    How to sort array values

    Anyone know how to sorting array values from least to greatest. Here the code;

    [PHP]function mulsort($a)
    {
    sort($a);
    $c = count($a);
    for($i = 0; $i < $c; $i++)
    if (is_array($a[$i]))
    mulsort($a[$i]);
    }

    $temp = array(5,4,1,3,2 );
    $test = array();

    $test = mulsort($temp);

    for($i=0; $i<sizeof($test );...
    See more | Go to post

  • All leftFrame and topFrame contents are hidden but the problem is both size never change! What i want is to hide both frames while the specified contents inside the mainFrame is only preview not all the mainFrame contents.
    See more | Go to post

    Leave a comment:


  • The topFrame and leftFrame are hidden while previewing mainFrame but i still not got an expected result, previewing only 'complaint'. Here the code as below;

    [HTML]function printpreview()
    {
    var OLECMDID = 7;
    /* OLECMDID values:
    * 6 - print
    * 7 - print preview
    * 8 - page setup (for printing)
    * 1 - open window
    * 4 - Save As
    * 10 - properties
    ...
    See more | Go to post

    Leave a comment:


  • But, how to hide the mainFrame if i use three frames (leftFrame, mainFrame, topFrame) and i put the code inside the mainFrame? Your help are appreciete, thanks

    Regard;

    Fareast Adam
    See more | Go to post

    Leave a comment:


  • It's ok i have been got the solution a while ago! Here the code as folowing;

    [HTML]<script language="javas cript">
    function printpreview()
    {
    var OLECMDID = 7;
    /* OLECMDID values:
    * 6 - print
    * 7 - print preview
    * 8 - page setup (for printing)
    * 1 - open window
    * 4 - Save As
    * 10 - properties
    */
    var PROMPT = 1;...
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    started a topic how to hide unwant objects to print?

    how to hide unwant objects to print?

    I try to hide the print preview button that inside <div id="button"> when previewing the page. But the the problem happened the button is always hidden after i closing the preview page. Anyone have an idea how to overcome this? Here is the code;

    [HTML]<html>
    <head>
    <script language="javas cript">
    function printpreview()
    {
    var OLECMDID = 7;
    /* OLECMDID...
    See more | Go to post

  • it's ok i have been got the solution by using in_array function as shown below;

    [PHP]$valid_ext = array('3gp','aa c','avi','bmp', 'doc','flv','gi f','gz','gzip', 'jpeg','jpg','m ov','mp3','mpeg ','mpg','pdf',' png','ppt','rar ','tar','tif',' txt','wav','wmv ','zip');
    if(!in_array('a bc',$valid_ext) )
    {
    echo 'File not supported!';
    }
    else
    {
    echo 'File supported!';
    }[/PHP]
    See more | Go to post

    Leave a comment:


  • Fareast Adam
    started a topic Function to check file extension not working
    in PHP

    Function to check file extension not working

    Anybody please help me! The function always return false although file extension is supported. Here my code;

    [PHP]function checkExtension( $extension)
    {
    $valid_ext = array('3gp','aa c','avi','bmp', 'doc','flv','gi f','gz','gzip', 'jpeg','jpg','m ov','mp3','mpeg ','mpg','pdf',' png','ppt','rar ','tar','tif',' txt','wav','wmv ','zip');

    foreach($valid_ ext as $ext)
    {
    if($extension== $ext)
    ...
    See more | Go to post

  • i've been got the answer. here the answer;

    [PHP]gmdate('Y-m-d H:i:s a', mktime(0,0,0,gm date('m'),gmdat e('d')+2,gmdate ('Y')))[/PHP]
    See more | Go to post

    Leave a comment:


  • how to add several days to the current date using php?

    how to add several days to the current date using php? here my php code

    [PHP]$time = gmdate('Y-m-d H:i:s a');[/PHP]

    what i mean is i want to add 2 days on the current date. how can i do this? your help are appreciate! thanks...

    regard Fareast Adam
    See more | Go to post

  • Fareast Adam
    replied to Server GMT time problem
    in PHP
    I want to get present Malaysia GMT time (GMT + 08:00) within localhost. But i got the unexpected result, where all the result display am althought currently is pm in Malaysia when i retrieve it from database. Am i wrong on way?
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...