You are here: populate a popup window using php and javascript « PHP Programming Language « IT news, forums, messages
populate a popup window using php and javascript

Posted by jsd219 on 10/17/07 15:04

Hi all, I know this is an elementary question but I am at a loss. I
have googled and searched but can not find the answer. My knowledge of
javascript is infant at best and php is novice. I have a database
driven site coded in php, on the 'display_trip.php' page the user sees
a list of possible trips and with dates. I would like to code it so
when the user clicks on one of the trips a popup window opens with the
value stored in the content field of the database for that particular
trip. I have figured out how to create a popup window for images but
not how to pass info from a query.

below are snippits of my code:

File Name: display_trip.php
------------------------------------------------------------------------------------------------------------
as you can see I am calling the content field in my query.

$query = "SELECT TRIP_ID, TRIP_TITLE, TRIP_THUMB, TRIP_CONTENT
FROM TRIPS
WHERE TRIP_ID != ''";
------------------------------------------------------------------------------------------------------------
$chref = "<a class=triplink href=\"javascript:OpenEvent('";
-----------------------------------------------------------------------------------------------------------
here is part of my echo statement to create the link:

"<td align=\"left\">" . "&nbsp;&nbsp;" . "{$chref}{$row['TRIP_ID']}')
\">" . "{$row['TRIP_TITLE']} " . "</td>" .
------------------------------------------------------------------------------------------------------------


File Name: header.php file
------------------------------------------------------------------------------------------------------------
here is my javascript function from my header.php

function OpenEvent(id)
{
window.open ('SOMETHING NEED TO GO HERE' + id, 'newwindow',
config='height=450, width=550, toolbar=no, menubar=no, scrollbars=no,
resizable=no, location=no, directories=no, status=no')
}
---------------------------------------------------------------------------------------------------------------
Any help would be greatly appreciated

God bless
jason

 

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

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