Jump to content

sunilvadranapu

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sunilvadranapu's Achievements

Member

Member (2/5)

0

Reputation

  1. I have permissions to write on target directory. moreover it is working fine when number of files to be copied in source directory is less than 1000. but when backlog count increased then FTP connection(ftp_put) was failing. is there any mechanism to handle it in more better way.
  2. PFMaBiSmAd, thanks for your reply and i think i can explore with the inputs that you gave. thanks alot.
  3. Hi all, i read in php.net that readdir() returns next filename from the directory and filenames are returned in the order in which they are stored by the filesystem. how to know in which order files are stored in the file system. To know the order(whether time or alphabetic) of the files, i created below files(with date of creation) on my linux system # ls -ltr rw-r--r-- 1 root root 12861 2009-11-11 16:20 sunil.txt -rw-r--r-- 1 root root 2157 2009-11-11 16:21 raja.txt -rw-r--r-- 1 root root 1334 2009-11-11 16:22 ben.txt -rw-r--r-- 1 root root 6 2009-11-11 16:23 basha.txt -rw-r--r-- 1 root root 6 2009-11-11 16:24 abi.txt Next i wrote a small PHP script to know which order does readdir() function reads these files: if ($handle = opendir($localpath)) { while (($filename = readdir($handle)) !== false) { echo "LocalFileName:: ".$filename."\n"; if (is_file("$localpath/$filename")) { $fsize = filesize("$localpath/$filename"); echo "FileSize:: ".$fsize."\n"; } //if } //while Result is - LocalFileName:: basha.txt FileSize:: 6 LocalFileName:: sunil.txt FileSize:: 12861 LocalFileName:: raja.txt FileSize:: 2157 LocalFileName:: abi.txt FileSize:: 6 i am totally confused to find the order in which files are returned by readdir(); i thought it would return the files order by timestamp(date of creation) or by alphabetic order. but to my surprise it returned in different order. please any one help me by explaining what order readdir follows to return files in dir. does it return in random order? i dont think it follows random order, because i run the above script for many times, all the time it returned same order. could some one please clarify my doubts. thanks in advance.
  4. Hi, i'm trying to upload files with FTP_PUT in my PHP script. but when i run the scirpt i'm getting the warnging - PHP Warning: ftp_put(): Can't open data connection. in /tmp/sun/test.php on line 70 I'm not sure why my code is failing. Below is the PHP script using to FTP files. <?php $ftpServer = $argv[1]; $localpath = $argv[2]; $rempath = "/home/sun/data"; $connId = ftp_connect($ftpServer); $loginRes = ftp_login($connId, "root", "root"); if((!$connId) || (!$loginRes)){ die("Ftp failed"); } ftp_pasv($connId, true); ftp_site($connId, 'UMASK 013'); if ($handle = opendir($localpath)) { while (($filename = readdir($handle)) !== false) { if (is_file("$localpath/$filename")) { if(ftp_put($connId, "$rempath/$filename", "$localpath/$filename", FTP_ASCII)){ $rfsize = ftp_size($connId, "$rempath/$filename"); if(function_exists('ftp_chmod')){ ftp_chmod($connId, 0764, "$rempath/$filename"); } } } } closedir($handle); ftp_close($connId); ?> could anyone help me by figuring out the error in above code. Thanks in advance.
  5. HI, I'm trying to develop a PHP script that should return OS name(Linux/UNIX) of the system on which the script is running. <?php echo "php_uname: ". php_uname("s") ."\n"; echo "PHP_OS: ". PHP_OS ."\n"; ?> This script is returning host name correctly but not OS name php_uname: sun102 PHP_OS: sun56 --- it shoud be UNIX Can anyone help me to get this. Thanks in advance -sun
  6. Hi, is there any way to get IPv6 address of given host name expect get_dns_record() function. because we don't have DNS for IPv6 addresses. But we are maintaining list of IPv6's and corresponding host name in /etc/hosts file on my system. I want a function that fetches IPv6 address of given host name by scanning host file. can any one share info regarding this. Thanks in advance. -SUN
  7. Thanks for your reply. But dns_get_record() function fetches corresponding IP/IPv6 for the hostname from DNS. But we dont have IPv6 DNS. Thing is i've configured my linux box for IPv6 with tunneling mechanism and added its IPv6 entry in /etc/hostfile. I want to know is there any function in PHP that resolves hostname from /etc/hostfile and return corresponding IP/IPv6? or else share with me if there is any other way for the same purpose. thanks once again. -SUN
  8. Hi, I am using gethostbyname() function in my php script for getting the IP address of host. Its working well with IPv4. but if the host is having IPv6 if is not working. is there any alternative method in PHP to return IPv6 address by taking host name. please suggest on this. thanks in advance. -sun
  9. Hi all, i am working on one feedback form. This form have been divided into different pages based on sections. i mean for tech skills one page, analysis one page etc i have upto 6-pages. each page has around 10-questons with 4-options(radio buttons). i have created the pages with questions and added next and previous links for navigation. when i am trying to submit only questions on last page only got submitted. how to get the data from all 6-pages. and also i want to retain data when user moving previous and next. how can i do this? can any one help me in this regard. thanks in advance. -sunil
  10. Hi, I am trying to connect to Teradata using ODBC from PHP. My code is function ConnectDB($dsn, $username, $password, $options="") { if (!($this->connection_id = @odbc_connect($dsn,$username,$password)) ){ $this->report_error("\nConnection Failed.....\n"); exit; } else { return $this->connection_id; } }//end of connectDB it is working well and Now suddenly it is giving the error ODBC error: 523 80 ODBC error code: 81 But the same application working from the terminal and failing when running from browser. i set all the ODBC env variables in PHP code itself. Could you tell me what might be the problem. Thanks in advance. -Sunil
  11. Hi all, I got one solution for this using NTLM module with Apache. I have downloaded and installed NTLM from sourceforce (http://sourceforge.net/project/showfiles.php?group_id=4906&package_id=75281). Find the configuration procedure at http://www.section6.net/wiki/index.php/Setting_up_Apache_2.2.x_for_NTLM_Authentication_using_Mod_NTLM2 Now i am able to read the windows login username with PHPs $_SERVER['REMOTE_USER']. Thanks for all your help and time. please let me know if there any other solution for this. Thanks, Sunil
  12. hi, can we read/access client side environment variables using Javascript? if so, please help me in writing the javascript to read env variables. If not, any other alternate is there?? i want to read username from client env variables using javascript and want to use in PHP web application. Thanks, Sunil
  13. my problem is : We have a Windows file server with some shared folders. We have a web server running Apache on Suse. We want to give access to the shared folders via PHP running on apache(the web server) only to the valid Windows users. We can not use the normal authenication techniques commonly used in Apache like basic, authentication, dbm, or LDAP. I wanted to know if there is any way to authenticate users against a Windows domain on Apache running in Linux? I couln't find any useful information on Google. Can anyone point me the appropriate resources? thanks, Sunil
  14. thanks for the information you are providing. the code i downloaded from sourceforge is for apache on windows.I want similar modules for apache on linux. thanks in advace. -sunil
  15. thanks for your replies. I can put a login page but the thing is all of us already having network/windows logins here and instead of giving them another login and pwd, i am thinking it is better to ask them to enter same windows loign/pwd. if i am able to enable the windows login dialog, then they can login with their windows loign/pwd and i can keep them in sessions and can proceed with that. any alternative for this?? Thanks, Sunil
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.