[Js] Popup functie.. (Opgelost)
8 antwoorden
Gesponsorde links
Stijn - 07/12/2007 15:53
PHP expert
Als je het goed gedaan hebt zou het moeten werken. Wat lukt er niet? Opent de popup niet of is het een php fout?
Als de popup niet opend is er iets mis met de <a href onclick> dinges van projects.php of is de functie niet ingeladen.
Simax - 07/12/2007 15:54 (laatste wijziging 07/12/2007 16:44)
Onbekend
De popup word niet geopend..
Zou je kunnen uitleggen waar wat moet staan?
index.php
<?php
require("connect.php");
session_start();
?>
<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<?php
require ( "connect.php" ) ;
?>
<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
functions.js
<script language="javascript" type="text/javascript">
function project_details()
{
window.open("project_details.php","Project Details",
"tooldbar=no, location=no, width=400, height=400")
}
</script>
< script language= "javascript" type= "text/javascript" >
function project_details( )
{
window.open ( "project_details.php" , "Project Details" ,
"tooldbar=no, location=no, width=400, height=400" )
}
</ script>
projects.php
<table>
<?php
$query = mysql_query("SELECT * FROM projects ORDER BY pr_id")
or die(mysql_error());
$count = mysql_num_rows($query);
if($count != 0)
{
while($result = mysql_fetch_array($query))
{
?>
<tr>
<td><a href="???"></a></td>
</tr>
<?php
}
}
else
{
print("<p class=\"error\">Geen projecten gevonden.</p>");
}
?>
</table>
<table>
<?php
$query = mysql_query ( "SELECT * FROM projects ORDER BY pr_id" ) if ( $count != 0 )
{
{
?>
<tr>
<td><a href="???"></a></td>
</tr>
<?php
}
}
else
{
print ( "<p class=\" error\" >Geen projecten gevonden.</p>" ) ; }
?>
</table>
Giant - 07/12/2007 17:22
PHP beginner
je moet functions.js ook laden op je index...
Stijn - 07/12/2007 19:18
PHP expert
index.php
<?php
require("connect.php");
session_start();
?>
<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="./functions.js"></script>
</head>
<?php
require ( "connect.php" ) ;
?>
<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="./functions.js"></script>
</head>
projects.php
<table>
<?php
$query = mysql_query("SELECT * FROM projects ORDER BY pr_id")
or die(mysql_error());
$count = mysql_num_rows($query);
if($count != 0)
{
while($result = mysql_fetch_array($query))
{
?>
<tr>
<td><a href="javascript:;" onclick="popup('project_details?projectID=<?php echo $result['id']; ?>');"></a></td>
</tr>
<?php
}
}
else
{
print("<p class=\"error\">Geen projecten gevonden.</p>");
}
?>
</table>
<table>
<?php
$query = mysql_query ( "SELECT * FROM projects ORDER BY pr_id" ) if ( $count != 0 )
{
{
?>
<tr>
<td><a href="javascript:;" onclick="popup('project_details?projectID=
<?php echo $result [ 'id' ] ; ?> ');"></a></td>
</tr>
<?php
}
}
else
{
print ( "<p class=\" error\" >Geen projecten gevonden.</p>" ) ; }
?>
</table>
Giant - 07/12/2007 19:24 (laatste wijziging 07/12/2007 19:27)
PHP beginner
@stijn,
popup('project_details?projectID=<?php echo $result['id']; ?>');
moet dat niet
popup('project_details.php?projectID=<?php echo $result['id']; ?>');
worden?
edit
<script language="javascript" type="text/javascript">
function project_details()
{
window.open("project_details.php","Project Details",
"tooldbar=no, location=no, width=400, height=400")
}
</script>
< script language= "javascript" type= "text/javascript" >
function project_details( )
{
window.open ( "project_details.php" , "Project Details" ,
"tooldbar=no, location=no, width=400, height=400" )
}
</ script>
kun je beter:
<script language="javascript" type="text/javascript">
function project_details(url)
{
window.open(url,"Project Details",
"tooldbar=no, location=no, width=400, height=400")
}
</script>
< script language= "javascript" type= "text/javascript" >
function project_details( url)
{
window.open ( url, "Project Details" ,
"tooldbar=no, location=no, width=400, height=400" )
}
</ script>
van maken
Simax - 09/12/2007 01:11 (laatste wijziging 09/12/2007 13:26)
Onbekend
@Giant,
Waarom zou je da doen?
Edit
Krijg geen resultaat in beeld.
Alle paginas worden zonder inhoud(blank) weergegeven.
Giant - 09/12/2007 09:40 (laatste wijziging 09/12/2007 09:54)
PHP beginner
simax, dat is beter omdat je nu alleen de pagina project_details.php weergeeft in de pop-up
zodra je er:
<script language="javascript" type="text/javascript">
function project_details(url)
{
window.open(url,"Project Details",
"tooldbar=no, location=no, width=400, height=400")
}
</script>
< script language= "javascript" type= "text/javascript" >
function project_details( url)
{
window.open ( url, "Project Details" ,
"tooldbar=no, location=no, width=400, height=400" )
}
</ script>
van maakt, zal die de pagina die je bij het aanroepen meegeeft,
bijv.:
<a href="javascript:;" onclick="popup('project_details.php?projectID=<?php echo $result['id']; ?>');"></a>
<a href = "javascript:;" onclick = "popup('project_details.php?projectID=<?php echo $result['id']; ?> ');">
</ a >
zal de pagina project_details.php?projectID=<?php echo $result['id']; ?> weergeven.
Gesponsorde links
Dit onderwerp is gesloten .