Cannot pass values to PHP files ...

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
html code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="GENERATOR" content="">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_" style="position:absolute;left:34px;top:34px;width:197px;height:206px;z-index:2" align="left">
<form name="Form1" method="POST" action="in.php" enctype="text/plain" id="Form1">
<input type="text" id="Editbox1" style="position:absolute;left:24px;top:24px;width:144px;font-family:Courier;font-size:19px;z-index:0" size="16" name="Editbox1" value="">
<input type="submit" id="Button1"" name="Button1" value="Submit" style="position:absolute;left:48px;top:89px;width:75px;height:24px;z-index:1">

</form>
</div>
</body>
</html>



in.PHP Code:

<?php
echo $_POST["Editbox1"];
?>

this has no output

please help.
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
I found that removing this property 'enctype="text/plain" ' from your form tag fixed the problem. That type of encoding doesn't seem to work with php.

I also found that you need to add a '/' to the end of your input tags, but thats just to make it correct html, the php will work fine without it.

Your code should look like this.
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="GENERATOR" content="">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_" style="position:absolute;left:34px;top:34px;width: 197px;height:206px;z-index:2" align="left">
<form name="Form1" method="POST" action="in.php" id="Form1">
<input type="text" id="Editbox1" style="position:absolute;left:24px;top:24px;width: 144px;font-family:Courier;font-size:19px;z-index:0" size="16" name="Editbox1"/>
<input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:48px;top:89px;width: 75px;height:24px;z-index:1"/>

</form>
 
Last edited:

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
k thanks i'll try and reply

it still does not work for me

i removed 'enctype="text/plain but still...

the code you posted has the enctype field in it...
it still doesnt work...did it work whenu ran the code ?
 
Last edited:

supajason

Member
Messages
288
Reaction score
2
Points
18
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="GENERATOR" content="">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_" style="position:absolute;left:34px;top:34px;width: 197px;height:206px;z-index:2" align="left">
<form name="Form1" method="POST" action="in.php" id="Form1">
<input name="Editbox1" type="text" id="Editbox1" style="position:absolute;left:24px;top:24px;width: 144px;font-family:Courier;font-size:19px;z-index:0" size="16" name="Editbox1" value="">
<input type="submit" id="Button1"" name="Button1" value="Submit" style="position:absolute;left:48px;top:89px;width: 75px;height:24px;z-index:1">

</form>
</div>
</body>
</html>

PHP:
<?php
echo $_POST["Editbox1"];
?>

try that?
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
My example was a bit stuffed up, :biggrin:

I fixed it, but here is a working example if you want one.
http://www.verbtest.com/test/test.php

The html and php code for it, the only change you will want to make to this code is the forms action, change it to 'in.php'.
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="GENERATOR" content="">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_" style="position:absolute;left:34px;top:34px;width: 197px;height:206px;z-index:2" align="left">
<form name="Form1" method="POST" action="test.php"  id="Form1">
<input type="text" id="Editbox1" style="position:absolute;left:24px;top:24px;width: 144px;font-family:Courier;font-size:19px;z-index:0" size="16" name="Editbox1"/>
<input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:48px;top:89px;width: 75px;height:24px;z-index:1"/>

</form>

</div>
<?php
echo $_POST["Editbox1"];
?>
</body>
</html>
 

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
no it does not work either :-(
verbsite suggested this,i tried but it did not work
 
Last edited:

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
it is working thank you

thanks alot for your help
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
i was replyng to supajason

yes wat u told is working....
now why does this work...
pasting the code into the php file again,how does the variable become accessibe now ?
is there ne specific reason for the other code not working ??

not that i can see, his code works fine for me.
 

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
Sorry ,but i found out wat u said was true... it is working after removing enctype field
'twas my mistake
if i tell u the n i'm screwed for sure :D

actually i used paranthese instead of []

apologies again
 
Last edited:
Top