473,426 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

form w/php action

Hi,

I have a form which needs posting the php script below. (I sent my vars to a
cookie, which I have read correctly). This is the form command used in
hoping to process my information.

<form method="POST" action="scripts/WebContractor.php" name="bizinfo"
id="bizinfo">

Since most of this is new to me, please let me ramble in my thought process.

1. post the vars to a cookie
2. post the form pointing to the php script
3. read the vars in the php script
4. send the info from within the script

When I submit my form, I receive a dialog box stating the downloading this
file can be dangerous. What happens is the php script is downloaded to my
desktop - not executed.

Here is the php script named WebContractor.php:

<?php
$Bizname = $HTTP_GET_VARS['BizName'];
$BizAddress = $HTTP_GET_VARS['BizAddress1'];
$BizAddress2 = $HTTP_GET_VARS['BizAddress2'];
$BizCity = $HTTP_GET_VARS['BizCity'];
$BizZip = $HTTP_GET_VARS['BizZip'];
$BizWorkPhone = $HTTP_GET_VARS['BizWorkPhone'];
$BizHomePhone = $HTTP_GET_VARS['BizHomePhone'];
$BizCellPhone = $HTTP_GET_VARS['BizCellPhone'];
$BizFax = $HTTP_GET_VARS['BizFax'];
$BizEmail = $HTTP_GET_VARS['BizEmail'];
$rec_email = "ju**********@thewrongplace.com"; // send this email to myself
$subject = "Contractor Liability Form (Web)";
// make it pretty

$msgInfo = "<html><head></head><body>";
$msgInfo = "<font face=\"Microsoft Sans Serif\" size=\"2\">";
$msgInfo .= "<hr width=\"100%\" size=\"1\" ><br>";
$msgInfo .= "<b>Bizname:</b> $Bizname<br>";
$msgInfo .= "<b>Address:</b> $BizAddress<br>";
$msgInfo .= "<b>Address2:</b> $BizAddress2<br>";
$msgInfo .= "<b>City:</b> $BizCity<br>";
$msgInfo .= "<b>Zip:</b> $BizZip<br>";
$msgInfo .= "<b>WorkPhone:</b> $BizWorkPhone<br>";
$msgInfo .= "<b>HomePhone:</b> $BizHomePhone<br>";
$msgInfo .= "<b>CellPhone:</b> $BizCellPhone<br>";
$msgInfo .= "<b>Fax:</b> $BizFax<br>";
$msgInfo .= "<b>Email:</b> $BizEmail<br>";
$msgInfo .= "</font></body></html>";

$header_info = "MIME-Version: 1.0\r\n";
$header_info .= "Content-type: text/html; charset=iso-8859-1\r\n";
$header_info .= "From: ".$name." <".$email.">";
mail($rec_email, $subject, $msgInfo, $header_info); // mail it

?>


TIA
danny
Jul 23 '05 #1
3 1351
In article <11*************@corp.supernews.com>, dt*****@planet-inc.net
enlightened us with...
Here is the php script named WebContractor.php:

<?php


This is a javascript group.
Perhaps you meant to post this to alt.php?

That said, you didn't set the actual PHP document as mime type html. The
browser didn't know what to do with it, so it tried to load it.
PHP is embedded as scriptlets INSIDE an HTML page. The PHP page needs its own
head, title, body, etc.

Also, if the server doesn't know to execute it, it won't. So make sure a
simple PHP test page works.

I use this to test.
<html><head><title>test</title></head>
<body>
<p>testing</p>
<?php
echo "<h1>Can you see this?</h1>";
?>
</body>
</html>

The page needs to display that as all html and not show the PHP stuff. If it
shows it all as plain text, the server is not configured right. It is the
server which sends the content as html.

(why is the php script in the scripts subdir? That's for perl and other cgi
type scripts...php is a scripting language embedded in html docs, not run as
standalone. the scripts subdir on many machines is configured as cgi-bin:
executables.)

HTH
--
--
~kaeli~
Can you be a closet claustrophobic?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
danny wrote:
When I submit my form, I receive a dialog box stating the downloading this
file can be dangerous. What happens is the php script is downloaded to my
desktop - not executed.


Sounds like your server isn't configured to handle PHP scripts. Nothing to
do with JavaScript whatsoever.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #3
<SNIP>
That said, you didn't set the actual PHP document as mime type html. The
browser didn't know what to do with it, so it tried to load it.
PHP is embedded as scriptlets INSIDE an HTML page. The PHP page needs its own
head, title, body, etc.

<SNIP>

FWIW, you don't *HAVE* to place the head/title in the script as it will
generate itself if it doesn't exist.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: bissatch | last post by:
Hi, I have been trying to come up with an idea to reduce double submissions where a user clicks refresh and, for example, another row is INSERT into a table. Originally, I would have a form...
10
by: iam247 | last post by:
Hi In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action: <form name="form" method="post" action="RegDetails.asp"> ...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
6
by: tencip | last post by:
Hi everyone, So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section...
2
by: Myk Quayce | last post by:
I have a small .aspx page that uses old style forms with client-side JavaScript validation. Everything works fine until I try to upate the database with some new information. I must be doing...
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
6
by: Arthur | last post by:
Hello. How might it be possible to change where a form action is directed based on a selected option. For example I have this: <FORM METHOD = "post" ACTION = ""> And a drop down such as
12
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to...
1
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.