Jump to content

How to post multiple keys to php script?


mikk809h

Recommended Posts

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

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);
}
 
 
?>

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).

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.