Jump to content

denno020

Members
  • Posts

    761
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by denno020

  1. Ok so I had a bit of a play around, and my next question would be, are you sure you've put the values into the array correctly? I checked online, and found out to input the values, and then I simply echoed out one value at a time, and it worked fine, which means it will print into your email fine.. For testing, I would try echoing just First Name, and then just Last Name, separately, and see if it prints anything. This way you can see if the data is going into the array fine. If the values print as expected, then the string you'r building for the email is being built incorrectly. Here is the code I made, which worked perfectly fine. $arr = array("FirstName" => "John", "LastName" => "Doe", "Age" => "23"); echo $arr["FirstName"]; echo "\n"; echo $arr["LastName"]; echo "\n"; echo $arr["Age"];
  2. echo "Dear" . $array["First Name"] . " " . $array["Last Name"] . ","; tried that? (quotes could be wrong, but that's the general form I think should work..) Denno
  3. You need to add this information in the users table. I imagine it would be very involved to get the functionality you're after though.. Here is how I would approach it: If a user presses delete, instead of changing the values in the topics table, add a value to the users table (in a new table field), which will keep track of which topic numbers they've 'deleted'. Every time a topic is deleted, append its topic number to this field. You will parse this field, and break it up to get each individual topic number, and make sure it isn't shown to the user. Alternatively, you could add another field to your topics table, that will keep track of which users have 'deleted' the topic. Append each user to that field. Parse the field to get each user's id, and make sure it doesn't get displayed to them in the future. Hope that helps Denno
  4. is session information stored at the server or in the users browser? I would think the best way for this would be to set a flag in your db that says if they're logged in or not.. This wouldn't be very hard at all if you already have a users table with their information. I'm not very well versed in sessions though, so I could be incorrect with my assumption above. Denno
  5. Nothing is said about validating the actual information in the field. Only that there is something in there. I don't want to start an argument, but from reading the original question, this it he impression that I got as to what was being asked. Denno
  6. I was merely suggesting javascript to check if the field has been filled in, as the original question asked. Validating if the entered data matches when compared to a db (or something), like for usernames or passwords, is a different matter. Denno
  7. You want to add a simple javascript function to your page. This will allow you to check the fields without refreshing the page. If you want to use php, then the page will need to be refreshed each time, as the php get's executed back at the server, not up where the client is. If you want an example of some javascript code, let me know. Otherwise just google it . Denno
  8. I don't know then sorry..
  9. Do you still get that Fatal error then?
  10. $query = $db->query(" SELECT $select (etc etc) Doesn't this '->' apply to objects? Is your database connection an object? Your second error: Fatal error: Call to a member function query() on a non-object in C:\wamp\www\ASF A Simple Forum\functions\functions.php on line 233 Appears to be hinting at this, I think.. Denno
  11. So I guess you've settled on $db = mysqli_connect($config['database']['hostname'], $config['database']['username'], $config['database']['password'], $config['database']['database']); being the problem? Can you take out the whole config thing, and just put in the raw values? Other than that, I would be pretty much out of ideas.. Denno
  12. which is line 239?
  13. Fair enough then.. Have you tried the procedural type though, just to try and cross off the connection as the problem? Denno
  14. I'm not sure what sort of format you're using to connect to your database there? To connect to my database I use this format: $myConnection = mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysql_select_db("$db_name"); But also, if you want to use mysqli, I have used: $myConnection = mysqli_connect("$db_host","$db_username","$db_pass", "$db_name") or die ("could not connect to mysql"); Try one of those formats instead? Denno
  15. Can you post up the connect file (init.php). Just replace your username and password with something generic if you want. Denno
  16. I must admit, it's a bit confusing. You would think that you're starting a brand new session on each page. It would be nice if there was a "continue_session()" or, "extend_session()" function, but there isn't lol. Denno
  17. Echo it directly before the mail is sent. Either just before, or just after you say "Your information has been submitted etc etc" Denno
  18. Wouldn't you explode the paragraph into another array, and then you could compare the arrays, iterating through them looking for matches..
  19. Why don't you echo $body for testing purposes. That way you can see if it's the mail function that isn't working, or if the variables aren't being put into the $body variable correctly. Denno
  20. I'm not sure exactly how to do this, but I would approach it this way. You would have to parse the string, and break up each of the individual words. Then you would need to compare each individual word to a db of words that you have. When a match is found, then pull the score for that word.. Might be an easier way, but I'm not sure? Denno
  21. have you put session_start() on every page at the very top? I doesn't show in your code that you've posted, not sure if you've omitted it as it's inferred, or if you forgot to add it. Denno
  22. You should do a search on Google for how to pull the data from the system, and then brake it up into variables (like hours, minutes, seconds etc.). Then you can display the time in whatever format you want. Denno
  23. echo "<table> <tr><td>id</td> <td class="tableCellOne">Description</td></tr> <tr><td>1</td> <td class="tableCellOne">4 rows are there</td></tr> <tr><td>2</td> <td class="tableCellOne">1 row only</td></tr> <tr><td>3</td> <td class="tableCellOne">8 rows</td></tr> </table>" You'll notice that now there is two sets of <td> </td> between each <tr> </tr> tag. This means 2 cells on one row. I just did a google search for online HTML table generator. Look at this link and it will generate the code you need for a X column by Y rows. http://www.quackit.com/html/html_table_generator.cfm Denno
  24. Well you are printing one row(<tr> </tr>), and then 3 cells (<td> </td>). This means they're all aligned horizontally on the same line. You want to print your data in a new cell, that's on a new row. I added <tr> </tr> tags to fix this. You will get the format of "Description need a site for school gave order on 12-10-2010 work started on 12-10-2010" Using this code. Denno
  25. Ta mate, I shall do that. Denno
×
×
  • 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.