473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

to give the link

hai all,
I am very new to this php language.I want to create a
webpage with php ,in the first page there is two text boxes are there
one for username and other for password so when ever then user should
give the correct username and password,how should i give link to the
next page in php.plese help me..

Sep 10 '07 #1
2 1878
bl*******@gmail.com wrote:
hai all,
I am very new to this php language.I want to create a
webpage with php ,in the first page there is two text boxes are there
one for username and other for password so when ever then user should
give the correct username and password,how should i give link to the
next page in php.plese help me..
Hi,

This is typically done with sessions.
So you should start with making sure you understand the working of sessions.
A good place to start is www.php.net:

http://nl3.php.net/manual/en/ref.session.php

Pay attention to session_start() and start with making a simple page
that only tries to read/write sessionvars and try to retrieve them on
another page.

Also, great for debugging:
echo "<pre>";
print_r($_SESSION);
echo "</pre>";

(Replace $_SESSION with $_POST or $_GET or $_COOKIE to print out those
superglobals, also very handy when developing and debugging.)

Regards,
Erwin Moller
Sep 10 '07 #2
On Sep 10, 11:32 am, blesso...@gmail.com wrote:
hai all,
I am very new to this php language.I want to create a
webpage with php ,in the first page there is two text boxes are there
one for username and other for password so when ever then user should
give the correct username and password,how should i give link to the
next page in php.plese help me..
the very simplest way to do this is to have one page with the form

--http://server.com/login.html
<form method="post" action="protected.php">
<input type="text" name="username"/>
<input type="password" name="password"/>
</form>

--protected.php
<?php
$user = 'me';
$pass = 'hello_world';

if( $_POST['username']!=$user || $_POST['password']!=$pass )
{
header( 'http://server.com/login.html' );
exit();
}
else
{
//place your protected page here
}
?>

of course then you would go firther and do what Wewin suggests and use
sessions and pasword encryption and so on....

Sep 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: techy techno | last post by:
Hiii Hello.. I just wanted to know if anyone can tell me how can I give my website visitors the feature of "FRIENDLY PRINTING" through IE. I would definitely like to give a feature like...
1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
7
by: Helen | last post by:
Hi, I'd like to give a detailed description of the link label when the user hovers over it, just like the web environment. How is this done, please? Tks!
11
by: Prince of Code | last post by:
Hey There, I have been to this group for a couple of days. I am really impressed by the way people respond. I get answers for all my doubts and that too more info. So I am putting across a doubt...
12
by: Jarno Suni | last post by:
I want a device to use styles given for media type handheld and not the styles given for media type screen, if the device supports media types handheld and screen. Is it possible without writing...
3
by: shabeerv | last post by:
hello sir, i hv to give link to a html page rom flash, will u give me the details how to do that? thaks... best regards..
2
by: Jen P. | last post by:
Hi, I'm working on a database where I need to calculate some data that fits certain sets of parameters, but I'd like it to give me more information than I know how to get. As an example,...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does simple decimal arithmetic give strange results?...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.