help me!!

if ( $username == 'admin' and $password == 'ncr' )
{
echo("Location: http://localhost/ncr/home");
}

if username and password is correct, echo should takeme to specified link. This page (http://localhost/ncr/home) should be displaced

Recommended Answers

All 6 Replies

i don't want the link to be displayed, if validated the specified page should be diplayed!!!

Help me with coding!!!
If username and password validated
{
Display the home page[[B]need help here[/B]]
}
else
username password invalid

Probably you want this:

if ( $username == 'admin' and $password == 'ncr' )
{
[B]header("Location: http://localhost/ncr/home");[/B]
}

With header("Location: URL/HERE"); you will be redirected to URL/HERE
Is that what you want?

If you want to display you homepage at the bolded part then you could also use the include function.

commented: got wat i was lookin for!! +1

it's dis simple!!!

THX Viletung!!!

CREATE TABLE details (
s_no int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  
 content1sno varchar(50) NOT NULL,

content1name varchar(50) NOT NULL

  content2sno varchar(50) NOT NULL,

content2name varchar(50) NOT NULL,

 content3sno varchar(50) NOT NULL,

content3name varchar(50) NOT NULL,

) type=MyISAM;

Here in this sql query s_no is declared as primary key, so it is unique.
There is no chance of adding the same serial no again in s_no. Apart from that it is given as auto increment, so absolutely no chance of having same serial no again

What i need here is content1sno, content2sno, content3sno should also be unique;;;it will have both integers and characters 'varchar';;

For example:
If in insert operation, the following value is inserted
content1sno=QW78
content2sno=WE23
content3sno=12AB

In the second insert operation, if the value 12AB is given as input to content1sno=12AB. It should display an error as the same value is given as input to content3sno already.


In the php, during insert operation it should check the database if the value going to be inserted is unique for this three


content1sno=QW78
content2sno=WE23
content3sno=12AB

this three should be unique!!


Why i need this is, it will help me in search operation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.