Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Need help with FORM/CGI. Simple!? request!?

Reply
Thread Tools

Need help with FORM/CGI. Simple!? request!?

 
 
Peter Lozzi
Guest
Posts: n/a
 
      09-17-2004
::Sigh::

I am going to take a risk here, and probably be yelled at, etc... But
I am pulling my hair out, and I am QUITE CERTAIN the key to my problem
is right there, and in my grasp...

I am a novice using Macromedia Dreamweaver to design a website. I am
100% self taught, and think I have an okay grasp on nested tables and
putting together some coherent graphics.

I created a form. The form is located here:

http://www.vacavillemultimedia.com/contact.html

All I want to do is take the information that the user puts in the
fields and send it to me via email.

THAT'S IT. THAT'S ALL I AM ASKING.

I have spent TWO WEEKS scouring the ends of the earth for a solution,
and I know it is RIGHT UNDER MY NOSE.

Here's what I know so far...

I need to use the <POST> method to have the HTML page send the info to
a CGI script that resides on the server, right? That CGI script does
*something* to the info, and viola, it ends up in my inbox, no? THATS
ALL I AM ASKING.

On the remote root level of my site (the same level as the index page)
is a folder (that was put there by the hosting company) with the label
CGI. I would imagine this is where I put the CGI script?

I have serched google 20 different ways to find information, a
tutorial, etc, on how to do this, and it's the ONE THING I CANNOT seem
to accomplish. My Dreamweaver book (all 900 pages) just says to
contact the web host for more information. The web host kinda chuckled
and said, "It's easy, what's the problem?" then never followed up (at
least not yet.)

Like I said, this CANT be this hard, right? I know one of you can do
this in your sleep! PLEASE tell me what piece of the puzzle I am
missing... Maybe take a look at the page, and see how simple it would
probably be?!

Thanks in advance for any assistance you can offer...

Pete

 
Reply With Quote
 
 
 
 
Christopher Finke
Guest
Posts: n/a
 
      09-17-2004
"Peter Lozzi" <(E-Mail Removed)> wrote in message
news:2004091620063175249%thelozzis@sbcglobalnet...
> I created a form. The form is located here:
>
> http://www.vacavillemultimedia.com/contact.html
>
> All I want to do is take the information that the user puts in the fields
> and send it to me via email.
>
> THAT'S IT. THAT'S ALL I AM ASKING.


Well, you could do it with a pretty simple PHP script, if your host supports
PHP:

<?php

foreach ($_REQUEST as $key => $value){
$message .= $key .' = '. $value."\n";
}

mail("(E-Mail Removed)","Email Form",$message);

header("Location: confirmation.html");
exit;

?>

So if you set the action of your form to this script, it will e-mail you a
list of all the fields in your form and the values the user gave them. It
won't be especially pretty, but this should get you started.

Chris Finke

--
I'll send you a gMail invite if you sign up for a free iPod:
http://www.freeiPods.com/default.aspx?referer=9228418


 
Reply With Quote
 
 
 
 
Peter Lozzi
Guest
Posts: n/a
 
      09-17-2004
On 2004-09-16 20:11:07 -0700, "Christopher Finke" <(E-Mail Removed)> said:

> "Peter Lozzi" <(E-Mail Removed)> wrote in message
> news:2004091620063175249%thelozzis@sbcglobalnet...
>> I created a form. The form is located here:
>>
>> http://www.vacavillemultimedia.com/contact.html
>>
>> All I want to do is take the information that the user puts in the
>> fields and send it to me via email.
>>
>> THAT'S IT. THAT'S ALL I AM ASKING.

>
> Well, you could do it with a pretty simple PHP script, if your host
> supports PHP:
>
> <?php
>
> foreach ($_REQUEST as $key => $value){
> $message .= $key .' = '. $value."\n";
> }
>
> mail("(E-Mail Removed)","Email Form",$message);
>
> header("Location: confirmation.html");
> exit;
>
> ?>
>
> So if you set the action of your form to this script, it will e-mail
> you a list of all the fields in your form and the values the user gave
> them. It won't be especially pretty, but this should get you started.
>
> Chris Finke


Chris!

RIGHT ON BROTHER! Progress! Now...

HOW do I get that great script you shared with me ON THE SERVER and WORKING!?

