nav33n 472 Purple hazed! Team Colleague Featured Poster

You dont need phpbb for this. Save the user's messages in a table.. You can have 2 tables.. users and messages. user_id -> foreign key for messages. Whenever the user saves a message, save it in messages table which references the user_id of that user. List all the messages of that user for viewing.. select message_details from messages where user_id='user-id-of-that-user'; To search for a message, you can use select message_details from messages where message_details like '%-search-string-%' && user_id='user-id'; Since its a school project, I dont think you need more than that!

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. Just include that js and call the function wherever you want. Did you even click the links that I gave you ? :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

umm..I didn't get what you really want..But as per my understanding, it can be done using sql. Say a user adds a level module. Have a column in the table with name level_module. If the user has installed a level module, set it to 1. You can then check if level_module is 1 for that particular user.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Check this or this..

nav33n 472 Purple hazed! Team Colleague Featured Poster

mysql yog is really good !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Get a good editor.Find all the matching braces and check if all the open braces are closed properly.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Oh, Well, first of all, you are not fetching the record from the table. What you are doing is, checking if a row exists in the table with the provided details. If yes, then print the "input values". But you should do something like this.

<?php
.....blah blah blah.....
$query="select * from table where firstname='$fname' && lastname='$lastname' && date_of_birth='$dob'";
$result=mysql_query($query);
$row=mysql_fetch_array($result); //if you are sure that the query returns only 1 row. If you are not sure, then use the while loop. while($row=mysql_fetch_array($result)){
}
//$row will have all the information. You can then use the columnname as the index.
echo "Welcome". $row['fname']."  ".$row['lastname']." Your date of birth is". $row['date_of_birth']." and your registration number is ". $row['reg_num'];

mysql_num_rows returns only the number of rows returned by that query.
:) Hope it helps.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thats because, reg_num variable is null. Where is reg_num coming from ? From a previous page ? You can use print_r($_POST) for debugging purpose. This will print all the variables that are posted from page1 to page2.(PS. You should write print_r($_POST); in page 2.) Try that and tell me if you are posting reg_num !

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can do that using css.

<html>
<body>
<a href="http://www.example.com" style="text-decoration: none;">click here</a>
</body>
</html>

To apply the same style to all hyperlinks, use this.

<html>
<head>
<style type="text/css">
a {
text-decoration: none; 
}
</style>
</head>
<body>
<a href="http://www.example.com">Click here</a>
</body>
</html>

This will take off the underline from all a href links.

nav33n 472 Purple hazed! Team Colleague Featured Poster

ok i cant seem to log in with a regualr password. this code works fine without md5 but it doesnt work when i use md5. yes i've already connected and selected database.
$username = mysql_real_escape_string($_POST); //so someone cant sql inject.

$ = mysql_real_escape_string($_POST['username']);
$password = md5($_POST['password']);
$result = mysql_query("SELECT * FROM registered_members WHERE username=\"$username\"");
$row = mysql_fetch_assoc($result); // note assoc
if ($row['password'] == $password) {
echo "Login successful <br />";
echo "Welcome $username <br />";
include("adminstuff.php"); // shows the user stuff if the user login is successfull
} else {
die ('Login Failed.');
}

Umm.. Instead of checking the password for that username(by fetching the password from the table and all), you can simplify this step by checking the password in your query !

$query="select * from registered_members where username='$username' && password='$password'";
$result=mysql_query($query);
if(mysql_num_rows($result) > 0 ){
  echo "Valid user";
} else {
   echo "Invalid User";
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

@[omega], Sorry. This is the first time I am seeing something like this! hmm..maybe someone who knows bout it should answer !

nav33n 472 Purple hazed! Team Colleague Featured Poster

You need to write style for that (using css ie.,) Check this out.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are the man nav33n! Can I rent you please ;)

:P lol..

nav33n 472 Purple hazed! Team Colleague Featured Poster

you r right, but not completely. We should not print anything befor header. If someone print then it will not redirect.

Yep. Thats what I said.

When header will use to redirect the page, printing anything after the header, what will happen?

Nothing. Since we are calling the header function, the page will be redirected to another page ignoring anything after the header function.

nav33n 472 Purple hazed! Team Colleague Featured Poster

nl2br function!

Venom Rush commented: Helpful response as always +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Wow! what are you talking about ? Sorry for my ignorance, but what are neurons ? learning rate ? momentum ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

You make a good point, but would that store 'checked' or 'unchecked' in the database??

No. It will store the value of the checkbox. Eg.

