| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| PHP Tips and tricks!; Not a question for once! | |
|---|---|
| Tweet Topic Started: Apr 6 2005, 12:10 AM (1,001 Views) | |
| Dennis | Apr 6 2005, 12:10 AM Post #1 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Post any little PHP tricks here. One thing I just learned today, is the require_once() function. I sure wish I had known this earlier! It's great for functions files, since you can call it over and over and it won't give a Cannot Redefine error. Anyways, I <3 PHP.
|
![]() |
|
| JCink | Apr 6 2005, 01:01 AM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Counting number of rows in an SQL table. I just learned this a while ago: $result = mysql_query("SELECT * FROM a_table"); $total = mysql_num_rows($result); echo "$total rows"; |
![]() |
|
| Seth | Apr 6 2005, 02:04 AM Post #3 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Ewwww, bad form!
|
![]() |
|
| Jeremy | Apr 6 2005, 08:07 AM Post #4 |
![]()
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Yes... mysql_num_rows() is generally used to check if you got a result, usually if you're wanting to make sure you only got a certain number of rows or if you're looking for more than one, etc.
|
![]() |
|
| shockwave- | Apr 6 2005, 08:09 PM Post #5 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
cookie stealers are great. Google about them. They write information about a user's cookie to any file you want it to. |
![]() |
|
| JCink | Apr 7 2005, 02:45 PM Post #6 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Is it still okay though anyway to do it the way I am? Is that invalid? I seem to remember that way a bit better...
>_< and, what, would you do with this cookie? |
![]() |
|
| Dennis | Apr 7 2005, 02:52 PM Post #7 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
mysql_num_rows() would work, but the mysql_fetch_array() uses less CPU, I think. |
![]() |
|
| JCink | Apr 7 2005, 03:40 PM Post #8 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Oh allright then, thanks. |
![]() |
|
| Seth | Apr 8 2005, 09:46 AM Post #9 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Not true. It's simply the wrong way to go about things. |
![]() |
|
| Dennis | Apr 8 2005, 10:11 AM Post #10 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
ok. I wasn't sure, but that was my guess. :/ |
![]() |
|
| shockwave- | Apr 15 2005, 08:01 PM Post #11 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
Ok, let's say someone was in an unsecure site, in an admin area. Some PHP sites put your pwd and other file info in the address bar such as ?username=namehere&password=passhere Since you get the reffer from this, you get their username and password. There is a lot of other useful information you can get from a cookiestealer. |
![]() |
|
| blakeo_x | Apr 17 2005, 01:45 AM Post #12 |
![]()
I cant believe its not PHP!
![]() ![]() ![]() ![]() ![]()
|
Cookie STEALING is considered an illegal offense online as you take cookies that arent meant to be read by anyone other than the person who set them. Cookie READING, however, is legal in that it only reads cookies set by the current domain. I hope you meant reading. |
![]() |
|
| Seth | Apr 17 2005, 02:24 AM Post #13 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Since a site can only read cookies that match its domain name, you're good. :rolleyes: |
![]() |
|
| blakeo_x | Apr 17 2005, 03:08 PM Post #14 |
![]()
I cant believe its not PHP!
![]() ![]() ![]() ![]() ![]()
|
actually, you can read cookies from any site by fooling javascript into thinking you are the parent site. Also, higher-level languages can get the cookie content as a file. PHP is one of them, I think. |
![]() |
|
| Seth | Apr 17 2005, 04:51 PM Post #15 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I don't know what Javascript has to do with anything... and the cookiegrab limitation is a browser function; has nothing to do with any "higher-level languages". You would have to install software on a person's computer to yoink their cookies. Believe me, if we could grab cookies between servers, that would be wubbly. But you just can't. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Technology Chat · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
4:02 PM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)





4:02 PM Jul 11