Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. "Umm, well, yeah you're right. Better make it $40 bucks."
  2. I assume you have some javascript in the document you are loading. I'm going to also assume it's a simple form. So you might have some onsubmit code that takes an input on the form. Let's assume that input is named 'username'. In the onsubmit you'd have: window.returnValue = window.document.forms[0].username.value; Before wasting too much time on this, I hope you realize that showModalDialog is an IE only function!
  3. Looks like you deleted some code when you did your copying and pasting here:
  4. So, the question is, how do you enhance your system with a login. Make a user who wants to send a message to another user, login in order to do so. Then spammers will not be able to message other users anonymously.
  5. When you do an inner join, you get the product of the number of rows that match on the join criteria. So if you have 2 credits and 2 debits that all have the same account_number, you will get 2x2 = 4 rows. Add one debit, and you will find you get 6 rows, and so on. If you just want a list of debits and credits for an account, since you have these in 2 different tables, do 2 queries, and UNION ALL the results.
  6. The way you get a return value wiht showModalDialog is to set the window.returnValue property of the document you load as the first parameter. Also: return('uid'); Would return a string 'uid' not the local uid variable in CloseMe, but perhaps you knew that?
  7. If the table has the email address in it, you let the person fill out the form, you look up the email address in the user table and you use mail to send them the email. I would probably not be very happy about your system if i was a user, as it would enable any fool to spam your entire user base quite easily. Many systems (including this forum) do enable private messaging between users, but that does not involve email, and requires that the person sending the message have established their identity by logging in. You could exert some control over this with an implementation of a solid captcha like recaptcha that would make it at least a bit harder for someone to spam your users, but I would spend some time thinking the system through, and make sure you have really thought out all the angles.
  8. Happy B-Day. As one father to another, you know that you will not be allowed to shake the mortal coil until you have raised those kids to be responsible adults (or as they think of it, paid all their bills). Should you attempt to pass on too early, rest assured they will find a way to dig you up and reanimate you. Those B-Day/Father's day cards you just got are subtle reminders of that.
  9. I agree loved the series. We've been watching GoT and The Killing, and I'm also watching Treme. I actually felt a bit depressed that the season was over. We waited for 2 weeks to save the last 2, and watching them back to back I was like "holy s.....t!" I may read the books when everything is done with, but for now I would rather be surprised as the plot unfolds. The best series for me is still the Wire, but that's in hindsight looking back over its 3 seasons. I'm excited to see how things progress, and glad that they've picked it up, and it's been so successful. Although it will be hard to wait for the next season, at least True Blood is picking back up and that will hold me over a bit. If you haven't seen The Killing, do yourself a favor and check it out. It's been a close second for me, this season.
  10. Brenda, I looked at your original question. I even glanced at your code, but I decided to pass. The truth is, most questions like yours will not receive a response, because this is a community of developers, or students, or would-be developers. Most of us (the people who answer most of the questions) are professional developers, although we do have a fair number of students and hobbyists. We come here to help other developers learn more about what we do, and in the process we often learn from each other. It appears that you are not a developer, nor trying to be a developer. I'm not sure what your angle is, but it seems that you have some code, you didn't write and don't understand, and are really asking for someone to recode it for you. There just isn't anything in it for us as developers or the community at large. I could actually argue that it makes it worse for people who are working as developers or trying to work as developers when we do what in essence is free contracting for people like yourself, because those developers are deprived of potential freelance work. I don't want you to think that this is any way is meant as a personal attack. It's what I consider a long running misunderstanding that was introduced to this community many years ago when we started allowing questions about 3rd party scripts and applications that we originally did not allow. The interest in doing that was to attempt to engage developers who specialized in ecommerce and cms packages, but instead what has happened is that we are inundated with questions from novices and business people who for one reason or another are trying to gets hands on with their website code, when in reality they are completely over their head. In their own minds they may justify that they are "trying to learn web development", but more often than not it ends up being a pointless exercise in futility for everyone involved, because really what you are asking for is someone to implement what you want, and then be in a position to accept the results. All too many times, I've decided to just throw in some free code for someone, and then there's a small bug, or problem with their environment or it didn't do quite what they wanted it to do, and it gets into a long cycle back and forth over something that could have been settled quickly if it was a paid job, and I was working for that person as a contractor. The way most of the core group of gurus, moderators, admins and senior developers has come to deal with this problem is simply to ignore questions like yours, but CV put into words exactly what I thought to myself when I originally read your question and passed over it. FWIW, I recall that you have some javascript that lets a person pick an area of an image clientside, and the coordinates are sent to the php script that uses some gd calls to overlay an image with a block that matches the dimensions -- something along those lines. Any solid php developer with even a modicum of php and gd experience would most likely be able to implement what you want to do. You didn't provide enough information to make it crystal clear what the specification is, which is another reason I chose to skip it, but if you were paying someone you would no doubt hammer that out with the person involved, to enough detail that you'd have a clear estimate, and acceptance criteria. It's just not the design or purpose of this community to be a source for free programming.
  11. error_reporting is an error filter. It simply allows you to setup which category of errors you want php to catch. Most frequently, people will include E_NOTICE and E_STRICT messages during development and then exclude them on the production server. If during development you want to display the errors to screen, then you can use display_errors and display_startup_errors. If you are trying to set these types of things up at runtime and your script does not even compile, you will not see any errors. This is sometimes a surprise to people, when they get a blank page, and don't understand why they didn't get a stack trace, however, the error will be logged to the error log. When you think about it, it makes complete sense that your runtime code never executes, because the program never made it past the parser to the state of being runable byte code. Production applications often want to have custom behavior and application specific error handling. This is where the issue with fatal runtime errors can come into play, however with 5.x there is a technique you can use that will even catch these fatal runtime errors. For example you might have a logger that writes the error out to a log file in a particular format of your choice, or logs to a database, or emails you certain critical errors. I'm not going to go into the specifics of it, but you can find out more details if you're interested in these advance techniques. The secret is to use register_shutdown_function. With that said, if you have a production server with display_errors off as it should be, and logging configured in the php.ini file, errors will go into the log file -- including runtime errors.
  12. This is a nice thread at this point, as it offers a procedural solution and an oop solution to the same problem.
  13. To add to Pika's answer, MAC addresses and TCP operate at entirely different OSI layers. In general, the higher the level, the more abstract. HTTP is built upon TCP which is layer 4. To be dogmatic about it, HTTP at layer 7 makes absolutely no provision for even IP. The reason you have access to IP addresses at all in php is because they come from the old cgi specification, and are provided by the http server itself which implements the socket server. There is no place in HTTP where even the IP address is part of the specification. Ethernet where the MAC address comes into play is layer 1. There is no reason for IP and certainly not TCP to be concerned with MAC addresses -- they need to be entirely transparent. If things weren't transparent, different network technologies would not be able to interoperate. One of the fundamental concepts enabling the internet, is that of routing, where you are able to send a packet to a destination IP from your network, without any real idea how the packet is going to get to the destination, since routers are able to delegate an understanding of where the packets need to go next, to other routers which advertise routes. People requesting a Mac address from you as a website owner, truly don't know what they are talking about.
  14. Remove these lines: $input = file_get_contents('php://input'); var_dump($input); add var_dump($_POST); What do you get?
  15. The -> is used to access the variables and methods of an object: echo $obj->variable; echo $obj->method(); // assumes that function method() returns something.
  16. I have never heard of anything that would effect the functionality of $_POST. It is very simple. Without seeing some code, it's hard to say what is going on. Did you try a simple form posting to a simple script that displays the $_POST?
  17. The code is very simple: $poppy->DogTag = new DogTag; This is creating a "DogTag" object and assigning it to $poppy->DogTag. So clearly the DogTag variable in the Dog object IS being used, so store an associated DogTag object.
  18. I used a database design tool: http://www.datanamic.com/dezign/index.html
  19. I mocked this up quickly for you. See attachment for diagram and sql file. You probably want to look at the datatypes of attributes in hond. A lot of those columns look like they need to be normalized out -- for example, vaccination or flea. Not sure what those are supposed to represent or what the datatype is suppossed to be, but you can edit the sql file appropriately. [attachment deleted by admin]
  20. Your design is fine. However, dogs, are owned by an owner, so it would be useful for you to have Owner_id as a foreign key in Hond. If you did that, you would not need the owner_id in the reservation table, as it would already be available in the hond table. You would also need to determine whether or not an owner with multiple dogs should have multiiple reservations. If you don't want that then your structure would need to be modified.
  21. The most likely answer is http://www.pdflib.com/ because it's a commercial product. There are some good libraries for generating pdf documents on the fly like http://www.tcpdf.org, but I'm not sure they have the type of capability that you need.
  22. The first thing you did wrong "here" ie. phpfreaks, was to post a bunch of code with no php or code tags. Also, where is your indentation? Your 2nd mistake was not describing what the problem is. I don't see anything in the code that jumps out at me as being obviously wrong. Depending on the size of dictionary.txt this could take a long time to run, so it may be timing out. The php.ini has variables that control the amount of time a script can run, how much memory it can use, etc. The default timeout is usually pretty short.
  23. In addition to what Pikachu stated, PLEASE use a salt value. Add a column to the database table that stores the salt value. A salt can be a phrase or set of characters of your choice. You could make it something random like: $salt = sha1(time() . 'this is going to help generate my salt' . rand(0, 10000)); The important thing is that when you insert the password you're going to store it in the same row in it's own column. Then generate your password hash: $hashpw = sha1($password . $salt); This defeats the use of rainbow tables against the hash values should your user table be compromised, because rather than having a pre-computed table available which can be used to match hashes against, the hacker would have to generate the complete rainbow table FOR EVERY ROW using each individual salt, making it a huge hassle for them. In summary, sha1 is a good way to store passwords, since you aren't really storing the password at all, and it can not be "decrypted". But you must use a salt!
  24. Yeah, I think you're letting this overwhelm you. What they probably are looking for is can you develop a few reasonable classes. The actual web aspect of this is really only one form.. no logins or anything like that. Do you have a good understanding of php5 oop, and oop concepts in general? That is what I'd be expecting from a task like this.
  25. Let's see the test questions, so we can evaluate its difficulty. Web development is difficult, and like any other type of programming, it takes time to become good at it. Junior people should be mentored by a sr. person. Often what companies mean when they hire a "jr person" is really: we don't want to pay for a sr. developer, so we'll call it a jr. position, but we'll expect the same results we would expect from a sr. person." If you didn't have a senior person working with you, reviewing your code, and providing answers to your questions, then those weren't entry level positions. Try not to become discouraged.
×
×
  • 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.