Jump to content

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

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);
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.