|
Posted by Jerry Stuckle on 10/17/07 15:56
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\">" . " " . "{$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.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|