You are here: Re: passing php variables with javascript? « PHP Programming Language « IT news, forums, messages
Re: passing php variables with javascript?

Posted by dkirkdrei on 11/09/06 17:54

Matthew256 wrote:
> dkirkd...@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. Everything works
> > like it should except the new window contains nothing. Anyone familiar
> > with this? Any help would be greatly appreciated.
> >
> > <?
> > 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);
> > ?>
> > <SCRIPT language="JavaScript">
> > <!--hide
> > function newwindow()
> > {
> > window.open('cust_parts_notes.php','Notes','width=300,height=200,resizable=yes');
> >
> > }
> > //-->
> > </SCRIPT>
> > </body>
> > </html>
> >
> > The referenced page 'cust_parts_notes.php' only contains:
> >
> > <?
> > echo "$aster";
> > ?>
>
>
> window.open('cust_parts_notes.php?aster=<?print
> ($aster);?>','Notes','width=300,height=200,resizable=yes');
>
> echo $_GET['aster'];

Thanks, thats getting there. My variable $aster can be many things
depending on its location in the resulted table. With the code that you
suggested, it only echo's the last result in the table. I will have to
do a little tweaking. thanks again.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация