Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to POST / GET params with '+' char inside ?
2020-02-18, 14:47
Post: #5
RE: How to POST / GET params with '+' char inside ?
Hi, yes I tried substitute with %2B like :

param --mydata data_1 some%2Bthing , with no luck...

I tried both POST & GET methods with same results.
I tried GET method by the browser and work as expected, eg :
http://127.0.0.1/conf.php?data=some%2Bthing

mydata file : some+thing

Then I think it's an iPXE issue.

But I made an ugly and dirty hack to make it works by using base64 encoding, eg :

#!ipxe
set data_1:string some+thing
set data_2.....
params --name mydata
param --params mydata data_1 ${data_1:base64}
param --params mydata data_2.....
imgfetch http://webserver/conf.php##params=mydata || echo can't POST

conf.php file from webserver :

<?php
$myfile = fopen("/var/www/html/mydata", "wb") or die("Unable to open file!");
fwrite($myfile, "#!ipxe\n");

foreach ($_POST as $key => $value){
$txt = "set " . $key . "\t" . base64_decode($value) . "\n";
fwrite($myfile, $txt);
}
fclose($myfile);
?>

result of mydata file :

#!ipxe
set data_1 some+thing
set data_2.....

Dodgy
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to POST / GET params with '+' char inside ? - alhyene - 2020-02-18 14:47



User(s) browsing this thread: 1 Guest(s)