Jump to content

Sinan

New Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Sinan

  1. Could you tell what exactly you are trying to do? What's your goal? Because what you are asking is very unusual since you can't stop a loop from "restarting". You can select keys individually however. Like so:

    $product_description = $products[0]['product_description'];
    

    But I don't know how your array looks like and I am not clear on what you are trying to do.

  2. <?php
    $login = file_get_contents("tpl/contents/login.html");
    
    if(isset($submitlogin)){
    //Query setup
    $loginquery = "SELECT 
    				UserID, 
    				Password 
    			FROM 
    				Login 
    			WHERE 
    				UserID='".mssql_real_escape_string($username)."' AND 
    				Password='".$password."'";
    $loginresult = mssql_query($loginquery);
    $countrows = mssql_num_rows($loginresult);
    
    if($countrows == 1){
    	$_SESSION['username'] = $username;
    	$_SESSION['password'] = $password;
    
    }
    if($countrows != 1){
    	$login .= "<span style='color:red'>Login Failed</span>";
    }
    }
    echo $_SESSION['username'];
    //Get template
    $template = str_replace("%ucp%", $login, $template);
    ?>

     

    Its included in a file where session_start(); has been used and I tested it with other ways too like

     

    <?php
    $_SESSION['username'] = "test";
    echo $_SESSION['username'];
    ?>
    
    

    When I remove $_SESSION['username'] = "test";

    It doesnt echo it anymore

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.