Jump to content

Incorporating DHTML Popup Window into my PHP Script


tmharrison

Recommended Posts

I have downloaded the following script from http://www.php-development.ru/javascripts/popup.php

 

It is a wonderful free popup window really great!

 

I would like to some how incorporate it into my php script at the end were i have  a couple of echo javascript statements right now.

 

I there are quite a few options that you can decide on, and only one of them is what i wanted and it is at the 'mouse-corner'

 

anyway below is the code from the there sample html page

<!DOCTYPE html PUBLIC
          "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>

<link rel="stylesheet" type="text/css" href="sample.css" />

<script type="text/javascript" src="popup.js">
</script>

</head>
<body>

<h3>DHTML Popup Window</h3>

<form>

<input type="button" value="Corner"
       onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-corner', 10, 10);" />
<input type="button" value="Center"
       onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-center', 10, 10);" />
<input type="button" value="Mouse"
       onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'mouse-corner', -10, -10);" />
<input type="button" value="Right"  id="pos_right"
       onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'element-right' , 10, 0, 'pos_right');" />
<input type="button" value="Bottom" id="pos_bottom"
       onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'element-bottom', 0, 10, 'pos_bottom');" />
<input type="button" value="Default"
       onclick="popup_show('popup', 'popup_drag', 'popup_exit');" />
</form>

<br />
<br />
<div style="font-stile: Arial, Sans-Serif; font-size: 75%;">
<a href="http://www.hotscripts.com/Detailed/62154.html">Vote</a> for the script.
<br />
Web scripts <a href="http://www.php-development.ru/products/collection/">collection</a>.

</div>

<div class="sample_popup"     id="popup" style="visibility: hidden; display: none;">
<div class="menu_form_header" id="popup_drag">
<img class="menu_form_exit"   id="popup_exit" src="form_exit.png" />
   Login
</div>
<div class="menu_form_body">
<form method="post" action="popup.php">
<table>
<tr>
  <th>Username:</th>
  <td><input class="field" type="text" onfocus="select();" /></td>
</tr>

<tr>
  <th>Password:</th>
  <td><input class="field" type="password" onfocus="select();" /></td>
</tr>
<tr>
  <th> </th>
  <td><input class="btn" type="submit" value="Submit" /></td>
</tr>
</table>
</form>
</div>
</div>

</div>

</body>
</html>

 

anyway then here is my existing php code, you will see at the bottom there are two echo statements i would like to use this other javascript if i can figure out how to script just what i was needing and be able to put it in.

 

<?php
ob_start();
if (!empty($_POST['id_num'])) {

require_once ('/home/virttcom/public_html/VHDdb/mysql_connect.php');

// Clean the $_POST['id_num'] to avoid sql injection
if(get_magic_quotes_gpc()) {
	$_POST['id_num'] = stripslashes($_POST['id_num']);
}
$_POST['id_num'] = mysql_real_escape_string($_POST['id_num']);

$q = "SELECT url FROM Tours WHERE id_num='{$_POST['id_num']}'";

$get_url = mysql_query($q) or die("There was a problem with the query: $q" . mysql_error());

if (mysql_num_rows($get_url) > 0) {
	$rw = mysql_fetch_assoc($get_url);
	$url = $rw['url'];

	// Redirect the user
	header("location:$url");
} else {
		echo "<script language=\"javascript\"> alert('Not Found - Contact to find out how to get setup'); </script>"; 
}
} else {
	echo "<script language=\"javascript\"> alert('You didn\'t submit anything!'); </script>"; 
}
ob_end_flush();
?>

 

Thanks for all your help!

 

Tina

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.