Search found 49 matches

by Shahlin
Thu Jan 24, 2013 8:54 pm
Forum: Tutorials
Topic: My delete function doesn't work! (PM System)
Replies: 2
Views: 843

My delete function doesn't work! (PM System)

I'm done with the whole PM system. Only thing that's not working is the delete conversation feature. Here's my delete_conversation function : function delete_conversation($conversation_id){ $conversation_id = (int)$conversation_id; $sql = "SELECT DISTINCT `conversation_deleted` FROM `conversati...
by Shahlin
Thu Jan 10, 2013 8:05 pm
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Re: Private Message System help!

jacek wrote:Is the table conversations_messages I think mine was conversation_messages, either way try sticking a
echo mysql_error();
after that mysql_query line.
I have actually found out the mistake! :D I didn't add 's' in 'conversation' in one of the INSERT queries. Now, it works fine! :D
by Shahlin
Thu Jan 03, 2013 4:50 pm
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Re: Private Message System help!

But my conversations_members table is empty. That is not good :P Could you post the INSERT query where the users are added to this table ? This one? $sql = "INSERT INTO `conversations_messages` (`conversation_id`, `user_id`, `message_date`, `message_text`) VALUES({$conversation_id}, {$_SESSION...
by Shahlin
Wed Jan 02, 2013 8:29 pm
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Re: Private Message System help!

ExtremeGaming wrote:Are there any rows in the database where $_SESSION['user_id'] = 1?
In my 'conversations_messages' table, there are rows with the user_id = 1. But my conversations_members table is empty.
by Shahlin
Sun Dec 30, 2012 9:31 am
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Re: Private Message System help!

Make sure you are including the init.inc.php file correctly, that you are logged in correctly and that you call session_start() in the init.inc.php file. Since it's returning empty, you also need to make sure that the $_SESSION['user_id'] is set and is being used inside the table. If you think it m...
by Shahlin
Sat Dec 29, 2012 2:46 pm
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Re: Private Message System help!

You may have to wait for someone with better eyes than mine :? /me enters room An empty array means that the query is technically working but not returning any rows, since it looks like the correct format that probably means the WHERE is faulty. . . . . . If would also be worth setting your error_r...
by Shahlin
Wed Dec 26, 2012 7:35 pm
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Re: Private Message System help!

I tried! But it didn't work!
by Shahlin
Wed Dec 26, 2012 11:38 am
Forum: Tutorials
Topic: Private Message System help!
Replies: 13
Views: 2690

Private Message System help!

