Search found 59 matches
- Thu Sep 04, 2008 2:11 pm
- Forum: PHP - Code
- Topic: Count down postings remaining for user
- Replies: 3
- Views: 176
Re: Count down postings remaining for user
You need to fetch the data from the query using mysql_fetch_row first. Try this code, be sure to add error checking in case the user doesn't exist, etc... $remain = mysql_query("SELECT postings_remaining FROM ".TBL_USERS." WHERE username = '$session->username' limit 1"); $remai...
- Fri Aug 29, 2008 12:47 pm
- Forum: PHP - Code
- Topic: How to add visitor counter per ID page
- Replies: 5
- Views: 694
Re: How to add visitor counter per ID page
Well ignoring the ID, you can do two things. One you can log all IPs even duplicates and use a query that does a GROUP BY ip but then you will have a lot of records or you can run a query that checks for an existing IP, then just do an UPDATE WHERE IP = $ip.
- Thu Aug 28, 2008 9:43 am
- Forum: PHP - Code
- Topic: How to add visitor counter per ID page
- Replies: 5
- Views: 694
Re: How to add visitor counter per ID page
Are you assigning a Unique ID to each person, or do you just want to log based on IP address?
- Tue Aug 26, 2008 3:17 pm
- Forum: PHP - Code
- Topic: How to make single sign in
- Replies: 4
- Views: 308
Re: How to make single sign in
Its good to read up on the tutorials to see how others do it. But so you know to keep a user logged in page to page you should probably use sessions. That way a session variable will be set on login, and checked on all pages to see if the user has logged in.
- Tue Aug 26, 2008 2:20 pm
- Forum: PHP - Code
- Topic: How to handle multiple submit buttons on one page?
- Replies: 7
- Views: 659
Re: How to handle multiple submit buttons on one page?
I have the exact same setup on my site, where I have to approve/reject a bunch or stuff at once. Personally I use an array of check boxes, or you can use radio buttons as well. That way you have one submit button, and your code just loops through all the boxes/radios that are selected. Nice and sweet!
- Tue Aug 26, 2008 10:56 am
- Forum: PHP - Code
- Topic: copy file to remote computer
- Replies: 3
- Views: 348
Re: copy file to remote computer
Its not files you need to worry about, some ports that are for other reasons can be bombarded with junk info causing problems to the remote computer. Back in the day there was a WinNuke program that would send info to some port (113 or something) and cause a Blue Screen of Death.
- Tue Aug 26, 2008 9:19 am
- Forum: PHP - Code
- Topic: Password protection without mysql
- Replies: 4
- Views: 319
Re: Password protection without mysql
The way Zig has it above, if you want to save the password in your script you must first run the hash_function on it. Then save the resulting password in your script. At least this way if someone does see it they can not reverse it back to the original password. They would have to run a brute force ...
- Tue Aug 26, 2008 9:01 am
- Forum: PHP - Code
- Topic: php5 form script problem!!
- Replies: 3
- Views: 1056
Re: php5 form script problem!!
Opps, I didn't realize I was talking to two different people. Sorry Zig I thought you were the original poster. I see now your not, and its should be obvious that your native language is Russian. I have Russian decent but wouldn't be able to understand a word of it!
Al
Al
- Tue Aug 26, 2008 8:43 am
- Forum: PHP - Code
- Topic: php5 form script problem!!
- Replies: 3
- Views: 1056
Re: php5 form script problem!!
Two things right off the bat, I'm not sure why but people keep making these huge echo statements with their entire HTML in it. That is asking for problems, just one wrong space and it will pop an error. You should come out of PHP where that echo starts and back in where needed. The second thing is m...
- Mon Aug 25, 2008 6:33 pm
- Forum: PHP - Code
- Topic: How to make the fields as READ ONLY for the second user?
- Replies: 1
- Views: 765
Re: How to make the fields as READ ONLY for the second user?
I don't know enough about MYSQL to know how it handles multiple users, but I do know most DB systems have ways to deal with this. I am not even sure if your using MYSQL. If I had to make this happen right now without looking to deep I would do this: 1) A user logs in, while reading info from DB you ...
- Mon Aug 25, 2008 6:03 pm
- Forum: PHP - Code
- Topic: simple select does not work - beginner question
- Replies: 3
- Views: 413
Re: simple select does not work - beginner question
mysql_fetch_field returns an object containing field information not the actual field itself. Use mysql_fetch_row, and access the variable with $rest[0]. $result = mysql_query("select max(SessionID) from Session") or die(mysql_error()); $rest = mysql_fetch_row($result); echo " Top 1...
- Mon Aug 25, 2008 10:18 am
- Forum: PHP - Code
- Topic: Not understanding why my tables returns empty.
- Replies: 7
- Views: 554
Re: Not understanding why my tables returns empty.
Well based on that error you know it is being caused on your SQL statement. Two great things I always do to figure out my SQL problems are: 1) Save SQL statements in a variable and echo them out to make sure they are correct 2) Use something like phpMyAdmin to make sure the SQL statement that you ar...
- Fri Aug 22, 2008 9:30 am
- Forum: PHP - Code
- Topic: email form
- Replies: 15
- Views: 1502
Re: email form
Those errors are caused because you can't send data before using the header function. First does echo $UN; display the username? Second if it does work, get rid of it from your code. I just used that as a debugging method, once its gone your errors should go away.
- Fri Aug 22, 2008 8:35 am
- Forum: PHP - Code
- Topic: email form
- Replies: 15
- Views: 1502
Re: email form
code?
- Fri Aug 22, 2008 8:14 am
- Forum: PHP - Code
- Topic: free host access and database access
- Replies: 7
- Views: 717
Re: free host access and database access
No Problem, glad I could help. I know how frustrating the little things can be.