473,387 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

trouble passing arguments

I have a RedHat Linux 8.0 system. I have started the httpd (Apache
2.0.40) process and can now fetch pages from the server. I have a
test htlm page which has a form that will take a string and try to
send it back. The variable being passed in the form is not being
displayed by the php script. This must be so simple that I am just
overlooking something.

<html>
<body>
<form action="testecho.php" method="POST">
Enter String: <input type="text" instring="instring" />
<input type="submit">
</form>
</body>
</html>

---------- testecho.php code -----------------

<html>
<body>
string 1
<br>
<?php
$v1="string 2";
echo $v1;
?>
<BR>
<?php
$v1="string 3";
echo $v1; ?>
<br>
<?php
echo $_POST["instring"];
?>

</body>
</html>
----------- load the page and enter a string into form then submit
-----------
--------- the output of the returned html code is as follows
-----------

string 1
string 2
string 3

---------- the string I enter on the form is missing ---------

I do not understand why the variable from the form is not being
passed.
Jul 17 '05 #1
2 3345
Walt

Maybe its just that your form should say "name=instring" rather than
"instring=instring"?
"Walt Last" <ki**********@hotmail.com> wrote in message
news:41*************************@posting.google.co m...
I have a RedHat Linux 8.0 system. I have started the httpd (Apache
2.0.40) process and can now fetch pages from the server. I have a
test htlm page which has a form that will take a string and try to
send it back. The variable being passed in the form is not being
displayed by the php script. This must be so simple that I am just
overlooking something.

<html>
<body>
<form action="testecho.php" method="POST">
Enter String: <input type="text" instring="instring" />
<input type="submit">
</form>
</body>
</html>

---------- testecho.php code -----------------

<html>
<body>
string 1
<br>
<?php
$v1="string 2";
echo $v1;
?>
<BR>
<?php
$v1="string 3";
echo $v1; ?>
<br>
<?php
echo $_POST["instring"];
?>

</body>
</html>
----------- load the page and enter a string into form then submit
-----------
--------- the output of the returned html code is as follows
-----------

string 1
string 2
string 3

---------- the string I enter on the form is missing ---------

I do not understand why the variable from the form is not being
passed.

Jul 17 '05 #2
On 20 Sep 2003 15:44:52 -0700, ki**********@hotmail.com (Walt Last)
wrote:
I have a RedHat Linux 8.0 system. I have started the httpd (Apache
2.0.40) process and can now fetch pages from the server. I have a
test htlm page which has a form that will take a string and try to
send it back. The variable being passed in the form is not being
displayed by the php script. This must be so simple that I am just
overlooking something.

<html>
<body>
<form action="testecho.php" method="POST">
Enter String: <input type="text" instring="instring" />


Try:

Enter String: <input type="text" name="instring" />

Regards,

--
Derek Sorensen
http://goldcrossdata.co.uk
Jul 17 '05 #3

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
3
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) {...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
5
by: Michael | last post by:
Hi, once I read here that it is not 'a good idea' to pass variables that are not initialized to a function. I have void something ( double *vector ); ....
4
by: Justine | last post by:
Can anyone help? e.g. when you open a vb project property page, in "Configuration Properties" You will see "Command line arguments" in "Start Options". Does anyone knows how to find a way to do...
7
by: Bonzo | last post by:
>From within a function, I want to pass a/some parameters to another function, AND all arguments, passed into this function. e.g. function firstFunction(){ //this function may have been...
11
by: thierrydollar | last post by:
Hi, I have written a very simple program using variable arguments calls and I get strange things that I cannot explain. I have one function (add) that displays two parameters. It works well...
8
sonic
by: sonic | last post by:
I am having trouble passing two variable types into my printPattern function. I need to pass rows and characterSelect from my getInput function into my printPattern function. I keep getting a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.