# trying to utilize that existing script for my situation



## Sean8 (Jun 9, 2010)

Can't seem to get it to work.

http://michaelthompson.org/doc/index.php?manID=2


----------



## Deleted member 3 (Jun 9, 2010)

Why can't you get it to work? Try to actually explain your problem instead of just saying you can't get it to work.


----------



## Sean8 (Jun 9, 2010)

DanTheBanjoman said:


> Why can't you get it to work? Try to actually explain your problem instead of just saying you can't get it to work.



the script is supposed to stop direct linking to urls from what i gather.

I have it setup in a directory called url.com/test with .chill and chill.php and an image and an index page to test it.  You can still access the image if you type in the url.  and the image doesnt show in the index test page


----------



## Deleted member 3 (Jun 9, 2010)

Sean89 said:


> the script is supposed to stop direct linking to urls from what i gather.
> 
> I have it setup in a directory called url.com/test with .chill and chill.php and an image and an index page to test it.  You can still access the image if you type in the url.  and the image doesnt show in the index test page



Without looking at it, how is a php script supposed to do this? If you access the image it won't magically run the code of your script. So either you can set this somehow or you have to access all images via it. I bet the manual of the script has some mention of that.

Edit: I checked it Access images via that file. ie <img src="chill.php?uri=fig1.jpg">


----------



## Sean8 (Jun 9, 2010)

DanTheBanjoman said:


> Without looking at it, how is a php script supposed to do this? If you access the image it won't magically run the code of your script. So either you can set this somehow or you have to access all images via it. I bet the manual of the script has some mention of that.
> 
> Edit: I checked it Access images via that file. ie <img src="chill.php?uri=fig1.jpg">



yea i embed the images like that in my html page.  I think my problem lies in this 

obviously i enter my domain i dont know about cpath.  the ipath i dont know what to put
its in a directory called "hi" so mydomain.com/hi



> # Your domain and the scope of this cookie
> #$domain='.mydomain.com';
> $cpath='/';
> 
> ...


----------



## Disparia (Jun 9, 2010)

You'll want the "file system" path for where you're keeping your files to be served.

If you put "<pre><? print_r($_SERVER); ?></pre>" into a php file and access it you'll see your DOCUMENT_ROOT (and more).

On shared hosting the value of DOCUMENT_ROOT might be: "/home/sean/public_html"

If the files were in /home/sean, then put that as your $ipath. Or if you're putting them in a web accessible directory, make sure to put that. Ex: /home/sean/public_html/wheremyfilesat.


Lunch break over, back to work...


----------



## Sean8 (Jun 10, 2010)

I found the ipath only thing i dont understand now is this



> # Your domain and the scope of this cookie
> #$domain='.mydomain.com';
> *$cpath='/';*


----------



## Disparia (Jun 10, 2010)

```
$rtn = setcookie("chill",rand(1,12),$expire,$cpath,$domain,$secure);
```

http://us.php.net/setcookie



> The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.



You probably want to leave that as-is.


----------



## Sean8 (Jun 10, 2010)

I'm stumped on why its not working.  I have my directory below root.  With all the information setup i upload the .chill and the chill.php and an image to test it.  Yet when I go to www.website.com/directoryitsin/image.png I can view the image.


----------

