Jump to content

dsandif

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dsandif's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Many thanks. You were right. Thank you for your wisdom and and patience. dsandif-
  2. WAMP is installed correctly, so php is there, age.html and age.php are correctly named so the only thing I not clear is the invoking, although I have gotten another small php script to run, so I don't think its that either. Over all, everything looks goood, still not sure it won't run. dsandif-
  3. this is the out put I get when I put in an age: = 18 && $age < 50) print "You're in the prime of your life\n"; else print "You're not in the prime of your life\n"; } ?>
  4. I trying to reverse engineer a php output. I've got the code, but I can't quite get the html to work with it. her is the code: <?php $age = 20; if ($age >= 18 && $age < 50) { print "You're in the prime of your life\n"; } else { print "You're not in the prime of your life\n"; } ?> and here is the html: <html> <head></head> <body> <form action="age.php" method="post"> Enter your age: <input type="number" name="age" size="30"> <input type="submit" value="Send"> </form> </body> </html> I am a beginner at this & trying to get better.Thanks for your input. dsandif
  5. I removed the line: if(isset($_POST['submit'])) and the brackets "{}" and that did the trick. Thanks to all who replied. dsandif-
  6. Thanks for the quick responses from all. This is what I get back now: Notice: Undefined index: first in C:\wamp\www\572_projects\quick-form.php on line 14 Notice: Undefined index: last in C:\wamp\www\572_projects\quick-form.php on line 15 Notice: Undefined index: address in C:\wamp\www\572_projects\quick-form.php on line 16 Notice: Undefined index: gender in C:\wamp\www\572_projects\quick-form.php on line 17 First Name: Last Name: Address: Gender: Do I need to use double quotes instead of single on the echos?
  7. Hi All, This is My first time here. I just started learning php about two weeks ago. My hope is as I ask questions and get better at this, that i would and will grow into a contributor and not just a leech. I have what is probably to you a very basic php question\problem. I have created a simple form and I want to generate output from the data\information that is put into the form fields. The problem is, I seem to only get one field to output and not all. I am using the POST method to store all post values in a associative array ($_POST), but unless I'm just not doing my variables correctly, I just can't seem to get the all display I want. Here is the html: <html> <head></head> <body> <form action="quick-form.php" method="post"> First Name: <Input type="text" name="msg" size="30" maxlength="12"><br /> Last Name: <input type="text" name="msg" size="30" maxlength="12"><br /> Address: <input type="text" name="msg" size="30" maxlength="12"><br /> <input type="radio" name="sex" value="male" /> Male <br /> <input type="radio" name="sex" value="female" /> Female<br /> <input type="submit" value="Submit"> </form> </body> </html> And here is the php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>form22</title> </head> <body> <?php // retrieve form data $input = $_POST['msg']; // use it echo "You said: <i>$input</i>"; ?> </body> </html> Thxs to all. dsandif-
×
×
  • 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.