473,587 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem submitting previously working form on new server

Hello, I'm a php newbie and have been using the following php code fine
(until now) to submit a form and create an email message. I recently
moved the site from a local server to an ISP's server and now, whenever
I attempt to submit the form, the entries I made are cleared and no
e-mail is sent.

I have no idea what the problem is - can anyone help?
------------begin extracted php---------------
<?php
if ($_SERVER['REQUEST_METHOD '] != 'POST'){
$me = $_SERVER['PHP_SELF'];
print <<<TOEND

<form name="form1" method="post" action="$me">

Name: <input type="text" name="Name">
Subject: <input type="text" name="Subject"> </td>
Message: <textarea name="MsgBody"> </textarea></td>
<input type="submit" name="Submit" value="Send"></td>

</form>

TOEND;

} else {
error_reporting (0);
$recipient = 'a***@innovez.c o.uk';
$subject = stripslashes($_ POST['Subject']);
$from = stripslashes($_ POST['Name']);
$msg = "Message from: $from\n\n".stri pslashes($_POST['MsgBody']);
if (mail($recipien t, $subject, $msg))
echo nl2br("<b>Messa ge Sent:</b>
To: $recipient
Subject: $subject
Message:
$msg");
else
echo "Message failed to send";
}
?>
------------end extracted php---------------
Jul 17 '05 #1
7 1804
["Followup-To:" header set to comp.lang.php.]
a c s wrote:
Hello, I'm a php newbie and have been using the following php code fine
(until now) to submit a form and create an email message. I recently
moved the site from a local server to an ISP's server and now, whenever
I attempt to submit the form, the entries I made are cleared and no
e-mail is sent.

I have no idea what the problem is - can anyone help?
(... snip ...)
} else {
error_reporting (0);


Try
error_reporting (E_ALL);

instead.
Then correct all Notices, Warnings and Errors, and repost if it still
doesn't work.

--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #2
Hi Pedro,

I have changed the error_reporting function to E_ALL but there is no
change in behavior: the form just resets itself.

Any other ideas? With thanks, Alan.
Pedro Graca wrote:
["Followup-To:" header set to comp.lang.php.]
a c s wrote:
Hello, I'm a php newbie and have been using the following php code fine
(until now) to submit a form and create an email message. I recently
moved the site from a local server to an ISP's server and now, whenever
I attempt to submit the form, the entries I made are cleared and no
e-mail is sent.

I have no idea what the problem is - can anyone help?

(... snip ...)

} else {
error_reporting (0);

Try
error_reporting (E_ALL);

instead.
Then correct all Notices, Warnings and Errors, and repost if it still
doesn't work.

Jul 17 '05 #3
a c s top-posted:
I have changed the error_reporting function to E_ALL but there is no
change in behavior: the form just resets itself.

Any other ideas? With thanks, Alan.


Hmmm ... It worked perfectly here.

What PHP version is running on your server?

<?php echo phpversion(); ?>
$_SERVER, $_POST, ... are available from PHP 4.1.0 onwards.
If you use an earlier version substitute those superglobal arrays with
$HTTP_SERVER_VA RS, $HTTP_POST_VARS , ...

http://www..php.net/manual/en/reserved.variables.php
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #4
Sir, you are a genius - the version of PHP on the server was 4.0.6.

The workaround sorted the problem nicely, and it'll be added to my
troubleshooting list for the future.

Thanks again, Alan.

Pedro Graca wrote:
a c s top-posted:
I have changed the error_reporting function to E_ALL but there is no
change in behavior: the form just resets itself.

Any other ideas? With thanks, Alan.

Hmmm ... It worked perfectly here.

What PHP version is running on your server?

<?php echo phpversion(); ?>
$_SERVER, $_POST, ... are available from PHP 4.1.0 onwards.
If you use an earlier version substitute those superglobal arrays with
$HTTP_SERVER_VA RS, $HTTP_POST_VARS , ...

http://www..php.net/manual/en/reserved.variables.php

Jul 17 '05 #5
Hi Pedro,

Have you any idea why (it seems only in PHP versions less than 4.1.0)
the attachment received is an empty "attachment.txt " file instead of the
actual file I attached?

Many thanks in advance, Alan.

Pedro Graca wrote:
a c s top-posted:
I have changed the error_reporting function to E_ALL but there is no
change in behavior: the form just resets itself.

Any other ideas? With thanks, Alan.

Hmmm ... It worked perfectly here.

What PHP version is running on your server?

<?php echo phpversion(); ?>
$_SERVER, $_POST, ... are available from PHP 4.1.0 onwards.
If you use an earlier version substitute those superglobal arrays with
$HTTP_SERVER_VA RS, $HTTP_POST_VARS , ...

http://www..php.net/manual/en/reserved.variables.php

Jul 17 '05 #6
a c s top-posted:
Hi Pedro,
To mail me use my address and follow the indications in the signature.
If you ask me something by mail I probably will tell you to ask in the
newsgroup instead :)
Have you any idea why (it seems only in PHP versions less than 4.1.0)
the attachment
Attachment? ?!?!?!? What do you mean?
Something in MIME e-mail, perhaps?
received
received? ?!?!?!? What do you mean?
Received by what?
A mail client?
A HTTP server?
A IRC client?

And, if it was received, it must have been sent. Sent by what?
A PHP script?
A mail client?
An FTP-to-Mail server?
is an empty "attachment.txt " file instead of the
actual file I attached?


Where could the attachment be lost?
One of several places:
a) before being sent
b) at the moment of sending
c) between being sent and received
d) at the moment of receiving
e) after being received

You say it's at c); I guess it's at b) -- or even at a)
Verify your sending script.

PS. What is the relation between the failed "received attachment"
and switching a form to a different server (the subject of this
post)?
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #7
Pedro. My apologies. My script had a missing semi-colon.

Thanks again, Alan.

Pedro Graca wrote:
a c s top-posted:
Hi Pedro,

To mail me use my address and follow the indications in the signature.
If you ask me something by mail I probably will tell you to ask in the
newsgroup instead :)

Have you any idea why (it seems only in PHP versions less than 4.1.0)
the attachment

Attachment? ?!?!?!? What do you mean?
Something in MIME e-mail, perhaps?

received

received? ?!?!?!? What do you mean?
Received by what?
A mail client?
A HTTP server?
A IRC client?

And, if it was received, it must have been sent. Sent by what?
A PHP script?
A mail client?
An FTP-to-Mail server?

is an empty "attachment.txt " file instead of the
actual file I attached?

Where could the attachment be lost?
One of several places:
a) before being sent
b) at the moment of sending
c) between being sent and received
d) at the moment of receiving
e) after being received

You say it's at c); I guess it's at b) -- or even at a)
Verify your sending script.

PS. What is the relation between the failed "received attachment"
and switching a form to a different server (the subject of this
post)?

Jul 17 '05 #8

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

Similar topics

10
2365
by: amit.purohit | last post by:
hi, I have a very strange problem on my login Page. the Page was working fine a few days back, but now does not generate post back events for controls. this login page uses form based authentication. Whenever the button is clicked, no event is raised, infact it doesnt even go to the page_load as well. Events are registered and there is no...
5
1897
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000...
5
2440
by: Mary Litten | last post by:
Hi - (This is my very first post) I have gotten to this point of registering to post because I have been spinning my wheels so long, I believe I am all caught up in the weeds. (and mud) I have a form, that has several tabs. On one tab, I have a subform (wr_completion_subform). This subform is bound to a table (wr_completion_table). On...
3
1158
by: ooper | last post by:
Hello, I have a page with multiple frames. The body frame has an href as follows: http://www.fincalc.com/BUD_02.asp?id=12345&css=demo BUD_02.asp has code that tries to read the id value from the querystring as follows: dim id id = Request.QueryString("id")
10
9233
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side click event and I update session information to track the visibilty of some panels in a wizard type navigation ("Next >>" and "<< Back" buttons).....
4
1766
by: john | last post by:
I have an app that uses Server.Transfer from page1 to page2. page2 needs to be able to read all the values from page1's form. The problem is, if the user clicks the back button on page2 after a Server.Transfer, the user gets a page has expired error. Is there a way to keep using Server.Transfer, but also have the back button work normally?
1
4707
by: Naim | last post by:
hi I have this situation where I need to do some server side execution without posting the page. I used to do this in asp using IFrame, but it's not working in asp.net. I had a form and iframe element in the web page as follow: <form id=MainForm ....> this is the form that the user see </form>
1
1950
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and accessing the webservice each min. It was working 100% fine. Problem: But now in actual deployment, we have deployed webservice in Win Server 2003 and we...
9
1686
by: Dave | last post by:
Hi guys, I have just set up a duplicate server running: apache 2.54, mysql 5.04 and php 5.04 This is the same setup as as the server we are using now, apart from the hardware inside. I have copied across the database and website, with exact same permissions as the first server. The problem is that part of the php code is executing but...
0
7920
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.