![]() |
![]() |
||||||
|
|||||||
| Tags: buttons, php, radio, simple |
![]() |
|
|||
|
Hi. I'm trying to program some radio buttons to put in an ASP form, using PHP
coding. I just need something simple for three yes/no questions. I've looked around online and haven't found anything of much help. Any help is appreciated. Thanks. ![]() |
| Sponsored Links |
|
|||
|
> Hi. I'm trying to program some radio buttons to put in an ASP form, using
> PHP > coding. I just need something simple for three yes/no questions. Now I'm confused. You cannot use PHP on an ASP page. Can you clarify what it is you are doing? -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "Quiet Winter" <webforumsuser@macromedia.com> wrote in message news:g6870l$a8m$1@forums.macromedia.com... > Hi. I'm trying to program some radio buttons to put in an ASP form, using > PHP > coding. I just need something simple for three yes/no questions. > > I've looked around online and haven't found anything of much help. Any > help is > appreciated. > > Thanks. ![]() > |
|
|||
|
So, you mean you are using a PHP scripted page to process the data from an
ASP form? > I tried an HTML form, but it > kept failing, whereas the ASP worked immediately, so I have to stick to an > ASP > form. This REALLY makes no sense. What was failing? So, what do you want to do with the radio buttons? -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "Quiet Winter" <webforumsuser@macromedia.com> wrote in message news:g6ddna$6v1$1@forums.macromedia.com... > I'm using an external PHP page to program my ASP form. Everything so far > works, > except that I'm unsure how to put the radio buttons in it. > > What it is is I used a form, and for the info I have this: <form > method="post" > action="phpform.php">. > > For my PHP coding, I want to how to add the radio info. So, to clarify, > it's > going into PHP, but it's linked to an ASP form. I tried an HTML form, but > it > kept failing, whereas the ASP worked immediately, so I have to stick to an > ASP > form. > |
|
|||
|
I'm using an external PHP page to program my ASP form. Everything so far works,
except that I'm unsure how to put the radio buttons in it. What it is is I used a form, and for the info I have this: <form method="post" action="phpform.php">. For my PHP coding, I want to how to add the radio info. So, to clarify, it's going into PHP, but it's linked to an ASP form. I tried an HTML form, but it kept failing, whereas the ASP worked immediately, so I have to stick to an ASP form. |
|
|||
|
What do you want to do with the radio buttons?
Can we see the scripting on the PHP page? -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "5th Star from Venus" <webforumsuser@macromedia.com> wrote in message news:g6dfia$8qu$1@forums.macromedia.com... > Yes, correct. > > Incase I'm making it confusing...I have an ASP form that's information is > collected by a PHP scripted page. |
|
|||
|
So, you mean you are using a PHP scripted page to process the data from an ASP
form? - Yes I want to know a working code for radio buttons to use in a PHP scripted page. I've tried some before but they wouldn't work, and I'm hoping that a form built in html and an asp form generally work the same. If you need to see the PHP script, I can post it for you. |
|
|||
|
> I want to know a working code for radio buttons to use in a PHP scripted
> page. I'm very sorry, but I have no idea what you are asking for. Can you please try to give more information? A form is an HTML construction. It will work on an HTML page, and ASP page, a ColdFusion page, a PHP page, a JSP page, or any other kind of server model page. The type of page will have no effect on whether or not the form "works", depending of course on what you mean by "works". -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "Quiet Winter" <webforumsuser@macromedia.com> wrote in message news:g6dg0d$9d9$1@forums.macromedia.com... > So, you mean you are using a PHP scripted page to process the data from an > ASP > form? - Yes > > I want to know a working code for radio buttons to use in a PHP scripted > page. > I've tried some before but they wouldn't work, and I'm hoping that a form > built > in html and an asp form generally work the same. If you need to see the > PHP > script, I can post it for you. > |
|
|||
|
Yes, it seems I'm confusing you, so I'll post it. The HTML not working thing
was actually something to do with my FTP provider, so I won't even go into that anymore, since it's off-subject for what you can help me with. Here's my PHP script: <?php $EmailFrom = "site@domain.com"; $EmailTo = "webmaster@domain.com"; $Subject = "Referral Information"; $Name = Trim(stripslashes($_POST['Name'])); $Date = Trim(stripslashes($_POST['Date'])); $Address = Trim(stripslashes($_POST['Address'])); $City = Trim(stripslashes($_POST['City'])); $State = Trim(stripslashes($_POST['State'])); $Zip = Trim(stripslashes($_POST['Zip'])); $Email = Trim(stripslashes($_POST['Email'])); $Phone = Trim(stripslashes($_POST['Phone'])); $validationOK=true; if (Trim($Name)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Date: "; $Body .= $Date; $Body .= "\n"; $Body .= "Address: "; $Body .= $Address; $Body .= "\n"; $Body .= "City: "; $Body .= $City; $Body .= "\n"; $Body .= "State: "; $Body .= $State; $Body .= "\n"; $Body .= "Zip: "; $Body .= $Zip; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Phone: "; $Body .= $Phone; $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=sent.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> The form is mostly fill-ins, as you can see, and I want to add three yes/no questions. |
|
|||
|
There's still a good deal of information missing here. Perhaps a look at
this code/page will help you figure out what needs to be added to your PHP script - <?php if (isset($_POST['submit']) && $_POST['submit'] == 'SUBMIT') { foreach($_POST as $key => $value) { echo $key . " => " . $value . "<br>"; } exit(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Radiobutton Test</title> </head> <body> <form name="form1" method="post" action=""> <label for="radiobutton">red</label> <input name="radiobutton" type="radio" value="red" id="redbutton"> <label for="label">green</label> <input name="radiobutton" type="radio" value="green" id="greenbutton"> <label for="radio">blue</label> <input name="radiobutton" type="radio" value="blue" id="bluebutton"> <input type="submit" name="submit" id="submit" value="SUBMIT"> </form> </body> </html> Your script will need to pick up the value of the radiobutton group, as I have done above, and add it to the body of the mail message. -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "Quiet Winter" <webforumsuser@macromedia.com> wrote in message news:g6djla$d39$1@forums.macromedia.com... > Yes, it seems I'm confusing you, so I'll post it. The HTML not working > thing > was actually something to do with my FTP provider, so I won't even go into > that > anymore, since it's off-subject for what you can help me with. > > Here's my PHP script: > > <?php > > $EmailFrom = "site@domain.com"; > $EmailTo = "webmaster@domain.com"; > $Subject = "Referral Information"; > $Name = Trim(stripslashes($_POST['Name'])); > $Date = Trim(stripslashes($_POST['Date'])); > $Address = Trim(stripslashes($_POST['Address'])); > $City = Trim(stripslashes($_POST['City'])); > $State = Trim(stripslashes($_POST['State'])); > $Zip = Trim(stripslashes($_POST['Zip'])); > $Email = Trim(stripslashes($_POST['Email'])); > $Phone = Trim(stripslashes($_POST['Phone'])); > > > $validationOK=true; > if (Trim($Name)=="") $validationOK=false; > if (!$validationOK) { > print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; > exit; > } > > $Body = ""; > $Body .= "Name: "; > $Body .= $Name; > $Body .= "\n"; > $Body .= "Date: "; > $Body .= $Date; > $Body .= "\n"; > $Body .= "Address: "; > $Body .= $Address; > $Body .= "\n"; > $Body .= "City: "; > $Body .= $City; > $Body .= "\n"; > $Body .= "State: "; > $Body .= $State; > $Body .= "\n"; > $Body .= "Zip: "; > $Body .= $Zip; > $Body .= "\n"; > $Body .= "Email: "; > $Body .= $Email; > $Body .= "\n"; > $Body .= "Phone: "; > $Body .= $Phone; > > > $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); > > if ($success){ > print "<meta http-equiv=\"refresh\" content=\"0;URL=sent.html\">"; > } > else{ > print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; > } > ?> > > The form is mostly fill-ins, as you can see, and I want to add three > yes/no > questions. > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise