Search Results

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

Page 88/632 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • Session handling in python / django

    - by Gaurav
    I am creating an application that lets users login using Google, Facebook and the website's native login. The site is being built in Python / Django. What would be the best way to handle login, session management and user authentication? I do not want to use the in-built Django user management. I am using Django very sparingly(URLs, templates)

    Read the article

  • Sending a variable from a processing page back to the original PHP page

    - by user1228907
    So on a PHP page (page 1) I have some HTML, including : <form action="create_subject.php" method="post" > Which goes to a processing page (page 2) containing MySQL which will be executed if there aren't any errors. If there are (checked by validation on the processing page (page 2)) or aren't, certain variables are set, including this one for if it's successful : if (mysql_affected_rows() == 1){ $success = 1; redirect_to("new_subject.php"); } However, how would I include $success into the URL without putting it in as : redirect_to("new_subject.php?success=1"); I can't do this as I need to do if statements, and it's only PHP on "page 2" so I can't do an if statement inside redirect_to("new_subject.php"); I know I could do ... } else { redirect_to("new_subject.php?success=1"); } But this would seem mundane and non-semantic especially as I have several variables to proccess.

    Read the article

  • Right way to handle friend-multi-select post on facebook, issues with session

    - by simple
    Do I need a infinite key with fbml facebook app that resides on fanpage? I am asking user to select user and posting it(facebook posts) to my server. On my server I want to get user_id and selected friends Id. Everything is fine with selected friend_ids, but have issues with getting id of a user. sometimes I can get it all fine, sometimes I am getting session expired exception, sometimes I get nothing. any ideas why this is happening?

    Read the article

  • Is it possible to use an incremental value within a variable name whilst declaring it within a loop?

    - by Jack
    Hi, I'm creating function which will read different XML files each time that will contain different amounts of the same nodes. I have already created a loop which stores the ID of each node into an array, and now I want to create variables for each array member which store attributes of the node with each ID. Because the number of nodes will be different for every XML document my function reads, I cannot manually assign variables for the attributes of each node ID not knowing how many to assign, so I have created a loop which runs specific to the number of items I have stored in the array. Inside this loop I was hoping to have something like: for (i=0; i<array.length; i++) { var ID + i + width = exampleheight var ID + i + height = exampleheight } I know this doesn't work, but was trying to outline what I am looking to find out. Is it possible to use some kind of variable or random number when declaring a variable?

    Read the article

  • Safely defining variables for public callback functions in javascript

    - by djreed
    I am working with the YouTube iFrame API to embed a number of videos on a page. Documentation here: https://developers.google.com/youtube/iframe_api_reference#Requirements In summary, you load the API asynchronously using the following snippet: var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); Once loaded, the API fires the predefined callback function onYouTubePlayerAPIReady. For additional context: I am defining a library file for this in Google Closure. I am providing a namespace: goog.provide('yt.video'); I then use goog.exportSymbol so that the API can find the function. That all works fine. My challenge is that I would like to pass 2 variables to the callback function. Is there any way to do this without defining these 2 variables in the context of the window object? goog.provide('yt.video'); goog.require('goog.dom'); yt.video = function(videos, locales) { this.videos = videos; this.captionLocales = locales; this.init(); }; yt.video.prototype.init = function() { var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); }; /* * Callback function fired when YT API is ready * This is exported using goog.exportSymbol in another file and * is being fired by the API properly. */ yt.video.prototype.onPlayerReady = function(videos, locales) { window.console.log('this :' + this); //logs window window.console.log('this.videos : ' + this.videos); //logs undefined /* * Video settings from Django variable */ for(i=0; i<this.videos.length; i++) { var playerEvents = {}; var embedVars = {}; var el = this.videos[i].el; var playerVid = this.videos[i].vid; var playerWidth = this.videos[i].width; var playerHeight = this.videos[i].height; var captionLocales = this.videos[i].locales; if(this.videos[i].playerVars) var embedVars = this.videos[i].playerVars; } if(this.videos[i].events) { var playerEvents = this.videos[i].events; } /* * Show captions by default */ if(goog.array.indexOf(captionLocales, 'es') >= 0) { embedVars.cc_load_policy = 1; }; new YT.Player(el, { height: playerHeight, width: playerWidth, videoId: playerVid, events: playerEvents, playerVars: embedVars }); }; }; To intialize this, I am currently using the following within a self-executing anonymous function: var videos = [ {"vid": "video_id", "el": "player-1", "width": 640, "height": 390, "locales": ["es", "fr"], "events": {"onStateChange": stateChanged}}, {"vid": "video_id", "el": "player-2", "locales": ["es", "fr"], "width": 640, "height": 390} ]; var locales = ['es']; var videoTemplate = new yt.video(videos, locales);

    Read the article

  • Session vs singleton pattern

    - by chobo
    Hi, I have a web application where I would like to pull user settings from a database and store them for Global access. Would it make more sense to store the data in a Singleton, or a Session object? What's the difference between the two? Is it better to store the data as an object reference or break it up into value type objects (ints and strings)? Thanks!

    Read the article

  • [Grails] HibernateException: No session currently bound to execution context

    - by user289206
    I'm trying to create a very basic REST-ish web service with Grails and Postgres. I have the read() & delete() methods working, but I can't get create() to work. Hibernate just gripes, "HibernateException: No session currently bound to execution context." Here's my create method: def create = { def member = new Member(params) member.save() render(status: 201) } Any advice would be great. Thanks.

    Read the article

  • get or session?

    - by Syom
    i have a login form, which is in login.php. after authorization i moove client to some.php file! so, from following two methods, which is better? i can send information aboud user id e.t.c by GET i can use SESSION - s for this what is more preferred? and two words about why i ask this question. i hear somewhere that SESSIONs aren't good programing method, and it's not suggested to use them in such situations... thanks

    Read the article

  • Flash Movie and tiny browser session

    - by jasmine
    I have created a flash movie and publish as html and swf. I have activated tiny browser session values. The intro not working now. Its also not working with disabling sessions in tinybrowser. How can I solve this. Thanks in advance

    Read the article

  • how to return success message in session variaible using jquery.get() method

    - by I Like PHP
    Hello All, i m using jQuery.get() to delete row from a table from a page main.php. now i want to show success message after deleting row ,that success message should be in session variable($_session['suxesMsg']) how do i set success message on a session variable and show on specific span ? or is there any other method in jQuery that a message appear for 5-10 seconds only and then disappear? Here is my code main.php <?php if($_SESSION['suxesMsg']!='') { ?> <span class="msg"> <?php echo $_SESSION['suxesMsg'];unset($_SESSION['suxesMsg']); } ?> </span> <table border="0" cellpadding="5" cellspacing="0" id="promotionTable"> <tr> <td align="left"><img border='0' src='images/just.gif'/>First Promotion</td> <td align="center" >View Detail</td> <td align="center" id="deleteMe"> <img src='images/delete.png' alt='Delete' width='14' height='14'id="45"/> </td> </tr> <tr> <td align="left"><img border='0' src='images/just.gif'/>First Promotion</td> <td align="center" >View Detail</td> <td align="center" id="deleteMe"> <img src='images/delete.png' alt='Delete' width='14' height='14' id="48"/> </td> </tr> </table> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('#deleteMe img').click( function() { if(!confirm('Want to delete!')) return; jQuery.get('deleteThis.php', {oid:this.id}); jQuery(this).parent().parent().fadeTo(400, 0, function() { jQuery(this).remove(); }); }); </script> deleteThis.php if(isset($_GET[oid])) { $offerID=$_GET[oid]; $delsql="DELETE FROM some_table WHERE promotion_id=".$offerID; $db->query($delsql); $_SESSION['suxesMsg'] = "Promotion deleted sucessfully."; } Thanks for helping me alwayz

    Read the article

  • What exactly is a variable in C++?

    - by FredOverflow
    The standard says A variable is introduced by the declaration of an object. The variable's name denotes the object. But what does this definition actually mean? Does a variable give a name to an object, i.e. are variables just a naming mechanism for otherwise anonymous objects? Or is a variable the name itself? Or is a variable a named object in the sense that every variable is also an object? Or is a variable just a "proxy" with a name that "delegates" all operations to the real object? To confuse things further, many C++ books seem to treat variables and objects as synonyms. What is your take on this?

    Read the article

  • How Session Works?

    - by learner
    Any body can explain me how session works in PHP. for eg. 3 users logged into gmail. how the server identifies these 3 uers. what are the internel process behind that.

    Read the article

  • visual c# 2010 communicating between two projects

    - by cake is a joke
    I am trying to create a windows form project, and use speech recognition for the Kinect with the Kinect to Windows SDK. I have the form application project (p1) and the Kinect speech project (p2) which is a command prompt. I made it a command prompt because it was the easiest way to do things. Anyway, I have read and found two things about this. 1)I found out how to run two projects at the same time in the same solution. 2) I also found out how to add references to get classes from each project to the other. So, how would I get variables from each project? Just by using project references, or something? P2 can recognize speech and save it to variables, if that counts for anything.

    Read the article

  • How to programatically set a permanent environment variable in Linux?

    - by Richard
    I am writing a little install script for some software. All it does is unpack a target tar, and then i want to permanently set some environment variables - principally the location of the unpacked libs and updating $PATH. Do I need to programmatically edit the .bashrc file, adding the appropriate entries to the end for example, or is there another way? What's standard practice? Edit: The package includes a number of run scripts (20+) that all use these named environment variables, so I need to set them somehow (the variable names have been chosen such that a collision is extremely unlikely)

    Read the article

  • [Symfony] Accessing user session from a custom routing class

    - by David
    Is there some way to acces the user object from a custom routing class? I'd like to add a parameter when generating a url, and that parameter is inside the user session, so I need to access it. The only way I found to access is using the sfContext::getInstance()-getUser(), but it's known to be inefficient. Thanks!

    Read the article

  • Referencing variables in a structure / C++

    - by user1628622
    Below, I provided a minimal example of code I created. I managed to get this code working, but I'm not sure if the practice being employed is sound. In essence, what I am trying to do is have the 'Parameter' class reference select elements in the 'States' class, so variables in States can be changed via Parameters. Questions I have: is the approach taken OK? If not, is there a better way to achieve what I am aiming for? Example code: struct VAR_TYPE{ public: bool is_fixed; // If is_fixed = true, then variable is a parameter double value; // Numerical value std::string name; // Description of variable (to identify it by name) }; struct NODE{ public: VAR_TYPE X, Y, Z; /* VAR_TYPE is a structure of primitive types */ }; class States{ private: std::vector <NODE_ptr> node; // shared ptr to struct NODE std::vector <PROP_DICTIONARY_ptr> property; // CAN NOT be part of Parameter std::vector <ELEMENT_ptr> element; // CAN NOT be part of Parameter public: /* ect */ void set_X_reference ( Parameter &T , int i ) { T.push_var( &node[i]->X ); } void set_Y_reference ( Parameter &T , int i ) { T.push_var( &node[i]->Y ); } void set_Z_reference ( Parameter &T , int i ) { T.push_var( &node[i]->Z ); } bool get_node_bool_X( int i ) { return node[i]->X.is_fixed; } // repeat for Y and Z }; class Parameter{ private: std::vector <VAR_TYPE*> var; public: /* ect */ }; int main(){ States S; Parameter P; /* Here I initialize and set S, and do other stuff */ // Now I assign components in States to Parameters for(int n=0 ; n<S.size_of_nodes() ; n++ ){ if ( S.get_node_bool_X(n)==true ){ S.set_X_reference ( P , n ); }; // repeat if statement for Y and Z }; /* Now P points selected to data in S, and I can * modify the contents of S through P */ return 0; }; Update The reason this issue cropped up is I am working with Fortran legacy code. To sum up this Fotran code - it's a numerical simulation of a flight vehicle. This code has a fairly rigid procedural framework one must work within, which comes with a pre-defined list of allowable Fortran types. The Fortran glue code can create an instance of a C++ object (in actuality, a reference from the perspective of Fortran), but is not aware what is contained in it (other means are used to extract C++ data into Fortran). The problem that I encountered is when a C++ module is dynamically linked to the Fortran glue code, C++ objects have to be initialized each instance the C++ code is called. This happens by virtue of how the Fortran template is defined. To avoid this cycle of re-initializing objects, I plan to use 'State' as a container class. The Fortran code allows a 'State' object, which has an arbitrary definition; but I plan to use it to harness all relevant information about the model. The idea is to use the Parameters class (which is exposed and updated by the Fortran code) to update variables in States.

    Read the article

  • Find where a variable is defined in PHP (And/or SMARTY)?

    - by Jon
    I'm currently working on a very large project, and am under a lot of pressure to finish it soon, and I'm having a serious problem. The programmer who wrote this last defined variables in a very odd way - the config variables aren't all in the same file, they're spread out across the entire project of over 500 files and 100k+ lines of code, and I'm having a hell of a time figuring out where a certain variable is, so I can fix an issue. Is there a way to track this variable down? I believe he's using SMARTY (Which I can not stand, due to issues like this), and the variable is a template variable. I'm fairly sure that the variable I'm looking for was initially defined as a PHP variable, then that variable is passed into SMARTY, so I'd like to track down the PHP one, however if that's impossible - how can I track down where he defined the variable for SMARTY? P.S. I'm in Vista, and don't have ssh access to the server, so 'grep' is out of the question.

    Read the article

  • Access JavaScript variables with Selenium IDE

    - by kRON
    I'm wondering if it's possible to access page JavaScript variables with Selenium. I have an application that's using a variable attached to the window object. It has a global scope and I can access it either with window._myvar, window['_myvar'], _myvar, this['_myvar'], this._myvar depending on the context. So I tried to get Selenium to echo it. As far as I understand, in Selenium IDE the context in which everything runs is selenium. I tried doing this.browserbot.getCurrentWindow()._myvar, this.browserbot.getCurrentWindow()[_myvar] to no avail. I get bumped with the following error Unexpected Exception: message -> eval(match[1]) is undefined. Anyone managed to access their page's JavaScript?

    Read the article

  • Python regular expressions matching variables to end of line

    - by None
    When you use variables (is that the correct word?) in python regular expressions like this: "blah (?P\w+)" ("value" would be the variable), how could you make the variable's value be the text after "blah " to the end of the line or to a certain character not paying any attention to the actual content of the variable. For example, this is pseudo-code for what I want: >>> import re >>> p = re.compile("say (?P<value>continue_until_text_after_assignment_is_recognized) endsay") >>> m = p.match("say Hello hi yo endsay") >>> m.group('value') 'Hello hi yo' Note: The title is probably not understandable. That is because I didn't know how to say it. Sorry if I caused any confusion.

    Read the article

  • Memory allocation in case of static variables

    - by eSKay
    I am always confused about static variables, and the way memory allocation happens for them. For example: int a = 1; const int b = 2; static const int c = 3; int foo(int &arg){ arg++; return arg; } How is the memory allocated for a,b and c? What is the difference (in terms of memory) if I call foo(a), foo(b) and foo(c)?

    Read the article

  • How to use variables with regex?

    - by dontoo
    This is the input string: 23x^45*y or 2x^2 or y^4*x^3. I am matching ^[0-9]+ after letter x. In other words I am matching x followed by ^ followed by numbers. Problem is that I don't know that I am matching x, it could be any letter that I stored as variable in my char array. For example: foreach (char cEle in myarray) // cEle is letter in char array x, y, z, ... { match CEle in regex(input) //PSEUDOCODE } I am new to regex and I new that this can be done if I define regex variables, but I don't know how.

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >