Jump to content

Search the Community

Showing results for tags 'variable'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH


  • Community Calendar




Website URL








Found 21 results

  1. function loadDoc(n_file) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var myObj = JSON.parse(this.responseText); var parametr = "september" var neco = myObj.september.17[0].dayname; var neco2 = "myObj." + parametr + ".17[0].dayname"; debugger; x = zacinajiciDen(neco); than i have this in my variables: neco1: "pa" neco2: "myObj.september17[0].dayname" i would like to have value "pa" inside like in neco1 but i would like to be able to change name of month. Is it possible Hi all, I have a simple problem. I would like to have a value of Object "myObj.september17[0].dayname" in my variable neco2. but there is of course more month which i need access and i need to changing this variable but when i use "myObj." + parametr + "17[0].dayname"; it is saved a string to variable instead of value. I am very new in JS, learning two days now so please be patient with me.
  2. Hello, I've just read the tutorial on how to process a form in PHP, available on this site, and I was wondering if there's a specific reason to declare empty variables (or arrays) at the beginning? I don't understand what is the point of doing so. For example, in the following code, why would the 2sd and 3rd lines be necessary? <?php $errors = []; $name = $email = $message = ''; if (condition) { $errors['name'] = 'alert'; } else { $name = sanitize_input($_POST['name']); if (new_condition, $name) { $errors['name'] = 'new alert'; } }
  3. So my question is: how can I insert variables into my mysql queries in php? This is my code now, I would like to use the $me and the $friend variables to work in the sql query: function newChat($me, $friend) { global $conn; $sql = "SELECT id FROM chats WHERE (person1 = $me AND person2 = $friend) OR (person1 = $friend AND person2 = $me);"; mysqli_query($conn, $sql) or die('Error querying database.'); echo "check <br />"; $result = mysqli_query($conn, $sql); $row = mysqli_fetch_array($result); while ($row = mysqli_fetch_array($result)) { echo $row['id'] . ' - ' . $row['person1'] . ' - ' . $row['person2'] . ' - ' . $row['date'] .'<br />'; } } newChat('John', 'Marie'); Also if I set $sql to "SELECT * FROM chats" it only gives me one row of my two test rowes in my database. (it only gives the second row, and just ignores the first one? --> a screenshot of the database is at the end of this post) Can anyone please help me with this? Thanks already!
  4. MySQL query is not working

    MySQL queries are not working only inside this block: ... if (isset($_POST['send'])) { } ... The variable itself is set and transferred from the form. What could be the reasons of this and how is better to check?
  5. Hi, Is it possible to access property of the object using variable, for example I have the object named "objExample" with properties named: Property1 Property2 Property3 Property4 ... Property10 I would like to access all of these properties in FOR loop using variable propertyName = " Property " & i in each step, but I don't know how to make it. The code below it's an simple example of my problem ("???" indicates piece of code which I missing): Dim i Dim propertyName Dim objExample Set objExample = ....... For i = 1 To 10 propertyName = " Property " & i objExample.??? = ...... ...... Next Best regards
  6. Hello, I've a problem when I try to send variables (django variables) from html to javascript. My variables contain coordinates, I mean, they are decimals, and when I receive them in the javascript and I show them in console, I've got only the no decimal part of the coordinates. This is my code: Template: <td><button onclick="window.to('{{p.coorx}}','{{p.coory}}')" data-coorx="{{p.coorx}}" data-coory="{{p.coory}}">Ver Pozo</button></td> Javascript: window.to = function(coorx,coory) { var coorx = parseFloat(coorx); var coory = parseFloat(coory); console.log(coorx); console.log(coory);} I'm sure that my error is in the way in what I establish the parameters to send in HTML. I've tried several choices as: <td><button onclick="window.to(" + {{p.coorx}} + "," + {{p.coory}} + ")" data-coorx="{{p.coorx}}" data-coory="{{p.coory}}">Ver Pozo</button></td> But then it gives me an error: Uncaught SyntaxError: Unexpected token } Would anybody know how to solve this problem? Greetings and thank you very much in advance!
  7. Hi guys, I use a very big form and my variables will be saved in a session. In most cases I´m fine with PHP. Until now I just use JS to hide and show some options. My idea is to give the user a selection (somewhere in my form). As soon as the user clicks on one of the selection options, the value of the variable shall appear as text below the selection options (not just in the selection options). 1. Idea - import the php-variables in my JS and work with it <script type="text/javascript">var test ="<?php echo $test ?>";</script> --> didnt work. I could work with the variable, but I dont get a "fresh" variable from the session, because I would have to push the form button first. 2. Idea - create a JS variable in the selection options <selection id="test"><option value=test1">Test1</option><option value=test2">Test2</option>...</selection> --> didnt work. Do you have any ideas what I should look for or what I have to do? Thanks and cheers, Chrex
  8. Variable Output

    I have some code that uses a button to open up a prompt then you enter a number XXX.XX as a frequency. Then convert it to BCD32 then display it. Example 122.30 in decimal to 8752 in BCD32 Here is the code. <html><head></head><script type="text/javascript"></script> <script>function COMSET(){var FREQ = Number(prompt ("Frequency"));//sets to 2 decimal placesFREQ = FREQ.toFixed(2);alert(FREQ);//gets the first 2 characters before the . and drops the 1var n1 = FREQ.substr(0, FREQ.indexOf("."));n1 = n1.substr(n1.length-2);alert(n1);//gets the last 2 characters after the .var n2 = FREQ.substr(FREQ.indexOf(".")+1,2);alert(n1 + " : " + n2);//Converts from Decimal to BCD formatvar bcd = (parseInt(n1.charCodeAt(0) - 0x30 )<<12) + (parseInt(n1.charCodeAt(1) - 0x30 )<<8) + (parseInt(n2.charCodeAt(0) - 0x30 )<<4) + parseInt(n2.charCodeAt(1) - 0x30 );document.getElementById(COM1_ASET).innerHTML=bcd;}</script><body> <input name="COM1" type="button" id="COM1" value="COM1_SET" onClick="TEST()"><p id="COM1_ASET"><p> </body></html>
  9. Hello, I tried to replace the value of one element with the value of a precedent. Xml Source = Form02.xml ArticleList with two times an Article <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <Interface> <DatabasePath>mi-erp03sofonDevelopSPO</DatabasePath> - <ArticleList> - <Article> <Description>B110.226060.101.00477 - VARICONM CONFIG 7047</Description> <ArticleNumber>B110.226060.101.00477</ArticleNumber> <PositionDescription>1 - B110.226060.101.00477 - VARICONM CONFIG 7047</PositionDescription> <CostPrice>514.60</CostPrice> <CostPriceQuantity>1.00000000</CostPriceQuantity> <Unit>PCS</Unit> <ListPrice>1793.18</ListPrice> <SellPrice>1793.18</SellPrice> <AX_IDC_ConfigId>MPQ00477_1_0_1</AX_IDC_ConfigId> <AX_IDC_Name>B110.226060.101.00477 - VARICONM CONFIG 7047</AX_IDC_Name> <AX_ItemName>VARICONM CONFIG 7047</AX_ItemName> <AX_IVT_Template>SOFON-IT-VARICONM</AX_IVT_Template> <AX_Visible>true</AX_Visible> <GenericArticleNr>B110.226060.101.00477</GenericArticleNr> </Article> - <Article> <Description>B110.226060.102.00477 - VARICONM CONFIG 7047</Description> <ArticleNumber>B110.226060.102.00477</ArticleNumber> <PositionDescription>1 - B110.226060.102.00477 - VARICONM CONFIG 7047</PositionDescription> <CostPrice>514.60</CostPrice> <CostPriceQuantity>1.00000000</CostPriceQuantity> <Unit>PCS</Unit> <ListPrice>1793.18</ListPrice> <SellPrice>1793.18</SellPrice> <AX_IDC_ConfigId>MPQ00477_1_1_2</AX_IDC_ConfigId> <AX_IDC_Name>B110.226060.102.00477 - VARICONM CONFIG 7047</AX_IDC_Name> <AX_ItemName>VARICONM CONFIG 7047</AX_ItemName> <AX_IVT_Template>SOFON-IT-VARICONM</AX_IVT_Template> <AX_Visible>false</AX_Visible> <GenericArticleNr>B110.226060.102.00477</GenericArticleNr> </Article> </ArticleList> </Interface> XSL code = form02.xsl (renamed to form02xsl.txt in de Attach) <?xml version="1.0" encoding="utf-8" ?> - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" encoding="UTF-8" /> <xsl:variable name="hans" /> - <xsl:template match="/"> - <Interface> <xsl:apply-templates select="Interface/DatabasePath" /> - <ArticleList> <xsl:apply-templates select="Interface/ArticleList/Article" /> </ArticleList> </Interface> </xsl:template> - <xsl:template match="Article"> - <Article> - <xsl:for-each select="*"> - <xsl:choose> - <xsl:when test="name() = 'AX_IDC_ConfigId'"> - <AX_IDC_ConfigId> <xsl:value-of select="//ArticleNumber" /> </AX_IDC_ConfigId> </xsl:when> - <xsl:otherwise> - <xsl:element name="{name()}"> <xsl:value-of select="." /> </xsl:element> </xsl:otherwise> </xsl:choose> </xsl:for-each> </Article> </xsl:template> </xsl:stylesheet> Result = out2.xml <?xml version="1.0" encoding="UTF-8" ?> - <Interface> mi-erp03sofonDevelopSPO - <ArticleList> - <Article> <Description>B110.226060.101.00477 - VARICONM CONFIG 7047</Description> <ArticleNumber>B110.226060.101.00477</ArticleNumber> <PositionDescription>1 - B110.226060.101.00477 - VARICONM CONFIG 7047</PositionDescription> <CostPrice>514.60</CostPrice> <CostPriceQuantity>1.00000000</CostPriceQuantity> <Unit>PCS</Unit> <ListPrice>1793.18</ListPrice> <SellPrice>1793.18</SellPrice> <AX_IDC_ConfigId>B110.226060.101.00477</AX_IDC_ConfigId> <AX_IDC_Name>B110.226060.101.00477 - VARICONM CONFIG 7047</AX_IDC_Name> <AX_ItemName>VARICONM CONFIG 7047</AX_ItemName> <AX_IVT_Template>SOFON-IT-VARICONM</AX_IVT_Template> <AX_Visible>true</AX_Visible> <GenericArticleNr>B110.226060.101.00477</GenericArticleNr> </Article> - <Article> <Description>B110.226060.102.00477 - VARICONM CONFIG 7047</Description> <ArticleNumber>B110.226060.102.00477</ArticleNumber> <PositionDescription>1 - B110.226060.102.00477 - VARICONM CONFIG 7047</PositionDescription> <CostPrice>514.60</CostPrice> <CostPriceQuantity>1.00000000</CostPriceQuantity> <Unit>PCS</Unit> <ListPrice>1793.18</ListPrice> <SellPrice>1793.18</SellPrice> <AX_IDC_ConfigId>B110.226060.101.00477</AX_IDC_ConfigId> <AX_IDC_Name>B110.226060.102.00477 - VARICONM CONFIG 7047</AX_IDC_Name> <AX_ItemName>VARICONM CONFIG 7047</AX_ItemName> <AX_IVT_Template>SOFON-IT-VARICONM</AX_IVT_Template> <AX_Visible>false</AX_Visible> <GenericArticleNr>B110.226060.102.00477</GenericArticleNr> </Article> </ArticleList> </Interface> As you see the value in the second Article/AX_IDC_ConfigId element is B110.226060.101.00477 in stead of B110.226060.102.00477. How do I get the correct value in de second Article/AX_IDC_ConfigId element. Thanks in advance Hans van Roosmalen From02.xml out02.xml From02bat.txt From02xsl.txt
  10. Hi guys, I try to build an xml document with php. Creating, saving and sending works fine. Just couldnt figure out how to insert a variable to my php-code, which creates the xml. <?php$xml = new DOMDocument("1.0", "utf-8";$root = $xml->createElement("ABC");$xml->appendChild($root);$var1 = $xml->createElement("Town");$var1Text = $xml->createTextNode('$townname');$var1->appendChild($varText);$BCD = $xml->createElement("Data");$BCD->appendChild($var1);$root->appendChild($BCD);$xml->formatOutput = true;echo "<xmp>". $xml->saveXML() ."</xmp>";$xml->save("energieausweis.xml") or die("Error");?> Instead of using a fix "createTextNode" I wanna use a variable. Something like "createVariableNode" (I know that this doesnt exist). Hope you guys understand me. I get a variable from a form, lets say $townname, which can be Vancouver or Paris. This variable shall be written in my xml. Depending on the selection from the form, my xml shall contain Vancouver or Paris and not just the text "$townname". Thanks a lot for your help!
  11. Responses

    I'm trying to have a code that prints something in specific in response to you typing something. I have already set up the variable so it asks for me to type something. For example: If I type in A and hit enter, it prints B. If I type in 1 and hit enter, it prints 2. I'm new to HTML, thanks a bunch.
  12. So I have a calendar that I created using JavaScript on an HTML page but now I need to create a variable that contains an array. The array needs to be a week long to-do list. Problem 1, I try to create the variable to produce the 'to-do' list but I'm not sure how to associate the array with a week out of the month. Second, I'm not sure where to plug in the variable once I have created it in order to make it show up in the calendar. Below is the script I wrote for the calendar. And help would be appreciated. Thanks! <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Month Calendar</title> </head> <body> <script> monthnames = new Array( "January", "Februrary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Decemeber"); var linkcount=0; function addlink(month, day, href) { var entry = new Array(3); entry[0] = month; entry[1] = day; entry[2] = href; this[linkcount++] = entry; } Array.prototype.addlink = addlink; linkdays = new Array(); monthdays = new Array(12); monthdays[0]=31; monthdays[1]=28; monthdays[2]=31; monthdays[3]=30; monthdays[4]=31; monthdays[5]=30; monthdays[6]=31; monthdays[7]=31; monthdays[8]=30; monthdays[9]=31; monthdays[10]=30; monthdays[11]=31; todayDate=new Date(); thisday=todayDate.getDay(); thismonth=todayDate.getMonth(); thisdate=todayDate.getDate(); thisyear=todayDate.getYear(); thisyear = thisyear % 100; thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear)); if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) ||(thisyear % 400 == 0)) monthdays[1]++; startspaces=thisdate; while (startspaces > 7) startspaces-=7; startspaces = thisday - startspaces + 1; if (startspaces < 0) startspaces+=7; document.write("<table border=2 bgcolor=white "); document.write("bordercolor=black><font color=black>"); document.write("<tr><td colspan=7><center><strong>" + monthnames[thismonth] + " " + thisyear + "</strong></center></font></td></tr>"); document.write("<tr>"); document.write("<td align=center>Su</td>"); document.write("<td align=center>M</td>"); document.write("<td align=center>Tu</td>"); document.write("<td align=center>W</td>"); document.write("<td align=center>Th</td>"); document.write("<td align=center>F</td>"); document.write("<td align=center>Sa</td>"); document.write("</tr>"); document.write("<tr>"); for (s=0;s<startspaces;s++) { document.write("<td> </td>"); } count=1; while (count <= monthdays[thismonth]) { for (b = startspaces;b<7;b++) { linktrue=false; document.write("<td>"); for (c=0;c<linkdays.length;c++) { if (linkdays[c] != null) { if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) { document.write("<a href="" + linkdays[c][2] + "">"); linktrue=true; } } } if (count==thisdate) { document.write("<font color='FF0000'><strong>"); } if (count <= monthdays[thismonth]) { document.write(count); } else { document.write(" "); } if (count==thisdate) { document.write("</strong></font>"); } if (linktrue) document.write("</a>"); document.write("</td>"); count++; } document.write("</tr>"); document.write("<tr>"); startspaces=0; } document.write("</table></p>"); </script> </body> </html>
  13. Need some help on using a variable

    I have a nifty query that pulls data by orders.orderid > '85000' (and I update that number every week based on orders.) But I want it to automatically pull the most recent 3,000 orders instead of changing that number all the time, so I was hoping to set a variable which is Max(order.orderid)-3000, thus pulling the last 3000 order records. Here is my static select: SELECT Orders.OrderID, Orders.OrderStatus, Orders.CustomerID, Orders.ShippingMethodID, Orders.BillingFirstName, Orders.BillingLastName, Orders.BillingAddress1, Orders.BillingAddress2, Orders.BillingCity, Orders.BillingState, Orders.BillingPostalCode, Orders.PaymentAmount, Orders.OrderDate, Orders.ShipDate, Orders.LastModified, fraud.score, CAST(Orders.OrderID AS VARCHAR) AS 'za_orderid_full', CAST(Orders.CustomerID AS VARCHAR) AS 'za_custid_full'FROM Orders JOIN Fraud ON Fraud.OrderID = Orders.OrderIDWHERE Orders.ShipDate IS NULL AND Orders.OrderID > '85000' AND Orders.OrderStatus <> 'Cancelled' Can someone tell me how to declare and set that variable? Or suggest another way to accomplish this? Your help is greatly appreciated.
  14. Hello, i'm wondering is it possible to pass variable inside <script></script> to another <script></script> field. Example i have <script>var message = "Hello";</script><script>alert(message);</script> I know i could add them together in this script i write, but my actual codes is separating the scripts.
  15. [PHP] Problem

    Hello,I'm trying to get my PHP to select the ID from the table 'users' and use it in an SQL query,I've listed my code; $id= $_SESSION['id'];$id2 = mysql_query("SELECT * from 'Friends' WHERE 'id1' = '{$id}'"); echo $id2["id2"] ;?> this bit works,but I can't "echo $id2["id2"] ;" the above code does not list the id2 that is listed in the database. Any help appreciated!
  16. JavaScript global variable...

    Although I can console.log lastSel it is coming up as a blank when the PHP is called in the header. So when the header is passed it is id: "" even though clearly there is a value in lastSel and I am type casting to string. I am wondering what could be the source of the issue. lastSel is defined outside of any function braces as just "lastSel = """ without using the var keyword. Why would it be blank as String(lastSel) even though I can console.log a value? <script>$(function(){var date = new Date();var d = date.getDate();var m = date.getMonth();var y = date.getFullYear(); $('#calendar1').fullCalendar({ // put your options and callbacks hereheader:{left: 'prev,next today',center: 'title',right: 'month,basicWeek,basicDay'},editable: true,droppable: true,selectable: true,events: {url: 'php.scripts/events.get.php',type: 'POST',data: {id: String(lastSel),custom_param2: 'somethingelse'},error: function() {alert('there was an error while fetching events!');},color: 'yellow', // a non-ajax optiontextColor: 'black' // a non-ajax option},eventClick: function (calEvent, jsEvent, view) { $( "#eventdialog2" ).dialog({resizable: false,height:500,width:500,modal: true,buttons: {"Update": function() {$( this ).dialog( "close" );},Cancel: function() {$( this ).dialog( "close" );}}}); },eventDrop: function (event, dayDelta, minuteDelta, allDay, revertFunc) { },select: function(startDate, endDate, allDay, jsEvent, view) { $( "#eventdialog1" ).dialog({resizable: false,height:500,width: 500,modal: true,buttons: {"Add": function() {if(jQuery("#event_title1").val() == ""){alert("All active text fields are required input!");return false;}$( this ).dialog( "close" );},Cancel: function() {$( this ).dialog( "close" );}}}); } }); $('#calendar2').fullCalendar({ // put your options and callbacks here });});</script> <script>lastSel = "";$(function(){ $("#list").jqGrid({ url:'php.scripts/get.customers.php', datatype: 'xml', mtype: 'POST',colNames:['idcustomers','firstname', 'lastname','address1','address2','city','state','zip','phone','email','cell'], colModel :[ {name:'idcustomers', index:'idcustomers', width:55}, {name:'firstname', index:'firstname', width:90, editable: true}, {name:'lastname', index:'lastname', width:90, editable: true}, {name:'address1', index:'address1', width:90, editable: true}, {name:'address2', index:'address2', width:90, editable: true}, {name:'city', index:'city', width:90, editable: true}, {name:'state', index:'state', width:90, editable: true}, {name:'zip', index:'zip', width:90, editable: true}, {name:'phone', index:'phone', width:90, editable: true}, {name:'email', index:'email', width:90, editable: true}, {name:'cell', index:'cell', width:90, editable: true} ], pager: '#pager', rowNum:20, rowList:[20,100,300], sortname: 'idcustomers', sortorder: 'asc', viewrecords: true, gridview: true, caption: 'Customers',width: 1400,height: 290,editurl: 'php.scripts/update.row.php',ajaxGridOptions: {type:"POST"},onSelectRow: function(id){ if(id && id!==lastSel){ jQuery('#gridid').restoreRow(lastSel); lastSel=id;jQuery("#list").data('selid',lastSel);console.log(lastSel);console.log(jQuery("#list").data('selid'));} //jQuery('#list').editRow(id, true); jQuery('#list').data('selid', jQuery("#list").getCell(lastSel,0));jQuery('#list').data('firstname', jQuery("#list").getCell(lastSel,1));jQuery('#list').data('lastname', jQuery("#list").getCell(lastSel,2));jQuery('#list').data('address1', jQuery("#list").getCell(lastSel,3));jQuery('#list').data('address2', jQuery("#list").getCell(lastSel,4));jQuery('#list').data('city', jQuery("#list").getCell(lastSel,5));jQuery('#list').data('state', jQuery("#list").getCell(lastSel,6));jQuery('#list').data('zip', jQuery("#list").getCell(lastSel,7));jQuery('#list').data('phone', jQuery("#list").getCell(lastSel,8));jQuery('#list').data('email', jQuery("#list").getCell(lastSel,9));jQuery('#list').data('cell', jQuery("#list").getCell(lastSel,10)); } }).jqGrid('navGrid','#pager',{ edit: false, add: true }, {}, {}, {}, {}, {}).jqGrid('inlineNav',"#pager",{}); }); </script>
  17. So i am building an admin page as part of a project for the course I am doing. I want to execute the remote command "top" (it doesn't matter if i execute it by php ssh connection) on linux and than I want to store the output of the command in a variable called $data. Is that possible? I tried doing it with shell_exec() and exec() but couldn't get it to work. Thanks before hand.
  18. hey anyone, i have a problem about passing variable. gridpEmp.PHP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE></TITLE><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Style-Type" content="text/css"><meta http-equiv="Content-Script-Type" content="text/javascript"><script type="text/javascript">var preEl ;var orgBColor;var orgTColor;function HighLightTR(el, backColor,textColor){ var rowindex = el.sectionRowIndex; if(typeof(preEl)!='undefined') { preEl.bgColor=orgBColor; try{ChangeTextColor(preEl,orgTColor);}catch(e){;} } orgBColor = el.bgColor; orgTColor = el.style.color; el.bgColor=backColor; try{ChangeTextColor(el,textColor);}catch(e){;} preEl = el;}function ChangeTextColor(a_obj,a_color){ ; for (i=0;i<a_obj.cells.length;i++) a_obj.cells(i).style.color=a_color;}<style>table.selectable-table td { font-size:10pt; font-family: Arial; }table.selectable-table td { cursor:pointer; margin:0px; border:0px; padding:2px 5px 2px 5px; }table.selectable-table { border-spacing:0px; background:#eef;}</style></script></HEAD><BODY><table id="gridemp" border="1" cellspacing="0" cellpadding="4" align="center"><th>Employee Initial</th><th>Employee ID</th><th>Employee Name</th><tbody><?phpinclude('check/conDBodbc.php');$empid = $_POST['searchemployee']; function dbquery($sql) {include('check/conDBodbc.php'); $arr = array(); $rs = odbc_exec($con,$sql); $x = 1; while (odbc_fetch_row($rs)) { for ($y = 1; $y <= odbc_num_fields($rs); $y++) $arr[$x][$y] = odbc_result($rs,$y); $x++; } if ($x > 1) return $arr;}$arr = dbquery("select * from getemployee where employeeid like '%$empid%' or employeename like '%$empid%' or employeeinitial like '%$empid%'");echo $arr[1][3]; $rs1 = odbc_exec($con,"select * from getemployee where employeeid like '%$empid%' or employeename like '%$empid%' or employeeinitial like '%$empid%'");while(odbc_fetch_array($rs1)){?><tr onClick="HighLightTR(this,'#c9cc99','cc3333')"><!--<tr onClick="getvalue(this)">--><td align=left><?php echo odbc_result($rs1,employeeinitial);?></td><td align=left><?php echo odbc_result($rs1,employeeid);?></td><td align=left><?php echo odbc_result($rs1,employeename);?></td></tr><?php }?></tbody></table></BODY></HTML> i want to passing variable var rowindex = el.sectionRowIndex;how to do that passing variable in one file php??because i want to get value of row index from user selected row after that i can echo value of selected row from user by function dbquery($sql).
  19. Hello All, So you frequently see reductions with commonly used objects such as: var $this = $(this)//Or....var $objectName = $('.className') Is there any places or reason why you would chose to use the $ before the var name to create an object as oppose to just making a normal variable? I'm looking to find and replace the objects with these sorts of variables to reduce file size, make it easier to read, and hopefully speed up load time but to check with experts before I potentially F#$! up my work. Thoughts? Also, any thoughts on how to structure code (in general) to run most efficiently would be helpful. I auditioned a very scant, un-skinned version of my page on the server and it took much longer than I expected to load (on my itty bitty netbook of which I think some cell phones have more processing power). Thanks!
  20. I have a div animated by incremented margin-left when the user clicks a button. I would like to force the animation to stop at a specific margin-left value and callback a different animation. So if the user tries to click too far it prevents them from doing so. Suggestions? I'd like to do it with margin because it'd be easier to edit later, but if I have to use .position.left as a variable, I'll take the code for that just as well. Here's a wacky selector I tried, to no avail, if it helps convey my intention: $('.slidingDiv[style*=margin-left:80px]').stop().animate(.....); I didn't bind it to a .click because I want to be able to stop any-size div at any given point rather than map it out explicitly. Thanks!
  21. Problem In Styling

    I have a PHP script something like this: <?phpif (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE) { echo 'Firefox';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) { echo 'Google Chrome';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Iron') !== FALSE) { echo 'SRWare Iron';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Presto') !== FALSE) { echo 'Opera';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE) { echo 'Apple Safari';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { echo 'Internet Explorer';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'ChromePlus') !== FALSE) { echo 'ChromePlus';}elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'SeaMonkey') !== FALSE) { echo 'SeaMonkey';}else { echo '[Sorry, I can\'t recognise your browser, most probably because you might be on mobile device]';}?> Now I want it to store it (browser's name) in a variable so that I can echo it on appropriate place.