473,549 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ 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.p hp" method="post">
<font face = "Arial" size = 1>
<table>
<tr><td>Your name:*</td></tr>
<tr><td><inpu t type=text name=fromname size=50></td></tr>
<tr><td>Your email address:*</td></tr>
<tr><td><inpu t type=text name=fromemail size=50></td></tr>
<tr><td>Subject :</td></tr>
<tr><td><inpu t type=text name=subjects size=50></td></tr>
<tr><td><textar ea name="comments" rows="10" cols="80" wrap="on"></
textarea></td></tr>
</table>
<input type=submit value="Send"><i nput 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($fromemai l) ) // email address mandatory
{
echo "<h1>";
echo "Your email address must be entered <br><br>";
echo "<a href = 'bmail.htm'>Ret urn</a><br></h1>";
}
elseif ( empty($fromname ) ) // name mandatory
{
echo "<h1>";
echo "Your name must be entered <br><br>";
echo "<a href = 'bmail.htm'>Ret urn</a><br></h1>";
}
else
{
mail("$toaddres s", "$subjects" , "$mailconte nt", "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 1347
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_global s 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.comwro te:
register_global s 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
14914
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
3
1500
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 from the previous page. One way that I could think of would be to have the submit button's event handler call response.redirect with a querystring...
58
10073
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 code... TCHAR myArray; DoStuff(myArray);
1
2524
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 show me a example of how to do this. I was told to pass the arrays from function to function, but i do not know how .... Thanxs if you can help. ...
8
4401
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 click a button to determine whether the zip code is unique. If the zip code is not unique, another form/dialog is displayed (fclsLookup) - lookup...
11
8101
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 number) which is the last line of the following sub routine: ' procedure modifies elements of array and assigns ' new reference (note ByVal) Sub...
12
2668
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
2318
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 to include user entered values of length greater than 2048 bytes in such memo fields in the URL. The technique I use:
8
3254
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 page. Anyone to help? Thanks X
0
7541
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
7464
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
7826
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6065
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
5385
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
5107
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
3512
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...
1
1960
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
0
781
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.