Jump to content

wardo

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.realdesignnetwork.com

Profile Information

  • Gender
    Not Telling

wardo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have the following code which works fine apart from the format not coming through in HTML format. Can anyone see how I can make the email come through in html format? [code] $to = $_GET["email"]; $subject = "Online booking"; $message = stripslashes($message); $message = str_replace("\n","<p>",$message); $message = "<b>Booking Information:</b><p />Employee No:<br /><b>$eno</b> <p />Name:<br /> <b>$name</b><p />Title:<br /><b>$title</b><p />Base:<br /> <b>$base</b><p />Telephone No:<br /> <b>$tel</b><p />Course code and Date:<br /><b>$code</b><p />Title:<br /><b>$ctitle</b><p />"; $from="From: andyward1@hotmail.com"; // To send HTML mail, the Content-type header must be set $headers  = 'MIME-Version: 1.0' . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; mail($to,$subject,$message,$from,$headers); echo "<p /><h4>Thank you. Your message has been sent.</h4>";[/code] Thanks for your help.
  2. A better way to do it would be: You would have a table in one of your databases called users for example which stores the username and password. Your log in page would check this database for the username and password that the user enters. If it does not match then a message is displayed telling them so. If the log in is successful a cookie could be set and you could check on either site if the cookie is present to control access. You would only need one log in page which sets a cookie and you could then check for that cookie on either site. Hope this makes sense.
  3. You could store the log in table on either database and when you have checked for a successful log in in your script you could just include a different connection to the database as required.
  4. I have tried simplifying the query and using ANDs but it does not work how I want. I now have: $sql = "SELECT name, title, id,reviewdate,date FROM upload WHERE (department = '$listname' AND name LIKE '%$name%') OR (department = '$listname' OR name LIKE '%$name%')ORDER by title asc"; This gives the same results as before. Is there a way to modify the statement to do what I need or should I use php if statements to determine which sql statement to run under different circumstances? Thanks.
  5. I have the follwoing query that returns the results from a database if any of the search fields (department,name,title,color, classification) are filled in: [code]$sql = "SELECT name, title, id,reviewdate,date FROM upload WHERE (department = '$listname' OR name LIKE '%$name%' OR title LIKE '%$name%' OR colour LIKE '%$colour%' OR classification LIKE '%$classification%') ORDER by title asc";[/code] This works fine but how do I return the results if someone searches, for example, for a specifit name within a specific department or a name with a specific classification etc. So basically, I need to be able to return the results if someone enters information into just one search criteria and also if they enter data into multiple search criteria. Thanks for your help.
  6. Thanks for your help. I've got it working now using the original code. For some reason it works fine on the live server but not the test server.
  7. I've tried using glob() but I'm doing something wrong. How do I integrate it into my original code?
  8. Is there any way of arranging them a-z no matter what becuase i need them to be displayed that way even if the users directory is arranging them differently. Its really strange because i've used this same code before on the same directory and it worked perfectly then [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
  9. Hi, I've got some code that reads the contets of a directory but it orders the files in some random order and I need them displayed a - z. This is the code I have: [code]<?php if ($handle = opendir("departments/policiesnew/docs/policies/atoz")) {    while (false !== ($file = readdir($handle))) {        if ($file != "." && $file != "..") {            echo "<li><a href=\"departments/policiesnew/docs/policies/atoz/$file\">$file</a></li><p />";        }    }    closedir($handle); } ?> [/code] How could i modify this to make it read the files ordered by their name? Thanks.
  10. [a href=\"http://glish.com/css\" target=\"_blank\"]http://glish.com/css[/a] will show you some good css layouts.
  11. I just realised it actually works as intended, I didnt realise at first because there aren't that many records in the database. Thanks for your help.
  12. [!--quoteo(post=374292:date=May 16 2006, 03:38 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 16 2006, 03:38 PM) [snapback]374292[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have no idea what this means.. what "other results"? [/quote] I have a list of members in the database. Some are sponsors who apear at the top of the search results, the others are standard entries that appear after the sponors. It is the entries that appear after the sponsors that i want to be random. If I use the query suggested earlier the sponsors are random but the standard entries are not: SELECT * FROM members where (city like '%$city%' or country like '%$country%') and approved = '1' ORDER BY sponsor DESC, RAND() LIMIT $from, $max_results
  13. Thanks, Thats almost it but not quite. I need the other results to be random as well as the sponsors. Any other ideas?
  14. Hi, I need help with a query. At the moment I have a query which displays the results and orders them with the sponsored listings at the top of the page. What I want is for the sponsors to remain at the top of the page but everything to be displayed randomly as well, otherwise the people who have the lowest id will always be at the top of the search results. My current query is: "SELECT * FROM members where (city like '%$city%' or country like '%$country%') and approved = '1' ORDER BY sponsor DESC LIMIT $from, $max_results") Hope this makes sense [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] Thanks for your help.
  15. Hi, I have a form that users can mail me from on my website. At first, all the processing was done on one page but i realised that if the user presses the refresh button, the mail is sent again. I tried using header to stop cashing but that didnt work. Then I tried redirecting the user to another page once the mail has been sent but if they go back to the previous page and click refresh, it still has the same problem. What is the best way of stopping mail being sent more than once? Thanks for your help.
×
×
  • 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.