rbvinc Posted May 18, 2011 Share Posted May 18, 2011 I am using MS Access, winxp, ASP. The following code works fine in ASP when I select only one country. If check two or more countries, it does not work. Can you please modify the following code to work in PHP if I select 1 or 2 or 3 or more countries. Thank you in advance. PLEASE NEED PHP CODE. ---------- <html> <head> <title>Untitled</title> </head> <body> <% if request.form("country") = "" then %> <form action='aspformdata.asp' method="post"> <input type="checkbox" name="COUNTRY" value="USA">USA<br> <input type="checkbox" name="COUNTRY" value="Canada">Canada<br> <input type="checkbox" name="COUNTRY" value="Denmark">Denmark<br> <input type="checkbox" name="COUNTRY" value="China">China<br> <input type="checkbox" name="COUNTRY" value="Japan">Japan<br> <input type='submit' name='submit' value='Submit'> </form> <% Else %> <% set cn = server.createObject("ADODB.Connection") cn.open "dsn=northwind" courntry = request.form("country") %> <% sql = "select * from customers where country = '" & request.form("country") & "' order by country" set rs = server.createObject("ADODB.RecordSet") rs.open sql, cn %> <table> <tr> <td> CompanyName</font></td><td> City</font></td><td> State</font></td> </tr> <% Do Until rs.EOF %> <tr> <td> <%= rs("CompanyName")%></font> </td> <td> <%= rs("City")%></font></td> <td> <%= rs("State")%></font> </td> </tr> <% rs.movenext loop %> <% End if%> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/236745-php-code-needed-php-form-values/ Share on other sites More sharing options...
MadTechie Posted May 27, 2011 Share Posted May 27, 2011 Sure, please pay me in advance. Link to comment https://forums.phpfreaks.com/topic/236745-php-code-needed-php-form-values/#findComment-1221383 Share on other sites More sharing options...
DeX Posted June 20, 2011 Share Posted June 20, 2011 Quote Sure, please pay me in advance. Ya, exactly. The main thing you're going to want to know is that the <% %> symbols are going to be replaced with <?php ?>. Link to comment https://forums.phpfreaks.com/topic/236745-php-code-needed-php-form-values/#findComment-1232315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.