|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Sat Aug 11 2001 - 05:38:37 CDT
php-general Digest 11 Aug 2001 10:38:37 -0000 Issue 809
Topics (messages 62215 through 62254):
Re: Writing files on Linux
62215 by: Daniel Adams
62217 by: Michael Geier, CDM Systems Admin
62224 by: Corin Rathbone
62225 by: Corin Rathbone
62228 by: Tony Reed
Re: mysql error
62216 by: CC Zona
Re: Streaming a jpg
62218 by: Matthew Loff
62231 by: Todd Cary
62232 by: Todd Cary
62233 by: Todd Cary
62235 by: Matthew Loff
62245 by: Don Read
replacing variables in file
62219 by: Paul Roberts
Having trouble with exec function calling CGI program
62220 by: Tony Frasketi
62223 by: Tony Frasketi
Re: PHP Configuration issues in IIS 5.0 in win2k - EDITPAD instead of NOTEPAD
62221 by: Gerald Howse
running a php script as a user
62222 by: Mike Eheler
62226 by: Mark Maggelet
Re: Having my script login to a secure area of another site.....
62227 by: Evan Nemerson
Cookie only worked on "/" but not in any sub-directories
62229 by: Aaron Chan
Referencing the return value of split()
62230 by: David Fuchs
62234 by: Ryan Fischer
Apache 2.0 compliance
62236 by: The Doctor
php and autoconf 2.50
62237 by: Daniel Adams
HELP!! QUERY_STRING
62238 by: The iGroup
62246 by: Evan Nemerson
Function problem.....
62239 by: Juan Pablo Rivera
62241 by: Rasmus Lerdorf
what websites do u surf every day ...
62240 by: ...
62242 by: ReDucTor
upgrading from 4.03 to 4.06
62243 by: Yamin Prabudy
Re: open_basedir and safemode-ish things
62244 by: Chris Cameron
62249 by: Rasmus Lerdorf
62252 by: Chris Cameron
62253 by: Rasmus Lerdorf
Re: PHP in corporate settings?
62247 by: Adrian D'Costa
Re: [PHP-DEV] php and autoconf 2.50
62248 by: Sebastian Bergmann
62251 by: Sascha Schumann
squirrelmail
62250 by: hans
Handling files
62254 by: vishal khialani
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
What error does it give you? Is it a permissions issue?
- Dan
On Fri, 10 Aug 2001, Corin Rathbone wrote:
> Does anybody know why the function below does not work on Linux yet works
> perfectly well on windows.
>
> function write_file($file, $contents){ // $contents is like "Test, Test"
> global $root_path; // $root_path is /var/www/htdocs
> $file_location = $root_path.$file; // $file is /jim.txt
> $fp = fopen("$file_location", "w") or die("Could not open file pointer.");
> $worked = fwrite($fp, $contents) or die("Could not write to file pinter");
> // It fails here
> fclose($fp) or die("Could not close file pointer");
> return $worked;
> }
>
> It always fails at fwrite.
>
> Thanks,
> Corin Rathbone
>
>
>
--
attached mail follows:
there really is no reason to "return $worked" since the script will "die" on any problems.
chmod 777 /var/www/htdocs/$file for one pass of the script to see if it is a permissions issue.
file either needs to be 'chmod a+w' or owned by the user the script is running as.
-----Original Message-----
From: Daniel Adams [mailto:danno
wpi.edu]
Sent: Friday, August 10, 2001 3:31 PM
To: Corin Rathbone
Cc: php-general
lists.php.net
Subject: Re: [PHP] Writing files on Linux
What error does it give you? Is it a permissions issue? - Dan
On Fri, 10 Aug 2001, Corin Rathbone wrote:
> Does anybody know why the function below does not work on Linux yet works > perfectly well on windows. > > function write_file($file, $contents){ // $contents is like "Test, Test" > global $root_path; // $root_path is /var/www/htdocs > $file_location = $root_path.$file; // $file is /jim.txt > $fp = fopen("$file_location", "w") or die("Could not open file pointer."); > $worked = fwrite($fp, $contents) or die("Could not write to file pinter"); > // It fails here > fclose($fp) or die("Could not close file pointer"); > return $worked; > } > > It always fails at fwrite. > > Thanks, > Corin Rathbone > > >
---- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I have chmod 777 the file using exec(). The permissions have changed, yet the problem still there.
The dies were added afterwards to debug it, as before the page it was called from printed that an error had occured from the returned $worked.
It is owned by nobody in the group nobody.
It is strange as it works fine on Win98.
-----Original Message-----
From: Michael Geier, CDM Systems Admin [mailto:mgeier
cdmsports.com]
Sent: 10 August 2001 21:43
To: Corin Rathbone
Cc: php-general
lists.php.net
Subject: RE: [PHP] Writing files on Linux
there really is no reason to "return $worked" since the script will "die" on any problems.
chmod 777 /var/www/htdocs/$file for one pass of the script to see if it is a permissions issue.
file either needs to be 'chmod a+w' or owned by the user the script is running as.
-----Original Message-----
From: Daniel Adams [mailto:danno
wpi.edu]
Sent: Friday, August 10, 2001 3:31 PM
To: Corin Rathbone
Cc: php-general
lists.php.net
Subject: Re: [PHP] Writing files on Linux
What error does it give you? Is it a permissions issue? - Dan
On Fri, 10 Aug 2001, Corin Rathbone wrote:
> Does anybody know why the function below does not work on Linux yet works > perfectly well on windows. > > function write_file($file, $contents){ // $contents is like "Test, Test" > global $root_path; // $root_path is /var/www/htdocs > $file_location = $root_path.$file; // $file is /jim.txt > $fp = fopen("$file_location", "w") or die("Could not open file pointer."); > $worked = fwrite($fp, $contents) or die("Could not write to file pinter"); > // It fails here > fclose($fp) or die("Could not close file pointer"); > return $worked; > } > > It always fails at fwrite. > > Thanks, > Corin Rathbone > > >
---- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Also the dir it is in is
Permissions: drwxr-xr-x User: 99 Group: 98
Is this right?
Thanks, Corin
-----Original Message-----
From: Corin Rathbone [mailto:corinrathbone
yahoo.com]
Sent: 10 August 2001 22:57
To: Michael Geier, CDM Systems Admin
Cc: php-general
lists.php.net
Subject: RE: [PHP] Writing files on Linux
I have chmod 777 the file using exec(). The permissions have changed, yet the problem still there.
The dies were added afterwards to debug it, as before the page it was called from printed that an error had occured from the returned $worked.
It is owned by nobody in the group nobody.
It is strange as it works fine on Win98.
-----Original Message-----
From: Michael Geier, CDM Systems Admin [mailto:mgeier
cdmsports.com]
Sent: 10 August 2001 21:43
To: Corin Rathbone
Cc: php-general
lists.php.net
Subject: RE: [PHP] Writing files on Linux
there really is no reason to "return $worked" since the script will "die" on any problems.
chmod 777 /var/www/htdocs/$file for one pass of the script to see if it is a permissions issue.
file either needs to be 'chmod a+w' or owned by the user the script is running as.
-----Original Message-----
From: Daniel Adams [mailto:danno
wpi.edu]
Sent: Friday, August 10, 2001 3:31 PM
To: Corin Rathbone
Cc: php-general
lists.php.net
Subject: Re: [PHP] Writing files on Linux
What error does it give you? Is it a permissions issue? - Dan
On Fri, 10 Aug 2001, Corin Rathbone wrote:
> Does anybody know why the function below does not work on Linux yet works > perfectly well on windows. > > function write_file($file, $contents){ // $contents is like "Test, Test" > global $root_path; // $root_path is /var/www/htdocs > $file_location = $root_path.$file; // $file is /jim.txt > $fp = fopen("$file_location", "w") or die("Could not open file pointer."); > $worked = fwrite($fp, $contents) or die("Could not write to file pinter"); > // It fails here > fclose($fp) or die("Could not close file pointer"); > return $worked; > } > > It always fails at fwrite. > > Thanks, > Corin Rathbone > > >
---- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On Fri, 10 Aug 2001 22:58:44 +0100
corinrathbone
yahoo.com (Corin Rathbone) wrote:
:Also the dir it is in is : :Permissions: drwxr-xr-x :User: 99 :Group: 98
You have to make the directory "world writable" in order for the server to be able to create a file in it:
chmod 777 [directory]
(if you have that privilege).
The user and group numbers are specific to your system.
-- Tony Reed <trljcaltern.org> "The President was assassinated by a precision guerrilla team of at least seven men ..." -- Jim Garrison
attached mail follows:
In article <000001c121bc$36475fa0$0103670a
europa.com>,
jerryl
europa.com (Jerry Lake) wrote:
> $result = mysql_query($query,$connection) or die("Error in this > query"); > > This for some reason is giving me errors, I don't know why.
$result = mysql_query($query,$connection) or die("Error in query: <pre>$query</pre>. MySQL reports: <pre>" . mysql_error() . "</pre>");
-- CC
attached mail follows:
This should work...
header("Content-Type: image/jpeg");
$image = fopen($filename, "r"); echo fread($file, filesize($filename)); fclose($file);
(... Copied almost verbatim from PHP manual entry for fread() ...)
-----Original Message-----
From: Todd Cary [mailto:todd
aristesoftware.com]
Sent: Friday, August 10, 2001 3:15 PM
To: php-general
lists.php.net
Subject: [PHP] Streaming a jpg
If I know the location and name of a jpeg file, can I stream it to a HTML page?
What I have is a DB that contains the path and name of jpeg files. These files are "outside of the www Home directory" for security reasons. I would like to access the files from my PHP script and stream them to the page.
Never having done any streaming (PHP files) with PHP, I am not sure if this can be done and if it can, how to do it.
Many thanks for any guidance........
Todd
-- Todd Cary Ariste Software toddaristesoftware.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Matthew -
With the data in $image, what is the syntax to put the data onto a HTML page.
Todd
-- Todd Cary Ariste Software toddaristesoftware.com
attached mail follows:
Matthew -
One other question:
If the "header..." line is not at the top of the script, I will have to open a new socket, correct?
Todd
-- Todd Cary Ariste Software toddaristesoftware.com
attached mail follows:
Matthew -
The following script just gives me a blank image holder. Am I missing something simple?
Todd
<?php header("Content-Type: image/jpeg");
$filename = "test.jpg"; $fd = fopen($filename, "r"); if ($fd) { $contents = fread ($fd, filesize ($filename)); print($contents); fclose($fd); } else { print("Cannot open file<br>"); } ?>
This works:
<?php // Read a text file $filename = "test.txt"; $fd = fopen($filename, "r"); if ($fd) { $contents = fread ($fd, filesize ($filename)); print($contents); fclose($fd); } else { print("Cannot open file<br>"); } ?>
-- Todd Cary Ariste Software toddaristesoftware.com
attached mail follows:
Todd--
Someone suggested readfile(), which I agree is even easier... Here's a -very- basic sample:
In your HTML file...
<IMG SRC="image.php?filename=whatever.jpg">
In image.php:
<?php
header("Content-Type: image/jpeg"); readfile($filename);
?>
-----Original Message-----
From: Todd Cary [mailto:todd
aristesoftware.com]
Sent: Friday, August 10, 2001 6:54 PM
To: Matthew Loff
Cc: php-general
lists.php.net
Subject: Re: [PHP] Streaming a jpg
Matthew -
The following script just gives me a blank image holder. Am I missing something simple?
Todd
<?php header("Content-Type: image/jpeg");
$filename = "test.jpg"; $fd = fopen($filename, "r"); if ($fd) { $contents = fread ($fd, filesize ($filename)); print($contents); fclose($fd); } else { print("Cannot open file<br>"); } ?>
This works:
<?php // Read a text file $filename = "test.txt"; $fd = fopen($filename, "r"); if ($fd) { $contents = fread ($fd, filesize ($filename)); print($contents); fclose($fd); } else { print("Cannot open file<br>"); } ?>
-- Todd Cary Ariste Software toddaristesoftware.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On 10-Aug-2001 Todd Cary wrote: > If I know the location and name of a jpeg file, can I stream it to a > HTML page? > > What I have is a DB that contains the path and name of jpeg files. > These files are "outside of the www Home directory" for security > reasons. I would like to access the files from my PHP script and stream > them to the page. > > Never having done any streaming (PHP files) with PHP, I am not sure if > this can be done and if it can, how to do it. >
<?php // // show.php?fname=da_image.jpg //
$basedir='/usr/website/images/'; $mime_types = array( '.asf' => 'application/vnd.ms-asf', '.gif' => 'image/gif', '.png' => 'image/png', '.jpeg' => 'image/jpeg', '.jpg' => 'image/jpeg', '.mov' => 'video/quicktime', '.mpe' => 'video/mpeg', '.mpeg' => 'video/mpeg', '.mpg' => 'video/mpeg' );
$ext = strtolower(strrchr($fname,'.'));
$fullpath = $basedir .$fname;
if (! file_exists($fullpath)) {
exit(0);
}
header('Content-type: ' .$mime_types[$ext]);
header('Content-length: ' .filesize($fullpath));
readfile($fullpath);
?>
Regards,
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
in Perl I use template files and parse them through a regx to change say $cat to the value of in the variable, I would like to do the same in php 4
example
#open template and replace title and story then save to a new file
open (TEMPLATE, "$template") or die "cannot open template please try again";
template = <TEMPLATE>;
close TEMPLATE ;
foreach $item (
template) {
$item =~s/\$(\w+)/${$1}/g;
}
#output data to browser
$|=1;
print "Content-type: text/html\n\n";
print
template ;
exit;
}
Paul Roberts
roberts_paul
bigfoot.com
+++++++++++++++++++++
attached mail follows:
Hello I'm a newbie and having trouble with the EXEC function call from a PHP script. EXEC seems to work ok for executing shell commands like 'ls -al' etc.
but when I execute the following PHP web page code...
---------------------------------- $basedir = '/mnt/web/xxx/myplace'; $cdir = $basedir . '/cgibin';
$cmd = "cd $cdir;pwd;perl -w myscript.cgi"; echo "cmd: $cmd<br>"; $result = exec($cmd,$arr,$status); echo "status: $status [$result]<br>"; ----------------------------------
Note: myplace and myscript.cgi are made up names.
The cgi program has been chmod'ed to 755 so it can run from a webpage and the cgi program runs fine when not called from the PHP script.
I get a status code of 155. Can someone please explain what this error code means!
Thanks in advance Tony Frasketi
attached mail follows:
Hello Sorry if this is a duplicate. First time I tried I got a "Mail delivery failed: returning message to sender" message, so I'm trying again.
Anyway, I'm a newbie and having trouble with the EXEC function call from a PHP script. EXEC seems to work ok for executing shell commands like 'ls -al' etc.
but when I execute the following PHP web page code...
---------------------------------- $basedir = '/mnt/web/xxx/myplace'; $cdir = $basedir . '/cgibin';
$cmd = "cd $cdir;pwd;perl -w myscript.cgi"; echo "cmd: $cmd<br>"; $result = exec($cmd,$arr,$status); echo "status: $status [$result]<br>"; ----------------------------------
Note: myplace and myscript.cgi are made up names.
The cgi program has been chmod'ed to 755 so it can run from a webpage and the cgi program runs fine when not called from the PHP script.
I get a status code of 155. Can someone please explain what this error code means!
Thanks in advance Tony Frasketi
attached mail follows:
when using NOTEPAD
choose "All Files" enclose the name of the file to be saved with " eg: "junk.php" and then it does not append the .txt
IF YOU HAVE TO USE WINDOZE A BETTER ALTERNATIVE IS TO GET EDITPAD it does not use any registry entries, just put the executable where you want and make a shortcut to it, you can also do a file association so EDITPAD will open certain types of files for you in future.
http://www.editpadclassic.com/
GET THE EDITPAD LITE and solve these types of problems, and when you are ready.... switch to LINUX MANDRAKE 8.0 and use one of the free text editors that are included
Gerald Howse EDMONTON, AB Canada
*******************************
On August 9, 2001 02:21 pm, you wrote:
> >I can't seem to get my win2000 box to recognize the .php files. It's
> > coming
>
> up with an error,
>
> What error is it coming up with?
>
> >and just reading them as test.php.txt files in explorer. How do i get this
>
> to work. I believe
>
> Change their name to not have .txt on the end, and stop using that stupid
> Notepad program to edit the PHP pages, which then saves them with
> foo.php.txt as the name of the files, unless you choose "Any File" from the
> popup for file type every time you save.
>
> Get EditPlus, or PFE, or any of the other 10,000 text editors that people
> are now going to say is the "best" on Windows. Sigh.
>
> >I've set everything up right. Could someone please email me with answers.
>
> Thanks
>
> There are innumerable other things you could have done wrong that would
> show you PHP source instead of executing it, but you'd have to tell us how
> you configured IIS to do PHP.
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
Okay, I'll try to make this short.
I work for a hosting provider, and thustly we have a few hundred clients. We have been working to provide a web-based file management system for the users, but have come across a stumbling block. The problem is allowing the users read/write/delete/move/create access to their folders on the server. We want to be able to run a central php script, but be able to dynamically tell that script what user to run as, based on HTTP authentication (username & password provided).
I've seen plenty of documentation about running scripts that use the suid bit, but those scripts are required to be owned by the person who the script is to be run as.
Any help is greatly appreciated, Mike
attached mail follows:
On Fri, 10 Aug 2001 14:28:06 -0700, Mike Eheler
(meheler
searchbc.com) wrote:
>Okay, I'll try to make this short.
>
>I work for a hosting provider, and thustly we have a few hundred
>clients. We have been working to provide a web-based file management
>system for the users, but have come across a stumbling block. The
>problem is allowing the users read/write/delete/move/create access
>to
>their folders on the server. We want to be able to run a central php
>script, but be able to dynamically tell that script what user to run
>as,
>based on HTTP authentication (username & password provided).
>
>I've seen plenty of documentation about running scripts that use the
>suid bit, but those scripts are required to be owned by the person
>who
>the script is to be run as.
>
>Any help is greatly appreciated,
> Mike
you didn't mention what os you're running so I'm guessing linux. Setting the suid of a php script won't work because it's not a binary file. you need to set the suid of the php executable, which means you probably want to have a copy of it in each user's home directory.
attached mail follows:
Try messing with the query string, and emulate a GET request. For instance
$uri = "http://www.somewhere.com/secure.php?username=bob&password=linuxrocks"; $theFile = implode("\n",file($uri)); echo $theFile;
can be used to grab a page and output it. Alternatively, you can use readfile(); but I like file(); since it allows you to manipulate the page.
On Friday 10 August 2001 12:37, you wrote: > Hello, > > I am making a script that needs to login to a secure area of another > site. To login you use a basic html form. Is there a way to login to > that site and then use sockets to emulate a post from one of the forms > on that site’s secure section? > Thank you, > Brandon Orther
attached mail follows:
Hi,
First of all, I'm very new to PHP. I tried to call setcookie() function to set a cookie using the following code:
setcookie ("TestCookie", "Some Value", time()+3600); echo $TestCookie, "<BR>";
It works perfectly for the root directory, but when i try to do the same thing in another directory called '/phptest/', it didn't work at all. I tried to switch on netscape's "Warn me before accepting cookie" and saw that the cookie was indeed sent to the client. However, I could not read back the cookie's value no matter how many times i refresh netscape. Can anyone tell me what's going on?
Any help would be greatly appreciated.
Thanks, Aaron
attached mail follows:
Hello,
I'm trying to use the following in a piece of code, but I keep receiving parse errors:
$myVar = split(":", $myStrings)[0];
The following code works, however:
$myTempVar = split(":", $myStrings); $myVar = $myTempVar[0];
I'd much rather execute the statement in one line, rather than two, if possible. The PHP Manual states that split() returns an array. Why can I not reference the returned array immediately? It works in Perl... =)
Thanks for any help!
-David Fuchs
attached mail follows:
You wrote: > Hello, > > I'm trying to use the following in a piece of code, but I keep > receiving parse errors: > > $myVar = split(":", $myStrings)[0]; > > The following code works, however: > > $myTempVar = split(":", $myStrings); > $myVar = $myTempVar[0]; > > I'd much rather execute the statement in one line, rather than two, > if possible. The PHP Manual states that split() returns an array. Why > can I not reference the returned array immediately? It works in Perl... =) > Thanks for any help! > > -David Fuchs
Because Perl is better than PHP! :D
What you could do is:
list($myVar) = split(":", $myStrings);
Not tested, but it should work. HTH! :D
If you want to do it Perl style, you could do this, forcing list context:
$myVar = (split(":", $myStrings))[0];
But I really doubt that will work, because PHP isn't Perl. ;)
-- -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
attached mail follows:
Small suggestion. I am compile httpd 2_0_22 on a test basis BUT it is looking for the headers in the layout. Could we include the package tree please?
attached mail follows:
Has anyone got the cvs source to work with autoconf 2.50? - Dan
--
attached mail follows:
the things i want it to do are: when i go to index.php?172.0.0.1:5500 that it would change the $ipname to 172.0.0.1 and $portNum to 5500 and if i go to index.php?172.0.0.1 then $ipname to 172.0.0.1 and $portNum to 5500
so if i would go to: index.php?255.255.255.255 $ipname to 255.255.255.255 and $portNum to 5500
ok.. i think i know 50% of the solution of this problem: if $portNum eq'' $portNum "5500"; else }
is that right or i that cgi or is that totally wrong?
right now this is my code: (index.php)
####################################
<?
#First output the HTML page
?> <? #Some functions if (! $sock = fsockopen($ipname, $portNum, &$num, &$error, 5)) print ("<IMG SRC=\"http://hlpass.macomega.com/red.jpg\" WIDTH=10 HEIGHT=10>"); else{ print ("<IMG SRC=\"http://hlpass.macomega.com/green.jpg\" WIDTH=10 HEIGHT=10>"); fclose($sock); } #If the form has been posted, process the query, otherwise there's #nothing to do yet
if(!$queryType) exit;
#Make sure the target appears valid
if( (!$ipname) || (!eregi("\.",$ipname)) ){ message("Error: You did not specify a valid target host or IP."); exit; }
#Figure out which tasks to perform, and do them
if( ($queryType=="all") || ($queryType=="checkp") ) checkp($ipname,$portNum);
?>
####################################
attached mail follows:
I think this is what you're going for:
$portNum = 5500; $arr = explode(":",$QUERY_STRING); $ipname = $arr[0]; if(isset($arr[1])) { $portNum = $arr[1]; };
On Friday 10 August 2001 19:00, you wrote: > the things i want it to do are: > when i go to index.php?172.0.0.1:5500 > that it would change the $ipname to 172.0.0.1 and > $portNum to 5500 > and if i go to > index.php?172.0.0.1 > then $ipname to 172.0.0.1 and > $portNum to 5500 > > so if i would go to: > index.php?255.255.255.255 > $ipname to 255.255.255.255 and > $portNum to 5500 > > ok.. i think i know 50% of the solution of this problem: > if $portNum eq'' > $portNum "5500"; > else > } > > is that right or i that cgi or is that totally wrong? > > right now this is my code: (index.php) > > > #################################### > > > <? > > #First output the HTML page > > ?> > <? > #Some functions > if (! $sock = fsockopen($ipname, $portNum, &$num, &$error, 5)) > print ("<IMG SRC=\"http://hlpass.macomega.com/red.jpg\" WIDTH=10 > HEIGHT=10>"); > else{ > print ("<IMG SRC=\"http://hlpass.macomega.com/green.jpg\" WIDTH=10 > HEIGHT=10>"); > fclose($sock); > } > #If the form has been posted, process the query, otherwise there's > #nothing to do yet > > if(!$queryType) > exit; > > #Make sure the target appears valid > > if( (!$ipname) || (!eregi("\.",$ipname)) ){ > message("Error: You did not specify a valid target host or IP."); > exit; > } > > #Figure out which tasks to perform, and do them > > if( ($queryType=="all") || ($queryType=="checkp") ) > checkp($ipname,$portNum); > > ?> > > ####################################
attached mail follows:
Hi to all..... can anybody help me with this problem, I am running a php script but it display this error:
Call to unsupported or undefined function session_start() in index.php3
How do I fix this?
Thanks...
attached mail follows:
> can anybody help me with this problem, I am running a php script but it display this error: > > Call to unsupported or undefined function session_start() in index.php3 > > How do I fix this?
If you are actually using PHP 3, as your extension would indicate, you fix it by upgrading to PHP version 4. The session functions are not available in PHP 3.
-Rasmus
attached mail follows:
what websites do u surf every day ... in order to improve ur php coding ability...:) i am confused now...>< thx ........nick
attached mail follows:
just read the mailing list... sometimes evilwalrus.com or newbienetwork.net
----- Original Message -----
From: "..." <geteasy
seed.net.tw>
To: <php-general
lists.php.net>
Sent: Saturday, August 11, 2001 1:10 PM
Subject: [PHP] what websites do u surf every day ...
what websites do u surf every day ... in order to improve ur php coding ability...:) i am confused now...>< thx ........nick
attached mail follows:
Hi there recently I had upgrade my php from as you see in the subject
and I have a problem raise after I do some upgrading.... my php script already run OK when I used the previous version after I do the upgrading a lot of error raise here is how I configure ./configure --with-mysql=/usr/local --with-apxs=/usr/local/apache/bin/apxs --enable-memory-limit --enable-ucd-snmp-hack --with-snmp=/usr/local/snmpd --enable-discard-path --enable-force-cgi-redirect --enable-trans-sid
the problem is like this....
on the beginning of the script i declare $connectid=mysql_connect(bla,bla,bla);
and at the end (still the same page) I used this mysql_db_query($db,"query",$connectid); <------ here is the error come up seems like the $connectid variable that I declare in previous didn't parse till the end.... then I put the $connectid=mysql_connect(bla,bla,bla); before the query then everything is OK......
can any body point me out where did I go wrong...I'm sure my script is OK..it's run in version 4.03 but got error in 4.06
Thanks in Advance
Yamin Prabudy
attached mail follows:
So on a mailing list that developers run around on, no one can tell me how to properly use open_basedir?
-----Original Message-----
From: Chris Cameron [mailto:chris
upnix.com]
Sent: Thursday, August 09, 2001 4:27 PM
To: php-general
lists.php.net
Subject: [PHP] open_basedir and safemode-ish things
I looked through the archives, and tried finding info in the PHP manual, but haven't had much luck.
I'm looking for a way to restrict virtual host users to their specific little directory by putting a <Directory> thing in my httpd.conf.
It looked like open_basedir should do the trick, but it didn't, and obviously something's not quite right. My php.ini has: safe_mode = off safe_mode_exec_dir =
for safe mode stuff, while in a virtual host spot in my httpd.conf I have
<Directory "/home/www/chris/www"> php_admin_value open_basedir /home/www/chris/www </Directory>
This doesn't work. If anyone could let me know the proper format this is suppose to take, I'd be most appreciative.
Thanks, Chris
attached mail follows:
Did you actually search the manual?
http://php.net/open_basedir gives you a list of hits. One of them is:
http://php.net/manual/en/features.safe-mode.php
-Rasmus
On Fri, 10 Aug 2001, Chris Cameron wrote:
> So on a mailing list that developers run around on, no one can tell me
> how to properly use open_basedir?
>
> -----Original Message-----
> From: Chris Cameron [mailto:chris
upnix.com]
> Sent: Thursday, August 09, 2001 4:27 PM
> To: php-general
lists.php.net
> Subject: [PHP] open_basedir and safemode-ish things
>
>
> I looked through the archives, and tried finding info in the PHP manual,
> but haven't had much luck.
>
> I'm looking for a way to restrict virtual host users to their specific
> little directory by putting a <Directory> thing in my httpd.conf.
>
> It looked like open_basedir should do the trick, but it didn't, and
> obviously something's not quite right. My php.ini has:
> safe_mode = off
> safe_mode_exec_dir =
>
> for safe mode stuff, while in a virtual host spot in my httpd.conf I
> have
>
> <Directory "/home/www/chris/www">
> php_admin_value open_basedir /home/www/chris/www
> </Directory>
>
> This doesn't work. If anyone could let me know the proper format this is
> suppose to take, I'd be most appreciative.
>
> Thanks,
> Chris
>
>
>
>
>
attached mail follows:
Put bluntly, it doesn't work.
The manual says: If instead of safe_mode, you set an open_basedir directory then all file operations will be limited to files under the specified directory.
I'm assuming that this should work without making any changes to my php.ini. The manuals example: <Directory /docroot> php_admin_value open_basedir /docroot </Directory>
I've got: <Directory /home/www/chris/www> php_admin_value open_basedir /home/www/chris/www </Directory>
Like I said originally, I must be doing something wrong.
"php_admin_value" isn't suppose to be set to something is it? I'm also surprised that (apperantly) nothing has to be changed in the .ini.
This is inbetween <VirutalHost> and </VirutalHost>, and I'm testing that it does/doesn't work by reading out my /etc/passwd. That directory does exist, and is the www root for the Virtual Host.
Thanks, Chris
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: Saturday, August 11, 2001 1:04 AM
To: Chris Cameron
Cc: php-general
lists.php.net
Subject: RE: [PHP] open_basedir and safemode-ish things
Did you actually search the manual?
http://php.net/open_basedir gives you a list of hits. One of them is:
http://php.net/manual/en/features.safe-mode.php
-Rasmus
attached mail follows:
Did you restart your server?
On Sat, 11 Aug 2001, Chris Cameron wrote:
> Put bluntly, it doesn't work.
>
> The manual says:
> If instead of safe_mode, you set an open_basedir directory then all file
> operations will be limited to files under the specified directory.
>
> I'm assuming that this should work without making any changes to my
> php.ini.
> The manuals example:
> <Directory /docroot>
> php_admin_value open_basedir /docroot
> </Directory>
>
> I've got:
> <Directory /home/www/chris/www>
> php_admin_value open_basedir /home/www/chris/www
> </Directory>
>
> Like I said originally, I must be doing something wrong.
>
> "php_admin_value" isn't suppose to be set to something is it? I'm also
> surprised that (apperantly) nothing has to be changed in the .ini.
>
> This is inbetween <VirutalHost> and </VirutalHost>, and I'm testing that
> it does/doesn't work by reading out my /etc/passwd. That directory does
> exist, and is the www root for the Virtual Host.
>
> Thanks,
> Chris
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Saturday, August 11, 2001 1:04 AM
> To: Chris Cameron
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] open_basedir and safemode-ish things
>
>
> Did you actually search the manual?
>
> http://php.net/open_basedir gives you a list of hits. One of them is:
>
> http://php.net/manual/en/features.safe-mode.php
>
> -Rasmus
>
>
attached mail follows:
Evan,
I agree with you. I face the same problem too and need a way to convince my cleints.
Adrian
On Thu, 9 Aug 2001, Evan Nemerson wrote:
> Bill has hit it right on! Programmers all over the world have already
> recognized that PHP is a superior language, and open-source is not the root
> of all evil (as M$ would have us believe). However, many (most?) execs do not
> listen to reason, but rather only to TV and glossy ads. Therefore, I propose
> we fight fire with fire!
>
> Lets band together and form a web site not altogether unlike LinuxFund.org.
> However, instead of development of new technology, our site could focus on
> the spread of PHP, or perhaps open source technology. Get our own credit
> card, ask for donations, be those donations money or time.
>
> We could use this money to fund ad-campaigns. Ad-campaigns targeted not at
> programmers who already know the merit of PHP (and open-source in general),
> but rather the "Big Corporate Executive" who has the power to make or break
> PHP.
>
> The ads could go in magazines like Forbes, Fortune, etc. instead of Open
> Magazine.
>
> If you are interested in this, either helping make the site, providing
> expertise in other areas (such as marketing), or would just be willing to
> make a donation, visit a page I just set up:
> http://www.coeus-group.com/AdCamp.php . I'll consider this post to be a kind
> of market analysis. I sincerly hope that you are as interested- and willing-
> as I.
>
> Evan Nemerson
> evan
coeus-group.com
>
attached mail follows:
Daniel Adams wrote: > Has anyone got the cvs source to work with autoconf 2.50?
autoconf 2.5x is not supported, please use autoconf 2.13.
-- Sebastian Bergmann Measure Traffic & Usability http://sebastian-bergmann.de/ http://phpOpenTracker.de/
attached mail follows:
On Fri, 10 Aug 2001, Daniel Adams wrote:
> Has anyone got the cvs source to work with autoconf 2.50?
Noone as far as I know has worked on that so far; anyone who is interested in this functionality is encouraged to provide patches which addresses the remaining issues.
- Sascha Experience IRCG http://schumann.cx/ http://schumann.cx/ircg
attached mail follows:
Hello there,
I have a question about gettext. My provider compiled into PHP4 but when i try to install squirrelmail (a webmail programm in php4) I get only the english text.
When i switch from a language i don't get any error. getenv('LC_ALL') return's the right language.
Is there a wy to check if the installation of gettext is right?
How can help.
-- ---------------------------------------------------------------------------- -- VOF Mobron internet en automatiseringsdiensten Abel Tasmanstraat 30 1827 PV Alkmaar The Netherlands Phone: +31 72 5644102 Fax: +31 72 5647515
attached mail follows:
I used to use :
$data[0] = addslashes(fread(fopen($picture1, "r"), filesize($picture1))); to store files from a client machine but now I want to store files from a webstie ie http://servername.com/file.jpg
but I can't seem to get the logic for it rite. Can some suggest wht shall I do ? Vishal
>From: Rasmus Lerdorf <rasmus
php.net>
>To: Chris Cameron <chris
upnix.com>
>CC: <php-general
lists.php.net>
>Subject: RE: [PHP] open_basedir and safemode-ish things
>Date: Sat, 11 Aug 2001 01:13:27 -0700 (PDT)
>
>Did you restart your server?
>
>On Sat, 11 Aug 2001, Chris Cameron wrote:
>
> > Put bluntly, it doesn't work.
> >
> > The manual says:
> > If instead of safe_mode, you set an open_basedir directory then all file
> > operations will be limited to files under the specified directory.
> >
> > I'm assuming that this should work without making any changes to my
> > php.ini.
> > The manuals example:
> > <Directory /docroot>
> > php_admin_value open_basedir /docroot
> > </Directory>
> >
> > I've got:
> > <Directory /home/www/chris/www>
> > php_admin_value open_basedir /home/www/chris/www
> > </Directory>
> >
> > Like I said originally, I must be doing something wrong.
> >
> > "php_admin_value" isn't suppose to be set to something is it? I'm also
> > surprised that (apperantly) nothing has to be changed in the .ini.
> >
> > This is inbetween <VirutalHost> and </VirutalHost>, and I'm testing that
> > it does/doesn't work by reading out my /etc/passwd. That directory does
> > exist, and is the www root for the Virtual Host.
> >
> > Thanks,
> > Chris
> >
> > -----Original Message-----
> > From: Rasmus Lerdorf [mailto:rasmus
php.net]
> > Sent: Saturday, August 11, 2001 1:04 AM
> > To: Chris Cameron
> > Cc: php-general
lists.php.net
> > Subject: RE: [PHP] open_basedir and safemode-ish things
> >
> >
> > Did you actually search the manual?
> >
> > http://php.net/open_basedir gives you a list of hits. One of them is:
> >
> > http://php.net/manual/en/features.safe-mode.php
> >
> > -Rasmus
> >
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]