Search Results

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

Page 30/632 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Adding Variables to JavaScript in Joomla

    - by Vikram
    Hello friends! This is the script I am using to display an accordion in my Joomla site: <?php defined('JPATH_BASE') or die(); gantry_import('core.gantryfeature'); class GantryFeatureAccordion extends GantryFeature { var $_feature_name = 'accordion'; function init() { global $gantry; if ($this->get('enabled')) { $gantry->addScript('accordion.js'); $gantry->addInlineScript($this->_accordion()); } } function render($position="") { ob_start(); ?> <div id="accordion"> <dl> <?php foreach (glob("templates/rt_gantry_j15/features/accordion/*.php") as $filename) {include($filename);} ?> </dl> </div> <?php return ob_get_clean(); } function _accordion() { global $gantry; $js = " jQuery.noConflict(); (function($){ $(document).ready(function () { $('#accordion').easyAccordion({ slideNum: true, autoStart: true, slideInterval: 4000 }); }); })(jQuery); "; return $js; } } I want to call these three values in the templateDetails.XML file as a user input. slideNum: true, autoStart: true, slideInterval: 4000 Like this in the templateDetails.xml file: <param name="accordion" type="chain" label="ACCORDION" description="ACCORDION_DESC"> <param name="slideNum" type="text" default="true" label="Offset Y" class="text-short" /> <param name="autoStart" type="text" default="true" label="Offset Y" class="text-short" /> <param name="autoStart" type="text" default="4000" label="Offset Y" class="text-short" /> </param> How can I do so? What will be the exact syntax for the same. I am very new to programming ans specially to JavaScript. Kindly help.

    Read the article

  • Passing variables from Model to Model in codeigniter

    - by Craig Ward
    Hi, I need to pass a variable to model, that model needs to send another back and use that variable to query a different model. EG: I have a product_ID which I send to the product model, From that I find out the supplier_ID. I want to grab that supplier_ID to the supplier model to get the supplier name. How do you implement this in codeigniter?

    Read the article

  • Variables variable and inheritance

    - by Xack
    I made code like this: class Object { function __get($name){ if(isset($this->{$name})){ return $this->{$name}; } else { return null; } } function __set($name, $value){ $this->{$name} = $value; } } If I extend this class (I don't want to repeat this code every time), it says "Undefined variable". Is there any way to do it?

    Read the article

  • Can't access variables from dynamically loaded javascript

    - by Menno
    I'm using a fairly simple system to load javascript dynamically: include = function (url) { var e = document.createElement("script"); e.src = url; e.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(e); }; Let's say I have a file test.js which has the following contents: var foo = 4; Now, in my original script, I want to use include(test.js); console.log(foo); However, I get a 'foo has not been defined' error on this. I'm guessing it has to do with the dynamic script being included as the last child of the <head> tag. How can I get this to work?

    Read the article

  • java objects, shared variables

    - by raven
    hello, I have a simple question here. If I declare a variable inside an object which was made [declared] in the main class, like this: public static int number; ( usually I declare it like this : private int number; ) can it be used in a different object which was also made [declared] in the main class? btw I do not care about security atm, I just want to make something work, don't care about protection)

    Read the article

  • How can I make this cookie persistent? (Classic ASP)

    - by Isaac Levin
    Hello, I am maintaining a classic asp website that uses cookies throughout. We have had some issues where users are losing these cookies after they close the browser. I have verified in IE and Firefox that the cookie expires when the session does. The issue is that I have a extent the life of the cookie with the following Response.Cookies("foocookie").Expires = dateadd("d",1,now) What am I doing wrong? All I want this cookie to do is be persistent. Any help would be great. Thanks

    Read the article

  • problem in variables in jquery

    - by Alvin
    Hi, I don't understand why I'm not getting the message as "username already exits" if type the username which is already in database. If the username in a server, then it is returning the value as "1" otherwise empty, and despite of successfully getting the value from the server based on username is present or not, and assigning the value to variable "x", I'm unable to get message when I pass already exist username. May I know? $(document).ready(pageInit); function pageInit() { $('#1').bind('blur',go); } function go() { var value = $('#1').val(); var x = 0; $.post('just.do',{username:value},function(data){ x = data; } ); if(x) { $('#para').show(); $('#para').html("Username already exits"); return false; } else { $('#para').hide(); return true; } }; EDIT: This is what I'm doing in post request in servlets: String user1 = request.getParameter("username"); if(user != null) { String query = "Select * from users where user_name="+"\""+user+"\""; b = db.doExecuteQuery(stmt,query); if(b) { out.write("1"); } }

    Read the article

  • Substituting variables in a loop?

    - by jksl
    I am trying to write a loop in R but I think the nomenclature is not correct as it does not create the new objects, here is a simplified example of what I am trying to do: for i in (1:8) { List_i <-List colsToGrab_i <-grep(predefinedRegex_i, colnames(List_i$table)) List_i$table <- List_i$table[,predefinedRegex_i] } I have created 'predefinedRegex'es 1:8 which the grep should use to search The loop creates an object called "List_i" and then fails to find "predefinedRegex_i". I have tried putting quotes around the "i" and $ in front of the i but these do not work. Any help much appreciated. Thank you.

    Read the article

  • Using variables in Tasker

    - by Waza_Be
    I am trying to create a Tasker plugin. Everything is fine, and works pretty well. I can configure a String to be sent in my app by using EditActivity and this code, following the examples: resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE,PluginBundleManager.generateBundle(getApplicationContext(),message)); resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_STRING_BLURB,generateBlurb(getApplicationContext(), message)); setResult(RESULT_OK, resultIntent); The problem comes when I want to use this code to get the battery level for instance, so I added: resultIntent.putExtra("net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS",com.twofortyfouram.locale.Intent.EXTRA_STRING_BLURB); but the app is not working and I get a string %BATT as the result, the variable is not replaced... As I haven't found any example, I would be pleased to get some help to make it work.

    Read the article

  • Android: How to declare global variables?

    - by niko
    Hi, I am creating an application which requires login. I created the main and the login activity. In the main activity onCreate method I added the following condition: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ... loadSettings(); if(strSessionString == null) { login(); } ... } The onActivityResult method which is executed when the login form terminates looks like this: @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch(requestCode) { case(SHOW_SUBACTICITY_LOGIN): { if(resultCode == Activity.RESULT_OK) { strSessionString = data.getStringExtra(Login.SESSIONSTRING); connectionAvailable = true; strUsername = data.getStringExtra(Login.USERNAME); } } } The problem is the login form sometimes appears twice (the login() method is called twice) and also when the phone keyboard slides the login form appears again and I guess the problem is the variable strSessionString. Does anyone know how to set the variable global in order to avoid login form appearing after the user already successfully authenticates? Thanks!

    Read the article

  • Django1.1 file based session backend multi-threaded solution

    - by Satoru.Logic
    Hi, all. I read django.contrib.sessions.backend.file today, in the save method of SessionStore there is something as the following that's used to achieve multi-threaded saving integrity: output_file_fd, output_file_name = tempfile.mkstemp(dir=dir, prefix=prefix + '_out_') renamed = False try: try: os.write(output_file_fd, self.encode(session_data)) finally: os.close(output_file_fd) os.rename(output_file_name, session_file_name) renamed = True finally: if not renamed: os.unlink(output_file_name) I don't quite understand how this solve the integrity problem.

    Read the article

  • Using variables within Attributes in C#

    - by tehp
    We have some Well-Attributed DB code, like so: [Display(Name = "Phone Number")] public string Phone { get; set; } Since it is quite generic we'd like to use it again, but with a different string in the Name part of the attribute. Since it's an attribute it seems to want things to be const, so we tried: const string AddressType = "Student "; [Display(Name = AddressType + "Phone Number")] public string Phone { get; set; } This seems to work alright, except that having a const string means we can't overwrite it in any base classes, thereby removing the functionality that we originally were intending to add, and exposing my question: Is there a way to use some sort of variable inside of an attribute so that we can inherit and keep the attribute decorations?

    Read the article

  • Declare global variables for a batch of execution statements - sql server 2005

    - by Shrewd Demon
    hi, i have an SQL statement wherein i am trying to update the table on the client's machine. the sql statement is as follows: BEGIN TRANSACTION DECLARE @CreatedBy INT SELECT @CreatedBy = [User_Id] FROM Users WHERE UserName = 'Administrator' --//////////////////////////////////////////////////////////////////// --//////////////////////////////////////////////////////////////////// PRINT @CreatedBy --(Works fine here and shows me the output) PRINT N'Rebuilding [dbo].[Some_Master]' ALTER TABLE [dbo].[Some_Master] ADD [CreatedBy] [BIGINT] NULL, [Reason] [VARCHAR](200) NULL GO PRINT @CreatedBy --(does not work here and throws me an error) PRINT N'Updating data in [Some_Master] table' UPDATE Some_Master SET CreatedBy = @CreatedBy COMMIT TRANSACTION but i am getting the following error: Must declare the scalar variable "@CreatedBy". Now i have observed if i write the Print statement above the alter command it works fine and shows me its value, but if i try to print the value after the Alter command it throws me the error i specified above. I dont know why ?? please help! Thank you

    Read the article

  • global variables doesn't change value in Javascript

    - by user1856906
    My project is composed by 2 html pages: 1)index.html, wich contains the login and the registration form. 2)user_logged.html, wich contains all the features of a logged user. Now, what I want to do is a control if the user is really logged, to avoid the case where a user paste a url in the browser and can see the pages of another user. hours as now, if a user paste this url in the browser: www.user_loggato.html?user=x#profile is as if logged in as user x and this is not nice. My html pages both use js files that contains scripts. I decided to create a global variable called logged inizialized to false and change the variable to true when the login is succesfull. The problem is that the variable, remains false. here is the code: var logged=false; (write in the file a.js) while in the file b.js I have: function login() { //if succesfull logged=true; window.location.href = "user_loggato.html?user="+ JSON.parse(str).username + #profilo"; Now with some alerts I found that my variable logged is always false. Why? if I have not explained well or if there is not some information in order to respond to my question let me know.

    Read the article

  • Why use of session name and session id in the get variables does not work?

    - by Roman
    I have the following code: $location .= 'red=no&'.session_name() . "=". session_id(); $content = file_get_contents($location); echo $content; If I run it, noting is displayed in my browser. However, if I modify it in the following way: $location .= 'red=no'; $content = file_get_contents($location); echo $content; everything works fine (I see the content in my browser). What is also strange, if I display the value of the $location variable from the first example (url) and manually paste it in the address line of my browser, I do see the content. So, my browser is able to use this URL and file_get_contents not. Does anybody know how it can be explained?

    Read the article

  • Session in php are not enough clear to me

    - by Lulzim
    I find sessions in php kind of confusing, can anybody of you explain those to me. I have an example which is not working in my case: I register sessions this way, would you please tell me is this the right way of registering sessions //this is the page from where i register myusername in sessions if($count==1){ session_start(); $_SESSION['myusername'] = $_POST['myusername']; include("enterpincover.php"); } else { echo "Wrong Pin"; } here i check first whether the username is registered in sessions in oder to open his account , otherwise open again login. It works, if user is not loged in, it will show login page which is right, if user is loged it shows welcome message but not the Welcome the name of the user as I want. for ex: Welcome David <?php session_start(); if(isset($_SESSION['myusername'])) { echo 'Welcome '.$_SESSION['myusername']; } else { include("leftmodules.php"); include("rightmodules.php"); include("login.php"); } ?>

    Read the article

  • Accessing Variables in Javascript using .length

    - by CoV
    Hey all, I'm pretty new to Javascript, so forgive me if this is a simple question. I'm trying to access the length of a set of checkboxes in a form using Javascript. However, I need to be able to change the "name" field of the checkboxes to check several different sets of them. Right now, my sample code looks like: var set = "set" + x; totalLength = optionBoxes.set.length; The variable x is being incremented by a for loop that wraps the whole thing and the name of the checkbox sets that I'm trying to access are set0, set1, set2, etc. Thanks. Edit: small typo fixes

    Read the article

  • How to set javascript data in asp session variable?

    - by fazilmir
    i am having a div and i am adding innerHtml in it using javascript. now what i want is that i have to set that innerHtml data in my session variable. and want to use that session variable in my another asp webform page. but i dont know how to perform this task. any help will be highly appreciated. i am doing it like this. //cartDetailsDiv is a div in which i am adding innerHtml through javascript. //now i am getting that innerHTML in my session variable like this Session["_cartDetails"] = cartDetailsDiv.InnerHtml.ToString(); Response.Write(Session["_cartDetails"].ToString()); but i am getting nothing in my session variable. please help me out.

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >