473,497 Members | 2,184 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Passing Entered Variable Values

I just switched ISPs and am in the process of moving all MySQL
databases and PHP scripts to the new ISP. I have some simple HTML
forms that post to simple PHP scripts that used to work with my old
ISP, but don't work on the new ISP. The entered values don't seem to
be passed to the PHP script.

Here's an example. This is a an email form:
<html>
<body>
<form action="bmail.php" method="post">
<font face = "Arial" size = 1>
<table>
<tr><td>Your name:*</td></tr>
<tr><td><input type=text name=fromname size=50></td></tr>
<tr><td>Your email address:*</td></tr>
<tr><td><input type=text name=fromemail size=50></td></tr>
<tr><td>Subject:</td></tr>
<tr><td><input type=text name=subjects size=50></td></tr>
<tr><td><textarea name="comments" rows="10" cols="80" wrap="on"></
textarea></td></tr>
</table>
<input type=submit value="Send"><input type=reset value="Reset"><br>
* Mandatory
</font>
</form>
</body>
</html>

Here's the PHP script that the form posts to:

<html>
<body>
<?
$toaddress = <my email>;
$subject = $subjects;
$mailcontent = $comments. "<br><br>"
. $fromname . "<br>";
$fromaddress = $fromemail;
if ( empty($fromemail) ) // email address mandatory
{
echo "<h1>";
echo "Your email address must be entered <br><br>";
echo "<a href = 'bmail.htm'>Return</a><br></h1>";
}
elseif ( empty($fromname) ) // name mandatory
{
echo "<h1>";
echo "Your name must be entered <br><br>";
echo "<a href = 'bmail.htm'>Return</a><br></h1>";
}
else
{
mail("$toaddress", "$subjects", "$mailcontent", "MIME-Version: 1.0\r
\nContent-Type:text/html; charset=iso-8859-1\r\nFrom: ". $youremail
. "\r\n");
echo "<h1>";
echo "Thank You for Your Email";
}
?>
</body>
</html>

The script parses fine. But it thinks that the $fromemail value is
empty and exits at the first "if" condition, when in fact a non-Null
value was entered on the form.

The version of PHP I'm currently using with the new ISP is 4.4.4. The
old ISP was using an older version.

Thanks in advance.

Mar 11 '07 #1
2 1341
Rik
bombardier <bo*****@gmail.comwrote:
I just switched ISPs and am in the process of moving all MySQL
databases and PHP scripts to the new ISP. I have some simple HTML
forms that post to simple PHP scripts that used to work with my old
ISP, but don't work on the new ISP. The entered values don't seem to
be passed to the PHP script.
The script parses fine. But it thinks that the $fromemail value is
empty and exits at the first "if" condition, when in fact a non-Null
value was entered on the form.

The version of PHP I'm currently using with the new ISP is 4.4.4. The
old ISP was using an older version.
register_globals is off, like it should be. User the
$_GET/$_POST/$_REQUEST array.
--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Mar 11 '07 #2
Rik
Rik <lu************@hotmail.comwrote:
register_globals is off, like it should be. User the
$_GET/$_POST/$_REQUEST array.
s/user/use

more coffee needed
--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Mar 11 '07 #3

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

Similar topics

3
14901
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
3
1493
by: Ben R. | last post by:
I've got an asp.net application with a page that collects user info via forms and I'd like to have those values then passed to a 2nd page for a continuation which makes use of the entered values...
58
10042
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
1
2518
by: Foxy Kav | last post by:
Hi everyone, im a first year UNI student doing a programming subject and im stuck on how to get rid of my global variables, char stringarray and char emptystring. I was wondering if anyone could...
8
4393
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
11
8091
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
12
2661
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
5
2315
by: u0107 | last post by:
Hello all, I have an ASP generated form to maintain a back end Access Database. Some tables have Memo Type fields. On account of the limitations of the length of the URL String, I am unable...
8
3247
by: chimambo | last post by:
Hi All, I am trying to pass variables between two frames in PHP. I want to get a variable from F1 to F2 and the variable that is now in F2 should pass back the variable to F1 and call another...
0
7120
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,...
0
7160
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,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
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
5456
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,...
1
4897
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
4583
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
1405
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 ...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.