Search found 1179 matches

by Temor
Sat Sep 08, 2012 4:36 pm
Forum: Tutorials
Topic: Little problem with message system
Replies: 18
Views: 2446

Re: Little problem with message system

It should not be appearing seeing as $errors is only set if $_POST['to'], $_POST['subject'] and $_POST['body'] is set. [syntax=php]if (isset($_POST['to'], $_POST['subject'], $_POST['body'])) { $errors = array();[/syntax] are you refreshing using f5? that resends post data. Type the address again and...
by Temor
Sat Sep 08, 2012 4:19 pm
Forum: Tutorials
Topic: Little problem with message system
Replies: 18
Views: 2446

Re: Little problem with message system

I didn't go through all your code, so I won't comment on the suitability of doing things the way you did. [syntax=php]if (empty($errors)) { if (empty($errors)) { echo '<div> Your message has been sent! <a href="messages.php">Return to your Inbox</a></div>'; } else { foreach ($errors as $er...
by Temor
Thu Sep 06, 2012 2:46 am
Forum: PHP
Topic: PHP Tutorial: Register and Login (Cookie Extension) [part 01
Replies: 8
Views: 1484

Re: PHP Tutorial: Register and Login (Cookie Extension) [par

it is not expecting the triple equals ( === false ). Change that to two equals.
by Temor
Thu Sep 06, 2012 1:55 am
Forum: PHP
Topic: PHP Tutorial: Register and Login (Cookie Extension) [part 01
Replies: 8
Views: 1484

Re: PHP Tutorial: Register and Login (Cookie Extension) [par

Your problem is that you're applying the sha1 hash twice. Once when you call it, and once inside the function.
Remove the one where you call it and keep the one inside the function.
by Temor
Thu Sep 06, 2012 12:52 am
Forum: PHP
Topic: PHP Tutorial: Register and Login (Cookie Extension) [part 01
Replies: 8
Views: 1484

Re: PHP Tutorial: Register and Login (Cookie Extension) [par

That's not the code I asked for. Post the code for the function. Not where you use the function.
by Temor
Wed Sep 05, 2012 1:38 pm
Forum: PHP
Topic: PHP Tutorial: Register and Login (Cookie Extension) [part 01
Replies: 8
Views: 1484

Re: PHP Tutorial: Register and Login (Cookie Extension) [par

The problem is likely within the valid_credentials function. Could you post the code for that?
by Temor
Sun Sep 02, 2012 5:41 pm
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2554

Re: User Profile List Catergories

$user will always be an array. You need to tell php what you want to show from that array.

[syntax=php]echo $user['company_name'];[/syntax]
Doing this should suffice.
by Temor
Sun Sep 02, 2012 12:38 pm
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2554

Re: User Profile List Catergories

I think I do understand. I would sort this into two pages. Categories.php and Users.php ( For simplicity, you can name them whatever you want ). Categories.php will fetch all categories, and print them to the screen. [syntax=php] // Put this function in a backend file. function fetch_categories(){ $...
by Temor
Sat Sep 01, 2012 8:21 pm
Forum: PHP
Topic: Vote for Diamonds
Replies: 5
Views: 1065

Re: Vote for Diamonds

Would you care to elaborate on what a Vote for Diamonds system is?

I am more than willing to help you do this, however I will not do this for you.
Tell me what you mean and I'll do my best to tell you what to do :)
by Temor
Fri Aug 31, 2012 2:02 pm
Forum: Code
Topic: Secure Password Class
Replies: 6
Views: 2338

Re: Secure Password Class

Would there be any noticeable difference in security if you would go farther than 2048, or incorporate letters as well?
I'm thinking that 2048 bits is difficult enough to crack, so going bigger wouldn't necessarily mean being safer. Am I wrong here?
by Temor
Fri Aug 31, 2012 12:07 pm
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2554

Re: User Profile List Catergories

I'm guessing you're using a boolean to determine the gender? ( 0 for male 1 for female ) If so, then it's pretty much just like any other time you fetch data from a table. [syntax=php]$sql = "SELECT `user_name` FROM `user_system` WHERE `gender` = 0";[/syntax] This will select all the usern...
by Temor
Thu Aug 30, 2012 11:06 pm
Forum: Suggestions
Topic: security: password encryption
Replies: 4
Views: 2244

Re: security: password encryption

After some quick knowledge refresh I came to the conclusion that: hash is the exact same thing as openssl_digest. hash_hmac is the same thing as hash except it runs twice every time it's called. The difference between hash and crypt is that crypt is slower, and computationally expensive. So it is le...
by Temor
Tue Aug 21, 2012 8:04 pm
Forum: Tutorials
Topic: login email activation problem
Replies: 3
Views: 730

Re: login email activation problem

No worries :P
by Temor
Tue Aug 21, 2012 12:18 pm
Forum: SQL
Topic: Checkbox filter
Replies: 3
Views: 1784

Re: Checkbox filter

Well, the first solution that comes to mind is to create a "dynamic" SQL statement. [syntax=php]$sql = "SELECT `type`,`state` FROM house WHERE `type` = '{$_POST['type']} AND `state` = '{$_POST['state']}'' ";[/syntax] This would only select results that match the chosen type and s...
by Temor
Tue Aug 21, 2012 12:00 pm
Forum: Tutorials
Topic: User Profile - edit profile not working.
Replies: 19
Views: 2630

Re: User Profile - edit profile not working.

I mean, if you do this:
[syntax=php]echo $_SESSION['id'];[/syntax]
does it give you a value, or is it empty?
by Temor
Tue Aug 21, 2012 11:59 am
Forum: Tutorials
Topic: login email activation problem
Replies: 3
Views: 730

Re: login email activation problem

[syntax=php]is_active($_POST['usesrname']) === false)[/syntax]

You have a typo here.
by Temor
Tue Aug 21, 2012 11:58 am
Forum: Tutorials
Topic: User Account System - not working
Replies: 5
Views: 1046

Re: User Account System - not working

I always use backticks ( ` ) around table and column names. It adds to the readability of the code. I'm not sure if it makes any other difference though.

[syntax=php]mysql_connect('database_host', 'data_username, 'data_pass');[/syntax]

you forgot a quote after data_username.
by Temor
Mon Aug 20, 2012 11:50 pm
Forum: Tutorials
Topic: User Account System - not working
Replies: 5
Views: 1046

Re: User Account System - not working

That error means something is wrong with the SQL statement.
Adding [syntax=php] echo mysql_error();[/syntax]
underneath the mysql_query(); will provide details on the error.
by Temor
Mon Aug 20, 2012 10:25 pm
Forum: Tutorials
Topic: User Account System - not working
Replies: 5
Views: 1046

Re: User Account System - not working

There are a few typos. Line 7: [syntax=php]if (isset($_POST['username'], $_POST['password'], $POST['check_password']))[/syntax] you forgot an underscore in the last value. Line 20: [syntax=php] if ($_POST['passowrd'] !== $_POST['check_password'])[/syntax] you spelled Password wrong. Fixing those wil...
by Temor
Mon Aug 20, 2012 3:03 pm
Forum: Tutorials
Topic: User Profile - edit profile not working.
Replies: 19
Views: 2630

Re: User Profile - edit profile not working.

Are all the errors gone?
Is the $_SESSION['id'] variable populated?