variables

Sharing user session variables between Magento and Symfony

Hi, One part of our website will be built using Symfony the other Magento. I would like to know if it is possible to share user session variables between two of them. Thank you! ...

Using xmlhttp.open() how do I add more than one parameter to url?

I have this code. xmlhttp.open("GET","getuser.php?q="+str,true); where q="+str I want to pass a second var how do I do this? ...

In SQL Server, how do I create a reference variable to a table?

I'm currently using sp_executesql to execute a T-SQL statement with a dynamic table name. However, it is really ugly to see something like: set @sql = 'UPDATE '+Table_Name+' SET ... WHERE '+someVar+' = ... AND '+someVar2' = ...' sp_executesql @sql What I would rather like to have is a TABLE variable of which is a reference to a table...

Pass a variable from the source file to an included file in PHP

For my website I want to store the general format of the site in a single PHP file in a single location, and each of the different pages content in the local location of the page. I then want to pass the title and content address to the included file via a variable. However I can't get the included format file to read the variables stor...

How to put XML returned by stored procedure in a variable?

Hello I have stored procedure returning XML. XML returned not as parameter but as result of SELECT: create procedure #xml_test as select 1 as a for xml raw go I'm trying to put this XML in a variable: declare @xml as nvarchar(max) But I can't find how to do it. My best idea was INSERT INTO ... EXEC, but I get error 'The FOR XML ...

Using PHP variables inside of here documents inside of functions inside of a class

If the title hasn't scared you away yet, read on. I'm working on an ExpressionEngine website and I'm editing the member templates file. All templates that relate to member interaction are stored as functions inside of a class in one single file. Each of these functions is a simple here document, but many of them print code with paths ...

What is the C# static fields naming convention?

I have recently started using ReSharper which is a fantastic tool. Today I came across a naming rule for static fields, namely prefixing with an underscore ie. private static string _myString; Is this really the standard way to name static variables? If so is it just personal preference and style, or does it have some sort of lower ...

Why PHP variables start with a $ sign symbol?

Has anybody ever thought about this question. Why we must write $var_name = value; and not var_name = value;? Yes I know that it is the syntax rule that PHP uses, but why is it a $ sign symbol? ...

Can a reference variable in PHP be used to as an alias for long variable names?

This may be a silly question to some, but I was curious how would PHP react to something such as: $blog_title = &$author->get_blog()->get_title(); I'm assisting someone with some upgrades to an in house php framework. There is some serious method chaining going on, repeatedly in some places. I'd like to make the code more readable w...

Remove Commas in a string and insert each comma-separated value into a string

How would I do this? To bring it into some better context, I'm having a value from an XML attribute and I want each individual value to be added to an array of strings and each of those values is separated by commas ...

Another Undefined Index (this one's defined though)

Alright, PHP is throwing this error (in the log) and it's quite detrimental to the application. PHP Notice: Undefined index: sessid in methods.php on line 7 Yes, I'm aware of what this error means, what I cannot figure out is why it's obviously defined and saying it's undefined. Here is the relevant code in methods.php $sessid = mys...

Bash shell losing environment variables between two lines

I have a bash script as follows: rvm use 1.8.7 rvm list The first line is a function loaded within my .bashrc file that defines some enviroment variables. When executing the second line, those variables have been set to their previous values (the set values have been lost). What am I missing here? Running on a ubuntu box. ...

php WAMP setup - undefined variable error

What settings to change while setting up php WAMP so that undefined variable error is not encountered. I changed setting of register_globals = on but it did not help. ...

C# static - What does the definition on MSDN mean?

Use the static modifier to declare a static member, which belongs to the type itself rather than to a specific object. ??? My encounter with this static keyword occurred when I defined a variable public int abc. When the value of this variable changed withing the brackets of while, or within the brackets of if, or within the ...

Where to use "var' in javascript programs

Possible Duplicate: Difference between using var and not using var in JavaScript Hello, I am a self learned developer. Always, i write javascripts without the var for variables. But some javascripts use var for variables. Both worked well for me. I am bit confused by this. Is Writing scripts with var a standard form or the...

C++ reference variable across files

I have a project where I need to reference a variable declared in one CPP file in another, is that possible? If so, how? ...

How can I make a variable of the same type as another using templates?

I'd like to create a variable which matches the type of another variable by way of a template such that if the other variable ever changes type to match, the one derived from it via a template also changes its type. How can I do this with templates in C++? The purpose is to ensure that when I read from disk into a temporary variable th...

How to change the value of a variable using back button in iphone

I need to change the value of a variable of the previous view when the default back button is selected. How can I develop this using viewControllers in an iphone application? I tried to do it by creating a custom back button and by set method. I call both these methods in viewWillDisappear method. -(void)viewWillDisappear:(BOOL)animate...

accessing dynamicly generated array names using square brakets in an object...

object, contains 'array1'. $Obj -> array1 [12]; // works fine. however, dynamically generating that array name - you can't use square brackets... $var = 'array1'; $Obj -> $var [ 12] ; // nothing. no error, but no result. I had to do $ar = $Obj -> $var ; // copy out array $ar [12] ; // get value in array. note: $Obj -> $$var ...

Are variables useful or redundant in CSS?

I've seen a lot of ways of adding variables in CSS (e.g. SASS and LESS). What are the pro and cons of changing from this: #div-one, #div-two { color: blue; } to this: @default: blue; #div-one { color: @default; } #div-two { color: @default; } ...