FreddoB Posted September 2, 2017 Share Posted September 2, 2017 Hello. I have a very old order form that I developed with VBS/Access many years ago and I'm now converting it to PDO/MYSQL and I am stuck with conversion regarding arrays. I am almost totally new to PHP and have gone well so far with the project. Any help would be much appreciated. The following is the form and the VBS for posting to a review order page:There are 4 categories and the following form code for each category is within the one <form></form>:<input type="hidden" name="plantname1[ ]" value = "<?php echo $row['plantname']; ?>" /> 140mm @ $<?php echo $row['price140']; ?> UNITS REQUIRED<input type="text" name="quantity1[ ]" size="5" maxlength="10" value="0" /> I have set the [], which I understand is necessary for the various arrays. The Plantname and Quantity is posted through to the Preview Order page.On the Preview Order page there is the following code for each category:<% Dim arrPlants, arrAmounts, xarrPlants=Split(strPlantname1, ", ")arrAmounts=Split(strQuantity1, ", ")For x=0 To UBound(arrPlants) If CLngN(arrAmounts(x))>0 Then response.write (arrAmounts(x)&" "&arrPlants(x)&"<br>") End IfNextFunction CLngN(n) CLngN=0 'default value! On Error Resume Next CLngN=CLng(n) Err.Clear On Error Goto 0End Function%>At the end of the 4 lots of code for the 4 categories is the following for each category, 1 to 4:<%Dim strToSend1For x=0 To UBound(arrPlants) If CLngN(arrAmounts(x))>0 Then strToSend1=strToSend1&arrAmounts(x)&" "&arrPlants(x)& " " End IfNext%> Link to comment Share on other sites More sharing options...
Jacques1 Posted September 2, 2017 Share Posted September 2, 2017 So what is your concrete question? PHP basics like form handling and dealing with arrays are explained in the manual as well as in countless online tutorials, videos and books. If you just want somebody to do the conversion for you, there's the hire-a-programmer section. Link to comment Share on other sites More sharing options...
FreddoB Posted September 4, 2017 Author Share Posted September 4, 2017 Thanks for the reply. I will look at the tutorials and see if I can code it myself. I have attempted it but I hit a brick wall and thought it might be easier to get some help with converting the VBS. I will post separate questions regarding what I have already coded. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.