PDA

View Full Version : help with a pop-up and database connection


Joe Pimms
02-07-2005, 08:36 AM
i have a java script that will do a pop-up for a new window and i started doin a view.php file so when a user selects an item a pop-up will show with all the contents my problem is im haveing problems with making the php file to do that

look at ss1 image this is the code i have:
<td class='alt2' align='center' width='1%'><a href=\"view.php?$session[sessionurl]serialid=$row[serialid]\"><img src='info.gif' alt='view!' border='0' /></a></td>

and here is the java script :
function d(id){
window.open('view.php?'+id,'Operate','toolbar=0,lo cation=0,directories=0,status=0,menubar=0,scrollba rs=1,resizable=0,width=570,height=300');
}

now in the template code there is this :
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $pagetitle</title>
<script src="./sys.js"></script>
$headinclude
</head>
<body>
$header
$navbar
{$_page}
<br />
and in the section part of the template there is this:

{$pagenav}
<br/>
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan='5'>
<a style="float:right" href="#top" onclick="return toggle_collapse('forumhome_attatch')"><img id="collapseimg_forumhome_attatch" src="$stylevar[imgdir_button]/collapse_tcat.gif" alt="" border="0" /></a>
<div align='center'>items</div></td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_attatch" style="{$vbcollapse['collapseobj_forumhome_attatch']}">

<tr>
<td class='thead' align='center'>App Name</td>
<td class='thead' align='center'>Uploaded By</td>
<td class='thead' align='center'>View Now</td>
</tr>

$views_now

</tbody>
</table>
<br />
{$pagenav}

now look at ss2 this is the template code :
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
</head>
<body>
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat" colspan="2">$vbphrase[items_for]$item</td>
</tr>
</thead>
<td class="alt1">$vbphrase[item_number]$itemnum</td>
</tr>
</table>

<div align="center"> <br>
<input type=submit name=sbm value=Close onClick=window.close()>
</span><br>

</div>
</body>
</html>
please help me im needing help with the database and the view.php file to work

Joe Pimms
02-12-2005, 05:46 PM
can i get a little help plz

Jolten
02-12-2005, 07:20 PM
<td class='alt2' align='center' width='1%'><a href="view.php?$session[sessionurl]serialid=$row[serialid]\"><img src='info.gif' alt='view!' border='0' /></a></td>


There's no reference to your javascript function there. Javascript won't work unless you call it.

link should be...


<a href="javascript: d($row=[serialid]"><img src='info.gif' alt='view!' border='0' /></a>



Since your javascript handles the file name you do not need that in the anchor. What you need is to tell the link to call the javascript and the id number in perenthesis.

You may need to make $row=[serialid] into a singular variable in your php file. i.e. $idnum = $row['serialid']; then use <a href="javascript: d($idnum)"> for the link.

This is all untested.

Joe Pimms
02-13-2005, 02:41 AM
can any one else help me plz

Jolten
02-13-2005, 03:03 AM
My answer wasn't good enough?

noppid
02-13-2005, 03:10 AM
My answer wasn't good enough?

Well you are using that 4.2.6 code, so you must be doing it different.