I mean, do I creat like a text edit document with that script pasted in
it, and stick it in a folder?

WHERE DO I PASTE THAT GREAT SCRIPT?

Thank you, it looks like I am ON THE SCENT with your reply, if you BEAR
with me for a few more posts, I COULD ACTUALLY BE GETTING SOME OF MY
POTENTIAL CLIENTS' INFO!

Thank you! NOW WHERE DO I STICK THAT GREAT SCRIPT!?

Pete

 
Reply With Quote
 
Sam Hughes
Guest
Posts: n/a
 
      09-17-2004
Peter Lozzi <(E-Mail Removed)> wrote in
news:2004091620211043658%thelozzis@sbcglobalnet:


>
> Thank you! NOW WHERE DO I STICK THAT GREAT SCRIPT!?


In a PHP file. Then put it on a server that has a PHP interpretor.
 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      09-17-2004
On Fri, 17 Sep 2004 03:21:10 GMT, Peter Lozzi <(E-Mail Removed)>
declared in alt.html:

> Thank you! NOW WHERE DO I STICK THAT GREAT SCRIPT!?


You put it in a PHP file - that generally means a file with a .php
extension. Put the name of that file in the action="" attribute of your
form.

BTW: Your shift key is broken.

--
Mark Parnell
http://www.clarkecomputers.com.au
"Never drink rum&coke whilst reading usenet" - rf 2004
 
Reply With Quote
 
Christopher Finke
Guest
Posts: n/a
 
      09-17-2004
"Peter Lozzi" <(E-Mail Removed)> wrote in message
news:2004091620211043658%thelozzis@sbcglobalnet...
> HOW do I get that great script you shared with me ON THE SERVER and
> WORKING!?


Copy the following (starting with the "<?php" and ending with the "?>") into
a text document and save it as form_processor.php

<?php

foreach ($_REQUEST as $key => $value){
$message .= $key .' = '. $value."\n";
}

mail("(E-Mail Removed)","Email Form",$message);

header("Location: confirmation.html");
exit;

?>

