Topic: Problem in path directory

Hi there, i've searched for similar problem but haven't found one !

I assume my problem is a simple directory path one :
My site is : http://ainur.vaxserver.eu
I want Chevereto in http://ainur.vaxserver.eu/images/

So i've uploaded the files in the dire : root/www/images/
And edited the config file :

// SERVER ///
/* We get this values with $_SERVER. If your server doesn't resolve this values The script will not work.
   If the script doesn't work, you must change this values to be like values in the comments (see the exaple below) */

$DOM_SCRIPT = $_SERVER['SERVER_NAME']; // --> mysite.com
//$PATH_SERVER = $_SERVER['DOCUMENT_ROOT']; // --> /public_html (pssst.. NO ENDING SLASH!)
$PATH_SERVER = '/home/ainur/www/images'; // --> /public_html (pssst.. NO ENDING SLASH!)

    // example:
    # $DOM_SCRIPT = 'mysite.com';
    # $PATH_SERVER = '/public_html'; 
    /* Btw, you can check this values by uncommenting this: */
    // echo 'DOM: '.$DOM_SCRIPT.' - PATH: '.$PATH_SERVER;

// FTP MODE //
/* Use this if you want to upload the files through ftp php (http://php.net/ftp). This is handly when your server config don't
   allow to upload files without CHMOD 777, like almost all the cPanel. Using this, you can forget the CHMOD ;) */
$use_ftp = false; // true: Uses ftp to upload files - false: Upload without ftp.
$ftp_host = $DOM_SCRIPT; // Change this if your ftp host is not the same as your mysite.com -- example: $ftp_host = 'ftp.mysite.com';
$ftp_user = ''; // valid username.
$ftp_pass = ''; // Valid password.
// NOTICE: FTP user must have access to the script folder.


///////////////////////////////
/// DO NOT TOUCH BELOW THIS ///
///////////////////////////////

// PATH //
/* Uhhh.. Can't touch this!. */
$path = dirname($_SERVER['PHP_SELF']);
if (strlen($path)>1) { 
    define('PATH_SCRIPT', $path.'/');
} else {
    define('PATH_SCRIPT', '/'); // Windows fix
}

// URL //
/* Uhhh... Uhhh.. Can't touch this!. */
define('URL_SCRIPT', 'http://'.$DOM_SCRIPT.PATH_SCRIPT);

echo 'Path : '.$path.' '; 
echo 'Dom Script : '.$DOM_SCRIPT.' ';
echo 'Path Server : '.$PATH_SERVER.' ';
echo 'http://'.$DOM_SCRIPT.PATH_SCRIPT;
?>

I've added the last lines in order to make you view the output dir :

[url=http://ainur.vaxserver.eu/images/config.php]HERE
[/url]

For me everything is fine but it does not work
http://ainur.vaxserver.eu/images/

If anyone could help me i'll be very grateful !

Last edited by Ainur (2009-10-11 06:17:23)

Thumbs up

Re: Problem in path directory

First off the url  ( http://ainur.vaxserver.eu/images/ )  at the end of your post seem to be missing php support. What i mean with that is that either php is turned off or you don't have it install your server. Look in your control panel if there's an option to turn php on or ask your host if its install.

Thumbs up

Re: Problem in path directory

Hi gamerlv thanks for the reply !
Php is on, i've got a forum running here http://ainur.vaxserver.eu/forum/
and http://ainur.vaxserver.eu/images/config.php works fine and gives correct output (take a look).

Thumbs up

Re: Problem in path directory

Then it's that non of the php tags get parsed. hhm.
It maybe a tight setting on php that doesn't see that <? is the same as <?php.

Ok, I've change all of them in this index.txt( http://download.gamers4life.org/glv/index.txt ) Just rename the extension from txt to php and upload it.

Thumbs up

Re: Problem in path directory

Hi it was one of the first thing that i did but it did not worked more . (<? => <?php in all *.php because of the include) Maybe i've missed one but i don't think i've used the search & replace function. I will take a better look next friday but if you have other ideas don't hesitate and share !it's cool to know that someone tries to help you and thanks for that !

Thumbs up

Re: Problem in path directory

Well this is currently the only thing i can think of. If you do replace all <? tag with <?php make sure you leave the close tags (?>) the same as they are right now.

hm just thought up an easy test to find out what tags work and what don't.

<? echo('Short php tags work</br> '); ?>
<?php echo('Normal php tags work </br> '); ?>
</br>If the raw php is visible above here php isn't working correct

past that in a php file called test or something in the same directory as chevereto.
And i appreciate you saying thanks smile

Thumbs up

Re: Problem in path directory

Currently only <?php tag is recognize cause you can see the config.php link i've posted before : i had to change the <? into <?php in order to get the output echo.

Thumbs up

Re: Problem in path directory

Well then you'll know what to do. If you haven't edited your index.php yet you can just copy past mine. That's the txt i posted a few post back. ( i just changed the brackets from <? to <?php nothing else).

Thumbs up

Re: Problem in path directory

Hi, i've done some research yesterday the problem is that both <? and <?= must be changed in <?php OR activate the short tags in the php.ini ! But according to the php devellopers <? and <?= are old fashioned tags "for lazy programmers" and are bound to dissapear in the next versions of php engine and so the script won't work anymore.

Last edited by Ainur (2009-10-13 14:01:50)

Thumbs up

Re: Problem in path directory

Ainur wrote:

Hi, i've done some research yesterday the problem is that both <? and <?= must be changed in <?php OR activate the short tags in the php.ini ! But according to the php devellopers <? and <?= are old fashioned tags "for lazy programmers" and are bound to dissapear in the next versions of php engine and so the script won't work anymore.

Lazy?
Lazy is using register globals and other kind of stuff. Like just take the vars and don't pass any check about the data. <? vs <?php means no difference at all, is not like <b> vs <strong> when you have a real difference in what does it means.

Btw, you can do a automatic search and replace and change those bad bad <? to <?php, if php.net cancel that support, i will just change a few things and voila... Not big deal.

Final tought.. To open is "right": <?php... but to close, is "right" ?>... It should be php?> ¿?¡?

Is just stupid don't you think?

rodolfoberrios.com | PLEASE use Tech Support forums to ask for support!

Re: Problem in path directory

Hi Rodolfo,
Don't see anything personal in my words, i'm very grateful for the script, i've just quoted an answer from php-manual i'm nobody in php to give any judgment. As you said <? or <?php for me doesn't make any difference : search and replace and it's done.
For php dev <? and <?= were a problem with the xhtml or something like this.

Once again i'm very sorry if you saw something hurting in my words.

; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = Off

Last edited by Ainur (2009-10-16 14:02:05)

Thumbs up