codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Using php vars in javascript function  dcjones at 15:04 on Thursday, August 25, 2005
 

Hi all,

I am new to this so please be kind.

I have a buuton link on a page:

<a href=location_map.php?lat=<?php echo $row_accomm_counties['lat']; ?>&lon=<?php echo $row_accomm_counties['lon']; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('location_map','','../images/map_ov.gif',1)"><img src="/images/map_up.gif" alt="Location map" name="location_map" width="23" height="23" border="0"></a>

Embedded in the link are 2 PHP variables:
<?php echo $row_accomm_counties['lat']; ?>
<?php echo $row_accomm_counties['lon']; ?>

On the same page I have:

<script language="JavaScript" type="text/JavaScript">
<!--
function location_map()
{
window.open("/forum/location_map.html","location_map","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=375,top=250,left=300");
}
//-->
</script>

What I am trying to do is when the button is clicked, call the function and execute it so it calls:

location_map.php?lat=<?php echo $row_accomm_counties['lat']; ?>&lon=<?php echo $row_accomm_counties['lon']; ?>

Append the php variables to the name of the called page.

Can anyone please try and help me.

Many thanks in advance, keep safe and well.

Dereck








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Why Use Method?
•  Re: Help with filesystem object & displaying in a table
•  Re: Genetic Algorithm Help
•  Re: How to make an investment calculator
•  Re: line breaks in GUI
•  Re: Graph in Gui...
•  Graph in Gui...
•  Re: Counting zero values in a string
•  Re: Help!


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005