Forum Moderators: open
Is there any way to translate that code into shift-jis? I seem to have missed something. I've already made a nice drop-script which cuts all of the search url's out of my logs, but for the time being I am forced to plod one by one between the resulting list and my browser.
Thanks in advance for any help,
Josefu
Thanks,
Josefu
(added) it seems to convert the characters into the the right code, but your page won't switch from western encoding to shift-jis so we can read it.
Thanks for trying - I'd like to know how you did it so that from now on I can do it for myself instead of depending on your site and your kindness. I'm sure it's really simple and I'll be slapping my forehead for days afterwards.
Take care,
Josef.
sorry I was in a really busy spell for the last few days..
here is a very simple PHP script that will url-decode whatever you paste into the text box.
Save it as anything.php and upload to your server.
and give it a try...
I've got some longer, bigger, mega scripts that read directly from the logfile but they sometimes run out of server memory on HUGE logfiles and may cause you heartburn if you dont know what your doing....
hope this is useful enough for now.
------------ COPY BELOW THIS LINE -----------
<?
$text = urldecode($text);
$text = nl2br($text);
?>
<html lang=ja>
<head>
<title>URLDECODE</title>
</head>
<body>
<? echo $text;?>
<center>
<form action="<?php echo $PHP_SELF;?>" method="post" enctype="application/x-www-form-urlencoded">
<textarea name="text" cols="48" rows="10"></textarea><br>
<input type="submit" value="Convert Text" name="convert">
</form>
<br>
</center>
</body>
</html>
------------ COPY ABOVE THIS LINE -----------
Peace:)
Kaz
Here's a similar version that will do an entire file at a time.
1) Save the file that you want to de-code
2) Upload it to your server in the same directory as the script.
3) then call the script in your browser and enter the name of the file (eg. referers.txt)
4) click convert and it should do the trick.
Notes:
a) how big your file can be (eg. referers.txt) is limited by your servers PHP settings. I would start with a file of up to 200kb and increase the size by 200kb increments till the script stops working.
b) some SE's send info as UTF8, others as EUC-JP so if you change the page encoding option, you should get a different visible result. Otherwise, you can try saving the output as an html file, and view it in your browser and then change the encoding in your browser.
Give this one a go...
------ COPY ALL BELOW THIS LINE AND SAVE AS decode.php -------
<?
$fd = fopen ($file, "r");
if($fd)
{
$text = fread ($fd, filesize ($file));
fclose ($fd);
}
else
{
$text = 'invalid filename';
}
$text = urldecode($text);
$text = nl2br($text);
?>
<html lang=ja>
<head>
<title>URLDECODE</title>
</head>
<body>
<? echo $text;?>
<center>
<form action="<?php echo $PHP_SELF;?>" method="post">
<input type="text" name="file" size="30"><br>
<input type="submit" value="Convert Text" name="convert">
</form>
<br>
</center>
</body>
</html>
------ COPY ALL ABOVE THIS LINE AND SAVE AS decode.php -------
btw, I didn't test this but do let me know if you have any issues and I'll try to help.
G'luck,
Kaz