Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > newbie questions regarding forms

newbie questions regarding forms
Thread Tools
Forum Regular
Join Date: Nov 2001
Status: Offline
Reply With Quote
Mar 22, 2002, 01:48 AM
 
I want to add a form to my site and I didn't realize is was so complex, well to me anyway. Can someone walk me through the steps or point to a tutorial?

I take it I have to have some sort of script on my server? Is there any special configuration I have to do to my server to set this up? Will any script I find on the net work or does it have to be Mac specific?

Any help is appreciated
     
Mac Elite
Join Date: Mar 2001
Location: somewhere in ohio
Status: Offline
Reply With Quote
Mar 22, 2002, 03:01 PM
 
You can use CGI if you're knowledgable in that area. WebMonkey has a tutorial on forms, thoughs its a few years old. Try there first
     
Forum Regular
Join Date: Jan 2002
Location: japan
Status: Offline
Reply With Quote
Mar 22, 2002, 03:40 PM
 
"you can use CGI" is a bit of a pants answer, KaptainKaya (nice name btw - kaya is yum). You can use any number of different languages to process forms, such as php, asp, perl etc.

basically a form is made up of several parts, and its complexity and functionality is wholly dependant on what you actually need to do with it.

It will start with a <form> and end with </form>. The most important attributes to the <form> tag will be what method the form takes, and what script will process the information in your form (for example, a script might take what is written in the form, and send it to a set email address). If you are passing variables to a script, they all need to be named the same as the name of the variables in the processing script, otherwise your form will not work (well, thats obvious).

in between the form tags there will be any number of things such as input boxes, text boxes, select boxes etc.

It is important that each of these objects in the form is given a 'name' attribute so that the script you are passing these variables to knows what is what.

So, as an example, here is the code for a simple form:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
&lt;form method=<font color = red>"POST"</font> action=<font color = red>"myscript.php"</font>&gt;
&lt;input type=<font color = red>"text"</font> name=<font color = red>"sometext"</font> length=<font color = red>"<font color = blue>30</font>"</font>&gt;
&lt;input type=<font color = red>"submit"</font> value=<font color = red>"press this button!"</font>&gt;
&lt;/form&gt;
</font>[/code]
That was a really simple form that basically has an input box and a submit button.

Anything that is written in the input box is a variable with the name 'sometext'.

myscript.php will have instructions in it as to what to do with the data contained in 'sometext'.

Thus, when the data in the form is passed to 'myscript.php' everything should work fine and the data will be processed according to the instructions in 'myscript.php' - this could be a number of things such as add the data in 'sometext' to a database, or email 'sometext' to your email address etc.

hmmm reading back on this, I havent made it that clear really, but I hope Ive at least helped a little!

cheers
Jon
http://www.yongfook.com
     
motoyen  (op)
Forum Regular
Join Date: Nov 2001
Status: Offline
Reply With Quote
Mar 22, 2002, 03:49 PM
 
That does make it clear. What a need is a script that will take the information and email it to me.
     
Forum Regular
Join Date: Jan 2002
Location: japan
Status: Offline
Reply With Quote
Mar 22, 2002, 06:08 PM
 
ok well first of all you need to know what kind of scripts your host supports.

If it supports php, then you can use phphmail: http://www.phytoon.com/ash/it/php.html
http://www.yongfook.com
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2