...

View Full Version : Positioning the window



spanish_steps
06-06-2003, 06:00 PM
Hello everybody,

I display records on a page from a table using PHP and theres a link called "Contact the person"When i click on this link, i want to open a new page and this page has to be centered on the window.This code is working fine in another application of mine but does'nt seem to work here.Could somebody please tell me why this does'nt work.

Thanks in advance

On the first page i've this code:


echo"<tr>";
echo"<td width='50%'><a href='contactform.html' target='_blank'>Contact the Person</a>";
echo"</tr>";


and now when i click on contact the person, the page contactform.html opens and here is the code for that.


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Contact Page</title>

<script type="text/javascript">

function openWindow(theURL,winName,features, myWidth, myHeight, isCenter) {
if(window.screen)if(isCenter)if(isCenter=="true"){
var myLeft = (screen.width-myWidth)/2;
var myTop = (screen.height-myHeight)/2;
features+=(features!='')?',':'';
features+=',left='+myLeft+',top='+myTop;
}
window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

</script>
</head>

<body bgcolor="#FFFFCC">

<table border="1" width="100%">
<tr>
<td width="50%">Your name</td>
<td width="50%">
<p><input type="text" name="T1" size="20"></p>
</td>
</tr>
<tr>
<td width="50%">Your text</td>
<td width="50%"><input type="text" name="T2" size="20"></td>
</tr>
<tr>
<td width="50%">Your description</td>
<td width="50%">
<p><textarea rows="2" name="S1" cols="20"></textarea></p>

</td>
</tr>
</table>

<table border="1" width="100%">
<tr>
<td width="100%"><input type="submit" name="submit" value="enter"></td>
</tr>
</table>

</body>

</html>

chrismiceli
06-06-2003, 07:32 PM
http://www.codingforums.com/showthread.php?threadid=11091&highlight=center

look in there and ignore my code.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum