sending e-mail form !?HELP!

sending e-mail form !?HELP!

am 19.12.2007 04:29:18 von Majki Majk

Hi! I'm not managing to start this script. It's my first php script i'm
implementing. I'm not an php scripter, i am an html/css amater working on
society association.

I have apache server on my computer. I have inserted this php script into
my website folder which is emailform.php and the contact form part into
html/css document. But when trying to send e-mail on my computer to test the
script then a box for 'saving file' jumps out into the screen, so,....here
is the emailform.php script text. I think it's a bit long, but am not
competant to confirm that.


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





Emailing Form Data










//This is a very simple PHP script that outputs the name of each bit of
information (that corresponds to the name attribute for that
field) along with the value that was sent with it right in the browser
window, and then sends it all to an email address (once you've added it to
the script).

if (empty($_POST)) {

print "

No data was submitted.

";

print "";

exit();

}

//Creates function that removes magic escaping, if it's been applied, from
values and then removes extra newlines and returns to foil spammers. Thanks
Larry Ullman!

function clear_user_input($value) {

if (get_magic_quotes_gpc()) $value=stripslashes($value);

$value= str_replace( "\n", '', trim($value));

$value= str_replace( "\r", '', $value);

return $value;

}



if ($_POST['comments'] == 'Please share any comments you have here')
$_POST['comments'] = '';

//Create body of message by cleaning each field and then appending each name
and value to it

$body ="Here is the data that was submitted:\n";

foreach ($_POST as $key => $value) {

$key = clear_user_input($key);

$value = clear_user_input($value);

if ($key=='extras') {


if (is_array($_POST['extras']) ){

$body .= "$key: ";

$counter =1;

foreach ($_POST['extras'] as $value) {

//Add comma and space until last element

if (sizeof($_POST['extras']) == $counter) {

$body .= "$value\n";

break;}

else {

$body .= "$value, ";

$counter += 1;

}

}

} else {

$body .= "$key: $value\n";

}

} else {

$body .= "$key: $value\n";

}

}

extract($_POST);

//removes newlines and returns from $email and $name so they can't smuggle
extra email addresses for spammers

$email = clear_user_input($email);

$name = clear_user_input($name);

//Create header that puts email in From box along with name in parentheses
and sends bcc to alternate address

$from='From: '. $email . "(" . $name . ")" . "\r\n" . 'Bcc:
youremail@yourdomain.com' . "\r\n";



//Creates intelligible subject line that also shows me where it came from

$subject = 'Bed Order from Web Site';

//Sends mail to me, with elements created above

mail ('youremail@yourdomain.com', $subject, $body, $from);



?>

Thanks for your order! We'll send your bed right away.







Re: sending e-mail form !?HELP!

am 19.12.2007 20:22:10 von unknown

Post removed (X-No-Archive: yes)

Re: sending e-mail form !?HELP!

am 20.12.2007 03:03:08 von Majki Majk

Thanks, right, i'm a php-layman...so i'm practically blind =)
>
> I wasn't seeing any

tags in your code, that would define the action
> and
> method. If you don't have that, then I don't think you would have any
> "$_POST"
> variables to work with.
>
> Tom
> --
> NewsGuy Accounts Go Jumbo!
> NewsGuy Express increased from 30 to 50 GB of download capacity
> http://newsguy.com/overview.htm
>

Re: sending e-mail form !?HELP!

am 20.12.2007 09:02:31 von David Quinton

On 19 Dec 2007 11:22:10 -0800, Tom wrote:

>On Wed, 19 Dec 2007 04:29:18 +0100, Majki Majk wrote...
>>
>>Hi! I'm not managing to start this script. It's my first php script i'm
>>implementing. I'm not an php scripter, i am an html/css amater working on
>>society association.
>>
>>I have apache server on my computer. I have inserted this php script into
>>my website folder which is emailform.php and the contact form part into
>>html/css document. But when trying to send e-mail on my computer to test the
>>script then a box for 'saving file' jumps out into the screen, so,....here
>>is the emailform.php script text. I think it's a bit long, but am not
>>competant to confirm that.

>
>I wasn't seeing any tags in your code, that would define the action and
>method. If you don't have that, then I don't think you would have any "$_POST"
>variables to work with.

I think it's more likely (seeing that he's getting "saving file" box)
that his Apache isn't processing the PHP?
--
Locate your Mobile phone:
Great gifts:

Re: sending e-mail form !?HELP!

am 20.12.2007 09:40:25 von Vince Morgan

"David Quinton" wrote in
message news:b98km352tc97e0ih9rg58lj9tqt6lqp190@4ax.com...
> On 19 Dec 2007 11:22:10 -0800, Tom wrote:

> I think it's more likely (seeing that he's getting "saving file" box)
> that his Apache isn't processing the PHP?
> --

Good point. Actualy, there isn't anything to suggest that php is even
installed.

Re: sending e-mail form !?HELP!

am 20.12.2007 10:39:35 von Majki Majk

I have easy php package with php5. The thing works over the internet, but,
just, i DO NOT receive the mail messages. It seems the processing of message
isn't functional.

I don't understand how could this script understood on which adress to send
an e-mail anyways...???
I had never pointed to: ..@....... anywhere!

Bye
MAjki

Re: sending e-mail form !?HELP!

am 20.12.2007 14:08:18 von David Quinton

On Thu, 20 Dec 2007 10:39:35 +0100, "Majki Majk"
wrote:

>I have easy php package with php5. The thing works over the internet, but,
>just, i DO NOT receive the mail messages. It seems the processing of message
>isn't functional.
>
>I don't understand how could this script understood on which adress to send
>an e-mail anyways...???
>I had never pointed to: ..@....... anywhere!

It's trying to send to
youremail@yourdomain.com
as far as I can tell.

Make a file called, say, phpinfo.php.
In it put just:

phpinfo();
?>

Does anything happen when you access it using a web browser?
or do you just get the "Save" box?
--
Locate your Mobile phone:
Great gifts:

Re: sending e-mail form !?HELP!

am 20.12.2007 16:26:03 von Majki Majk

It seems it's working now over the internet. But the whole thing isn't quite
crystal to me...i have adjusted e-mail adress now but still have many
little occurances, or difficulties, i'll manage it with time goes by.

Ok, i have a file phpinfo.php, but how do you acess it using a web browser,
ie. do I need something to write into html/css code? I suppose it's a must?

Majki

> It's trying to send to
> youremail@yourdomain.com
> as far as I can tell.
>
> Make a file called, say, phpinfo.php.
> In it put just:
>
> > phpinfo();
> ?>
>
> Does anything happen when you access it using a web browser?
> or do you just get the "Save" box?
> --
> Locate your Mobile phone:
> Great gifts:

Re: sending e-mail form !?HELP!

am 20.12.2007 19:20:17 von unknown

Post removed (X-No-Archive: yes)

Re: sending e-mail form !?HELP!

am 27.12.2007 14:50:38 von Jerry Stuckle

Majki Majk wrote:
> It seems it's working now over the internet. But the whole thing isn't quite
> crystal to me...i have adjusted e-mail adress now but still have many
> little occurances, or difficulties, i'll manage it with time goes by.
>
> Ok, i have a file phpinfo.php, but how do you acess it using a web browser,
> ie. do I need something to write into html/css code? I suppose it's a must?
>
> Majki
>
>> It's trying to send to
>> youremail@yourdomain.com
>> as far as I can tell.
>>
>> Make a file called, say, phpinfo.php.
>> In it put just:
>>
>> >> phpinfo();
>> ?>
>>
>> Does anything happen when you access it using a web browser?
>> or do you just get the "Save" box?
>> --
>> Locate your Mobile phone:
>> Great gifts:
>
>
>

Just put it on your server and access it like you do any other page on
your server. Nothing else is required in this case. phpinfo()
generates all the HTML for this request.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================