Re: Evaluting form variables - I don't see what's wrong with code

From: Date: Mon, 14 Aug 2000 18:23:54 +0000
Subject: Re: Evaluting form variables - I don't see what's wrong with code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-11660@lists.php.net to get a copy of this message
Hey J. You should check your PHP functions more carefully, printf expects a string with data placeholders and then data to fill in those placeholders. Your code should have read: printf("The value is %s", $D0_0600SHOW); where %s is a string placeholder and $D0_0600SHOW is the variable that fills the data in. Joao Prado Maia's solution is simpler: echo "The value is " . $D0_0600SHOW; and more appropriate to PHP3 or 4 is: print "The value is $D0_0600SHOW"; or print 'The value is ' . $D0_0600SHOW; Hope that helps and keep reading the manual. Jarrod ----- Original Message ----- From: "J. Myers" <jr@mediastop.com> To: <php-general@lists.php.net> Sent: Monday, August 14, 2000 11:53 AM Subject: [PHP] Evaluting form variables - I don't see what's wrong with code > Hello Folks! This is probably the simplest problem but we're stumped. > We've set up a simple HTML form and now would like to evaluate the > submitted form variables. > > Eg. > > Form variable name: <input type="text" name="D0_0600SHOW"> > > Script: printf("The value is", $D0_0600SHOW); > > Output: "The value is " > > It's as if the variable doesn't exist. I've sent the same form variable > to another scripting language that I use and it works just fine. > What could I be doing wrong? > > Thanks ahead of time! > > Jr. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#11660) next »