I'm in the ending of the 9th part of the PM system. In the video (14:52 minute), Jacek's is shown keys and values of the array. But what I get is, just an empty array like this : Array() Please help! This is my fetch_conversation_summary function function fetch_conversation_summary(){ $sql = "S...
by Shahlin
Sat Mar 17, 2012 10:04 am
Forum: PHP
Topic: Login form - Viewing Errors!
Replies: 9
Views: 2522

Re: Login form - Viewing Errors!

Thanks! It works now!
by Shahlin
Fri Mar 16, 2012 7:17 pm
Forum: PHP
Topic: Login form - Viewing Errors!
Replies: 9
Views: 2522

Re: Login form - Viewing Errors!

This is my complete code : <?php include 'init.php' ; session_start() ; if (isset($_POST['username'], $_POST['password'])) { $username = $_POST['username'] ; $password = md5($_POST['password']) ; $errors = array() ; if (empty ($username) || empty ($password)) { $errors[] = 'Please enter your usernam...
by Shahlin
Fri Mar 16, 2012 12:44 pm
Forum: PHP
Topic: Login form - Viewing Errors!
Replies: 9
Views: 2522

Re: Login form - Viewing Errors!

I'll try to fix it. But what about this :
if ($rows == 1) {
$_SESSION['user_id'] = $user_id;
header('Location: profile.php?id='.$_SESSION['user_id'].'');
exit() ;
} 
When I do this, It takes me to this page : profile?id=

Any problem with sessions?
by Shahlin
Thu Mar 15, 2012 6:44 pm
Forum: PHP
Topic: Login form - Viewing Errors!
Replies: 9
Views: 2522

Re: Login form - Viewing Errors!

One more thing! if (empty ($username) || empty ($password)) { $errors[] = 'Please enter your username and password'; } else { $login_check = mysql_query("SELECT `id` FROM `users` WHERE `username`='$username' AND `password`='$password'"); $rows = mysql_num_rows ($login_check); if ($rows == ...
by Shahlin
Thu Mar 15, 2012 6:17 pm
Forum: PHP
Topic: Login form - Viewing Errors!
Replies: 9
Views: 2522

Re: Login form - Viewing Errors!

Temor wrote:
<div id="phpErrors" style="color:#F00"><?php if(!empty($errors)){
 foreach($errors as $error){
 echo $error;
}
}?></div>
I don't see why that wouldn't work.
Thanks! =)
by Shahlin
Thu Mar 15, 2012 5:27 pm
Forum: PHP
Topic: Login form - Viewing Errors!
Replies: 9
Views: 2522

Login form - Viewing Errors!

This is my code : <body> <?php include 'config.php' ; if (isset($_POST['username'], $_POST['password'])) { $username = $_POST['username'] ; $password = md5($_POST['password']) ; $errors = array() ; if (empty ($username) && empty ($password) ) { $errors[] = 'Please enter your username and pas...
by Shahlin
Fri Feb 24, 2012 2:35 pm
Forum: PHP
Topic: Help Needed In Remember Me Feature In Login!
Replies: 4
Views: 927

Re: Help Needed In Remember Me Feature In Login!

$id = (isset($_COOKIE['user_id'])) ? (int)$_COOKIE['user_id'] : $_SESSION['user_id'] it happens because the variable $_SESSION['user_id'] has no value. Was the code you posted the full thing, because it night be as simple as you forgot the session_Start() call. EDITED : Uhmmm Nevermind. I Managed T...
by Shahlin
Thu Feb 23, 2012 5:47 pm
Forum: PHP
Topic: How to autodirect to index pg after login???
Replies: 2
Views: 616

Re: How to autodirect to index pg after login???

use the header function.
header ('Location: index.php') ;
by Shahlin
Wed Feb 22, 2012 3:15 pm
Forum: PHP
Topic: Help Needed In Remember Me Feature In Login!
Replies: 4
Views: 927

Re: Help Needed In Remember Me Feature In Login!

foreach ($args as $field) { $args [$field] = $query_result[$field] ; } return $args ; You should use a different variable in place of $args in the loop really. Also this code is kind of all in the wrong order, maybe try my version of the login tutorial ? Uhmmm Can You Tell Me The Solution? :) I Alr...
by Shahlin
Tue Feb 21, 2012 11:39 am
Forum: PHP
Topic: Help Needed In Remember Me Feature In Login!
Replies: 4
Views: 927

Help Needed In Remember Me Feature In Login!

I Have A Login With Remember Me Feature In It. The Problem Is When A Person Checks 'Remember Me' And Logs In, Then His Data Isn't Shown. When He Logs In Without Checking 'Remember Me', His Data Is Shown! Everything Works Fine! Except The User's Data Isn't Shown. This Is The Notice I Get : Undefined ...
by Shahlin
Mon Feb 06, 2012 11:50 am
Forum: PHP
Topic: How To Let Users Visit Others Profile?
Replies: 19
Views: 3683

Re: How To Let Users Visit Others Profile?

Thanks ALOT! :D
Everything Works! :D
Thanks Again! :)
by Shahlin
Sun Feb 05, 2012 5:57 pm
Forum: PHP
Topic: How To Let Users Visit Others Profile?
Replies: 19
Views: 3683

Re: How To Let Users Visit Others Profile?

what does the URL look like when you go to profile.php? are you including the ?id= ? your url should look like this: /profile.php?id=x x is the number corresponding to the ID in the database. When I First Login...It Takes Me To The Profile...With The User's Id In The URL! Like : ../profile.php?id=4...
by Shahlin
Sun Feb 05, 2012 1:02 pm
Forum: PHP
Topic: How To Let Users Visit Others Profile?
Replies: 19
Views: 3683

Re: How To Let Users Visit Others Profile?

Oh I Am Sorry. I Fixed It...And It works Perfectly Now! :D Only Thing Is...When I Go To profile.php The Fields Are Blank. No Info Is Shown...Is There A Fix? i would need to see your code. Profile.php <?php require_once 'core.php' ; require_once 'config.php' ; if (isset($_SESSION['user_id'])&&am...