variables

Input PHP Variable into HTML Select Tag

Hello: I have a php variable ($list) that is a list of values separated by commas. I am trying to figure out how to convert or input this variable into a HTML select tag. Here is what I have so far: $dbquery = @$db->query('SELECT * FROM Company'); while ($queryText = $dbquery->fetchArray()){ $array[]=$queryText['Company_Name']; } /...

define colors as variables in CSS

Hi all, I'm working CSS file which is quite long. I know the client could ask for changes to the color scheme, and was wondering: is it possible to assign colors to variables so I can just change them to have the new color applied to all elements that use it? Please note I can't use php to dynamically change the css file. ...

Defining PHP variables - PHP 101

I'm defining the following variables: $rel_path = bloginfo('template_directory'); $thumb_directory = "$rel_path/images/portfolio/"; $orig_directory = "$rel_path/images/portfolio/thumbs"; the $rel_path is a WordPress function which appears to be printing, however, it is displaying spitting an error message which indicates that $rel_pat...

Variable scope js - return initial assignment instead of changed

Have next script: function clicker(){ var linkId = "[id*=" + "link]"; var butnId='initial'; $j(linkId).click(function(){ var postfix = $j(this).attr('id').substr(4); butnId = '#' + 'butn' + postfix; }); return butnId; } Function output is 'initial' value. How to return actual value of variable butnId,after it...

Parent and Child Shell Script Problem

Hi , I have two scripts parent.sh and child.sh. There is a variable in parent.sh which needs to be accessed by the child process. I have achieved this by exporting the variable in the parent script and the variable is available to the child process? Is there any way that child can modify the value of the export variable defined in par...

jquery load a selector contained in a variable

Hello, Can anyone help me with the right syntax to load some div, please I try'd to concat it in several ways, except the right way rcp= "#div02"; $("#content").load("/inc/forms.php " +rcp'"', function(){.... I will keep trying in the meantime EDIT AND ACCIDENTLY GOT IT RIGHT (not completely yet) $("#content").load("/inc/forms.p...

How to find the variables defined in a function.

Suppose I have a long javascript function such as function test() { var x; var a; ... ... ... ... ... } is there any way I can ask the function itself to tell me what variables were defined so far. function test() { var x; var a; ... ... ... ... ... // bit of code that would say to ...

How can I edit a JavaScript variable?

Hi, Say I have a variable tab_something I need to drop the tab_ bit. In php it's easy, using str_replace... Will tabSelect = document.location.hash.substr(1,document.location.hash.length); (which would always be tab_something) document.write(tabSelect.replace(/tab_/i, "")); Work the way I would like it to, consistently acros...

How to store Flex 3 ColorPicker Value in a variable and bind the variable to a textInput

Hello Stackoverflowers, Can anybody help me out? I would like to store a hex colorPicker value in a variable and then cast the value of the var backout to a textInput. The textInput is just to see witch hexcolor i have choosen. thus meaning seeing 0x000000 in the textInput. what i've done now is pretty simple i have bound the flex col...

PHP Defining $varname changes $_SESSION['varname']

It took me a while to realize that $_SESSION['user'] was changing because I have a variable set: $user = array(); Is this normal? I haven't had this issue until today, not sure if it is a server/php setting ...

Store javascript variables in array

I am sure someone has gone over this but I have had no luck finding some results. I want to know what is the fastest way to maintain a proper variable scope. Here is some example jquery code I wrote this morning. var oSignup = { nTopMargin: null, oBody: $("div#body"), oSignup: $("div#newsletter_signup"), oSignupBtn: $("d...

variable passing inside a function to another function in javascript

hello, setTimeout("refresh()", 2*15000 ); This is a code from my javascript here setTimeout is a built in function and refresh is a function which i have declared. i want to pass a variable (cval1) to this refresh fuction i have tried this setTimeout("refresh(cval1)", 2*15000 ); bit its not working What is the exact way to do th...

How to convert a string value to a variable in javascript?

var test1; $(document).ready(function () { test1 = $("#test1ID").jQueryPlugin(); }); var test2; $(document).ready(function () { test2 = $("#test2ID").jQueryPlugin(); }); ... This is done so we could just do test1.foo()... foo is a function inside the jQueryPlugin that is accessible using test1.foo() syntax; So we have an arr...

functions and variables

Well the question is quite simple but I somehow can't figure it out. For example I have string variable ts. After my loader loads image in movieclip instance i want to change ts value to something. The problem is - ts value isn't changing on my doneLoad function. Here's the code var ts:String = "loading"; var imgload = new Loader()...

How do I use this information in Python? I don't know how to use this data-type.

According to the NLTK book, I first apply the grammar, and parse it. grammar = r""" NP: {<DT|PP\$>?<JJ>*<NN>} {<NNP>+} """ cp = nltk.RegexpParser(grammar) chunked_sent = cp.parse(sentence) When I print chunked_sent, I get this: (S i/PRP use/VBP to/TO work/VB with/IN you/PRP a...

Clear all script-set variables easily (Javascript/jQuery).

I'm trying to find a simple way to reset all current variables in the DOM. My app has a 'locked' state, but currently, when locked, the last set of information is still visible in the DOM if you look using Firebug for example. I know all the names of all variables, but I don't want to have a really cumbersome script including all of the...

Why can't I pass variables into an included file in PHP?

I've had this problem before before with no real resolution. It's happening again so I'm hoping you experts can help. I set a variable on my index.php based on the $_GET array. So I use this code: $admin = isset($_GET['admin']) ? $_GET['admin'] : "dashboard"; Below that, I use a function to include my layout: include_layout("admin_h...

PHP: Dealing With MySQL Connection Variable

What is the best way to deal with the $db_conn variable once I create a mysqli object? I've been using $GLOBALS['_sql'] = new mysqli(...); But this seems dirty. The alternative that I've seen is to be constantly passing the connection var to every function that calls it, but that's a huge pain. ...

Java: Roller program - debug - variables not updating from JTextField and NumberFormatException thrown regardless of valid information.

Problems: I am unable to get the values of the JTextFields or the rollResultTotal to update. Even if the data in the JTextFields are valid, a NumberFormatException is still thrown. Questions: Why don't the variables stay? Is this due to declaration in the class itself? Is it possible to update a JLabel panel to show an updated resu...

How to see the values of a table variable at debug time in T-SQL?

Can we see the values (rows and cells) in a table valued variable in SQL Server Management Studio (SSMS) during debug time? If yes, how? ...