Jump to content

computer guy

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by computer guy

  1. etaRadio Ratings Dump – Current at 26/03/09<--The date That is the date. Thank you
  2. I have a 15" monitor so I dont think that is the problem. Im sorry but I didn't see "PHP help". Thank you for moving the thread.
  3. Thank you Sorry I couldn't find where 2 ask a help related question.
  4. Hi everyone, Is there a way that I can extract the following etaRadio Ratings Dump – Current at 26/03/09<--The date DJ Joelstar 14 12 14 15 18 21 16 20.17<--These eight numbers (seperate) and the DJ name From a string like this etaRadio Ratings Dump – Current at 26/03/09 DJ Joelstar 14 12 14 15 18 21 16 20.17 DJ Ant 0 0 0 0 0 0 0 0.00 DJ Jaxon 18 16 14 19 21 14 17 21.89 DJ Chuckmeister85 19 21 24 32 24 18 23 29.61 DJ Pat4life 21 20 24 28 21 18 22 28.33 DJ JessieB 0 0 0 0 0 0 0 0.00 Thank you
  5. http://74.52.122.114/~etaradio/ soon to be http://www.etaradio.com.au once the name servers propogate.
  6. Hi I have 2 fields in a mysql database. I need to make it so if a user searches for "john doe" it will search the 'firstname' field for "john" and 'lastname' field for "doe". It must only return 1 result. Except of course if there is more than 1 "john doe". Thank you
  7. Thank you both. However I decided to go with thorpe's method as He responded first and it uses up less coding realestate. Thank you
  8. Hi all, I need to split a phone number say 0232892357 into 02 3289 2357. How would I do this? Thank you
  9. Thank you that worked. Last time I put it in 1 form it screwed everything up. However this time it worked perfectly. Thank you :-)
  10. <?php require_once('../Connections/staffdb.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if($_POST['usrpass2'] == $_POST['usrpass']) { if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { print($_POST['usrfirst']); $insertSQL = sprintf("INSERT INTO tbl_staffinfo (firstname, lastname, picture, telephone, extension, mobile, facsimile, location, position, username, password, group) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['usrfirst'], "text"), GetSQLValueString($_POST['usrlast'], "text"), GetSQLValueString($_FILES['file']['name'], "text"), GetSQLValueString($_POST['usrphone'], "text"), GetSQLValueString($_POST['usrext'], "text"), GetSQLValueString($_POST['usrmobile'], "text"), GetSQLValueString($_POST['usrfacsimile'], "text"), GetSQLValueString($_POST['usrlocation'], "text"), GetSQLValueString($_POST['usrjob'], "text"), GetSQLValueString($_POST['usrname'], "text"), GetSQLValueString($_POST['usrpass'], "text"), GetSQLValueString($_POST['usrgroup'], "text")); mysql_select_db($database_staffdb, $staffdb); $Result1 = mysql_query($insertSQL, $staffdb) or die(mysql_error()); } if(isset($_POST['upload']) && $_FILES['file']['size'] > 0) { // ============== // Configuration // ============== $uploaddir = "staff"; // Where you want the files to upload to //Important: Make sure this folders permissions is 0777! $allowed_ext = "jpg"; // These are the allowed extensions of the files that are uploaded $max_size = "50000"; // 50000 is the same as 50kb $max_height = "135"; // This is in pixels - Leave this field empty if you don't want to upload images $max_width = "135"; // This is in pixels - Leave this field empty if you don't want to upload images // Check Entension $extension = pathinfo($_FILES['file']['name']); $extension = $extension[extension]; $allowed_paths = explode(", ", $allowed_ext); for($i = 0; $i < count($allowed_paths); $i++) { if ($allowed_paths[$i] == "$extension") { $ok = "1"; } // Check File Size if ($ok == "1") { if($_FILES['file']['size'] > $max_size) { print "File size is too big!"; exit; } // Check Height & Width if ($max_width && $max_height) { list($width, $height, $type, $w) = getimagesize($_FILES['file']['tmp_name']); if($width > $max_width || $height > $max_height) { print "File height and/or width are too big!"; exit; } } // The Upload Part if(is_uploaded_file($_FILES['file']['tmp_name'])) { move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']); } print "Your file has been uploaded successfully! Yay!"; } else { print "Incorrect file extension!"; } } } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/admin.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="HeadRegion" --><!-- InstanceEndEditable --> <script type="text/javascript"> var GB_ROOT_DIR = "/intranet/scripts/greybox/"; </script> <script type="text/javascript" src="../scripts/greybox/AJS.js"></script> <script type="text/javascript" src="../scripts/greybox/AJS_fx.js"></script> <script type="text/javascript" src="../scripts/greybox/gb_scripts.js"></script> <link href="../scripts/greybox/gb_styles.css" rel="stylesheet" type="text/css" /> <!-- CHANGE THE NEXT THREE LINES --> <title>Drop Menu Website Template</title> <META name="Description" content="Place your website description in this area. This is read by some search engines."> <META name="KeyWords" content="add, your, keywords and phrases in this area, separated, by, commas, this, is read by only a, few search, engines"> <!-- CHANGE THE ABOVE THREE LINES --> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META name="Copyright" content="Allwebco Design Corporation http://allwebcodesign.com/"> <link rel="StyleSheet" href="../style/common-style.css" type="text/css"> <link rel="StyleSheet" href="../style/gray.css" type="text/css"> <link rel="StyleSheet" href="../style/gray-menu.css" type="text/css"> <script language="JavaScript" type="text/javascript" src="../style/css.js"></script> <script language="JavaScript" type="text/javascript" src="../javascripts.js"></script> <script language="JavaScript" type="text/javascript" src="../pop-closeup.js"></script> <link href="../style/admin_style.css" rel="stylesheet" type="text/css" media="all"> </head> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <!-- OUTER PAGE TABLE--> <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="center" valign="top"> <script language="JavaScript" type="text/javascript" src="../scripts/header/header.js"></script> <script language="JavaScript" type="text/javascript" src="../scripts/menu/admin_menu.js"></script> <!-- SPLIT TABLE--> <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> <td align="left" valign="top" class="sidebar-background"> <!-- LEFT SIDEBAR AREA --> <iframe name="Sidebar" src="../scripts/sidebar/admin_sidebar.php" width="187" height="600" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" class="sidebar-frame"></iframe></td><td align="left" valign="top" width="40" class="pageheight"> <div id="cornerimage"> <img src="../images/spacer.gif" height="40" width="40" alt="image"><br> </div> <img src="../images/spacer.gif" height="200" width="10" border="0" alt="image"><br> </td><td align="center" valign="top" class="shadow-horizontal"> <br><br> <!-- START CONTENT TABLE --> <table cellpadding="5" cellspacing="0" border="0" width="100%"> <tr> <td width="100%" align="left" valign="top"><!-- InstanceBeginEditable name="EditRegion" --> <p id="ptitle">Add User</p> <SCRIPT LANGUAGE="javaScript" type="text/javascript"> function Submit() { document.form1.submit(); document.uploadform.submit(); } </SCRIPT> <form action="<?php echo $editFormAction ?>" method="post" name="form1" id="form1"> <input type="hidden" value="none" name="docdepName" id="docdep"/> <table cellpadding="0" border="0" cellspacing="0" id="tbluser"> <caption> Information </caption> <tr valign="baseline"> <th><label for="usrfirst">First Name:</label></th> <td><input type="text" id="usrfirst" name="usrfirst" value="" size="32" /></td> </tr> <tr valign="baseline"> <th><label for="usrlast">Last Name:</label></th> <td><input type="text" id="usrlast" name="usrlast" value="" size="32" /></td> </tr> <tr valign="baseline"> <th><label for="usrname">User Name:</label></th> <td><input type="text" id="usrname" name="usrname" value="" size="32" /></td> </tr> <tr valign="baseline"> <th><label for="docstatus">Password:</label></th> <td><input name="usrpass" type="password" id="usrpass" size="32" /></td> </tr> <tr valign="baseline"> <th><label for="doccat">Confirm Password:</label></th> <td><input name="usrpass2" type="password" id="usrpass2" size="32" /></td> </tr> <tr valign="baseline"> <th>User Group:</th> <td><select name="usrgroup" id="usrgroup"> <option value="user" selected>User</option> <option value="admin">Admin</option> </select> </td> </tr> <tr valign="baseline"> <th><label for="usrjob">Job Title:</label></th> <td><input name="usrjob" type="text" id="usrjob" size="32" /></td> </tr> <tr valign="baseline"> <th><label for="docdescr">Phone #:</label></th> <td><input name="usrphone" type="text" id="usrphone" size="32" /></td> </tr> <tr valign="baseline"> <th>Ext:</th> <td><input name="usrext" type="text" id="usrext" size="32" /></td> </tr> <tr valign="baseline"> <th>Mobile:</th> <td><input name="usrmobile" type="text" id="usrmobile" size="32" /></td> </tr> <tr valign="baseline"> <th>Fax:</th> <td><input name="usrfacsimile" type="text" id="usrfacsimile" size="32" /></td> </tr> <tr valign="baseline"> <th>Location:</th> <td><input name="usrlocation" type="text" id="usrlocation" size="32" /></td> </tr> </table> <br> <input type="hidden" name="MM_insert" value="form1" /> </form> <form action="" method="post" enctype="multipart/form-data" name="uploadform"> <table width="509" border="0" cellpadding="0" cellspacing="0" id="tblinsert"> <caption> Picture </caption> <tr> <th width="99">File:</th> <td width="409"><input type="file" name="file" size="30"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1" /> </form> <div id="error"> <table width='509' border='0' cellpadding='0' cellspacing='0' id='tblinsert'> <tr> <td width='99'><input name='Submit' type='button' id='button' onClick='Submit()' value='Add' /></td> <td width='414'> </td> </tr> </table> </div> <p> <a href="docs_list.php">Return to Document List</a></p> <!-- InstanceEndEditable --></td> <td align="center" valign="top" width="5"> <img src="../images/spacer.gif" width="5" height="5" alt="image"><br> </td><td align="right" valign="top"> <!-- RIGHT SIDEBAR AREA --> </td></tr></table> <!-- CONTENT TABLE --> </td></tr></table> <!-- SPLIT TABLE --> <!-- PAGE TABLE --> </td></tr><tr><td> <!-- BOTTOM PAGEBAR --> <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="printhide"><td class="pagebar-bottom"> <img src="../images/spacer.gif" width="10" height="1" alt="image"><br> </td></tr></table> <!-- PAGE TABLE --> </td></tr><tr><td class="shadow-horizontal"> <!-- COPYRIGHT --> <table cellpadding="6" cellspacing="0" border="0" width="100%"><tr><td align="left" valign="top"> <script language="JavaScript" type="text/javascript" src="../copyright.js"></script> </td><td align="right" valign="top"> <script language="JavaScript" type="text/javascript" src="../copyright-allwebco.js"></script> </td></tr></table> <!-- COPYRIGHT --> </td></tr></table> <!-- END OUTER PAGE TABLE --> </BODY> <!-- InstanceEnd --></HTML>
  11. I have it partially working using javascript to submit them at the same time. however the one that submits first refreshes the page and losses the other forms data.
  12. I have a page that has 10 form fields on them and 1 file input. I need the data from the 11 fields to go to a database. and the file to be uploaded. Of course the file field needs to be in a form with multi-part/form data turned on and the 10 form fields need cant be in this same form, I know this from experience. How can I submit them at the same time, so that I can do what I want with them. Thank you
  13. Thank you, Thank you, Thank you, Thank you, Thank you. That worked perfectly. You have made my day. Thank you.
  14. One last thing. How would I perform a for loop that searches a mysql database for each array entry. Then displays the 'title' field of each array entry in a table. Just the bare bones of the for loop is needed. I can do mysql and tables. Just not sure about arrays and doing multiple searches of mysql and displaying results. _______________________________________________________________________________ So basically the number i the array is an ID in a mysql field called 'dependencies'. I need to return the name of these dependencies from a mysql database and display them instead of the titles. _______________________________________________________________________________ So Database = ID:562167 Name:Name1Name2Name3 Array = $num[0]; //56 $num[1]; //21 $num[2]; //67 Display = Name:Name1Name2Name3 Thank you.
  15. Don't worry I solved it. I had ", " as the separator temporarily for testing purposes. All good. Thank you
  16. That returns the following: echo $num[0]; // 12, 56, 79, 35, 93, 22 echo $num[1]; // NULL echo $num[2]; // NULL Thank you
  17. Thank you wildteen88 Will try that in the morning and see how I go.
  18. I have a variable with several numbers in it, separated with a "." Is there a way to put these into separate variables. e.g get "12.56.79.35.93.22" and turn it into. "var1 = 12" "var2 = 56" "var3 = 79" "var4 = 35" and so on. Something like for variable contains "." retrieve number and set another variable. Thank you
×
×
  • 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.