Search Results

Search found 15797 results on 632 pages for 'session variables'.

Page 64/632 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Header redirect and Session start() generating errors

    - by RPK
    I am using following code. I get errors: Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/mc/cpanel/Source/verifylogin.php:11) Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/public_html/mv/cpanel/Source/verifylogin.php:11) Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/mv/cpanel/Source/verifylogin.php:11) <?php error_reporting(E_ALL^ E_NOTICE); ob_start(); require("../Lib/dbaccess.php"); $inQuery = "SELECT mhuserid, mhusername FROM cpanelusers WHERE mhusername = '". $_POST['UserName'] ."' AND mhpassword = '". hash('sha512', $_POST['Password']) ."'"; try { $Result = dbaccess::GetRows($inQuery); echo $Result; $NumRows = mysql_num_rows($Result); if ($NumRows > 0) { header("Location: http://www.example.com/cpanel/mainwindow.php"); session_start(); } else { header("Location: http://www.example.com/cpanel/"); echo "Last login attempt failed."; exit; } } catch(exception $e) { } ob_clean(); ?>

    Read the article

  • Create a Session in Django

    - by Reznor
    So far the Documentation for Django has been too technical. How do I create a session and store variables in it or get variables from it? I'm new to the Django framework, hence why the Documentation is too technical. Sessions are my 'last step'.

    Read the article

  • Inspecting variables in Xdebug problems

    - by tom
    I've been using xdebug to do php debugging (netbeans or eclipse). I am usually able to inspect variables OK. However, sometimes when I expand a disclosure triangle for a variable -- typically when the client is making an AJAX call -- it will result in an empty response being returned and causing the AJAX call to fail. Has anyone run into this? Is there a way to make PHP debugging with xdebug more robust? (Not being able to inspect variables defeats the purpose of a debugger. Thanks

    Read the article

  • Python: load variables in a dict into namespace

    - by celil
    I want to use a bunch of local variables defined in a function, outside of the function, so I am passing x=locals() as a return value. How can I load all the variables defined in that dictionary into the namespace outside the function, so that instead of accessing the value using x['variable'], I could simply use variable.

    Read the article

  • c declaring variables in blocks

    - by anon
    I know that in C++, I can declare variables pretty much everywhere. I recall once reading that in C, variables must be declared at the top of a function i.e. the following is invalid: void foo() { int good; if (...) { int bad; } } In the above code, is the declaraing of the bad varaible legal by C standards, or only legal due to a gcc extension? Thanks!

    Read the article

  • Facebook session query

    - by Hunter
    Since I have just started working with Facebook's api I had a few questions regarding Facebook sessions. In the index of my iFrame app I have the user establish a new sessions and set the $me and $uid variables as displayed in their example. However, when my app navigates to a new page should I create a new session and redeclare these variables or is there some way to grab those values from the already declared session? Thanks

    Read the article

  • PHP: How to implement a __get-like method for local function variables

    - by Tom Frost
    I'm no stranger to __get(), and have used it to make some very convenient libraries in the past. However, I'm faced with a new challenge (PHP 5.3, abbreviated and simplified my code for this question): <?php namespace test; class View { function __construct($filename, $varArray) { $this->filename = $filename; $this->varArray = $varArray; } function display() { include($this->filename); } function __get($varName) { if (isset($this->varArray[$varName])) return $this->varArray[$varName]; return "?? $varname ??"; } } ?> Above is a very, very simplified system for loading a View. This code would call the view and display it: <?php require_once("View.php"); use test\View; $view = new View("views/myview.php", array("user" => "Tom")); $view->display(); ?> My goal for this code is to allow the view "myview.php" to contain code like this: <p> Hello <?php echo $user; ?>! Your E-mail is <?php echo $email; ?> </p> And, used with the above code, this would output "Hello Tom! Your E-mail is ?? email ??" However, this won't work. The view is being included within a class method, so when it refers to $user and $email, it's looking for local function variables -- not variables belonging to the View class. For this reason, __get never gets triggered. I could change all my view's variables to things like $this-user and $this-email, but that would be a messy and unintuitive solution. I'd love to find a way where I can reference variables directly WITHOUT having PHP throw an error when an undefined variable is used. Thoughts? Is there a clean way to do this, or am I forced to resort to hacky solutions?

    Read the article

  • Codeigniter how to access class variables

    - by Obay
    I thought this was going to be a no-brainer but I can't seem to access member variables: class MyObject extends Controller { private $START_OF_WEEK = 1; /* constructor here */ function index() { echo $this->$START_OF_WEEK; } } echo $this->$START_OF_WEEK; says Cannot access empty property How do I access member variables? Or... how do I declare them correctly?

    Read the article

  • Making all variables accessible to namespace

    - by Gökhan Sever
    Hello, Say I have a simple function: def myfunc(): a = 4.2 b = 5.5 ... many similar variables ... I use this function one time only and I am wondering what is the easiest way to make all the variables inside the function accessible to my main name-space. Do I have to declare global for each item? or any other suggested methods? Thanks.

    Read the article

  • Using FlashVars to pass variables to a SWF

    - by SoeTheingiLin
    I would like to pass over 50 items of variables from php to flash. Actually I want to pass array with foreach statement, looping through the array and assigning loop index to the variables and flash again accept the php values through looping. Is this possible? If passing values through foreach or loop statement is impossible, I would like to break a new line in tag. how can I break a new line in FlashVars tag?

    Read the article

  • Using GET Method to Maintain Variables After Logging In

    - by John
    Hello, I am using a login system. When I navigate to comments/index.php without logging in, some variables get passed along using the GET method just fine. Then, if I log in while I am on this page, these variables disappear. The variables that disappear are $submission, $submissionid, and $url. I thought I could use the GET method to keep them live after logging in by appending ?submission='.$submission.'&submissionid='.$submissionid.'&url='.$url.' to the URL of the login form action as seen below. But the variables still disappeared after I made this addition. The relevant code I am trying to use is below. Any idea what I can do to make it do what I want? Thanks in advance, John In comments/index.php: require_once "header.php"; include "login.php"; include "comments.php"; In login.php: if (!isLoggedIn()) { if (isset($_POST['cmdlogin'])) { if (checkLogin($_POST['username'], $_POST['password'])) { show_userbox(); } else { echo "Incorrect Login information !"; show_loginform(); } } else { show_loginform(); } } else { show_userbox(); } In comments.php: $url = mysql_real_escape_string($_GET['url']); echo '<div class="subcommenttitle"><a href="http://www.'.$url.'">'.$submission.'</a></div>'; $submission = mysql_real_escape_string($_GET['submission']); $submissionid = mysql_real_escape_string($_GET['submissionid']); The login function: function show_loginform($disabled = false) { echo '<form name="login-form" id="login-form" method="post" action="./index.php?submission='.$submission.'&submissionid='.$submissionid.'&url='.$url.'"> <div class="usernameformtext"><label title="Username">Username: </label></div> <div class="usernameformfield"><input tabindex="1" accesskey="u" name="username" type="text" maxlength="30" id="username" /></div> <div class="passwordformtext"><label title="Password">Password: </label></div> <div class="passwordformfield"><input tabindex="2" accesskey="p" name="password" type="password" maxlength="15" id="password" /></div> <div class="registertext"><a href="http://www...com/sandbox/register.php" title="Register">Register</a></div> <div class="lostpasswordtext"><a href="http://www...com/sandbox/lostpassword.php" title="Lost Password">Lost password?</a></div> <p class="loginbutton"><input tabindex="3" accesskey="l" type="submit" name="cmdlogin" value="Login" '; if ($disabled == true) { echo 'disabled="disabled"'; } echo ' /></p></form>'; }

    Read the article

  • ANTLR, Dynamic variables

    - by JTS
    Hello, I have an ANTLR grammar that can parse and evaluate simple expressions like 1+2*4, etc. What I would like to do is to evaluate expressions like 2+$a-$b/4 where the $ variables are dynamic variables, that come from an external source and are continuously updated. Is there any design pattern on how to do this using ANTLR, best practices, etc? Shall I "substring" the $a with the updated value ($a - 4.34) A nicer way to do this? Thx

    Read the article

  • How to keep PayPal variables secure

    - by dclowd9901
    I'm trying to link my 3rd party shopping cart to PayPal, and in the process I'm finding that my variables are extremely exposed, such that, if someone uses, say, Firebug, to manipulate the values of my variables, they can change the cost of the items in the transaction. I'm very new to online carts and shopping, so my question is how do I keep this layer of exposure away from users and secure for the website?

    Read the article

  • View list of all JavaScript variables in Google Chrome Console

    - by GRboss
    Hello everyone. In Firebug the DOM tab shows a list of all your public variables and objects. In Chrome's console you have to type the name of the public variable or object you want to explore. Is there a way - or at least a command - for Chrome's console to display a list all the public variables and objects? It will save a lot of typing. Thank you all Stefanos

    Read the article

  • How to generate correlated binary variables

    - by jonalm
    Dear All I need to generate a series of N random binary variables with a given correlation function. Let x = {x_i} be a series of binary variables (taking the value 0 or 1, i running form 1 to N). The marginal probability is given Pr(x_i = 1) = p, and the values should be correlated in the following way E[ x_i x_j ] = const * |i-j|^-alfa where alfa is a positive number. Is it possible to generate a series like this? preferably in python.

    Read the article

  • In FitNesse, can variables be defined in terms of other variables?

    - by Dan Haywood
    In FitNesse, can variables be defined in terms of other variables? I want to do the equivalent of: int a=3; int b=a; To make this concrete, I have a variable defining the date: !define clock.date {2/2/2009} I then want to define some other variable ${other.date} based on it, something like: !define other.date {=${clock.date}=} However, this doesn't work. Is there any way to do this?

    Read the article

  • aggregate over several variables in r

    - by Misha
    Dear overflowers, I have a rather large dataset in a long format where I need to count the number of instances of the ID due to two different variables, A & B. E.g. The same person can be represented in multiple rows due to either A or B. What I need to do is to count the number of instances of ID which is not too hard, but also count the number of ID due to A and B and return these as variables in the dataset. Regards, //Mi

    Read the article

  • Question regarding the method local innerclasses accesing the local variables of the method

    - by flash
    Hi I was going through the SCJP book about the innerclasses, and found this statement, it goes something like this. "A method local class can only refer to the local variables which are marked final" and in the explanation the reason specified is about the scope and lifetime of the local class object and the local variables on the heap, But I am unable to understand that.am I missing anything here about 'final'??

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >