Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Php Function Equivalent For UNIX 'pwd' Command


Is there a function, or any roundabout way to get the current directory
other than using an exec or system to just run pwd?




View Complete Forum Thread with Replies

Related Forum Messages:
PHP Running Exec() Windows Program Very Slow In Comparison To UNIX Equivalent Program
Does anyone have an explanation or solution for the following.
I have a PHP script that uses exec() to call a program to do certain
calculations.

The UNIX version of this program I call runs in about 4 to 5 seconds.
When I run the same PHP script using exec() to call the Windows equivalent
of this same program on my Windows desktop, it takes about 32 seconds....

View Replies !
Unix/Linux Command Question
I'm trying to incorporate the following UNIX (I think) command in a PHP script.

unzip -P password /home/xxx/public_html/dir/file.zip -d /home/xxx/public_html/dir/targetdir What do I use to do that?

View Replies !
Folder Zip - Execute Unix Zip Command Exec()
1.Any one knows How to Zip the folder using php.

2.How execute unix zip Command exec() function.

View Replies !
Execute Shell Command From Browser Using Php (unix Server)
i need to execute shell command using  php in unix server

<?
  echo shell_exec('whoami');
?>

<?
$output = exec('ls -lart');
echo "$output";
?>

but i cant get output in the browser side. need to enable anythink in the server side .

View Replies !
Looking For Php Equivalent To Asp Function
I'm trying to get equivalents for the string manipulation functions in asp. (ie. mid, left, right)

ASP code: Code:
stringName = "John Paul Ringostarr"
newStringName = mid(stringName, 6,4)
print newStringName

View Replies !
Function That Corresponds To Its Equivalent In ASP Now()
What is the function that corresponds to its equivalent in ASP Now() that reports back the current date and time?

View Replies !
PHP Equivalent To The Asp Function GetClientUsername
I'm making a site running mainly on a intranet with all NT machines on it.. Every user has his own username of course, and i would like to make a poll system which only let persons vote once, just logging the IP or placing a cookie won't really work, because every computer keeps getting other users (still with the same ip though).

Personally i think that getting the clientusername would be the easiest, but i just don't know how to do that in php.

View Replies !
PHP Equivalent Of TCL Command "subst"?
I need to find a PHP equivalent to a very familiar TCL command "subst"
(see http://www.hume.com/html84/mann/subst.html ).

This command will take a string and evaluate anything TCL inside of it
and return values.

for example, if this were my line:

[TCL]
set word {World}
set line {Hello #word#}
regsub -all {#([^#]+)#} $line {$$1} line
return [subst $line]
[/TCL]

My return should be
Hello World

and not
Hello #word#

Nor
Hello $word

Because of a requirement for my app I am having to do the same kind of
substitution variation, however, I am having to do it entirely in PHP.
I don't know of any PHP manual operated command close to TCL's
subst() but I'm open to the idea.

Here is my class method that fails to do so:

Code: ( php )

View Replies !
ASP's Equivalent Of The Get Last Error() Function
Is there a PHP version of the GetLastError() function?

View Replies !
Equivalent Of Javascript Escape() Function
i know of addslashes, but it doesnt escape text to the extent javascript does.

View Replies !
Replace Command/function
is there a code/command/function that can be used in a form scenario, for instance when the submit button is pressed it does the normal get the post and upload onto database but for a certain fieldname it checks it and turns al the spaces into something else? is this possible? if so what is the code for it?

View Replies !
PHP On Command Line Issues: Function Registration Failed - Duplicate Name
I just upgraded to PHP 4.4.2 on my Slackware 10.2 system. And
Apache/mySQL/PHP all work great through a browser. No errors.
But when I try to run a PHP script through the command line, which I
need to do, I get blocks of errors like:

root@slackserve:/var/www/htdocs# php ./phptest.php
PHP Warning: Unknown(): Unable to load dynamic library.....

View Replies !
Tracert :: Passing Command To Command Prompt Via Exec
I want to execute a "tracert" command in the command prompt via php (using windows)

I've managed to use passthru() to open the command prompt (but it doesn't allow me to use it) and when I close it, it outputs the command prompt output in the browser.

I don't mind whether the result is passed back to the browser to stays in the command prompt window (but that would use exec() I would think).

So how can I tell the command prompt that launches to execute the line

tracert 192.190.201.273

So far my experimental code is:

<?php
passthru("c:windowssystem32cmd.exe");
?>

EDIT: my backslashes have been stripped from the path, but you know what I mean!

View Replies !
Equivalent Of PS In PHP?
I am looking for classes/modules in PHP that can give me output similar to the output of unix command "ps". Additionally, are there classes/modules that can kill processes based on process IDs?

Though I can execute a system command, I do not have a consistent
method that will work across platforms like Linux, SunOS, AIX, HP-UX
and Windows* and was hoping that PHP will help reduce complexity.

View Replies !
Clearerr() Equivalent In PHP?
Does PHP have a clearerr() equivalent for file streams ? It allows to do
things such as "tail -f", by resetting the error status and dozing for
few seconds.

I didn't see any equivalents in the function list (www.php.net)

void clearerr( FILE *stream);

The function clearerr clears the end-of-file and error indicators for
the stream pointed to by stream.

View Replies !
Equivalent To Use Strict In Php?
is there any equivalent of perl's use strict; in PHP?

View Replies !
PHP Equivalent Of ASP Code
Im trying to duplicate this ASP code in PHP.

Basically its a form of 10 records pulled from an MySQL table. The
form lets the user update all 10 records at once if they want to.

Each text box I name using the ID of the database record and the
Database Field. Example: 3|Name (3 is the ID and Name is the
database field)

When the form is submitted this code is run:

for x = 1 to request.form.count()
if request.form.key(x) <> "Submit" then
curFld = request.form.key(x)
aryCats = split(curFld, "|")

ID = aryCats(1)
Field = aryCats(2)
Data = request.form(curFld)

strSQL = "UPDATE " & Table & " Set " & Field & "= '" & Data "'
WHERE ID = " & ID
'response.write strSQL
conn.execute strSQL

end if
next

The code loops thru all the objects on the form. It takes each object
name and splits it into an array using the | in the object name.

Is there anything in PHP that will count the number of objects on a
form and let you loop thu them like this script?

View Replies !
JSP Equivalent To PHP $_SERVER?
I looked up System.getProperties, but to be honest, I have no clue how
to use it in light of what I can do in PHP, which is this:

<?php echo $_SERVER['HTTP_USER_AGENT'] . ' ' . $_SERVER['SERVER_URI'];
?>

it would be very nice to find the JSP equivalent of <? phpinfo(); ?>
(anyone know who knows both PHP and JSP?) but until then, what on earth
do I do?

View Replies !
PHP Equivalent To ASP Instr()
I've got a list of emails: doug@doug.com,mary@mary.com,rich@rich.com...

I want to test if an email is already in the list, to prevent double entries. So I would like to test to see if doug@doug.com is already there. I have tried using the strstr function, but this just returns the position of the first needle.

View Replies !
Equivalent Of Perl's $ ?
Is there an equivalent to Perl's output record separator, or input
record separator for that amtter, ( $ and $/ ), in PHP?

View Replies !
[PHP 4.4.6] BerkeleyDB Or Equivalent?
If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:

---------------
Configure Command ./configure --with-mysql=/usr/local/mysql
--with-config-file-path=/opt3/local/apache/conf --with-gd
--enable-gd-native-ttf --enable-gd-imgstrttf
--with-jpeg-dir=/usr/local --with-ttf=/usr
--with-freetype-dir=/usr/local --with-zlib-dir=/usr/local
--with-zlib=/usr/local --with-imap=/usr/local/imap-2006g
--with-imap-ssl=/usr/local/ssl --without-kerberos
--with-dom=/usr/local --with-sablot=/usr/local --enable-xslt
--with-xslt-sablot --with-png-dir=/usr/local --with-pdflib=/usr/local
--with-curl=/usr/local/ --with-mcrypt=/usr/local
--with-ming=/usr/local --with-gettext=/usr/local
--with-apxs=/opt3/local/apache/bin/apxs --enable-track-vars
--with-regex=system --with-pear --enable-ftp --enable-bcmath
--enable-mbstring --enable-exif --enable-calendar
--enable-memory-limit --enable-trans-sid --enable-libgcc
--enable-inline-optimization --disable-debug

Apache
Loaded Modules mod_php4, mod_setenvif, mod_so, mod_headers,
mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias,
mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation,
mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core
---------------

View Replies !
PDO Equivalent To Mysql_data_seek
Does anyone know if there is a equiavalent method to the
mysql_data_seek() function call to reset a result set in PDO?

View Replies !
Is There A PHP Equivalent Of Response.end?
Is there a way to stop php processing and flush the buffer sort of like ASP's response.end? I'm trying to do some debugging and want to isoloate chunks of code at a time.

View Replies !
Php Equivalent Of Global.asa?
In asp I used a global.asa file to open up database connections, record details about the number of people on the site, where they came from and some other stuff (affiliate ids etc). What is the closed thing to this in php?

View Replies !
Tuples Equivalent
What's the equivalent to Pythons Tuples in PHP? i.e Code:

tuple = {'a': [&#391;', &#392;', &#393;'], 'b': [&#394;', &#395;', &#396;']}

View Replies !
PHP Equivalent Of Grep
I need to write a script that will parse through several non-static documents on my server and print out all of the URLs on those documents to a single page. Is there a PHP equivalent of *nix "grep" that I can use to locate lines with "http://" in them?

View Replies !
Equivalent For File_get_contents
I'm running the final tests on my script, and I ran an install on my older server(php 4.2.2), and where I'm checking a remote server for an update, it's failing: Quote:

Fatal error: Call to undefined function: file_get_contents() in /path/to/automonial/admin/index.php on line 956

I would like to allow versions of php < 4.3.0 to be able to check for updates. Is it possible? If it's not possible, How could I get the script to detect that their php won't handle the request, and thus not perform it?

View Replies !
PHP Equivalent Of 4guysfromrolla.com
Is there such a web site out there?

View Replies !
TIMESTAMP Equivalent
I need a timestamp equivalent of this:

$result = mysql_query("SELECT COUNT(*) AS unique_members FROM users WHERE last_login > DATE_SUB(now(), interval 1 day)");

The last_login field IS in TIMESTAMP format. However, I want to use that for another field (signup_date) which is in DATETIME format. I can't convert the DATETIME field.

View Replies !
ASP AdRotator Equivalent
Is there a equivalent in PHP for the ASP AdRotator? Basically I want to be able to show 3 different includes at specific time percentages. For example, each of the 3 includes 33.33% of the time each.

View Replies !
Sendmail.asp Equivalent
I'm looking for a simple php code I can use for webforms to submit information submitted via email. I have usually used sendmail.asp in the past, keeping the script in one place and just calling on it on my server whenever I needed a form. Im hoping I can figure out something equivalent to that.

View Replies !
There's Equivalent For Global.asa (asp)
There's equivalent for global.asa (asp) in php ?

View Replies !
PHP Weather Equivalent
I would like to add weather information on a site. I do not want to use Weather Channel , Yahoo etc. but rather translate the metar reports. I would use PHP Weather that seems to do exactly what I need that is decoding metar ALSO for international cities. Apparently though the project has been abandoned and I tried to install the program with no success.


View Replies !
Equivalent To <jsp:param>
In JSP, I can pass parameter to an included page as follows:

<jsp:include page="page_include.jsp" flush="true">
<jsp:param name="buttonClicked" value="<%=submitBtn%>" />
<jsp:param name="navigation" value="<%=nav%>" />
</jsp:include>

Is there an equivalent in PHP? (I'm not talking about a simple include--require_once() and others--I mean, passing a param while including).

View Replies !
ASP Response.redirect Equivalent In PHP
ASP has <%Response.redirect("http://blahblah")%>

What is the equivalent command in php to redirect a user to a new URL in
the same window? Or is there a Javascript command that does this job better?

View Replies !
PHP Equivalent For Window.location
What's the PHP equivalent for the following?

if(window.location == "http:/site.com/page1.html")
{
}
else
{
}


View Replies !
Is There A PHP Equivalent Of Server.Transfer (in ASP.NET)
I've only been at PHP for a couple of
days, and I'm trying to get some stuff done as fast as possible. I'm an
experienced ASP.NET programmer, and am trying to find some equivalent
stuff in PHP.

In ASP.NET there is a method called Server.Transfer which transfers the
request to a different page from the one that the user requested, but
without doing a redirect. The user gets sent headers as though they were
seeing the page they requested.

Does PHP have such a function? I have seen the function...

header('Location: page.php');

....but these seems to be a redirect, which is not the same thing. I
don't want the headers altered as I want the search engines to see the
page with the original URL.

View Replies !
PHP Equivalent Of Perl's Digest::MD5?
Is there a PHP equivalent algorithm to Perl's Digest::MD5 module? PHP's md5() function doesn't produce the same strings as Digest::MD5 does...

View Replies !
NuSoap Equivalent To GetLastRequest?
Is there an equivalent method in nuSoap to return the SOAP request as it
was sent to the SOAP service?

View Replies !
Php Equivalent To Perl's || Behavior?
one feature of perl I'm desparately missing in php is using || to assign
the first non-empty value in a list to a variable. For example,

# perl example 1
$a = 1;
$b = 2;
$c = $a || $b;
print $c; # displays 1

# perl example 2
$a = 1;
$b = 2;
$c = $d || $b;
print $c; # displays 2, since $d is empty

# perl example 3
$a = 'apple'
$b = 'banana'
$c = 'cherry'
$d = $a || $b || $c;
print $d; # displays 'apple'

# perl example 4
$a = ''
$b = ''
$c = 'cherry'
$d = $a || $b || $c;
print $d; # displays 'cherry'

This is such a handy language construct. Is there any such php
equivalent that accomplishes this? I've already written a function to do
it. (Like this: $d = value($a, $b, $c). But making value() visible
everywhere is something I'd rather avoid if there's something built-in
to php.)

View Replies !
PHP Equivalent Of MySQL STR_TO_DATE()?
I have an application where I would like to be able to allow the user
to specify the date format used throughout the program (for
internationalization).

Then, on a date entry field, I can specify the date format on a MySQL
SELECT to get the date in the proper format.

The Javascript date selector I am using allows me to specify the
format for selecting the date.

Where I am having problems is posting the date back to MySQL. If I was
using v4 of MySQL, I could use STR_TO_DATE(). However, I need to be
able to support version 3 of MySQL, so I need a PHP equivalent to
convert the date in the user-defined format to the MySQL date format.

I can use date() to get a timestamp into the proper format, but how do
I get the user-defined format into a timestamp? strtotime() was the
closest I could find, but that doesn't look like it is going to work
for any format.



View Replies !
Array_pop Equivalent For SESSION
I understand how array_push() and array_pop() work on simple arrays, but I need something like this to manage $_SESSION arrays.

So far, the best I can come up with is using unset()

unset($_SESSION[$key]);

But, I would like to use the push/pop functionality for $_SESSION arrays.

I guess it is as easy as writing my own function to simulate it, but it would be nice to harness this power if it already exists in a predefined function.

I scoured the us.php.net website, and to no avail. Sessions don't seem to be equipped with this. Or, perhaps I am doing it wrong.

View Replies !
Equivalent Of Mysql Aes_decrypt
I am using AES_DECRYPT and AES_DECRYPT to store my datat in mysql databases. I want to be able to download these as csv files and have a php script decrypt them. I can use bin2hex to convert to text , but I cant figure out how to decrypt the hex to plaintext using php? I hv tried this without success, as AES is not recognized.

$input = 'some encrypted data in hexadecimal'

$len = strlen ( $input );
$input = pack("H" . $len, $input );

$td = mcrypt_module_open( 'AES' , '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND );
mcrypt_generic_init($td, $key, $iv);

$decrypted = mdecrypt_generic($td, $input );

View Replies !
PEAR DB Equivalent To Mysql_select_db()?
I'm connecting to a MySQL database via PEAR DB abstraction. Within the MySQL database there are multiple databases.

I can connect and do everything I need to do to ONE database, but I need to grab some entries from another one. Is there a way to switch around databases with (like the function mysql_select_db())?

If the above doesn't work, can I just create a second connection to the database? I tried this but couldn't get it to work for some reason.

View Replies !
Postgres Equivalent For Mysql_insert_id()
I have a database class that I use which encapsulates some database functions for mysql. I'm trying to make a new class that uses postgres and I'm having trouble understanding what to do about this line: Code:

$this->insert_id = @mysql_insert_id($this->connection_id);.

View Replies !
Simple Mod_rewrite Equivalent
I've got a site which is visible with three different domain names that I'd like to consolidate into one. Unfortunately, I've got a bug with mod_rewrite on the server, so I'm looking for a way with PHP. I've done this, which appears to work, for the home page:

<?php if ($_SERVER["HTTP_HOST"]!= "www.example.com") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");
exit; }
else {};
?>

That sorts it out for one page, but I'd like to extend it to be placed in an include on every page. Is there a way of doing that which would redirect automatically with a 301 to the same page name in each case.

View Replies !
Trying To Convert String To Decimal Equivalent
I am trying to convert a string of any given length (can include special characters such as :,/,-,.,etc...) into its decimal equivalent. I've tried all of the php functions I can find, but they all seem to deal with hex or binary.

For example:
h == 104 (it is ok if the function adds the html enties on &#104;)

(here is a table of the decimal equivalents http://www.neurophys.wisc.edu/www/comp/docs/ascii.html)

I've tried:
HexDec()
bin2hex()
BinDex()
etc....

Can anyone tell me how to convert this value?

View Replies !
Htons & Ntohs PHP Equivalent Functions
I need to work out the length of a message in network byte order.

Does PHP have an equivalent function of htons and ntohs?

I've searched all the PHP documentation but have so far drawn a blank.

View Replies !
Does PHP Have An Equivalent Of JavaScript's Prototype Object?
Basically, I want to add default methods to the PHP string object so
that I can do something like:

$stringvar = "hello";

$stringvar -> append(" world"); // where append is some kind of
prototyped function i define

echo $stringvar; // "hello world"

is this at all possible?

View Replies !
Is There A PHP Equivalent To This Gift Card Script?
This is a nifty perl script for sending greeting cards

http://bignosebird.com/carchive/cardcgi.shtml

Does anyone know if it has a freeware PHP equivalent?

View Replies !
OO Java Main Method Equivalent???
So I was wondering if it is possible to have within a PHP script
something equivalent to a main method as it is possible in JAVA....

For example:

class myclass{
//my class's code
}

//Here is where I want to create a main method... or a function that
gets automatically called when the script is executed... that way this
"main" method would create instances of "myclass" and use them..

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved