tmharrison Posted February 7, 2007 Share Posted February 7, 2007 Ok, everything is totally fine! Just perfect as a matter of fact I have been trying to get a javascript to be attached to the last couple of echo statements. what i was looking for was something like this: <!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> <div style="font-stile: Arial, Sans-Serif; font-size: 75%;"> Vote for the script. Web scripts collection. </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> _______________________________________________________________________________________________________________ except i don't want the "login or username or password" and i only want to use the input type of "mouse". I thought this was going to be easy, but i can't seem to break it apart to attach it to my php script which is listed below: <?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(); ?> ______________________________________________________________________________________________________________________ i don't see genericnumber1 online this evening as of yet, so i thought i would post it anyway, on the off chance maybe someone else would like to take a stab at this in the mean time. Thanks so much! Tina Link to comment https://forums.phpfreaks.com/topic/37388-help-with-incorporating-parts-of-javascript-to-php-file/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.