2015-05-02, 16:06
Bellow is a form the you enter text like a couple of posts up but
this time the text will be encoded so its gibberish
in till its read by the python script bellow
PHP---TEXT-----ENCODE
PYTHON-----TEXT-----DECODE
Save File As form.php
save file as write.php
this time the text will be encoded so its gibberish
in till its read by the python script bellow
PHP---TEXT-----ENCODE
PYTHON-----TEXT-----DECODE
PHP Code:
#Make Sure You Import base64 at the top of your addon
import base64
PHP Code:
# This Text Goes After your Imports It Reads The .TXT Or .PHP
# File From Location Below The File Reads SGVsbG8gVGhpcyBpcyBhIHRlc3Qg
message=urllib.urlopen('http://YOURSITE/update.txt').read()
PHP Code:
# Example of decoding file above and using it as the name
# the text will be decoded changing SGVsbG8gVGhpcyBpcyBhIHRlc3Qg
# to "hollo this is a text"
addDir('%s'%(message).decode('base64'),'URL',1,'ICON')
Save File As form.php
PHP Code:
<form action="write.php" method="get" id="text">
<input name="text" type="text" />
<input type="submit" name="Submit" />
</form>
PHP Code:
#the only change i had to make to encode it is add base64_encode($_GET['text'])
#if you wish for normal txt change base64_encode($_GET['text']) $_GET['text']
# removing base64_encode and one set of brackets ()
<?php
$file = fopen("update.txt","w");
echo fwrite($file,base64_encode($_GET['text']));
fclose($file);
echo ' File Saved';
?>