Jump to content

dgiberson

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by dgiberson

  1. on the one page have your checkboxes all named the same ie. do while (whatever) { echo "<input type=check value=$var name=\"chkActivity[]\">"; } now on your request page put in: $activities = $_POST['chkActivity'] all the selected boxes will return their values in an array.
  2. i have to echo chronister's comments, using unixtimestamps to do the work makes it much much easier to work with dates and times
  3. use $print_date = strftime('%Y-%m-%d', $today)
  4. the way i did this was using an unixtimstamp and then adding to it... $today = time(); // 1209600 = # of seconds in a two week period $twoweeks_date = $today + 1209600; this will give you the date range you need, there are other ways to do this.... and it all depends on how you want to display your calendar, but at least this way you have your start & ending points btw, you will see posts that this method doesn't totally account for daylight savings, blah blah blah... which is true. however most of the time this will be sufficient.
  5. you need to check the MIME type or $_FILES['type'] variable, create an array to hold the allowed types and then you can compare the upload against the array. there are additional checks you can perform, but this is the most basic. Here is a basic tutorial i found: http://php.about.com/od/advancedphp/ss/php_file_upload_2.htm Here is a link for MIME types: http://www.ltsw.se/knbase/internet/mime.htp
  6. echo "<table><tr><td>Angle</td><td>Sin(x)</td></tr>"; for ($i=0;$i<=360;$i++) { $d = deg2rad($i); $sin = sin($d); echo "<tr><td>$i</td><td>$sin</td></tr>"; } echo "</table>";
  7. hahaha, nice one jesirose.... was thinking that myself
  8. [quote]my table is called krankdcontacts and by saying select * from krankd contacts it should search for all fields with anything in it right??[/quote] This statement will return all rows where the name field is like the $name variable provided. It will not search all of the columns in the table for this variable.
  9. This should do it: [code] if ((!isset($_POST['name'])) && (!isset($_POST['target'])) && (!isset($_POST['Acutal']))) { // do something here } [/code]
  10. Question 1: make sure you have quotes around your data & that info is right for the column you are inserting. Question 2: looks like you are missing a space between the table name and the table definition.
  11. omg whats up with the varchars..... datatypes man! datatypes!
  12. try putting in an echo $query; then paste the line into phpMyAdmin or Query Browser, it will give you more information as to what is wrong vs. what php gives you..... PS did you misspell field on purpose or by accident? that could be your issue
  13. your problem is you are concatenating the variable not making an addition. $usrid = 0; This: $usrid = $usrid + "1"; Should be: $usrid = $usrid + 1; or $usrid++; Same thing goes for the cars.....
  14. is this in the same browser window or a new window?
  15. You'll need to find the page where $HTTP_COOKIE_VARS["admin_log"] is actually set from the login script.
  16. you might want to convert the two time vars into unix timestamps using mktime() function, then you can subtract the DOB from the current date, then use strftime() function to format the output. $unix_dob = mktime(0,0,0,$month,$day,$year); $today = time(); $diff = $today - $unix_dob; $age = strftime('%y-%j', $diff); would output something like 10 years - 122 days
  17. is the password set in the database? if so did you just type it in i.e. password = phpfreaks, so you see phpfreaks next to the username? search the login page for md5 and see if it is trying to compare the password you type using  a md5 hash..... if that is the case update the table (in phpMyAdmin or Query Browser) with something like: UPDATE users SET password = md5(phpfreaks) WHERE username = 'admin' now the password will look like a big jumble of numbers and letters.....
  18. save it, then open up with notepad/pspad whatever....
  19. <? $computer = $_POST['cboPC']; $q = "SELECT id, desc FROM table"; $result = mysql_query($q); $select = "<select name=cboPC>"; for ($i=0;$i<mysql_num_rows($result);$i++) {   if (mysql_result($result,$i,"id") == $computer) {   $select .= "<option value=".mysql_result($result,$i,"id")."selected>".mysql_result($result,$i,"desc")."</option>";      } else { $select .= "<option value=".mysql_result($result,$i,"id").">".mysql_result($result,$i,"desc")."</option>"; } } $select .= "</select>"; echo $select; ?>
  20. pull all the records required in one query to and put them into a multidimensional array, then loop through the array as necessary...
  21. Im not really sure what you are trying to get at with a "data file"..... do you mean separate text files, separate tables in mysql.... this can be handled all in a couple tables in mysql tblstudent_questions sqid - unique primary key userid - relates to the student table (their unique identifier in the system) quesDesc - text for the questions tblstudent_answers said - unique identifier to allow multiple answers to the same question sqid - foreign key relating to the questions table quesAnswer - their answer to the question datetime - optional to see when they entered the answer..... You would have to expand this out to four tables if you wanted predefined questions and answers.....
  22. $value = '<td>"' . $value . '"' . "<\td>"; should be $value = "<td>" . $value . "<\td>";
  23. will the students somehow be logging into this question / answer tool?
  24. [code]<?php $recNum = $_GET['rec_No']; $select = "SELECT * FROM clients where id=$recNum"; $export = mysql_query($select); $fields = mysql_num_fields($export); $header = "<table border=1><tr>"; for ($i = 0; $i < $fields; $i++) { $header .= "<td>".mysql_field_name($export, $i) . "<\td>"; } $header .= "</tr>"; while($row = mysql_fetch_row($export)) { $line = "<tr>"; foreach($row as $value) { if ((!isset($value)) OR ($value == "")) { $value = "<td>&nbsp;</td>"; } else { $value = str_replace('"', '""', $value); $value = '<td>"' . $value . '"' . "<\td>"; } $line .= $value; } $data .= trim($line)."</tr>"; } if ($data == "") { $data = "<tr><td colspan=$fields>(0) Records Found!<\td></tr>"; } $data .= "</table>"; header("Content-Disposition: attachment; filename=extraction.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n$data"; header("Content-type: application/x-msdownload"); require_once("footer.php"); mysql_close($conn); [/code] I think that should work.... if not its pretty close
  25. you might not be able to CHMOD, because of a CHOWNissue
×
×
  • 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.