Help - Search - Members - Calendar
Full Version: Really simple PHP problem
Codegrrl.com Forums > Languages > PHP and MySQL
corinne1261
So, I know nothing about PHP, I'm not the one to try to write scripts or whatever, but I do sometimes use a codes to make things simpler.

CODE
<?php if ($dl_location=="pepper") echo "/mint/pepper/tillkruess/downloads/tracker.php?uri=http://c0rinne.net/downloads/"; ?>


I have this right, and the use

CODE
<?php
$dl_location ="pepper";
?>


Just as a way to keep from having to write /mint/pepper/tillkruess/downloads/tracker.php?uri=http://c0rinne.net/downloads/ a bunch of times on my downloads page.

So, ultimately I want to have something like <a href="<?php something ; ?>file.zip">file.zip</a>.

Obviously there are easier ways to do this, but I was trying that way, and it didn't work.

Help please?

wub.gif


ps. I use something similar to make my active links, and other file includes and stuff.
Jem
You don't need to do that with the mint downloads pepper.. it automatically prepends the URL itself. Just make sure in the preferences it's set to pick up the right files (mine's set to zip,pdf,txt)
Alis Dee
You mean like:

CODE
<? $dl = "/mint/pepper/tillkruess/downloads/tracker.php?uri=http://c0rinne.net/downloads/"; ?>

[... html blah blah ...]

<a href="<?=$dl?>file1.zip">
<a href="<?=$dl?>file2.zip">


Edit: Or, well, possibly not having to... ^^
corinne1261
QUOTE(Jem @ Oct 16 2007, 05:04 PM) *

You don't need to do that with the mint downloads pepper.. it automatically prepends the URL itself. Just make sure in the preferences it's set to pick up the right files (mine's set to zip,pdf,txt)

Well, it doesn't seem to get them w/o it when I click on the links.

QUOTE(Alis Dee @ Oct 16 2007, 05:07 PM) *

You mean like:

CODE
<? $dl = "/mint/pepper/tillkruess/downloads/tracker.php?uri=http://c0rinne.net/downloads/"; ?>

[... html blah blah ...]

<a href="<?=$dl?>file1.zip">
<a href="<?=$dl?>file2.zip">


Edit: Or, well, possibly not having to... ^^


But, that works.
Amelie
You have the same tracker as me - you don't need to do anything like that, just do what I do and put this in your .htaccess:

CODE
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^downloads/(.*)$ /mint/pepper/tillkruess/downloads/tracker.php?uri=http://%{HTTP_HOST}%{REQUEST_URI}&force [L]


You need to keep all your downloadable files in a folder called downloads (or anything you like - change the ^downloads/(.*)$ part) for this to work.
corinne1261
^ That works as well! Yes!

Gracias! (the extent of my Spanish knowledge)

I think I did notice that when I was reading instructions, but I always get nervous messing around w/ .htaccess stuff because my firewall tends to be really aggressive and it prevents me from viewing/doing some stuff, but luckily it did work.
Amelie
It will also hide the real URL when people download - they will be silently redirected and can't bypass your tracker wink.gif I recommend using it over the PHP method.
Jem
Oh of course, different pepper! I should have checked that.

If you're interested, this is the one I use:
http://orderedlist.com/articles/pepper-download-counter

I'll have to look up the other one and compare smile.gif
Amelie
^ That one stopped working for me...

The other one is for Mint 2+ tongue.gif
Jem
QUOTE(Amelie @ Oct 17 2007, 07:51 PM) *

The other one is for Mint 2+ tongue.gif

http://www.jemjabella.co.uk/mint/
QUOTE
Mint 2.12 © 2004-2007 Shaun Inman. All rights reserved. Available at haveamint.com.

tongue.gif
Amelie
Oh you succumbed then did you? Tsk!
Vixx
Heehee - I thought the same thing!

I'm still on 1.29. Is it worth the upgrade, Jem?
Jem
QUOTE(Vixx @ Oct 18 2007, 08:24 PM) *

I'm still on 1.29. Is it worth the upgrade, Jem?

No! It sucks. I'd downgrade if the upgrade hadn't already cost me money. Tutorialtastic will be staying at 1.## (can't remember offhand)

It's slow, it locks up my browser while it's loading and it completely ate my nametags data turning everything to 0.0.0.0 so I had to download an official pepper and start afresh (less stalking possibilities!)
Amelie
...my nametags are fine?

Oh, you need to disable XXX Strong Mint (if you haven't already). And upgrade nametags (again, if you haven't already).

I don't think the upgrade was worth it either... I only got it because I wanted a shiny new admin theme that didn't work in 1.x sad.gif
Jem
I'd got rid of XXX Strong Mint months before, and it was the upgrade that killed nametags - certainly it was after that it started to drop data. My logic is if I hadn't upgraded Mint I wouldn't have upgraded nametags so therefore it's all mint's fault. I just use the secret crush thing now.
Amelie
Oh, yeah - you need secret crush enabled because it has the IP table. I keep it hidden though and use nametags like I used to.
Jem
Why? Secret crush does everything nametags does, doesn't it?

Sorry Corinne - hijacking your thread a bit :S
Amelie
Does it? I didn't really understand it when I first used it (back when I first upgraded to 2.0)... Eh, to each their own.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.