<?php
print "<pre>";
print_r($_POST);
print "</pre>";
?>
<form method="POST" action="test.php">
<input type="checkbox" name="check[]" value="100">100 <br />
<input type="checkbox" name="check[]" value="200">200 <br />
<input type="checkbox" name="check[]" value="300">300 <br />
<input type="submit" name="submit" value="submit">
</form>

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

umm.. Welcome to Daniweb ! :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hopefully this will give you an idea that you can adapt into your code, if not then ask again

<?php
if(isset($_POST['box01']))
{
$box01 = 1;
}
else
{
$box01=0;
}
if(isset($_POST['box02']))
{
$box02=1;
}
else
{
$box02=0;
}

$insert=mysql_query("
INSERT INTO tablename('field01', 'field02')
VALUES ('" . $box01 . "', '" . $box02 . "'");

Instead of $box01=1 and $box01=0, you can assign the value of the checkbox itself! $box01=$_POST['box01']; And this isn't useful if you have, say, 10 checkboxes. The best thing would be to have an array of checkboxes !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you show us your code ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Lol.. great idea though !

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. I would use confirm box too. But if you want to have custom buttons, thats the only way, a popup.

nav33n 472 Purple hazed! Team Colleague Featured Poster

@vipin_php, Next time, please put your code in [/code ] tags.[code=php ] [/code ] tags.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. Or put the above code in a javascript function, and call that function with onclick event.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, I write my own page with 2 buttons to do required operation. Then I call that page using the following.

window.open(url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width="300", height="200")

Here, url is the page that I want as popup.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi sir...I am online...can i ask few doubts to u...

Hey, dont call me sir. I am Naveen. And you can post your doubts here. (if its java related.)

nav33n 472 Purple hazed! Team Colleague Featured Poster

you can arrange your output in any format you want.

<?php
//connection
//select db
$query="select * from product_listing group by product_category";
$result=mysql_query($query);
echo "<table>";
while($row=mysql_fetch_array($result)){
   echo "<tr><td>".$row['product_name']."</td><td>".$row['product_id']."</td></tr>";
}
echo "</table>";
?>

This will put the values in a table of 2 columns. I don't understand what the code in your other thread do.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) awesome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

also how am i going to modify my whole login script to use tihs now? I have it verifying the first name and then the last name... Then i use that and create a session variable to use later on so i know whos voting.

how can i do that now?

Don't you have a separate username/loginname field ? Umm.. My suggestion is to change the table structure itself. But if you want to use the same table, then you can ask the user to enter his firstname and password, and then compare it with the values in the table for that first name and password.

dani190 commented: awesome help yet again! Well done +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

ok it works but now the firstname and lastname come up all bunched into 1 word, hows a space added there.

Add a white space in the concat function.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Ken.. Please post your question in hardware forum! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hello Brian ! Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

try it out ! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, If you dont have an id field, what/how do you plan to update the table ? because, there can be people with same first name and same last name. You need to have an id field. Anyway, you can make use of concat function in mysql to join those 2 fields.
Eg. select concat(firstname,lastname) as name from table;

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can do that by using group by clause. select * from product_listing group by product_category; I dont know what you mean by >>still be able to see the table layout in dreamweaver << :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

I guess you didn't see my example ?

nav33n 472 Purple hazed! Team Colleague Featured Poster
....
where id='"$_POST[id]"'"; // << $ sign.
nav33n 472 Purple hazed! Team Colleague Featured Poster

;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

This thread is more than an year old! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

never print or echo anything after using header.

After using header ? Are you sure ? You can print anything you want after calling header function. You shouldn't print anything before header. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

This wouldn't work since you are adding $_SESSION=$myusername; even without checking if hes a valid user. Secondly, $_SESSION will be null and not 0.

nav33n 472 Purple hazed! Team Colleague Featured Poster

when the user logs in, put his username to the session. Eg.
//After logging in, add his name to the session. $_SESSION['user']=$username; Then in each page, check if $_SESSION is not null. If its null, then use header function to redirect the user back to the first page. If its not null, then continue with normal operations.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Pedro!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Nope. You should write your own popup for that (with 2 buttons ie.,)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I dont know what are the fields you have in your table. So give me more details. Can you be more specific in what do you want exactly ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Removing expired jobs can be done by writing a simple query. When a webmaster logs in, do a check if that job is valid(if posted_date > DATE_SUB(CURDATE() - INTERVAL X DAYS)) or if its expired (if posted_date < DATE_SUB(CURDATE() - INTERVAL X DAYS)). If its expired, remove them.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What does a webmaster module do ?