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

Posted by Jerry Stuckle on 10/17/07 20:47

jsd219 wrote:
> On Oct 17, 10:56 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> jsd219 wrote:
>>> 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
>> You can't do it in PHP itself. You need Javascript or Ajax (which uses
>> javascript).
>>
>> Try comp.lang.javascript.
>>
>
> I have also posted this in comp.lang.javascript. I chose to post here
> as well because I am using php with javascript.
>
>

Then:

1. Cross-post, don't multi-pose.
2. So then, what's your PHP question?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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