Jump to content

Recommended Posts

Hi, i am working with a login form using php. I have a problem submitting the form values. Here is the code :

 

<BODY>

<div class="main">

<h1>Login Form</h1>

 

 

<br/><br/>

<div class="box">

<form action="process.php" method="post">

<label> <span>Username: </span><input type="text" name="username" value="" /><label/>

 

<label> <span>Password: </span><input type="password" name="password" value="" /><label>

 

 

 

 

 

</form>

<div class="spacer"><a href="process.php" onClick="" class="green">Sign in</a></div>

<div class="spacer">

Lost your data? <a href="#">Get your password</a><br/>

New User? <a href="#">Sign up</a>

</div>

</div>

</div>

 

</BODY>

 

i am new to both html and php. I understand that if i use a submit button, i can access the form varibles (username & password ) in the process.php page using $_POST.

Now if i want to access them by clicking on a link (<div class="spacer"><a href="process.php" onClick="" class="green">Sign in</a></div>)

i'm not able to access the same now using the $_POST superglobal. Please help me as to how i can access the form variables in process.php using this method. If i am wrong in writing the code, please correct me. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/128759-solved-help-needed-with-post-method/
Share on other sites

I am basically trying to create a login form. So that i can take in the username and password from a user and validate it using values from a database. I understand that i need to submit the form using this piece of code

<input type="submit" name="submit" value="Submit" />

But i don't want to use the default submit button. I wanted to use a custom button. How do i send the values (i,e username and password) from the login page to a process page using a custom button and not the default button. I am new to html and php. Sorry about not using the code tags earlier. Thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.