• 0

Return info and not show it in the address bar


Question

Well i have a sign in form, and there are about 10 fields... some of them are required so i want to know haw can i do this:

The user has filled in almost all the the fields, but he fogot one (required) and hit submit button... so i want to return to the sign in page but wiht the fields filled with the information he already typed. i have done it retuning the values like this: www.server.com/page.php?filed1=value&filed2=value2..... and so on... but i dont want my variable passed that way.. does exist any other way to return variables??

Thanks in advance!!!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

I think that is the difference between the get method and the post method when submitting a form. Get appends parameters to the URL, and post uses an http transaction. As far as accessing a post's values, I don't know how it works in php.

Link to comment
Share on other sites

  • 0

ok i got it.. but how can i do for this.. look :

two files

1.- account.php

2.- verify.php

in verify i know how to capture the info with th $_POST[name].. butn what happen if i have three fields: name, pass, email but the user forgot the email field and i wan tto go back to account.php but i want the name and the pass already there cause the user typed them..

Link to comment
Share on other sites

  • 0

You'll have to create a form on verify.php with hidden fields containing the values and a submit button for them to click on to go back. Hidden fields are simple enough:

<input type="hidden" name="username" value="<?php print $_POST["username"]; ?>" />

Same again for the other 2...

The possible problem with this is you need a form submit button. This might look out of place depending on your page - if it does, you can use an image to make it more fitting. I think there is a way, although I don't know how, to make a submit button out of normal text using style sheets. If someone knows how, please post!

Link to comment
Share on other sites

  • 0

I think for submitting without a submit button only requires some javascript. Like...

function submitIt()
{
  document.forms[0].submit(); // or you can use the DOM, getElementByID/Name... etc.
}

So you could use a hyperlink:

<a href="javascript:void(submitIt())">Whatever</a>

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.