Support Forums

Full Version: How to make a form.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Forms are used to send date to the file.

Methods

POST
A post method posts to the php file and you can't see anything by the eye.
GET
A get method sends the user to the php file like file.php?eg=thereinput

So lets get to the coding of the form.

Code
PHP Code:
<form action="" method="GET">
<
b>Username: </b><br><input type="text" name="username"><br>
<
input type="submit">
</
form>
<?
if(isset(
$_GET['username'])){
$username $_GET['username'];
echo 
"The username you put is: " .$username;
}
?>

Now let me show you what etch line does.
<form action="" method="GET">
Starting the form saying action = to... What php file the form sends to.
Method = meaning the method so post or get.

<b>Username: </b><br><input type="text" name="username"><br>
Inputing text and a textbox for the user to enter there username.
<input type="submit">
Inputing a submit button.
</form>
Ending the forum.
<?
Starting the php tag
if(isset($_GET['username'])){
Meaning if link has a get method in with the value username then so the script.
$username = $_GET['username'];
Grabbing what the user inputed in the textbox before.
echo "The username you put is: " .$username;
Showing on there screen that text.
}
Ending the if
?>
Ending the php tags.


If you need any help with this fell free to pm me.

Please take a look at the forums before posting, I already have a similar tutorial in here, I recommend you read THIS before continuing. Also, don't forget to read the rules. Proof reading always helps too, you have allot of grammatical errors in there.
(12-16-2011, 04:56 AM)BreShiE Wrote: [ -> ]Please take a look at the forums before posting, I already have a similar tutorial in here, I recommend you read THIS before continuing. Also, don't forget to read the rules. Proof reading always helps too, you have allot of grammatical errors in there.

Well two will be okay, and i'm so tired i'll do it latter.
Two what will be okay? You're too tired to do what? Please be clearer.
(12-16-2011, 05:03 AM)BreShiE Wrote: [ -> ]Two what will be okay? You're too tired to do what? Please be clearer.

Two tuts on this, and i'm to tried to fix my grammar errors.
What's the point in having two tutorials for the same thing? That's so illogical. (Don't mind me I'm a bit hyped up about today so I like using big words, just ignore it haha)

But yeah, nice tutorial I guess, some things are a bit hard to understand but never the less quite good! You should add into the OP THIS THREAD to explain to people what the IF statement does.

I like to use www.jotform.com because it is secure, otherwise there are a HANDFUL of things that hackers can do to your fields.
(12-16-2011, 04:56 AM)BreShiE Wrote: [ -> ]Please take a look at the forums before posting, I already have a similar tutorial in here, I recommend you read THIS before continuing. Also, don't forget to read the rules. Proof reading always helps too, you have allot of grammatical errors in there.

I am so sorry. I couldn't resist, but you have a spelling error in there also. Pinch

(12-30-2011, 06:19 PM)King Wrote: [ -> ]I am so sorry. I couldn't resist, but you have a spelling error in there also. Pinch


Where? I don't see any?

Everything is fine as far as I can see.
(12-30-2011, 07:54 PM)BreShiE Wrote: [ -> ]Where? I don't see any?

Everything is fine as far as I can see.

Third one down.

http://david.tribble.com/text/misspell.html
Pages: 1 2