Users IPs detect and store...
|
|||
|
Rank: ? (4)
Member #: 28918 |
Hi there!
I wish to detect and store the IPs of the users of my site which is All-Flash-Built. Where can I find a simple IP detect method in Flash working with a MySQL DB via PHP ? Thanks in advance, guys!
Simple is best.
<http://www.germaris.com/> and
<http://www.germaris.com/~annuaire/>
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
An IP cannot be detected via Flash and in the event that it could, would do you little use considering Flash is client side and you would wish to send the IP address to your server on which the MySQL database resides. Detecting an IP address in PHP, however, is extremely simple. In fact, it requires no more work than looking into the $_SERVER['REMOTE_ADDR'] predefined variable. Of course, this value could be incorrect if the user is behind a proxy and I know of a method which may retrieve it from behind a weak proxy, I don't feel the information is pertinent.
In any event, considering this is a forum intended to provide learning assistance, I refuse to do any more than that, meaning I will not supply you with the code you have requested, though I will attempt to lead you to your errors within it.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
lol. Why did you bother to say anything if you wernt going to help him.
I am going to go to every thread that i know how to solve the problem(will not be many) and tell them i know a solution but aint gonna tell ya |
||
|
|||
|
|||
|
Rank: ? (4)
Member #: 28918 |
I agree with your opinion "gordonmcmenemy".
I never received such a silly reply like relpats_eht's on a forum for years! Understood, brother! I flee this forum right now as I feel ain't welcome... Cheers!
Simple is best.
<http://www.germaris.com/> and
<http://www.germaris.com/~annuaire/>
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
most of the people on this site have been really friendly. I know who, but i cant tell you..
|
||
|
|||
|
|||
|
Rank: ? (4)
Member #: 28918 |
You may be right...
One is not all the people, for sure...
Simple is best.
<http://www.germaris.com/> and
<http://www.germaris.com/~annuaire/>
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
Avoiding the fact that I did provide assistance by telling how the IP of a user is found under PHP in about 99.99% of the circumstances, I offered to provide assistance granted that the user at the very least make an attempt to write the code themselves. Considering that this is a forum designed to help users learn PHP, I do not feel that this is too much to ask.
If I were to simply provide the answers to all users who had a question the vast majority of them would simply copy the code, learn nothing from it, and come back with their next problem having learned nothing from their first. So libel me not with your attempts to make my response seem incorrect by oversimplifying it to something I neither said nor intended to say. I have been on this forum for quite some time and I know well the problems which arise when users can ask for code and have it provided to them. They learn nothing, they beg for everything, and they waste a great deal of time.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (4)
Member #: 28918 |
Look, even if I am new on this forum, I'm 65, I've learn very much about life and I have quite a human experience.
What I didn't appreciate in your reply wasn't the foundation of it. It was the form and the terms you chose to express it. I didn't intend to swallow some chunks you chewed instead of me without I deeply tasting them like I do when I cook for my guests... Final. About what I asked for, in Flash and PHP (which I learn alone for the past three years), was something more elaborate than $_SERVER['REMOTE_ADDR'] because of the barriers which arise with dynamic IPs and proxies. If I ban an IP, I want to be sure it is the right one (even if it has changed...). May be the solution will be a combination of identification and setting a session? I don't know how to set this. May be you can indicate some guidelines? Regards. PS: Sorry for my english but it's not my native language, I'm French. » Post edited 2006-10-27, 02:04am by Germaris.
Simple is best.
<http://www.germaris.com/> and
<http://www.germaris.com/~annuaire/>
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
relpats_eht always has helpful information, but he's also used to seeing a lot of posts that are just people asking for someone to do their homework for them (in fact, i'm used to this as well). it makes it pretty easy to get in the mindset that everyone is asking for someone to do their work for them. he and i both are interested in helping people learn, but generally you can't tell if people are asking for help learning how to do something or asking for someone to do it for them until their second post (if they even come back).
onto my advice, i don't think it's worth worrying about proxies or dynamic ips. you might be able to block some people with dynamic ips by sending them a cookie and then not letting them see the site if they have that cookie, but you'd have to know that you want to ban them when they're requesting a page because that's when you can send cookies. that probably won't work for someone using a proxy as they would probably be able to find the cookie and delete it. simply going by $_SERVER['REMOTE_ADDR'] will work for most people, and anything further is just more work than it's worth in my opinion.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
Anyone who knows how to use a proxy will most likely be educated enough in the realm of computers to use a completly secure one, making what I know about how to get the actual IP of a user from behind a weak proxy irrelevant. However, if you are going to use the IP address of a user for a ban script, you should probably set a cookie as well and then have the script check for either. Considering the rather limited knowledge of your average computer user and the vashttp://www.free2code.net/plugins/articles/read.php?id=290t majority of IP addresses which are dynamic (although they only change about once per month at most), this method will most likely keep a user banned for a longer bit of time. As far as setting a cookie goes, this article describes the process proficiently and in complete detail, although, if you require more information on the PHP setcookie function, I would advise you check the PHP function reference. As far as having PHP interface with MySQL, it appear I had forgotten to include this link to the respective article in my previous two posts. If you have any questions on it, feel free to ask.
Therefore, simply to further clarify what I believe you should do to have an effective ban script in PHP, you should check the IP of the user as well as check for the ban cookie. If only their IP is banned but they do not have the ban cookie, set the ban cookie. If they only have the ban cookie but their IP is not set as banned, set their new IP as banned. In final regards to what you have most recently asked, do not expect to block users proficient in knowledge of the Internet, it is impossible without knowledge of their location and a weapon of some sort. If you ban their IP they will use a proxy and if you set them banned with a cookie they will clear their cookies. At the very least, using my method described above will keep them banned until their third attempt at unbanning themselves. Finaly, in response to the first paragraph of your most recent post, Germaris, you seem to have quite simply assumed that anything which I type expresses any emotion toward the person to whom I am typing. Granted it is a common mistake, however, I don't seem to have any emotion of any sort, and I especially do not believe it should be found present in the written word which is entirely open to interpertation on the subject. Therefore, I appoligize in the event you underwent any strife, however the posts in which you were referring have neither tone nor emotion beneath them and therefore should be read as such.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
Anyway he asked where to get one not for you to make him one. Wisdom is ment to be passed down otherwise nobody would lern. Wheer would we be if tony never shared his great recipy for making cereal or Mr Monster shared his munchys with anyone.
Unless i am mistaken..... Where can I find a simple IP detect method in Flash working with a MySQL DB via PHP ? Not Can anyone make me a simple IP...bla bla bla. But hey never mind we all like a good moan dont we.... If I were to simply provide the answers to all users who had a question the vast majority of them would simply copy the code, learn nothing from it, and come back with their next problem having learned nothing from their first. |
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
I was merely saving a bit of time, rather than wasting a few posts during the conversation about how such simple scripts do not exist on the Internet as standalone entities because those who write PHP scripts know that anyone proficient enough in it to merge such a simple script with their website (which they must invariably do, unless one's solitary intention is to ban users from a ban script) will know not only how to construct the script themselves, but will be able to do so in less time than it would take them to find, download, and merge the script with their project. But of course, I am replying to Germaris's second post, and not yet his first as you wish. Simply put, rather than provide a link to a page in a manual, I answered that question tacitly in my first post with a "nowhere" followed by an alternative route.
gordonmcmenemy writes... But hey never mind we all like a good moan dont we....
If I were to simply provide the answers to all users who had a question the vast majority of them would simply copy the code, learn nothing from it, and come back with their next problem having learned nothing from their first. Are you suggesting people have the ability to learn how to program through use of the copy and paste features? » Post edited 2006-10-27, 06:19am by relpats_eht.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
I am not suggesting that the "BEST" way to lern is to copy and paste, but having the coding in front of you to lern is another matter.
Think back to school. 1 + 1 = 2 2 x 2 = 4 Without looking at the whole picture first...... If the teacher had to suggest to you that she knew how to do it but was of the mentality that she was not going to show you...how would you lern. I know i stretch the example to the limits but the idea is the same. How can you lern if nobody is willing to teach. You seem clued up about coding in a few languages....am i to believe that this is all self taught? Or like the majority of us(lame programmers) have you had your hand held a little of the way. Copy and paste is just a term used in the 21st century which is no different to the copy out of a text book used in the dark ages of the 20th century. Now sorry for this to answer a question with a question but are you suggesting that it is not a way to lern? ......PHP scripts know that anyone proficient enough in it to merge such a simple script with their website (which they must invariably do, unless one's solitary intention is to ban users from a ban script) will know not only how to construct the script themselves, but will be able to do so in less time than it would take them to find, download, and merge the script with their project........ Surely to migrate a code into your own you would need sufficant knowledge of what the code is about. » Post edited 2006-10-27, 08:16am by gordonmcmenemy.
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
The problem appears to be, gordonmcmenemy, that you are misreading me. I am not suggesting that people are unable to learn from code, but that they are unable to learn by copying and pasting code. There is a very distinct difference here which you should be sure to note. I have no objections to users learning through the process of reading through code and often suggest it by pointing them to various places in which code similar to what they wish to create can be found within another project. However, I am not idealistic (read: foolish) enough to believe that if I provide the code the person asking for it would read through it and learn from it rather than simply copy and paste. Do not misread, I am not saying none would, but I cannot be partial toward those who present a convincing story and must treat all users similarly. Furthermore, I have at no point refused to provide any code. I have no objection to providing a user with the basics of a language in order that I might assist them in learning the language, and I usually do so by way of linking to tutorials which others have written which I believe perform their task effectively. I believe this would be similar to a teacher in elementary school providing you with the basics such as the mathematics example which you have provided. They have you memorize the basics so that you have an understanding of what you are doing and can thenceforth apply that knowledge to more complex problems. I would also like to add that copying and pasting is similar to copying a page from a textbook, in both, information is passed on to you, information which you must choose to process if you wish to locate the value and knowledge contained within it.
gordonmcmenemy writes... If the teacher had to suggest to you that she knew how to do it but was of the mentality that she was not going to show you...how would you lern.
She could do so by teaching concepts, a word which I fail to see how you miss in my intentions considering that you yourself brought up the topic of mathematics and teachers. If you still are blind to my point, allow me to ask you: Has your teacher ever done your work for you? Told you the answer to a math problem at or below your level? Told you the answer to a math problem which consisted of material she was currently teaching? If your teachers have been forcing you to memorize equations and their results the whole of your life then it is appreciable by me that my life is not yours. gordonmcmenemy writes... How can you lern if nobody is willing to teach.
As I have said on numerous occasions, several within this own topic which you seem to have chosen to skip over with your eyes, I am willing to teach, but one cannot teach by providing the answer. If this was face to face, I would have the capability of forcing all users whom I provide assistance to to answer the question of why it works after providing them with the code; however, such is not the case. I therefore must assume all users will scamper off, copy and paste the code, and leave things at that. Never reading it, and never learning from it. Accordingly, this means I can only provide them with simpler systems which much be combined in a certain fashion, which I have already done in this thread through my own text and links, or that I must ask the user to provide their own flawed code on the subject and lead them to a conclusion as to why it is flawed so that they may repair it on their own. gordonmcmenemy writes... am i to believe that this is all self taught? Or like the majority of us(lame programmers) have you had your hand held a little of the way.
Yes, I am entirely self taught in regards to programming (the language doesn't matter, that only changes syntax, programming is a manner of thought). While learning I asked not a single question, and since I have gained sufficient knowledge on the subject I have only asked two, both of which I believe I was the one who came to the conclusion. It is because of this that I can safely believe that any help while learning the subject is most certainly better than none and hold expectations up to the users who are asking for it. gordonmcmenemy writes... Surely to migrate a code into your own you would need sufficant knowledge of what the code is about.
Yes, it most certainly would, but it would also require at the very least sufficient knowledge of the language, especially in PHP, in order that you know what can be inserted or removed without modifying the script. Anyone who knows enough about PHP to know how to perform the extensive merging process required for a ban script without having it come up with errors and still display all of their html would undoubtedly know how to create one, or at the very least know how to learn how to create one.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
first I must tip my hat to you. Self taught. How long did that take you.
Me myself I went to university to do a degree in computing science. A major part of the course was of course programming. In each case we were handed a project and told to have it back by such and such a date. Before this of course we had to learn the basics. Which yes I was shown a complete code and told exactly what it does(in a book so I couldn’t copy and paste but I think we have established the principals are exactly the same just in paper instead of ones and zeros). Then I was told essentially to make it my own and expand on it. This is the key to what I am saying and I think that we are both saying is "to see is to learn" To answer you question on my maths teachers. No they never did my work for me, but and I think the key point here is that with all new topics in maths I did through primary to secondary and university is that they never handed me a sheet of paper and said do this. In this I mean the first time I heard the words calculus.... "cal-cu-what???" I was then shown several examples of different uses and only then was I given work to do. My point here and in every post I have posted is not the best way to learn or how easy it is to copy and paste but that you will never learn if people refuse you knowledge. Which in my humble opinion is what I think you were doing. Initially. What someone wants to do with the information that you provide is up to him or her. Use it well or not, unfortunately is not up to you. but them. So in short why make a post on a forum where someone needs the answer to a question(whatever that question is and remembering that how they do or don’t use the answer is up to them) SURLEY do not answer with in my understanding of your first post.... I know but I am not telling you. I am by no means a smart man but if I knew the answer to something and I was willing to share I would. If I knew the answer to something but felt the person would be better served without my input. I would say nothing..... |
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
First of all, to answer your question, it took me slightly under three months to learn to program. Of course, this was in C++ and after which I simply claimed to know PHP; however considering the extreme similarity in their syntax and how simple it was to view differences between the syntax of PHP and of C++ using the extremely well put together manual, this was not a lie.
All questions out of the way, your major problem is that you are not, as I have said earlier, reading my responses to my posts, or at least, this is the way it seems. Had you done so, you would perhaps realize that I in no way refuse information. I answer any and all questions in a rather direct manner, other than questions in which people ask me to do their work for them, to which I respond that they must first show some initiative of their own. Also, yes, I am well aware that it is not my responsibility what a user does with the information I provide, it is however, my problem. So long as I provide information which only leads them to the answer, I can be certain they are learning and I can be certain they are not cheating on their work from this source. As I have already said, I am not an idealist (read: foolish), and as you have said you obtained your knowledge of programming in a course at a university. Undoubtedly there were plenty of other people in that course with you, and undoubtedly not all of them particularly cared about learning the subject. It is blatant fact (which I can say because I have seen it) that if I were to simply provide the answer some would copy and paste it, compile, and turn it in, all without reading it or learning a thing. Of course, some of these people would know others in programming courses, whom they would in turn tell about "this amazing site where people do your programming work for you," at which point the number of new topics would increase and the amount of time I am required to spend writing out answers would increase dramatically as well. Do not attempt to argue that the situation would also bring in more users willing to help, it will only provide about one tenth of the new posters, and they will quickly burn out and leave this optional assistance force replying with code over and over again to users who seem to learn nothing from it and beg when it is not provided. Basically, I have the option of wasting a great deal of time writing what none will read, or I can focus exclusively on users who are willing to learn by not providing them with the answers but rather attempt to lead them to them and see who has not gone to another forum in an attempt to find someone willing to write their code for them. Lastly, I reiterate in an effort to cement it within your mind. I do not refuse users knowledge and whenever I provide input to a cause, I do believe it will be useful. Cease your libel of me at once and use the resources around you which, considering you may view the thousands of topics I have since my arrival here, are plentiful (just be sure to go back more than I month, or more accurately, before I was located in a hospital without a computer and no means to walk to one), to reach any further conclusions. » Post edited 2006-10-28, 05:04am by relpats_eht.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
You raise a very good point on the whole university student spreading word on where to get scripts. That is only too true.
The whole point to what I have been saying is not your willingness to share, BUT why mention that you know how to do it but you will not say. Just don’t post a comment. Surely this is the logical way of not being pestered "to do their work for them" Look back to my original post.... P.S i am not questioning your prog knowledge as i am quite sure it surpases mine |
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
I believe you should take your own advice and look back at my original post, along with every other in which I accuse you of libel. I never "mention that I know how to do it but I will not say," I merely state that although there are methods for retrieving an IP address from behind a weak proxy, but the information is largely irrelevant, which I expand upon later as to why. I had inserted that particular comment in the event the user was attempting to retrieve their users IP in all circumstances, even from behind a proxy, to let them know that there was no point in attempting it. I also answered the why to this question later when asked. You seem to have misconstrued this comment to something quite different from what it is (note the wording here, it is not, and cannot be read as, anything with the same implications as what you imply). Furthermore, in the event you are referring the the whole of the post, that neither is worthless, in fact, as I have already explained, it answers all questions in the original post and even provides more information than was requested.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (134)
Member #: 28863 |
Maybe i am confused then....maybe it is my understanding of the english language. Please explain the below comment
relpats_eht writes... In any event, considering this is a forum intended to provide learning assistance, I refuse to do any more than that, meaning I will not supply you with the code you have requested
???????????????? |
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
Had you quoted the entire sentence, rather than a select portion of it, you may know that it means, in short, that I will not do work for you though I will help you with your work in the event you ever show it. Considering that most people do not read the topic posted at the top of this forum, I must assume that it has not been read by anyone who does not follow its guidelines and therefor tell them that we do not provide scripts to those who ask for it but rather assistance with scripts to those who ask.
- relpats_eht
|
||
|
Please login or register to post a reply.