shebbycs Posted December 31, 2011 Share Posted December 31, 2011 <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:chatframe2.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("cute") or die(mysql_error()); $message=$_POST['message']; $a=$_SESSION['username']; if(isset($_POST['submit'])) //if submit button push has been detected { if(strlen($message)>1) { $message=strip_tags($message); $IP=$_SERVER["REMOTE_ADDR"]; //grabs poster's IP $checkforbanned="SELECT IP from ipbans where IP='$IP'"; $checkforbanned2=mysql_query($checkforbanned) or die("Could not check for banned IPS"); if(mysql_num_rows($checkforbanned2)>0) //IP is in the banned list { print "You IP is banned from posting."; } else { $thedate = date("U"); //grab date and time of the post $insertmessage="INSERT into chatmessages (name,IP,postime,message) values('$a','$IP','$thedate','$message')"; mysql_query($insertmessage) or die("Could not insert message"); } } } ?> <html> <head> <script type="text/javascript"> function addsmiley(code) { var pretext = document.smile.message.value; this.code = code; document.smile.message.value = pretext + code; } function a() { var x = document.smile.message.value; if(x=="") { alert("Please insert an message!"); return false; } } </script> <style type="text/css"> body{ background-color: #d8da3d } </style> </head> <body> <center> <form name="smile" method="post" action="form2.php" onSubmit="return a()" > Your message:                          <a style="text-decoration:none" <a href="javascript: void(0)" onclick="window.open('banip.php', 'windowname2', 'width=400, \ height=150, \ directories=no, \ location=no, \ menubar=no, \ resizable=no, \ scrollbars=1, \ status=no, \ toolbar=no'); return false;">Action</a>            <a style="text-decoration:none" href="logout.php">Sign Out</a><br><textarea name='message' cols='40' rows='2'></textarea><br> <img src="smile.gif" alt="" onClick="addsmiley('')" style="cursor:pointer;border:0" /> <img src="p.gif" alt="" onClick="addsmiley('')" style="cursor:pointer;border:0" /> <img src="lol.gif" alt="*lol*" onClick="addsmiley('*lol*')" style="cursor:pointer;border:0" /> <img src="blush.gif" alt="*blush*" onClick="addsmiley('*blush*')" style="cursor:pointer;border:0" /> <img src="angry.gif" alt=":@" onClick="addsmiley(':@')" style="cursor:pointer;border:0" />                                             <input type='submit' name='submit' value='Send' class='biasa' ></form> <br> <br> </center> </body> </html> im using window.open to pop up it but it will pop up to the left most top so how can i do to pop up the right top? Quote Link to comment https://forums.phpfreaks.com/topic/254107-how-to-make-the-window-popup-to-the-top-right/ Share on other sites More sharing options...
AyKay47 Posted December 31, 2011 Share Posted December 31, 2011 Use the "left" attribute of this method. Quote Link to comment https://forums.phpfreaks.com/topic/254107-how-to-make-the-window-popup-to-the-top-right/#findComment-1302754 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.