Syndicate content

Downloads System Fixed

6 posts / 0 new
Last post
meustrus's picture
Offline
RoyalÜber TownieUltra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 18 Jan 2006
Downloads System Fixed

Several things about the downloads system have been broken for the last couple of months. It wouldn't display anything but the first page of all resources sorted by date. I've found and solved the problem now. The server was changed in some way and I had to adjust the scripts to compensate.

Offline
Ultra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 12 Sep 2006

Ahahah. I was SO about to PM you and be all like "Okay, FINE! GIVE ME ACCESS AND I'LL FIX THE DOWNLOAD SCRIPT!" - has the upload script been fixed as well? Or was that even broken? I haven't tried to upload anything.

meustrus's picture
Offline
RoyalÜber TownieUltra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 18 Jan 2006

The problem was this: When I wrote the script, I used $cmd to refer to the value in index.php?cmd=0. I'm sure you realize I wasn't supposed to do this, but it worked at the time. Something changed in the server and the entire system basically stopped recognizing GET input because I wasn't using the $_GET array. I've just been very busy lately, and only recently have I gotten back to the kind of conditions that I end up working on the site with. Like, a constant internet connection and WAAY too much free time.

Offline
Ultra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 12 Sep 2006

Oh-ho-ho! What a big no-no! register_globals was turned off by default in PHP 4.2.0... your server musta been using a VERY old version of PHP. Sticking Out Tongue

Key lesson: ALWAYS use code that doesn't rely on any php.ini settings (use <?php, and never <?, use $_SERVER, and $_GET/$_POST (or $_REQUEST, which contains all get and post data)). Smile

meustrus's picture
Offline
RoyalÜber TownieUltra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 18 Jan 2006

I know, I know. But come on, I learned to code PHP by writing this system. And yes, I believe we were running very old software. It's my guess the server finally updated it and that's what broke my bad conventions.

Offline
Ultra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 12 Sep 2006

I learned PHP through coding MY site as well. Laugh

That was back in, uh... 2003 though.

Learning sucked... but now I have no drive anymore, knowing enough to actually DO something with it.

Topic locked

Who's online

There are currently 1 user and 3 guests online.

Online users