Jump to content

realjumper

Members
  • Posts

    399
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

realjumper's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. What about using double quote....I do. echo $_COOKIE["kbsMemID"]; echo $_COOKIE["kbsLoginName"]; echo $_COOKIE["kbsPassword"];
  2. Yep, mod_rewrite might be an option, but I like Corbins suggestion too. Don't want to use .htaccess. Thanks for your help
  3. Thanks Corbin, that's more or less what I was thinking I would have to do. Many thanks
  4. Hi, My website has a secure login section via ssl. None of the subsequent php pages can be accessed with being logged in, which is as intended. But, documents, such as pdf files etc, can be accessed directly via the url if you know the url (obviously!). How do I protect these files to prevent people from accessing them without logging in first?
  5. Hi, I retrieve and echo my searched data via a while loop. The data is for students details. Each row of the generated html table shows the students username, first name, last name, email, campus, status, and a checkbox to delete the account. The 'status' is a drop down to show the current status of each student, like for example, 'Graduated', 'Left', 'Expelled' etc etc. If the status of a student has changed, the new status can be selected from the drop down and the page refreshes with the new status and the DB is updated. This is all good. The delete account checkbox in each html row is to delete the account...obviously. One or more checkboxes can be checked, and upon clicking the 'Delete Account(s) button, the selected accounts are deleted, and the page refreshes and the DB is updated. This is all good too :-) If the user doesn't enter any details into the search text area, then it will retrieve all students, and sometimes this is useful because several students account details may need updating at the same time, so instead of searching student by student, they all appear on the one page. Now, if (say) a student account is either changed status or deleted, the page refreshes and the DB gets updated, and the page obviously loads from the top again. It would be nice to have the page reload in the same position again. I know that an internal html anchor will do this and I'm guessing that I could name each row, for example, row 1, row 2, row 3 etc etc, and then via the 'GET' method I should be able to reload the page in the same position it was before. The question is, can I have something like that done by the same loop I am using to retrieve the data. Here is a cut-down version of my code: while($row2 = mysql_fetch_array( $result2 )) { $first_name = stripslashes($row2[first_name]); $last_name = stripslashes($row2[last_name]); if ($row99[student_staff] == 'staff') { echo "<tr style=\"font-size:12px;text-align:left;\" bgcolor=\"#ffffff\">"; echo "<td><a href=\"edit.php?sid=$row2[sid]\">$row2[sid]</a> </td>"; echo "<td>$first_name </td>"; echo "<td>$last_name </td>"; echo "<td>$row2[email] </td>"; echo "<td>$row2[campus] </td>"; echo "<td align=\"center\">"; echo "<select name=\"menu1\" onChange=\"MM_jumpMenu('parent',this,0)\">"; echo "<option value=\"searchit.php?find=$find&sid=$row2[sid]&update=yes&status=$row2[status]\">$row2[status]</option>"; // Retrieve all the data from the table $result888 = mysql_query("SELECT DISTINCT status FROM status Order BY status") or die(mysql_error()); while($row888 = mysql_fetch_array( $result888 )) { echo "<option value=\"searchit.php?find=$find&sid=$row999[sid]&update=yes&status=$row888[status]\">$row888[status]</option>"; } echo "</select>"; echo "</td>"; Essentially I am asking if it is possible to include (in laymans terms) something like this, and if so, how? If not, what are my choices? I thought of Ajax but I'm not at the level sadly. $num = '1'; while($row2 = mysql_fetch_array( $result2 ) && $num <1000 ) { $num = $num + '1'; echo "<td>$first_name <a name=$num></a></td>" } The above code is obviously a shortened version, but I hope you understand what I'm trying to do!!
  6. Hi, My little application is for staff to purchase stationary from the stationary officer....each staff member is allowed $20 per month for basic stationary like white board markers, staples etc etc etc. I have created a shopping cart and the application works well, however, the staff member, once they have 'checked out' needs to go to the stationary officer to pick up the goods. To make life easy for the staff member, and to keep a paper record of purchases, I would like a PDF of the purchase to be emailed to the purchaser which he/she would then take to the stationary officer and swap for the goods. Just like a e-ticket for an airline booking for example. As I said, the shopping cart is working fine. I can send emails, no problem. I can create a PDF on the fly with the purchaser could view by clicking a link as well. What I can't do, and I can't find out how to, is to create the PDF and download it to a temporary directory on the server (I guess), then attach it to an email. Can anyone point me in the right direction please?
  7. I would make a table join - http://www.tizag.com/mysqlTutorial/mysqljoins.php
  8. Okay, well....I see you have renamed 'letter' to 'Message', and 'message' is already part of the mail function. Just trying out different things, what do you have to lose?
  9. So it is...sorry. Personally I would do it like this, but I don't know if this will help you. <?php $letter = mysql_real_escape_string(stripslashes(nl2br(strip_tags($_POST['letter'])))); // Send the email. $subject = "Login Infomation Desk"; $headers = 'From: Server'; $message = "A username ".$Username." has requested help !\r \r ~------------------~ \r \r"; $message = $message. "Their message is: \r \r ".$letter." \r \r ~------------------~ \r \r"; $message = $message. " \r Username is: ".$Username." \r"; $message = $message. " \r Email is: ".$Email; mail('myemail here', $subject, $message, $headers); ?>
  10. Have a look here: http://www.tizag.com/phpT/phpsessions.php
  11. What happens if you do this: <?php $query = "SELECT * FROM `books` order by `ncode` ASC "; $result = mysql_query($query); while( $row = mysql_fetch_array($result) ) { echo "Book: $row[bname]<br>"; } ?>
×
×
  • 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.