Jump to content

MikoMak

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MikoMak's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanx for that onlyican - that class looks really interesting, lots of built in features. I had a quick look at the free country db available from http://www.maxmind.com/app/geoip_country with a tutorial on how to get it going here - http://www.delau.net/php/geoip.html
  2. Thanks for that Semi - will look it up. MikoMak
  3. Hi all, I've got a site where I'd like to serve up ads based on the user's geographic location. I'll use $ip = $_SERVER['REMOTE_ADDR'];  to detect the IP but how then do I use it, e.g. is there a database of IP to country mappings so I can extract the location and do the necessary? Any help would be greatly apprciated. Thanx, MikoMak. p.s. Nice new look to the forum.
  4. Thanx for that Andy - with a bit of tweaking it'll do just what I need. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
  5. Hi all, I must be losing it cause I can't seem to get the hang of using gd - having spent 2 days reading the manual and various articles/posts/tutorials I'm just a tad confused about the functions I need to use. What I'd like is a simple roadmap to follow (not code) so I can sort it out myself, so if someone could point me in the right direction it'd be great. Here's what I'm doing (nothing complex) - I'm uploading a jpeg using a form - I'm saving it to a dir as well as writing a url to db so I can display it - this works just fine, no trouble there. What I'd like to plugin is a way to resize (and compress) to 2 different sizes. So now I'll save 2 images and 2 urls. What would be the process I need to follow i.e. the flow of functions? Thanx in advance.
  6. Fatal error: Call to undefined function: file_exisits() in /var/www/html/clients/npr/main.php on line 40 that's telling you a function by the name file_exis[b]i[/b]ts doesn't exist. Simple typo - change that to [b]file_exists[/b] ()
  7. Hi, you probably want to use the mysql function date_format() to pull out just the month from the table e.g. something like $sql_date = mysql_query("SELECT date_format(ddate, '%M ') as ddate FROM casinocredit ") This will give you just the months by name and not the full date. (use '%M %Y' if you need the month and year e.g. May 2006 ) hth.
  8. Hey guys, thanx for that! I tried Yesideez's array and that worked when I used just int for the month rather than the name. In any case I'm inserting the values in the db in 0000-00-00 format so that's probably best anyway! :) thanx again!
  9. Hi, I have a simple form with validation so if a user has not filled in a required field the form displays again on submit with all other fields filled in. I have day-month-year drop downs and need help with setting the values that the user has already selected when the form loads again after validation so the dropdowns display them and the user doesn't need to select them again. I'm sure I saw something similar on this forum ages ago but can't find it now. Any help would be greatly appreciated. Thanx.
  10. Hi fenway, Thanx for your response. Yup, I've added a column in my users table to store each users classification and it's made it all simpler. I had to re-write some other bits of the app but it's all a lot cleaner now. Thanx for the help!
  11. Hi, I require advice on the design of a table for a project I'm working on: The project is a room-mate matching service and so at the moment I have 3 tables, a user table for all users, a table for the Tenant (T) and one for the Landlord (L). Since I'm using a seperate user table to hold the personal details, both tblT and tblL only hold data that is specific to their requirements e.g. rent, location etc. The specifics for each differ from the other considerably so that tblL has many more columns than tblT. So when a T logs in they see L listings and vice versa. I'm using sessions so on login a session variable is set depending on whether it is a T or a L logging in and listings are displayed accordingly. Each user can only have 1 listing so each listing has a 'user' field with that user's unique id in that table to identify which user that listing belongs to. To facilitate communication, I have a messaging service where a L can send messages to a T, and vice versa, after viewing a listing. (Messages held in seperate tables so not part of this problem, only mentioned to facilitate a better understanding of the issue) When a user (either T or L) receives a message I am providing a link to the sender's listing so e.g. when a T receives a msg from a L, there will be a link to L's listing so that T can view it easily. And this is where my current problem lies - in order to get the id of L's listing, I've had to write a if/else script that first checks the session variable to see whether it is a T or L logged in and then use the inverse to go check for the listing. In this case it would be a T logged in so my script knows to check against tblL for the landlord's listing. This essentially makes this unscaleable as I would have to re-write that script if I ever introduce a third option in addition to T & L. The only solution I can think of at the moment is to have only one table to hold the specific data for both Ts and Ls so I can query a single table using using the unique id as compared to first figuring out which table to query and then using the id to query. So my queston is: is this the best way to go about it or am I being short-sighted and not seeing another, better solution? Would I be breaking convention in having a single table holding data for 2 such seperate entities? I hope my explanation here is clear. Any questions, just yell... Thanx in advance for any insight ....
  12. Hiya Humpty, Thanx for that. I think this may have had something to do with a server refresh. I tried out the forms again after a while, without changing any code, and everything worked fine! Patience and all that...
  13. Hi, this is a strange one - I have 2 seperate forms to add data into 2 tables. Both contain a textarea which corresponds to a TEXT field in my db. Both also contain other fields e.g varchar, int and enum. All the rest work, only the TEXT fields end up empty when I submit the form. I've built numerous forms like this and haven't ever had a problem so I don't think it's my code (I don't get any error messages either)- the only difference I see in this db, as compared to the others I use, is 'collation' when specifying the type. The default seems to be 'latin1_german2.ci' (German phone book, case-insensitive) Any ideas anyone? Any help will be greatly appreciated.
  14. Thanx for that php_b34st, works great.
  15. Hi all, I'd like to enter 2 dates into a table, date today [I'm using now()] and date 30 days from today How do I go about adding 30 days to now() and inserting it into the table? I'll be running a script daily to check if todays date matches the expiry date and deleting the row accordingly. Thanx, MikoMak.
×
×
  • 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.