Now, copy this file (form_processor.php) to the same folder that your
contact.html file is in, on the server. (Make sure to change the
http://www.velocityreviews.com/forums/(E-Mail Removed) address to your address.)

Then, change the line in contact.html that reads

<form action="" method="post" name="contact_form"
id="contact_form"(E-Mail Removed)>

to
<form action="form_processor.php" method="post" name="contact_form"
id="contact_form">
Then, create a page called confirmation.html. Put this in the same folder
as contact.html on the server as well. This can include whatever
confirmation text you want, such as "Your comments have been received; you
will receive a reply in ## days."

After all this is done, try filling out the form and submitting it. If
everything worked, you should get an e-mail with your data and be shown the
confirmation page.

I hope this helps. Feel free to post any more questions you have.

Chris Finke

--
I'll send you a gMail invite if you sign up for a free iPod:
http://www.freeiPods.com/default.aspx?referer=9228418


 
Reply With Quote
 
Peter Lozzi
Guest
Posts: n/a
 
      09-17-2004
On 2004-09-16 21:04:23 -0700, "Christopher Finke" <(E-Mail Removed)> said:

> "Peter Lozzi" <(E-Mail Removed)> wrote in message
> news:2004091620211043658%thelozzis@sbcglobalnet...
>> HOW do I get that great script you shared with me ON THE SERVER and WORKING!?

>
> Copy the following (starting with the "<?php" and ending with the "?>")
> into a text document and save it as form_processor.php
>
> <?php
>
> foreach ($_REQUEST as $key => $value){
> $message .= $key .' = '. $value."\n";
> }
>
> mail("(E-Mail Removed)","Email Form",$message);
>
> header("Location: confirmation.html");
> exit;
>
> ?>
>
> Now, copy this file (form_processor.php) to the same folder that your
> contact.html file is in, on the server. (Make sure to change the
> (E-Mail Removed) address to your address.)
>
> Then, change the line in contact.html that reads
>
> <form action="" method="post" name="contact_form"
> id="contact_form"(E-Mail Removed)>
>
> to
> <form action="form_processor.php" method="post" name="contact_form"
> id="contact_form">
> Then, create a page called confirmation.html. Put this in the same
> folder as contact.html on the server as well. This can include
> whatever confirmation text you want, such as "Your comments have been
> received; you will receive a reply in ## days."
>
> After all this is done, try filling out the form and submitting it. If
> everything worked, you should get an e-mail with your data and be shown
> the confirmation page.
>
> I hope this helps. Feel free to post any more questions you have.
>
> Chris Finke


Chris...

WOW! You have moved me closer than 4 books and 25 websites.

I am ALMOST there! I took your advice, and when I submit the form, it
actually opens the .php page with the script you created. I know this
isn't the desired result, and I am wondering what the heck I did wrong
now.

the form is still at:

http://www.vacavillemultimedia.com/contact.html

We're SO CLOSE! Thank you SO MUCH Chris for your help.

Pete

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      09-17-2004
On Fri, 17 Sep 2004 04:41:10 GMT, Peter Lozzi <(E-Mail Removed)>
declared in alt.html:

> I am ALMOST there! I took your advice, and when I submit the form, it
> actually opens the .php page with the script you created. I know this
> isn't the desired result, and I am wondering what the heck I did wrong
> now.


Doesn't look like your host supports PHP. You'll have to find out what
languages they do support, and use a script in one of those languages.
From your OP, they allow CGI (though whether they'll allow you to upload
your own may be a different matter); have a look at
http://sourceforge.net/projects/nms-cgi/

Doesn't your host have a form handler script already there anyway? I
know you said they didn't answer your emails - did you check their
support pages?

--
Mark Parnell
http://www.clarkecomputers.com.au
"Never drink rum&coke whilst reading usenet" - rf 2004
 
Reply With Quote
 
Christopher Finke
Guest
Posts: n/a
 
      09-17-2004
"Peter Lozzi" <(E-Mail Removed)> wrote in message
news:2004091621411016807%thelozzis@sbcglobalnet...
> I am ALMOST there! I took your advice, and when I submit the form, it
> actually opens the .php page with the script you created. I know this
> isn't the desired result, and I am wondering what the heck I did wrong
> now.


Make sure you save the file as a text file, not as an HTML file. From what
I can tell, it looks like you saved it as HTML in a WYSIWYG editor. Paste
the text into Notepad, and save it as form_processor.php, making sure to
select "All files" from the "Save as type" option box (if you're using
Windows, that is).

Chris Finke


 
Reply With Quote
 
Peter Lozzi
Guest
Posts: n/a
 
      09-17-2004
On 2004-09-16 21:50:25 -0700, "Christopher Finke" <(E-Mail Removed)> said:

> "Peter Lozzi" <(E-Mail Removed)> wrote in message
> news:2004091621411016807%thelozzis@sbcglobalnet...
>> I am ALMOST there! I took your advice, and when I submit the form, it
>> actually opens the .php page with the script you created. I know this
>> isn't the desired result, and I am wondering what the heck I did wrong
>> now.

>
> Make sure you save the file as a text file, not as an HTML file. From
> what I can tell, it looks like you saved it as HTML in a WYSIWYG
> editor. Paste the text into Notepad, and save it as
> form_processor.php, making sure to select "All files" from the "Save as
> type" option box (if you're using Windows, that is).
>
> Chris Finke


Chris...

Yeah, I created a new PHP document with dreamweaver. I made sure I
created a new dynamic PHP document, and not just an HTML or other
standard file.

The only thing I can think of now is that the host
(http://www.warped.com) does not support PHP by default, and that you
have to request to have it?

I mean, on the front page of their site it lists PHP as a feature.

I dunno. I think you have taken me as far as you can though... I
appreciate it more than you know. I will try in the coming days to
figure it out from here, unless there's something obvious I am doing
wrong that you can see...

Thanks!

Pete

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help, I am intermediate in Java...need help in follow case ElementX Java 9 10-01-2008 08:02 PM
Help Help. I really need some help with this =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 01-31-2007 09:33 PM
re_---need help Network Adapters!!!! NEED HELP!!!! hedayatniac@gmail.com Computer Support 4 08-13-2006 01:03 AM
Need help! I need to add lead zeros to a textbox Teep ASP .Net 2 06-21-2004 01:04 PM
Please help!!! Need datagrid selection to fill textboxes...Need quick!! TN Bella ASP .Net 1 06-18-2004 01:31 AM



Advertisments