473,395 Members | 1,440 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,395 software developers and data experts.

passing php variables with javascript?

I am trying to open a small new window using javascript and pass a php
variable onto the new window and this is really being a pain. I believe

that this is possible but everything that I have tried so far has not
worked. The relevant code that I am usiing is below. The problem is the
variable $aster resides in a cell of a table that displays notes
pertaining to a specific item and depending on the item the notes could
change. Each table may have anywhere from 1 to 10 notes and they are
all different. I had everything working fine opening another window
without javascript but a smaller window would suffice. As of now, all
of the notes are the same and it is always the last set of notes in the
table. Anyone familiar with this? Any help would be greatly
appreciated.
<SCRIPT language="JavaScript">
<!--hide
function newwindow
{
window.open('cust_parts_notes.php?aster=<?print
($aster);?>','Notes','width=400,height=400,resizab le=yes');
}
//-->
</SCRIPT>
<tr bgcolor=white><td align="center"><?echo "$qty";?></td><td><?echo
"$partnum";?></td><td><?echo "$desc1 $desc2"?></td>
<?
if ($yes_no == "Y"){
?><td><a href="javascript:newwindow'<?print ($aster);?>')"
title='<?echo "$aster"?>'>Notes</a></td><?
} else { ?><td>&nbsp;</td><?
}
?>
</tr>
<?
}
}
odbc_close($connect);
?>
</body>
</html>

Nov 9 '06 #1
1 1198

dk*******@yahoo.com wrote:
I am trying to open a small new window using javascript and pass a php
variable onto the new window and this is really being a pain. I believe

that this is possible but everything that I have tried so far has not
worked. The relevant code that I am usiing is below. The problem is the
variable $aster resides in a cell of a table that displays notes
pertaining to a specific item and depending on the item the notes could
change. Each table may have anywhere from 1 to 10 notes and they are
all different. I had everything working fine opening another window
without javascript but a smaller window would suffice. As of now, all
of the notes are the same and it is always the last set of notes in the
table. Anyone familiar with this? Any help would be greatly
appreciated.
<SCRIPT language="JavaScript">
<!--hide
function newwindow
{
window.open('cust_parts_notes.php?aster=<?print
($aster);?>','Notes','width=400,height=400,resizab le=yes');
}
//-->
</SCRIPT>
<tr bgcolor=white><td align="center"><?echo "$qty";?></td><td><?echo
"$partnum";?></td><td><?echo "$desc1 $desc2"?></td>
<?
if ($yes_no == "Y"){
?><td><a href="javascript:newwindow'<?print ($aster);?>')"
title='<?echo "$aster"?>'>Notes</a></td><?
} else { ?><td>&nbsp;</td><?
}
?>
</tr>
<?
}
}
odbc_close($connect);
?>
</body>
</html>
If I understand you correctly, u can use the hidden form element on
your first page to sotre the data. Then you can submit your form via
javascript to be able to open a new custom window. And then just use
php to retrive the hidden field(s) value(s).

Nov 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Consuelo Guenther | last post by:
Hello, I am having problems with passing variables between pages. I have the following: First asp page has the function: -----------------------------------------------------------------------...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
2
by: brianwmunz | last post by:
Hi, I'm having a problem passing a variable through a URL because the variable is supposed to hold a URL that has a variable of its own. Here is an idea of what I'm trying to do: href="javascript:...
9
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
3
by: jsdeveloper | last post by:
Hi, I just started programming in javascript, and I'm having a problem passing variables between javascript and asp code in .asp page. Can you please help? I've given the sample code below. ...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.