FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


passing input from a form to a script





Technaut
how exactly do i pass input from a form to a variable in a php script? i have a pop3 and imap mail checker on my site, but i do not know how to modify it so that the form tells the script what the server type, server, username, and password variables are. i can give you guys the script, if you need to look at it. any help you can give i am very thankfull for. Very Happy
DanielXP
So you made the html page

u see the textboxs should have a name="_____" in it if not add it to each of them and add a new

then in the page it has to post to add this below the <?php

$____ = $_POST["_______"];

Make sure you change all the lines!
Technaut
i do not understand. do you mean like this? (forgive me if i have the syntax wrong)

Code:
<input type="text" name="<?php $http_post["$server"]"?> value="Server">
badai
i think u better put the script here so we can see exactly what the form look like and what the php should be.
DanielXP
<input type="text" name="WHAT U WANT TO CALL IT" size="20">

thats there html file you need to change the name and make as many what you need if you don't understand this then stop here.

then in the php file you need to add this

$WHAT U WANT TO CALL IT = $_POST["WHAT U WANT TO CALL IT"];

If you don't under stand all this i can't help. read tutorials
yjwong
@DanielXP:
Remember that you cannot put spaces as a variable or a key in an array. In HTML, you cannot put spaces in the name attribute too. Maybe a browser might recognize it, but it won't work for Javascript.

Example of the HTML form: (this is just a section of it)
Code:

<form action="form_parser.php" method="POST">
What is your name? <input type="text" name="yourname" />
</form>


Example of the form parser [form_parser.php] as defined above:
Code:

<?php
$myvariablename = $_POST["yourname"];

echo "Your name is $myvariablename";
?>
badai
Daniel just gave an example, that's why he wrote with caps.
DanielXP
yes its the bits you need to change
Technaut
thank you for your help, everyone! Very Happy
Related topics
Email form script - 50 FRIH$
Wanting a PHP input security script: up to 1200frih$!
Disable "Enter" Key in Form script
Help with upload form script! [RESOLVED]
email form handling on a windows 2000 server help.
Looking for an email/attachment form script
Make me a job application page in php and earn 110 FRIH$!
Submit Picture form script
please please beta test it (PHP coders)
How to accept data with super and subscript
This piece of code isn't working properly :(
Form To Mail Script
Copying and pasting huge chunks of codes
Paying frih$100 to get 2 scripts installed!!
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.