Jump to content

Ericles

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by Ericles

  1. Dios mio! A typo! That was introduced when I copied/pasted from here to the script. Oh well. Ok, well then the $_POST solution does is the answer I've been looking for then and at least I know I'm not losing my mind. Thanks for the help everyone. I'll probably be back with more when I can't figure out the arrays.
  2. I played with it a bit more but no luck. This is the entire thing - one script to perform all duties. <html><head> <title>Simple Text Box Test</title> </head> <body> <FORM NAME="form1" ID="form1" METHOD="POST" ACTION="simple.php"> <INPUT Type='Text' Name="i1Text" ID="i1Text" Value="Default"> <INPUT Type="Submit" Name="Submit1" Value="Read the Text"> </FORM> <?PHP if (!empty($_POST)) { print "not empty<br>"; } if (isset($_POST['Submit1'])) { $PostText=$_POST['ilText']; print "PostText: $PostText"; $RefText=$i1Text; print "RefText: $RefText"; if (!empty($_POST['ilText'])) { $PostText = $_POST['ilText']; print "New Post: $PostText"; } else { print "<br>Error"; } } ?> </body></html> I've stared at this thing long enough that anything obvious is now invisible. I expected to be having fun reading SQL and building arrays and I'm stuck on reading input from the screen. Ah well, maybe muddy waters, let stand, will become clear in the morning.
  3. Good stuff! I'll use some of these samples when I get this one little issue working. Roger that. This is why I'm recoding rather than just going with the .PHP4 extension. I'm still doing something wrong however as the code below hits the ERROR line. $_POST is definitely not empty as the script spits out "not empty Error". Any suggestions? if (!empty($_POST)) { print "not empty"; } if (!empty($_POST['ilText'])) { $Reftext = $_POST['ilText']; } else { print "Error"; }
  4. A while back my webhost upgraded to PHP5 and broke a few of my simple scripts - primarily forms using a text box for entry. I renamed and relinked the forms to .php4 and it "solved" the problem. I've decided to fix them correctly and use proper PHP 5 code. What's the easiest way to actually retrieve the value of a text input in PHP5? My old reference tricks return null. When I started reading up I saw only PHP4 examples and then in over my head with global variables, httaccess and php.ini. I don't want to mess about with the default settings. I'm sure I zoomed right past a simple answer on my way to that mess. A simple example script: <FORM NAME="form1" ID="form1" METHOD="POST" ACTION="simple.php"> <INPUT Type='Text' Name="i1Text" ID="i1Text" Value="Default"> <INPUT Type="Submit" Name="Submit1" Value="Read the Text"> </FORM> <?PHP if (isset($_POST['Submit1'])) { $RefText=$i1Text; print "Text: $RefText"; <!-- Returns blanks unless .php4 --> } ?> So, how do I actually get to that text value? Thanks in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.