Jump to content

wisewood

Members
  • Posts

    226
  • Joined

  • Last visited

    Never

Everything posted by wisewood

  1. The email address has been used to register for receiving email exam results next week. Too late to change the email address with the exam people, so needs to be set up and in place as soon as possible just so she can read the emails.
  2. She uses an email account that i set up for her on my domain, no webmail access to her account only, the webmail logs into the master account. Can i have some help now please lol I have managed to figure out enough of the IMAP stuff to get a connection established, listing the emails in the inbox, with a link to a page to display the content of the message - but i cant get my head around the imap_body / imap_fetchbody to display the message. I have passed the UID from one page to another ($_GET[uid]) and that variable passes over properly - and have used imap_msgno to convert it into the message number, but still need to figure out how to display the message content.
  3. I'm after a quick and easy way to read the content of a pop3 mailbox. I don't need anything fancy, just a way to list the date/sender/title, and then when selected, display the content of the message. I'd also like the mail to remain on the server to be downloaded properly into a mail client later. It doesnt even need to be capable of sending email at the moment - just reading it. It's so that a friend of mine can check her email online to find out her exam result next week while on holiday. Thanks.
  4. SOLVED.  Just realised i asked before reading the manual :D
  5. Hi all, Can anyone point me in the right direction of a method to list the names of mySQL databases on localhost. Thanks.
  6. first you need to make sure you can echo the results of your query onto the page. Once you have that right, you will be able to do what you want.
  7. // relational_table id SoftwareID ComputerID "select * from relational_table where SoftwareID = 7" This will give you all the computer id's which have the software installed which has a softwareID of 7. If you wanted to know what was installed on a particular computer you could then do this; "select * from relational_table where ComputerID = 3" So you end up with the SoftwareID's of all the software installed onto computer number 3. Hope this makes sense.
  8. Create a mysql (or other) database with a simple table in it, something like this id - Integer (primary key) day - text month - text year - text file - text Each time a visitor loads your page, have it query the database table to see if there is an entry for todays day month and year. if there is, display the file specified in the database, otherwise select one at random, and insert the name of it into the database to be found by the next user.
  9. I've got a calendar script that i picked up online somewhere, it is a really basic calendar, but its got loads of complicated code in it, and the maths really messed with my head for a while. I would say, without comparing the code, that you are probably heading along the right lines.
  10. Should get you started. <?php if!($_POST) { echo "<form method=post action=$PHP_SELF"; echo "<input type=text name=cd_key>"; echo "<input type=submit value=submit"; echo "</form"; } else { echo "The cd_key you input was: $_POST[cd_key]"; } ?>
  11. I've had problems in the past similar to this, and often the area where it tells you to look for the problem is wrong when its an unexpected }. You'd need to examine all of your code carefully and check to see if you've got any un-necessary or out of place.
  12. you should have this: $id = $row['id']; Although that wont work because you havent set the $row[] array anywhere. What you should do is ditch the whole $id = row['id']; and leave it out, as you have already specified the $id variable above.
  13. use the strlen() function to determin how many characters are in your $count variable... and append the correct number of 0's to the $count variable afterwards. ie. $count_len = strlen($count); if($count_len==1){$zero="000";} if($count_len==2){$zero="00";} if($count_len==3){$zero="0";} if($count_len==4){$zero="";} echo "filename$zero$count.jpg";
  14. in very basic terms, as i'm a bit pressed for time. have your html form processed by a php script which compares the username and password to records in the database, if there is a match for that username and password combination, set the session variable for the username to the same as the username they input onto the form. eg. $_SESSION[username] = $_POST[username]; Once this is done, you just add something like this to the pages you want to make available only to people who are logged in. if(!$_SESSION[username]) { echo "You're an imposter!!!"; } else { // Your page code here } That will give you a simple login system. You can fill it out later with authorisation levels and stuff so you can show some content to "admin" and less to "users" etc.
  15. I have a string, which for example, might be this; $string = "The quick brown fox jumped over the lazy dog"; I want a way to count, for example, how many times the letter "o" appears in that string. Can someone nidge me in the right direction... my brain isnt working today. SOLVED. Engaged my brain and used the substr_count() function.
  16. use the mkdir("/directory_name") function before you create the html file, and then you can set the filename of the file you make with the /directory_name/ on the begining.
  17. <input type="text" value="<?php echo $ACCOUNT_NO ?>">
  18. This should not really be in the php help forum.
  19. COUNT_RECURSIVE is an optional component of the count() function. if you were to use count($mess) and mess contained two arrays, the result would be 2. However, by using count($mess, COUNT_RECURSIVE) you end up with it counting the contents of the $mess array, as well as the contents of any arrays stored within mess. To be honest, in this case, i dont think its required, but i used it anyway.
  20. much better & simpler way of doing it. Thats kinda the whole point of having the database there. Database & one php file size is nothing in comparison to databse, php file AND several hundred html files containing data stored in the database anyway.
  21. // Your message that you want to check for illegal characters/words. // $_POST[message] for example $message = "Your message here probably from a from on the previous page"; // Your array of things that you do not want added to the database $mess=array("@", "*", "$", "'", "{", "}", "<br>", "mysql", "connect", "</br>", "password", "money", "scam", ".", "com", "net", "uk"); // For each of the values in the $mess array, set it as $val and check if it exists in the $message variable. // If it does not exist, add 1 to the $count variable. foreach($mess as $val) { $invalid = strpos($message, $val); if($invalid===FALSE) { $count++; } } // Count the number of words/characters that are in the array $array_count = count($mess, COUNT_RECURSIVE); // If the $count variable is the same as the $array_count variable, there are no illegal characters if($count==$array_count) { echo "Contains no illegal characters";} // if the $count and $array_count variables do not match, there must be at least one illegal character in the $message variable. else { echo "Your message contains illegal words / characters"; } ?>
  22. When you get the script that i've emailed to you, you want to have that done after the database stuff. Insert the info into your database, then query the database straight away and get the id of the last entry. then just include that id into the part of the script i sent you that names the file you're creating. Second part... if you want to use reports.php?id=2 as the page name to load the html documents, you'd be better off not using html at all. Create reports.php to the layout etc that you want, and select your info from the database as follows SELECT * FROM reports WHERE report_id = $_GET[id] Obviously replacing reports with your table name, and report_id with the name of the field that you auto-increment.
  23. email sent. No pm notification ever appeared.
  24. <?php // only problem with this is that the word "coming" (for example) contains com, which is not allowed in your list. // to get around this, put a space either side of com, filter for .com instead. $message = "Your message here probably from a from on the previous page"; $mess=array("@", "*", "$", "'", "{", "}", "<br>", "mysql", "connect", "</br>", "password", "money", "scam", ".", "com", "net", "uk"); foreach($mess as $val) { $invalid = strpos($message, $val); if($invalid===FALSE) { $count++; } } $array_count = count($mess, COUNT_RECURSIVE); if($count==$array_count) { echo "Contains no illegal characters";} else { echo "Your message contains illegal words / characters"; } ?>
  25. another alternative would be to get the referring page to find out which page they came from.
×
×
  • 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.