473,408 Members | 2,832 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,408 software developers and data experts.

Using Submit buttons with $_POST

Hello,

I wondered if anyone could advise further? In my script I was trying
allow the user to enter a userid and password, and when the users
clicks the login button. Pass these values passed to a method
login_user, and finally display there record.

I was hoping to display the record on this web page. I would appreicate
some advice if my scrips looks correct? I unsure about the line
if(isset($_POST['login'])){?

Thank you

<?php
function login_form(){
?>
<html>
<head>
<title></title>
</head>

<body>

<div align="center">
<form method="post">
<table border="1">
<tr>
<th align="right">E-mail</th>
<td nowrap>
<input name="userid" size="25">
</td>
</tr>
<tr>
<th align="right">Password</th>
<td nowrap>
<input name="password" size="25">
</td>
</tr>
<tr>
<td align="center">
<input type="submit" name="login" value="Login">
</td>
</tr>
</table>
</form>
<div>
<?php
}

login_form();

if(isset($_POST['login'])){
$userid = $_POST["userid"];
$password = $_POST["password"];
$userRecord = login_user($userid, $password);
displayRecord($userRecord);

echo "</body>";
echo "</html>";
}
?>
Jul 17 '05 #1
0 1581

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

Similar topics

3
by: Mark | last post by:
We have developed an application with register_globals "On" and are now trying to convert it to run under "Off". I understand that a text field previously referred to as txtText must now be...
2
by: Richard B. | last post by:
Hi, Currently designing/building my first class/template driven site. Inside a PHP form a list of article titles are displayed along with the first two lines of the article. When the user...
3
by: Tom Asken | last post by:
Short version: IE 6.0 wrongly posts <button ..> value. Internet Explorer should only post the value of the clicked submit button - but IE 6 posts the value of several submit buttons if they have...
8
by: Adam | last post by:
Hey, I'm using JS to submit a form with image submit buttons, using the following code... (Page is here... http://www.cards2do.co.uk/addcard.php?card_id=292 ) ...
7
by: David T. Ashley | last post by:
Hi, For a web page, I want a SUBMIT button that commits the form data and a CANCEL button that goes to a different target (i.e. a different script). I haven't figured out how to do this,...
15
by: Sonnich | last post by:
Hi all! I have a file where I'd have to submit buttons, and I need to differ between those. Step #1 - open html win with default selection Step #2 - user may select some criteries for the...
1
by: ansc1 | last post by:
Hello, I'm new to using php coding. I need help with the following: 1. There is a submit button on the form and is saves information to my database. After clicking on "Save Measurement" it...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
2
by: sbettadpur | last post by:
Hi everybody, Hi iam strugling with more than one submit buttons with in one form here is my code <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.