473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

getting php value to javascript

ditditsasa
Expand|Select|Wrap|Line Numbers
  1. while (false !== ($sfname = readdir($dh))) {
  2.   if (substr($sfname, 0, 1) == '.') continue;
  3.   if ($sfname == 'CVS'            ) continue;
  4.   $sitedir = "$OE_SITES_BASE/$sfname";
  5.   if (!is_dir($sitedir)               ) continue;
  6.   if (!is_file("$sitedir/sqlconf.php")) continue;
  7.   $siteslist[$sfname] = $sfname;
  8.   //echo $sfname;
  9. }
hi friends i want to print the sfname value to javascript please help me
Apr 12 '12 #1
2 1297
Rabbit
12,516 Expert Mod 8TB
The same way you would output something as HTML.
Apr 12 '12 #2
print value in hidden elements like this ::

Expand|Select|Wrap|Line Numbers
  1. $tmp = 0;
  2. while(......)
  3. {
  4.  
  5.          echo "<input type='hidden' id='h_".$tmp."' value='".."'>";
  6.  
  7.         $tmp++;
  8. }
  9.  
after that get that values in javascript like this :::

var t1 = document.getElementById("h_0").value;
var t2 = document.getElementById("h_1").value;

try it.....

Bharat Parmar(Bharat383)
Apr 14 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Peter | last post by:
Hi all, Sorry if this is an obvious/common question, but I'm trying to get the value of a radio button using JavaScript. Where I can easily get the value of a text field: ...
5
by: Matt Williamson | last post by:
I have a table that gets generated every 5 minutes containing the drive space on my servers. The table is sortable via an external javascript file by clicking the column headers (using sortable.js...
10
by: Dwizz | last post by:
Hello, I really hope that someone can help me resolve my problem, I've been working on it for the past few days, to no avail. I have an asp:label which gets its value from the database, but what...
0
by: Randy | last post by:
Hi, is it possible to programmatically (from C#) get the value of a JavaScript Variable from a JavaScript running inside the embedded WebBrowser Control? Thanks in advance, Randy
5
by: velu | last post by:
Problem in getting value from textbox & radiobuttonlist to a valuable inside a datagid. I want to insert a record into a table thru datagrid. Here is the code (see below) Private Sub...
5
by: laredotornado | last post by:
Hi, How would I use Javascript to get the value of a hyperlink. That is, what function could I substitute below to get the value "2"? <a href="javascript:alert( /* WHat goes here? */...
2
by: Luke - eat.lemons | last post by:
Hi, I have this function: <script type="text/javascript"> function disp_prompt() { var reqid=prompt("Please enter the membership ID number","") if (reqid!=null && reqid!="") { reqid=reqid }
3
by: daveyand | last post by:
hey, I know in the new browsers you're not able to change the value of the status bar. Which is fair enough, i understand why and agree. Although, i cant seem to get the value of the status...
1
by: renatois | last post by:
Getting value from GridView Hi guys, I have a GridView and I need to access a value of an ID field on an event. I converted this field into template and the name of the label control in...
1
by: aloksingh83 | last post by:
This error coming when i am using telerik grid.It works fine in asp.net grid what i am trying to do is taking values from textbox and show in grid view... here is the code: <script...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.