473,326 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Find the name of the current folder

For use in a install.php

What would be the best way to do it .

Nov 10 '05 #1
5 13249
Krustov wrote:
For use in a install.php

What would be the best way to do it .


Probably with getcwd().
http://php.net/getcwd

--
Kim André Akerø
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Nov 10 '05 #2
<comp.lang.php , Kim André Akerø , ki******@NOSPAMbetadome.com>
<3t************@individual.net>
<10 Nov 2005 17:39:14 GMT>
For use in a install.php

What would be the best way to do it .


Probably with getcwd().
http://php.net/getcwd


Sounds good to me - thank you .
Nov 10 '05 #3
<comp.lang.php , Krustov , kr****@krustov.co.uk.INVALID>
<MP************************@no-cancel.newsreader.com>
<Thu, 10 Nov 2005 17:52:02 -0000>
For use in a install.php

What would be the best way to do it .


Probably with getcwd().
http://php.net/getcwd


Sounds good to me - thank you .


As I only need/want the last folder name and as i'm still a bit of a php
newbie is there any better way of doing it than the following .

(havent tried it on the webspace yet but assume it works just as well)

<?php

$junk=getcwd();
print $junk;

$pass="0"; $long=0;

$tv=strlen($junk); $dvd=$tv-1;

while ($pass=="0")
{
$vhs=substr($junk,$dvd,1);
if ($vhs==chr(47)) {$pass=1;}
if ($vhs==chr(92)) {$pass=1;}
$long=$long+1; $dvd=$dvd-1;
}

$vhs=substr($junk,$dvd+2,$long-1);
print "<br><br>";
print "$vhs";

?>
Nov 10 '05 #4
Krustov wrote:
As I only need/want the last folder name and as i'm still a bit of a
php newbie is there any better way of doing it than the following .


print basename(getcwd());
JW
Nov 10 '05 #5
<comp.lang.php , Janwillem Borleffs , jw@jwscripts.com>
<43***********************@news.euronet.nl>
<Thu, 10 Nov 2005 22:05:28 +0100>
As I only need/want the last folder name and as i'm still a bit of a
php newbie is there any better way of doing it than the following .


print basename(getcwd());


Typical and my own fault for not being clear in the OP .
Nov 10 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
8
by: Glenn A. Harlan | last post by:
Why am I receiving the below error when calling - Path.GetTempFileName() The directory name is invalid. Description: An unhandled exception occurred during the execution of the current web...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
3
by: COHENMARVIN | last post by:
I put the following code in my asp.net page: dbPath = MapPath("/FBDB/db1_newport2003.mdb") strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" strConnect = strConnect & "Data Source=" & dbpath & ";"...
2
by: John Regan | last post by:
Hello All I am trying to find the owner of a file or folder on our network (Windows 2000 Server) using VB.Net and/or API. so I can search for Folders that don't follow our company's specified...
18
by: Bruce Lawrence | last post by:
We use Access 97. We are in the process of migrating to 2003 along with SQL in most cases. We have a production database that contains a pretty important table and we would like to know which...
1
by: Mike Slinn | last post by:
The following short Python program parses a KML file and displays the names of all Marks and Routes: from elementtree.ElementTree import ElementTree tree = ElementTree(file='test.kml') kml =...
1
by: The Mad Ape | last post by:
Hello I have a FileSave Dialog and am trying to pass the current folder name to a string. Is there any way to do that? It was easy to get the file path and name using .FileName but I see nothing...
5
by: daokfella | last post by:
I have a custom web.config section similar to the following: <CustomAuthSettings attr1="" attr2=""> <Locations RedirectUrl="Invalid.aspx"> <add Path="test.aspx" Roles="1,2,3" Permissions="4,5,6"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.