473,473 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Where are my arguments going?

2 New Member
Hi All: Yet another PHP newbie here with a question. :)

I'm trying to run a script that I found on this site (the two files from the tutorial "Parsing Forms With PHP and Sending E-Mail"). The form and script work properly, for the most part (and the email function in the script does send an email). The problem I'm experiencing is that all of the variables in the PHP script seem to be empty. In other words, the values entered into the form don't seem to be making it to the PHP script (the reason I'm saying this is that the output from the script prints nothing for the occurrences of variable such as $name, $status, and $email).

The files are reproduced; they're also hosted at http://myweb.usf.edu/~cspears/form.htm in case anyone would like to see them in action.

Thank you in advance for any hints or pointers!
uvindex

This is the form file (form.htm):
Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Form Handling with PHP</TITLE>
  4. </HEAD>
  5. <BODY BGCOLOR="#FFFFFF">
  6. <FORM METHOD=POST ACTION="tellus.php">
  7. <TABLE>
  8. <TR height="20">
  9. <TD colspan="2"><FONT SIZE="-1" face="verdana">Below is a Sample Form for our PHP tutorial </TD>
  10. </TR>
  11. <TR height="50">
  12. <td></td>
  13. </TR>
  14. <TR>
  15. <TD align="left"><FONT SIZE="-1" face="verdana">Your Name Your E-Mail Address</td>
  16. <td><INPUT TYPE="text" NAME="name">
  17. <br>
  18. <INPUT TYPE="text" NAME="email">
  19. </TD>
  20. </TR>
  21. <tr>
  22. <td colspan="2"><SELECT NAME="opinion">
  23. <option value="is great">I like your site</option>
  24. <option value="is OK">Your Site is OK</option>
  25. <option value="is horrible">Your Site is horrible</option>
  26. </SELECT>
  27. <br>
  28. <INPUT TYPE="submit" value="Tell us!">
  29. </td>
  30. </tr>
  31. </TABLE>
  32. </FORM>
  33. </BODY>
  34. </HTML>
  35.  
  36.  
This is the script file (tellus.php):
Expand|Select|Wrap|Line Numbers
  1.  <?php
  2.  
  3. PRINT "<center><FONT SIZE=-1 face=verdana>"; PRINT "Greetings $name, thank you for filling out our";
  4. PRINT "form.";
  5. PRINT "</center><p><center><TABLE border=0 width=500";
  6. PRINT "cellspacing=0 cellpadding=7>"; PRINT "<TR><TD><FONT SIZE=-1 face=verdana>"; PRINT "In the form, you stated that our site";
  7. PRINT "$status. Thank you for your input."; PRINT "We will send you more information about our site";
  8. PRINT "in an email to $email.";
  9. PRINT "If you have any more comments, feel free to reply.";
  10. PRINT "</FONT></TD></TR></TABLE></center>";
  11.  
  12. mail("$email", "Site Information", "Hello $name,\nWe thank
  13. you again for using our form and telling \nus your option
  14. about our site\n\nThis is important to us so we can know how
  15. to improve.\n\nThank you once again.");
  16.  
  17. mail("cameronspears@yahoo.com", "An Opinion", "$name just
  18. used the form.\n\nThey stated that our site $opinion.");
  19.  
  20. ?>
Aug 11 '05 #1
2 1859
uvindex
2 New Member
After much gnashing of teeth and finally obtaining a hosting account from a completely different organization, it seems the missing arguments problem reported above is specific to the PHP installation.

To demonstrate: this simple script works on one server but not on another:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3. // This page should receive a name value in the URL.
  4.  
  5. print "<p>Hello, $name, and welcome to the web!</p>";
  6.  
  7. ?>
(these aren't real URLs, by the way - they're just simplified versions of verbose URLs)

http://www.serverA.com/simplehello.php?name=JohnDoe
(Observed output is "Hello, JohnDoe, and welcome to the web!")

http://www.serverB.com/simplehello.php?name=JohnDoe
(Observed output is "Hello, , and welcome to the web!")

Is there a PHP installation parameter which would inhibit the passing of arguments like this?

Thanks,
CS
Aug 11 '05 #2
pbmods
5,821 Recognized Expert Expert
Try using $_GET['name'] instead of $name.

Your problem is related to the value of register_globals.
May 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Edward Diener | last post by:
In the tutorial on functions there are sections on default arguments and keyword arguments, yet I don't see the syntactic difference between them. For default arguments the tutorial shows: def...
11
by: Neo | last post by:
Why the following code is compilable? The function abc() doesn't take any arguments, still i can call the function with arbitraty number of arguments. Even compiler doesn't show any warning. What...
9
by: thomson | last post by:
Hi all, Would you please explain me where will be the heap stored if it is declared inside the Class, As class is a reference type, so it gets stored on the heap, but struct is a value...
1
by: Matt B | last post by:
Hi all - I am going to implement a web service using .NET. It's a service that attributes authorship of a document to one of two authors, based on the training data provided. I am going to...
6
by: Programador | last post by:
I'm getting this error when running this program: Cannot calculate rate using the arguments provided Module Module1 Sub Main() Rate(360, -694.44444444444446, 244274.69178082192) End Sub
3
by: zlf | last post by:
I am asked to complete a COM+ component, there is a class A derived from ServicedComponent. However, when executing , exception is thrown. Messaged: Unhandled Exception:...
36
by: Pacific Fox | last post by:
Hi all, haven't posted to this group before, but got an issue I can't work out... and hoping to get some help here ;-) I've got a base object that works fine with named arguments when called...
11
by: -Lost | last post by:
I have this generic function (JavaScript newbie here, so don't think I am going to impress you): function blah() { var container = ''; for(var i = 0; i < arguments.length; i++) { container...
7
by: william | last post by:
My question is: Specific memory block where my pointer pointing to changed strangely, seemingly that no statement changed it. Here are two examples I got: ***********1***************** I was...
9
by: oldyork90 | last post by:
I'm going thru code and have never seen this before http://www.webreference.com/programming/javascript/mk/column2/3.html Look at function CreateDragContainer() on line 25. It has no arguments...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...
1
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.