Jump to content

HuggieBear

Members
  • Posts

    1,899
  • Joined

  • Last visited

Everything posted by HuggieBear

  1. Can you post your most recent code now.
  2. I assume you mean a line break, not a page break. Try changing these lines: $tmp[] = "</ACCOUNT_NO>"; $tmp[] = "</ACCOUNT_NAME>"; to these: $tmp[] = "</ACCOUNT_NO>\n"; $tmp[] = "</ACCOUNT_NAME>\n";
  3. There's also a Pear package for it
  4. Make sure your form has a username and password field and then use something like this: <?php session_start(); if (!isset($_SESSION['logged_in'])){ // You're not logged in, have you submitted the form if (isset($_POST['Submit']) { // You have submitted the form if ($_POST['username'] == 'admin' && $_POST['password'] == 'xyz'){ // You're authenticated $_SESSION['logged_in'] = $_POST['username']; echo "Thanks for logging in"; } else { // You entered invalid details echo "Sorry, the username and password you entered are invalid"; } } } else { // You're already logged in echo "You're logged in as " . $_SESSION['logged_in']; } if (!isset($_SESSION['logged_in'])){ // Display the form echo "This is where your form code goes"; } ?>
  5. That's not doing the same thing, it's setting an environment variable.
  6. Have you tried curly braces? $sub = $sub->{zip code} This doesn't seem right, do you have the code for us to look at?
  7. Your HTML form doesn't contain a field called username then.
  8. If you have no standard data structure within your text file it's going to be difficult I think. Can you edit the structure of the original text file?
  9. Happy to help. Just glad that you're giving it a go and learning yourself rather than asking people to do it for you.
  10. They should be in double quotes "\n\n" $message = "Someone just filled out the online order form! Here's their info:\n\n";
  11. Why do you think that is? Look at what I asked you to change (Connection variable name!)
  12. That means that your database connection failed, or you're specifying the wrong connection handle. In your case it's the latter. Change: mysql_query($sql,$con) To: mysql_query($query,$connection) As those are the variable names you've used earlier in your script.
  13. Thanks Kira, I didn't know that. Is it standards compliant?
  14. Run the message contents through nl2br() if it's an HTML email, if not then just add a \n.
  15. Nope, that's a browser preference and can only changed on the client side I believe. Try googling for terms like 'Prevent Auto Complete'
  16. The above post probably isn't what you want. Do you want the file saved on the server or the client?
  17. If you're checking two variables, make sure it comes before you check one. e.g. if ($direction == 'north'){ echo 'Direction is North'; } elseif (($direction == 'north') && ($distance == '1')){ echo 'Direction is North, Distance is 1'; } The second condition will never be met as the first is less specific. Put the most specific conditions first, like this: if (($direction == 'north') && ($distance == '1')){ echo 'Direction is North, Distance is 1'; } elseif ($direction == 'north'){ echo 'Direction is North'; }
  18. Yeah, that's possible. You should put more specific rules first though.
  19. This doesn't make sense. If you're trying to find out if today's date falls on a week day, what does the time matter? $weekend = array('Sat','Sun'); $today = date('D'); if (!in_array($today, $weekend)){ echo 'Yup'; } else { echo 'Nope'; }
  20. You're using $data in your for loop, but not setting it anywhere. Do you meant to use $res?
  21. OK, what separates the chapter from the author and the author from the content?
  22. Is the data in the text file delimited in anyway e.g. colon? 1:J.K. Rowling:"Well, I had one that I was playing Quidditch the other night," said Ron, screwing up his face in an effort to remember. "What do you think that means?". "Probably that you're going to be eaten by a giant marshmallow or something," said Harry, turning the pages of The Dream Oracle without interest.
×
×
  • 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.