0

I found somewere in here a post wich referred me to a blog that has a script I need. The problem is that the script is from 2008 and I get a little error saying Cannot redeclare hex2bin() in functions.php on line 97.

Since I'm not so good with including code here and I don't want to make a mess, I will present to you pastebin links.

functions.php: http://pastebin.com/pfAyiR26 and torrent.php: http://pastebin.com/vkcuuzRS

Can you please help me solve this error?

I tried require_once and include_once and it didn't work. Any other suggestions?

Without the function I get this: http://80.213.76.123:7070/newtracker/usrup/torrent.php

As you can see, I have some data missing, so I need the function.

Jongware
  • 22,200
  • 8
  • 54
  • 100
  • i did a search on the error and i didn't get any results before posting the question. Thank you – Kyo Kusanagi May 28 '15 at 18:24
  • There are only 2 (3 if you include @mario's) options, either remove the function, or change the function name and update all the calls that rely on that version. – Jonnix May 28 '15 at 18:24
  • Or wrap it in `if(!function_exists("…"))`. Albeit that's a pretty silly reimplementation of hex2bin. – mario May 28 '15 at 18:26
  • @Linial Nope. PHP has a native version as of PHP5.4, so even including it once will raise the error. – Jonnix May 28 '15 at 18:27
  • right... i tried include_once or require_once .. didn't work – Kyo Kusanagi May 28 '15 at 18:28
  • @KyoKusanagi I didn't look at the code, but if the output/functionality is the same as the native hex2bin, just remove it out from the included file and the script will then use the native function. – Mike May 28 '15 at 18:32
  • Mike that`s right but it doesen't display all i need – Kyo Kusanagi May 28 '15 at 18:36
  • Your function name has the same name as php core function. You can ether rename your function, use namespaces, or remove your function. Period. There's **NO** other solutions. – u_mulder May 28 '15 at 18:45
  • Thank you. I will try renaming. – Kyo Kusanagi May 28 '15 at 18:46

0 Answers0