Guest Posted January 14, 2005 Posted January 14, 2005 I would really appreciate some help with the following: when submitting a form for adding attributes on my product info page which has radio buttons and text boxes my POST variables are returned as Array ( [id] => Array ( [1] => 10 [txt_3] => My text [4] => 1 [5] => 16 [txt_6] = More text ) [products_id] => 1 ) I know that I can use $products = $HTTP_POST_VARS['products_id']; to get the value of products_id but how do extract the values from the attributes [id] array? I really would appreciate some advice. Thanks
Guest Posted January 15, 2005 Posted January 15, 2005 I would really appreciate some help with the following: when submitting a form for adding attributes on my product info page which has radio buttons and text boxes my POST variables are returned as Array ( [id] => Array ( [1] => 10 [txt_3] => My text [4] => 1 [5] => 16 [txt_6] = More text ) [products_id] => 1 ) I know that I can use $products = $HTTP_POST_VARS['products_id']; to get the value of products_id but how do extract the values from the attributes [id] array? I really would appreciate some advice. Thanks <{POST_SNAPBACK}> Simply use the same code as for the products_id! :) $post_id = $HTTP_POST_VARS['id']; Now the $post_id variable will be an array containing all the info... Bobby
Guest Posted January 15, 2005 Posted January 15, 2005 Simply use the same code as for the products_id! :) $post_id = $HTTP_POST_VARS['id']; Now the $post_id variable will be an array containing all the info... Bobby <{POST_SNAPBACK}> Yes I appreciate that, but are you able to tell me how I can separate out the options and values and get them out of the array. Thanks for the help
Guest Posted January 15, 2005 Posted January 15, 2005 Of course I could...but that takes half the fun out of learning. Go through the code...read tutorials on PHP (specifically arrays). Then when you get the knowledge and experience your osC prowess will have increased dramatically. Also, you won't be dependent on a support forum. Bobby
Guest Posted January 15, 2005 Posted January 15, 2005 Of course I could...but that takes half the fun out of learning. Go through the code...read tutorials on PHP (specifically arrays). Then when you get the knowledge and experience your osC prowess will have increased dramatically. Also, you won't be dependent on a support forum. Bobby <{POST_SNAPBACK}> Sound to me like you don't know any more than me so why bother replying? I enjoy being able to help people which is why I participate in this forum and try to answer other people's questions. I have spent a long time trying to understand the code in OSCommerce which has got me to the stage of being able to ask this question. If you have no programming experience this is a big step believe me. So you know where to go don't you?
Guest Posted January 15, 2005 Posted January 15, 2005 Wow...that is funny! :) After more than 1,000 posts trying to help people I've decided that the best way I could do it is give them a point in the right direction and just enough to solve their problem. The answer to your problem is right there...you just don't have the motivation to search. I have no programming experience? Yeah right... I'll let someone else that can put up with an attitude reply to your question. Bobby
boxtel Posted January 15, 2005 Posted January 15, 2005 Wow...that is funny! :) After more than 1,000 posts trying to help people I've decided that the best way I could do it is give them a point in the right direction and just enough to solve their problem. The answer to your problem is right there...you just don't have the motivation to search. I have no programming experience? Yeah right... I'll let someone else that can put up with an attitude reply to your question. Bobby <{POST_SNAPBACK}> here is the solution : http://tw2.php.net/array Treasurer MFC
Guest Posted January 15, 2005 Posted January 15, 2005 here is the solution :http://tw2.php.net/array <{POST_SNAPBACK}> Thanks a lot Boxtel - sorted! Bobby, as I said, if you don't have anything useful to say - keep quiet!
Guest Posted January 15, 2005 Posted January 15, 2005 Bobby, as I said, if you don't have anything useful to say - keep quiet! <{POST_SNAPBACK}> 99.99% of the time I have something useful to say...except for the .01% of the newbies that come here with an attitude with no desire to learn and only want the quick cut-n-paste answer. As for your keep quiet comment: it's not my problem that you lack the most basic skills to research your answer and must rely on others to do your work for you. Don't hate me because your knowledge and experience is not up to par. Take the time to learn...then come back here and answer questions for beginning webmasters for 2 years then you can tell me to keep quiet. Until then => have a Coke and a smile :) Bobby
Guest Posted January 15, 2005 Posted January 15, 2005 Bobby - I have had a life of learning and I'm not giving up now. Asking for pointers is sometimes necessary when you don't know where to look because you're not familiar with the terminology. So crawl back in your miserable lonely hole and stop wasting space on this very useful forum!
Guest Posted January 15, 2005 Posted January 15, 2005 You're right...I'm wasting everyone's time on this forum. Go get some therapy... Bobby
dwno Posted January 16, 2005 Posted January 16, 2005 Bobby - I have had a life of learning and I'm not giving up now. Asking for pointers is sometimes necessary when you don't know where to look because you're not familiar with the terminology. So crawl back in your miserable lonely hole and stop wasting space on this very useful forum! <{POST_SNAPBACK}> Alright, I'll try to explain why such immature, provocative statements aren't the wisest things to say. First, biting the hand that feeds you is not very clever, you can imagine why. You thought he wasn't being helpful when he said "go read a few tutorials", so my question is; is it really so hard to understand that educating yourself to find your food is much better than to be spoon-fed? (hint: you can't be spoon-fed forever) If someone had just come up with the exact code you wouldn't learn a thing, now fortunately that didn't happen. Someone gave you a link to php.net, and you were all grateful for that, but that was exactly was Chemo was trying to tell you. If you had done a quick search for 'php tutorial' then guess which page would show at the top.. -php.net. You would like to change your attitude if you want help from this forum in the future. Pissing off (or on) senior members of this forum is not going to help you. Finally, if it's web developing resources you're after, I have made links to my own favourite resources availible at my site. Feel free to check them out. Good luck learning -Eivind
Guest Posted January 17, 2005 Posted January 17, 2005 Alright, I'll try to explain why such immature, provocative statements aren't the wisest things to say. First, biting the hand that feeds you is not very clever, you can imagine why. You thought he wasn't being helpful when he said "go read a few tutorials", so my question is; is it really so hard to understand that educating yourself to find your food is much better than to be spoon-fed? (hint: you can't be spoon-fed forever) If someone had just come up with the exact code you wouldn't learn a thing, now fortunately that didn't happen. Someone gave you a link to php.net, and you were all grateful for that, but that was exactly was Chemo was trying to tell you. If you had done a quick search for 'php tutorial' then guess which page would show at the top.. -php.net. You would like to change your attitude if you want help from this forum in the future. Pissing off (or on) senior members of this forum is not going to help you. Finally, if it's web developing resources you're after, I have made links to my own favourite resources availible at my site. Feel free to check them out. Good luck learning -Eivind <{POST_SNAPBACK}> Dear Eivind I asked a question on the forum because I had spent ages going round in circles and had already trawled the web for some answers. In fact in the end the light dawned and I worked it out, however, I had come to the forum not for a quick fix but because I was having problems understanding the code and hoped a real person rather than a book might be able to help. After all, why do you think classrooms still exist and people pay to go to night school, now that the internet is available? With a Bachelors degree and a Masters degree I feel I know how to take responsiblity for my own learning. So being told to go and read a few tutorials was not and is not helpful. And if this happened whenever anyone posted a question there would be nothing worthwhile about the forum. We all run such busy lives these days that we don't want to be faced with events that waste any of our precious time. My only mistake seems to have been in telling a 'senior' member of your group just this. I have received a lot of help from this forum, and I hope that I have been able to and will continue to be able to help others too, which in my opinion, is what this forum is all about.
dwno Posted January 17, 2005 Posted January 17, 2005 Hi, I'm glad to hear you're serious about education. :thumbsup: The reason you got a response saying you should probably read a few tutorials, is because your question says you're not very experienced with php. For all we know, you can be a master of everything else, just not php, and reading a good tutorial would most likely be more of an investment for you than simply to give you the exact answer here. Imagine people answering more or less the same questions every day over and over again; if they simply answer each and every newbie question, the newbie will come back and ask a new one before you could say "tutorial". You may have searched high and low for this answer before you asked it, but that just indicates that you don't know where to look. Anyway, the reason I first responded to this thread was because I didn't like the attitude. This is all volounteer work you know, IMO any help should be appreciated. And considering the question, I do believe Chemo's advice was a good one. Cheers, :) Eivind
Recommended Posts
Archived
This topic is now archived and is closed to further replies.