mikk809h Posted May 15, 2013 Share Posted May 15, 2013 Hello! im wondering how to post multiple keys to a webpage.. but somehow it doesnt work really.. if (isset($_POST['key'])) { $userKey = $_POST["key"]; if ($userKey == $key) { if (isset($_POST['licensekey'])) { $lic = $_POST['licensekey']; echo $lic; -- when echo'ing, it returns 3 blank spaces. How do i post multiple strings/keys to the webpage then? Thanks in Advance Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/ Share on other sites More sharing options...
mac_gyver Posted May 15, 2013 Share Posted May 15, 2013 your post doesn't show what you mean by multiple strings/keys, so this is just a guess, but i suspect the answer involves arrays. Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430167 Share on other sites More sharing options...
Phear46 Posted May 15, 2013 Share Posted May 15, 2013 if(isset($_POST['<NAME OF SUBMIT BUTTON>'])) { $userKey = $_POST['key']; $lic = $_POST['licensekey']; } to see what has been 'sent' to your script use: print_r($_POST); if nothing is returned, your sending nothing which is why you have blank space. Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430171 Share on other sites More sharing options...
mikk809h Posted May 15, 2013 Author Share Posted May 15, 2013 it returns 1 long string (the key), but after that, it returns "Array" EDIT: maybe im posting wrong? This is the part, of the posting mechanism: "key=" .. key .. ", licensekey=" .. computer[pos].key); <?php $key = 'personalcode_not_shared_online'; if(isset($_POST['key'])) { $userKey = $_POST['key']; $lic = $_POST['licensekey']; print_r($_POST); } ?> Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430228 Share on other sites More sharing options...
mac_gyver Posted May 15, 2013 Share Posted May 15, 2013 until you define what you mean by "multiple strings/keys" and then share that definition or a diagram with us, we cannot help you. Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430229 Share on other sites More sharing options...
mikk809h Posted May 15, 2013 Author Share Posted May 15, 2013 But... Mac_Gyver.. if Phear understand what i mean. then you dont have to post the same post again. if you're not understanding what i mean, then dont try to help me! Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430257 Share on other sites More sharing options...
mikk809h Posted May 15, 2013 Author Share Posted May 15, 2013 as i said in previous post; This isnt the right posting method, right? "key=" .. key .. ", licensekey=" .. computer[pos].key); Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430271 Share on other sites More sharing options...
mac_gyver Posted May 15, 2013 Share Posted May 15, 2013 mikk809h, Phear showed you some troubleshooting logic in the hope that you would show us the output from it so that we could see how your submitted data is organized. you still haven't shown how you are submitting multiple sets of data, so you haven't gotten anywhere with this problem. you either must use an array name for your form fields (preferred method as it allows any number of data items in the set) or give each one a unique name (not preferred as it takes more code to keep track of the unique names). Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430296 Share on other sites More sharing options...
mikk809h Posted May 15, 2013 Author Share Posted May 15, 2013 BUT! i just want to know, what the "array" means... did that then mean that i've posted something wrong, or! and as i said.. do anyone know if this posting method is correct (does i need like an ? after the $key='$key') "key=" .. key .. ", licensekey=" .. computer[pos].key); Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430316 Share on other sites More sharing options...
Barand Posted May 15, 2013 Share Posted May 15, 2013 On 5/15/2013 at 5:57 PM, mikk809h said: .... if you're not understanding what i mean, then dont try to help me! Your wish is our command. Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430324 Share on other sites More sharing options...
Dathremar Posted May 16, 2013 Share Posted May 16, 2013 On 5/15/2013 at 5:57 PM, mikk809h said: ... if you're not understanding what i mean, then dont try to help me! I was going to GUESS what you mean and try to help you, but after reading this, my will is gone. Link to comment https://forums.phpfreaks.com/topic/278016-how-to-post-multiple-keys-to-php-script/#findComment-1430375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.