[PHP] SSH system command problem

2005-01-31 Thread Linn Fagerberg
Hi,

I am trying to use a php system command to run a script and access files
from another server using SSH. This does not seem to work in PHP or else I
am doing it wrong because I keep on getting the system return value=255 when
I do 

 

system("/usr/bin/ssh 10.0.0.1", $value)

 

I tried to do a "ssh -help" command to see if the reason it did not work was
that there was a problem with the server, but that did not give me a correct
return value either, so I am starting to suspect that ssh is different from
other system commands in php?

 

Is it possible to run ssh using php system command or do I have to try
something else? I found a new php library called ssh2 but I don't know if
that could be the solution to my problem? Have anyone used it?

 

/Linn Fagerberg



Re: [PHP] SSH system command problem

2005-01-31 Thread Jason Wong
On Monday 31 January 2005 16:44, Linn Fagerberg wrote:

> I am trying to use a php system command to run a script and access files
> from another server using SSH. This does not seem to work in PHP or else I
> am doing it wrong because I keep on getting the system return value=255
> when I do
>
>
>
> system("/usr/bin/ssh 10.0.0.1", $value)
>
>
>
> I tried to do a "ssh -help" command to see if the reason it did not work
> was that there was a problem with the server, but that did not give me a
> correct return value either, 

  system("/usr/bin/ssh --help", $value);

should certainly work, but $value is 1.


> so I am starting to suspect that ssh is 
> different from other system commands in php?

I don't think PHP makes any distinction between whatever system commands you 
use.

> Is it possible to run ssh using php system command or do I have to try
> something else?

OK, when you run ssh on the command line, the first time you connect to any 
host you'll get asked to verify the remote host's fingerprint, this then gets 
added to ~/.ssh/known_hosts. So the first thing you should do perform this 
step.

Then the next thing is you usually need a password to access the remote host, 
as it's usually pretty difficult to enter a password if you want to run this 
script non-interactively so you make use of keys:

  google > using ssh without password

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] upload file size limit

2005-01-31 Thread badlya badlu
Hi,

I have created one php file for uploading the file. i
also made changes in /etc/php.ini for size limit. but
i can not upload the files greater than 5mb. Is there
any modification which has to be done in other
configuration file.
thanks in advance

santosh

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Autoflush

2005-01-31 Thread Wudi
Can PHP attain autoflush?
(See attachments.)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] upload file size limit

2005-01-31 Thread Wudi
Run phpinfo() to see the Configuration File (php.ini) Path.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] upload file size limit

2005-01-31 Thread badlya badlu
the path is /etc/php.ini 
also 
upload_max_filesize  50M  50M 

Waiting for reply.



--- Wudi <[EMAIL PROTECTED]> wrote:

> Run phpinfo() to see the Configuration File
> (php.ini) Path.
> 
> 




__ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sessions memory allocation problem

2005-01-31 Thread adrian zaharia
Richard Lynch wrote:

> adrian zaharia wrote:
>> Hi,
>>
>> I am testing the following code that pushes a file to the browser
>> (Apache 1.3 + PHP 4.3.8 but tested also under several other configs)
>>
>> Try it with a BIG test1.zip (e.g. 100M in size)
>>
>> > ignore_user_abort();
>> set_time_limit(0);
>>
>> session_save_path('/tmp');
>> session_start();
>>
>> $sFileName = 'test1.zip';
>> $sFileDir = '/var/www/html/';
>>
>> header("Content-Type: application/octet-stream");
>> header("Content-Disposition: attachment;filename=\"" . $sFileName .
>> "\""); header("Content-Length: " . filesize($sFileDir . $sFileName));
>> header('Pragma: cache');
>> header('Cache-Control: public, must-revalidate, max-age=0');
>> header('Connection: close');
>> header('Expires: ' . date('r', time()+60*60));
>> header('Last-Modified: ' . date('r', time()));
>>
>> $oFp = fopen($sFileDir . $sFileName, "rb");
>> $iReadBufferSize = 512;
>> while (!feof($oFp)) {
>> echo fread ($oFp, $iReadBufferSize);
>> }
>> fclose ($oFp);
>> exit;
>>
>> ?>
>>
>> What i discovered is that if i keep the 2 session initialisation
>> functions the script will work ONLY if the allocated memory is greater
>> than the size of the tested file. If i remove the session functions the
>> script works fine
>> even if the test1.zip file is very big (hundreds of Megs)
>>
>> Is it something i do wrong? Or is a bug and i should report it?
>>
>> I mention that I NEED the 2 functions so removing them is not THE
>> solution.
>> Nor setting in php.ini a huge memory limit :(
> 
> This naive reader would suggest filing a bug report...
> 
> At least, *I* don't think it should behave this way.
> 
> http://bugs.php.net
> 


See this:
http://bugs.php.net/bug.php?id=31763&edit=2

Is not a bug but they under some configurations they cache the output :(

Adrian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] upload file size limit

2005-01-31 Thread Thomas Seifert
On Mon, 31 Jan 2005 03:15:00 -0800, Badlya Badlu wrote:

> the path is /etc/php.ini 
> also 
> upload_max_filesize  50M  50M 
> 
> Waiting for reply.

it also depends on your webserver. I guess you are running apache2? 


thomas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] upload file size limit

2005-01-31 Thread badlya badlu
yes
httpd-2.0.49-4
Should i upgrade it?

--- Thomas Seifert <[EMAIL PROTECTED]> wrote:

> On Mon, 31 Jan 2005 03:15:00 -0800, Badlya Badlu
> wrote:
> 
> > the path is /etc/php.ini 
> > also 
> > upload_max_filesize  50M  50M 
> > 
> > Waiting for reply.
> 
> it also depends on your webserver. I guess you are
> running apache2? 
> 
> 
> thomas
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Troublesome Code.

2005-01-31 Thread Chris Knipe
Lo everyone,
Can someone please perhaps just indicate to me what is wrong with the below 
code?  I am getting SQL Result errors, but all the queries executes 
successfully.

Errors in browser:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 11

Warning: Cannot modify header information - headers already sent by (output 
started at 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php:11) 
in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 28

Warning: Cannot modify header information - headers already sent by (output 
started at 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php:11) 
in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 29

Authentication Required.

Below is the code with explanations...

 if (!isset($_SERVER['PHP_AUTH_USER'])) {
   header('WWW-Authenticate: Basic realm="Cenergy Dialup Admin"');
   header('HTTP/1.0 401 Unauthorized');
   WritePageStart("Error - Authentication Required", "", "");
   echo "Authentication Required.";
   WritePageEnd();
   exit;
 } else {
   $SQL = mysql_query("SELECT RadiusAdmin.isWIFI AS isWIFI, 
RadiusAdmin.isPPTP AS isPPTP, RadiusAdmin.isDIAL AS isDIAL, 
RadiusAdmin.MinTokens AS MinTokens, RadiusAdmin.TokenCost AS TokenCost, 
RadiusAdmin.CustID AS CustID, RadiusAdmin.Realm AS Realm, SMTPZones.EntryID 
AS ZoneID, RadiusAdmin.Username AS AccountName, RadiusAdmin.Tokens AS 
Tokens, RadiusAdmin.Balance AS Balance FROM RadiusAdmin LEFT JOIN SMTPZones 
ON RadiusAdmin.Realm=SMTPZones.Zonename  WHERE RadiusAdmin.Username='" . 
$_SERVER['PHP_AUTH_USER'] . "' AND RadiusAdmin.Password=MD5('" . 
$_SERVER['PHP_AUTH_PW'] . "') LIMIT 1");

^^^ Line 10.  Query does execute successfully, and returns 1 Row.
   if (mysql_num_rows($SQL) == 1) {
^^ Line 11 (I also tried == "1" to no avail).
 while ($Data = mysql_fetch_array($SQL)) {
   $_SESSION['Username'] = $_SERVER['PHP_AUTH_USER'];
   $_SESSION['CustID'] = $Data['CustID'];
   $_SESSION['ZoneID'] = $Data['ZoneID'];
   $_SESSION['Realm'] = $Data['Realm'];
   $_SESSION['AccountName'] = $Data['AccountName'];
   $_SESSION['Tokens'] = $Data['Tokens'];
   $_SESSION['TokenCost'] = $Data['TokenCost'];
   $_SESSION['MinTokens'] = $Data['MinTokens'];
   $_SESSION['isDIAL'] = $Data['isDIAL'];
   $_SESSION['isPPTP'] = $Data['isPPTP'];
   $_SESSION['isWIFI'] = $Data['isWIFI'];
   $_SESSION['Balance'] = $Data['Balance'];
 }
 $SQL = mysql_query("UPDATE RadiusAdmin SET LastAccess=NOW() WHERE 
Username='" . $_SERVER['PHP_AUTH_USER'] . "'");
   } else {
 header('WWW-Authenticate: Basic realm="Cenergy Dialup Admin"');
 header('HTTP/1.0 401 Unauthorized');
 This generates the last two errors - hence, my problem is at line 
10 & 11?
 WritePageStart("Error", "", "");
 echo "Authentication Required.";
 WritePageEnd();
 exit;
   }
 }

Thanks,
Chris. 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Troublesome Code.

2005-01-31 Thread M. Sokolewicz
Chris Knipe wrote:
Lo everyone,
Can someone please perhaps just indicate to me what is wrong with the 
below code?  I am getting SQL Result errors, but all the queries 
executes successfully.

Errors in browser:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 11

Warning: Cannot modify header information - headers already sent by 
(output started at 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php:11) 
in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 28

Warning: Cannot modify header information - headers already sent by 
(output started at 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php:11) 
in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 29

Authentication Required.

Below is the code with explanations...

 if (!isset($_SERVER['PHP_AUTH_USER'])) {
   header('WWW-Authenticate: Basic realm="Cenergy Dialup Admin"');
   header('HTTP/1.0 401 Unauthorized');
   WritePageStart("Error - Authentication Required", "", "");
   echo "Authentication Required.";
   WritePageEnd();
   exit;
 } else {
   $SQL = mysql_query("SELECT RadiusAdmin.isWIFI AS isWIFI, 
RadiusAdmin.isPPTP AS isPPTP, RadiusAdmin.isDIAL AS isDIAL, 
RadiusAdmin.MinTokens AS MinTokens, RadiusAdmin.TokenCost AS TokenCost, 
RadiusAdmin.CustID AS CustID, RadiusAdmin.Realm AS Realm, 
SMTPZones.EntryID AS ZoneID, RadiusAdmin.Username AS AccountName, 
RadiusAdmin.Tokens AS Tokens, RadiusAdmin.Balance AS Balance FROM 
RadiusAdmin LEFT JOIN SMTPZones ON RadiusAdmin.Realm=SMTPZones.Zonename  
WHERE RadiusAdmin.Username='" . $_SERVER['PHP_AUTH_USER'] . "' AND 
RadiusAdmin.Password=MD5('" . $_SERVER['PHP_AUTH_PW'] . "') LIMIT 1");

^^^ Line 10.  Query does execute successfully, and returns 1 Row.
No it doesn't, it returns FALSE (because there was an error). Use 
mysql_error() to find out the problem.

   if (mysql_num_rows($SQL) == 1) {
^^ Line 11 (I also tried == "1" to no avail).
It gets $SQL=false since mysql_query() returned false. Use mysql_error() 
to find out the problem.
 while ($Data = mysql_fetch_array($SQL)) {
   $_SESSION['Username'] = $_SERVER['PHP_AUTH_USER'];
   $_SESSION['CustID'] = $Data['CustID'];
   $_SESSION['ZoneID'] = $Data['ZoneID'];
   $_SESSION['Realm'] = $Data['Realm'];
   $_SESSION['AccountName'] = $Data['AccountName'];
   $_SESSION['Tokens'] = $Data['Tokens'];
   $_SESSION['TokenCost'] = $Data['TokenCost'];
   $_SESSION['MinTokens'] = $Data['MinTokens'];
   $_SESSION['isDIAL'] = $Data['isDIAL'];
   $_SESSION['isPPTP'] = $Data['isPPTP'];
   $_SESSION['isWIFI'] = $Data['isWIFI'];
   $_SESSION['Balance'] = $Data['Balance'];
 }
 $SQL = mysql_query("UPDATE RadiusAdmin SET LastAccess=NOW() WHERE 
Username='" . $_SERVER['PHP_AUTH_USER'] . "'");
   } else {
 header('WWW-Authenticate: Basic realm="Cenergy Dialup Admin"');
 header('HTTP/1.0 401 Unauthorized');
 This generates the last two errors - hence, my problem is at 
line 10 & 11?
 WritePageStart("Error", "", "");
 echo "Authentication Required.";
 WritePageEnd();
 exit;
   }
 }

Thanks,
Chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Troublesome Code.

2005-01-31 Thread Mikey
> >if (mysql_num_rows($SQL) == 1) {

Err, this is just the query string variable right? So you need to do:

$sth = mysql_query ($SQL);
If (mysql_num_rows ($sth) == 1)

Then you will be checking the result set and not just the query string.

HTH,

Mikey

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Troublesome Code.

2005-01-31 Thread Mikey
> If (mysql_num_rows ($sth) == 1)

Gr.  Mean't to be "if", but Outlook is insisting that it knows english
better than I.

Pah!

Mikey

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Question about Safe Mode

2005-01-31 Thread Rick Root
I have a little home made CMS that writes files... on the server I've
recently installed this CMS on, those files get written as apache:apache ...
that file uses include to include other files that are not owned by
"apache", and this doesn't work.
Warning: main(): SAFE MODE Restriction in effect. The script whose uid
is 48 is not allowed to access ./inc_pagecontent.php owned by uid 538 in
/home/virtual/site36/fst/var/www/html/test.php on line 3
So...  how do I work around this?  Can I get php to write the files so
they aren't owned by "apache" but rather thwn owner of the php script
that creates them?
Thanks.
Rick


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.2 - Release Date: 1/28/2005
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Troublesome Code.

2005-01-31 Thread Chris Knipe
Had a fault in some globally included mysql structures... I don't know how 
this happened, but my mysql_select_db seemed to have dissapeared.  Thus 
there was no database initialised, and hence all the queries actually did 
not complete.

I sorted it out - it's all working now :)  Thanks for the suggestions 
everyone.

--
Chris.
- Original Message - 
From: "Mikey" <[EMAIL PROTECTED]>
To: 
Sent: Monday, January 31, 2005 3:15 PM
Subject: RE: [PHP] Re: Troublesome Code.


>if (mysql_num_rows($SQL) == 1) {
Err, this is just the query string variable right? So you need to do:
$sth = mysql_query ($SQL);
If (mysql_num_rows ($sth) == 1)
Then you will be checking the result set and not just the query string.
HTH,
Mikey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] FW: [NEWBIE GUIDE] For the benefit of new members

2005-01-31 Thread Jay Blanchard
=
Please feel free to add more points and send to the list. 
=

1. If you have any queries/problems about PHP try
http://www.php.net/manual/en first. You can download a copy and use it
offline also. 

Please also try http://www.php.net/manual/faq.php for answers to
frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for "php YOUR QUERY" may
fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the mailing list discussion at
http://phparch.com/mailinglists. Many of the common topics are discussed
repeatedly, and you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed question in the list is
"Best PHP editor". Everyone has his/her favourite editor. You can get
all the opinions by going through the list archives. If you want a
chosen list try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors/
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out what extensions are
available to 
you?

Just put the following code into a file with a .php extension and access
it through your 
webserver:

 

If PHP is installed you will see a page with a lot of information on it.
If PHP is not installed (or not working correctly) your browser will try
to download the file.
(contributed by Teren and reworded by Chris W Parker)

5. If you are stuck with a script and do not understand what is wrong,
instead of posting 
the whole script, try doing some research yourself. One useful trick is
to print the variable/sql query using print or echo command and check
whether you get what you expected. 

After diagnosing the problem, send the details of your efforts
(following steps 1, 2 & 3) and ask for help.

6. PHP is a server side scripting language. Whatever processing PHP does
takes place BEFORE the output reaches the client. Therefore, it is not
possible to access users' computer related information (OS, screen size
etc) using PHP. Nor can you modify any the user side settings. You need 
to go for JavaScript and ask the question in a JavaScript list.

On the other hand, you can access the information that is SENT by the
user's browser when a client requests a page from your server. You can
find details about browser, OS etc as reported by 
this request. 
(contributed by Wouter van Vliet and reworded by Chris W Parker.)

7. Provide a clear descriptive subject line. Avoid general subjects like
"Help!!", "A Question" etc. Especially avoid blank subjects. 

8. When you want to start a new topic, open a new mail composer and
enter the mailing list address php-general@lists.php.net instead of
replying to an existing thread and replacing the subject and body with
your message.

9. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. 
[contribued by Chris W Parker]

10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with attachments. If you don't
have a place to upload your code, try the many pastebin websites (such
as www.pastebin.com). 
(contributed by Burhan Khalid)

Following these guidelines will ensure that you get effective responses
from the list members. Otherwise, your questions might not be answered.

===
Hope you have a good time programming with PHP.
===

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Question about Safe Mode

2005-01-31 Thread Jay Blanchard
[snip]
So...  how do I work around this?  Can I get php to write the files so
they aren't owned by "apache" but rather thwn owner of the php script
that creates them?
[/snip]

PHP scripts run by the HTTP server are run as the web server. The web
server runs as 'Apache', so Apache needs permissions to do the writing
or Safe Mode must be disabled. Read
http://us2.php.net/features.safe-mode for more information

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP4/Apache2 Content-Length stripped?

2005-01-31 Thread Stoian Ivanov
Stoian Ivanov wrote:

>   Hi all,
> I'm writing a wap download script involving dynamic image resizing and so
> on. I've notice that some phones are quitting in the mids of http
> transfer. After looking further I found out that headers() is sometimes
> ignored or stripped. I've googled around and found in a perl forum that
> flush-ing
> helps but in PHP4.3.10/Apache2/Gentoo/linux2.6  it seems to not help (at
> least in my configuration) Is there a work-around or something...
>(I'm going to post same question in apache's mailiing list..)
> 
> Thanks in advance

Just for the record: I've managed to hack it by mod_headers and
apache_setenv() // works with prefork-ing apache not sure in multi-threaded

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Some questions about if and isset.

2005-01-31 Thread Geir Anders Berge
I'm sure that this code can be written more efficient, please tell me how,  
but that's not my problem. The problem is that when i run this script all  
lines are executed. I'm sure I'm doing something wrong, but can't find out  
just what.

 $constant)
{
Execute this code if $variable is more than $constant
}
if ($variable == $constant)
{
Execute this code if $variable and $constant are equal
}
}
else
{
Execute this code if $variable is not set
}
?>
Thanks for all help!
Geir Anders Berge
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Some questions about if and isset.

2005-01-31 Thread Jay Blanchard
[snip]
 $constant)
{
Execute this code if $variable is more than $constant
}
elseif ($variable == $constant)
{
Execute this code if $variable and $constant are equal
}
}
else
{
Execute this code if $variable is not set
}
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Some questions about if and isset.

2005-01-31 Thread Robinson, Matthew
Can we see some sample data? An example of what $variable and $constant
are would help.

A quick glance at the code I'd have:

if (isset($variable)
{
if ($variable < $contstant)
{
stuff
}
elseif ($variable > $constant)
{
more stuff
}
else
{
other stuff
}
}
else
{
even more stuff
}

M

-Original Message-
From: Geir Anders Berge [mailto:[EMAIL PROTECTED] 
Sent: 28 January 2005 19:05
To: php-general@lists.php.net
Subject: [PHP] Some questions about if and isset.

I'm sure that this code can be written more efficient, please tell me
how, but that's not my problem. The problem is that when i run this
script all lines are executed. I'm sure I'm doing something wrong, but
can't find out just what.

 $constant)
{
Execute this code if $variable is more than $constant
}
if ($variable == $constant)
{
Execute this code if $variable and $constant are equal
}
}
else
{
Execute this code if $variable is not set
}
?>

Thanks for all help!

Geir Anders Berge

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information
visit
http://www.citc.it

___


This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Creation and Saving

2005-01-31 Thread Jochem Maas
NathanielGuy#21 wrote:
Yes, I was mainly wanting to know if I needed to call it at all with
what I was doing.
not unless you want to create a new image (and add some part of another 
image
to it, add some text etc) and output that. also IIRC its only available in
GDlib 2.0.x and up.
On Sun, 30 Jan 2005 18:45:32 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
NathanielGuy#21 wrote:
Ah, thank you.  after checking that the folder was there I found I had
made a mistake in the path to the folder. 8_ I can believe I didnt
find it before.  Aside from that error, did I go about the image
resizing and everything in the correct way?  What is the use of
imagecreatetruecolor().  Thanks for the help.
imagecreatetruecolor
(PHP 4 >= 4.0.6, PHP 5)
imagecreatetruecolor -- Create a new true color image
Description
resource imagecreatetruecolor ( int x_size, int y_size )
imagecreatetruecolor() returns an image identifier representing a black image 
of size x_size by y_size.
Example 1. Creating a new GD image stream and outputting an image.

Note: This function requires GD 2.0.1 or later.
Note: This function will not work with GIF file formats.
See also imagedestroy() and imagecreate().
---
for a more well laided out copy of this text goto:
http://nl2.php.net/imagecreatetruecolor
or maybe the manual wasn't clear to you and you are seeking further
clarification?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] FW: [NEWBIE GUIDE] For the benefit of new members

2005-01-31 Thread Jason Wong
On Monday 31 January 2005 21:30, Jay Blanchard wrote:

> =
> Please feel free to add more points and send to the list.
> =

How about:

When replying to the list use standard quoting, ie prefix quoted lines with a 
'>' character. Smart mail clients will recognise lines quoted in such a 
fashion and can display them in different styles/colours/indentations making 
it easier to distinguish who said what and when.

But as Jay Blanchard is about the only person on the list to regularly use 
funny quoting instead of standard quoting it might suffice to just ask him to 
turn over a new leaf :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] best way to handle user authentication, PHP vs. apache

2005-01-31 Thread Jochem Maas
Raymond Still wrote:
On Sun, 30 Jan 2005 18:49:41 -0800 (PST), "Richard
Lynch" wrote:

Raymond Still wrote:
...
You've got a long way to go before you properly
understand all the
security issues you've jumbled together -- Took me
forever, too. :-)
not to mention the fact that security is a moving target
:-)
--
Like Music?
http://l-i-e.com/artists.htm

Hello;
Your absolutly right and I freely admit it. I know just
slightly more than zero about internet security. :) 
Can any one recomend some good resources so that I can
learn? I'm not looking for "use this function" or "that
program", but something that will help me to actually
understand.
well we assume (and hope) you have read the 'NEWBIE GUIDE'
(currently being regularly posted to the list by Jay Blanchard), if
not please do and see where the instructions take you, another option
id to keep your eyes on this site:
http://phpsec.org/
which has just gone live - not that much info there yet AFAICS but
will probably become a good resource (they have people like Andi Gutmans
on the board/team/whatever - i.e. people who know where there towels are).
TIA
Ray
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Permissions on uploaded image don't allow for over writing

2005-01-31 Thread Dave
Jason, Hugh, John,
   Thanks for all your help. And thanks Hugh for sending me your FTP 
script.
   It turns out that the chmod() command was the magic bullet I was 
looking for. By placing
   chmod ($imageName, 0777)
   ... into the script right after it places the uploaded file in it's 
destination directory, it is then ready to be over written by future users.

   I appreciate everyone taking the time to answer my question.
--
Dave Gutteridge
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] best way to handle user authentication, PHP vs. apache

2005-01-31 Thread Chris Shiflett
--- Jochem Maas <[EMAIL PROTECTED]> wrote:
> http://phpsec.org/
> 
> which has just gone live - not that much info there yet AFAICS but
> will probably become a good resource

There may not be a lot of stuff in terms of the number of resources, but
the PHP Security Guide is a lot by itself:

http://phpsec.org/projects/guide/

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] file upload error

2005-01-31 Thread Tom
Hi
I have a very simple file upload form and script to handle it (copied 
verbatim from the php manual, except for the file target location and 
the script name).
However, it always fails, with an error code in the _FILE array or 6.
Does anyone know what this error is or what I am likely to have set 
wrong? All that I can find in the docs are errors from 0 to 4 :-(
Also, the tmp_name is always empty (as is the type, but I would expect 
that as I'm not explicitly setting it).

My config is php5 with apache 2 on linux. My php.ini file has 
upload_tmp_dir explicitly set to /tmp (permissions on this are 777)

Code as follows :-
1) Form
 1 
 2Form to test file uploads
 3
 4   
 5
 6 
 7 
 8 
 9 
10 Send this  
11 
12 
13
14 

2) Handler
 1 
 2 // script to handle file uploads. Files are recieved from 
uploadForm.php in same directory.
 3
 4 $uploaddir = '/usr/local/apache2/htdocs/TradEx/uploads/';
 5 $uploadfile = $uploaddir . 
basename($_FILES['userfile']['name']);
 6
 7 echo '';
 8 if (move_uploaded_file($_FILES['userfile']['tmp_name'], 
$uploadfile))
 9 {
10 echo "File is valid, and was successfully uploaded.\n";
11 }
12 else
13 {
14 echo "Possible file upload attack!\n";
15 echo 'Here is some more debugging info:';
16 print_r($_FILES);
17 print "";
18 }
19
20 ?>

3) Output :-
Possible file upload attack!
Here is some more debugging info:Array
(
   [userfile] => Array
   (
   [name] => MANIFEST
   [type] => 
   [tmp_name] => 
   [error] => 6
   [size] => 0
   )

)
Thanks for any help
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] best way to handle user authentication, PHP vs. apache

2005-01-31 Thread Jochem Maas
Chris Shiflett wrote:
--- Jochem Maas <[EMAIL PROTECTED]> wrote:
http://phpsec.org/
which has just gone live - not that much info there yet AFAICS but
will probably become a good resource

There may not be a lot of stuff in terms of the number of resources, but
the PHP Security Guide is a lot by itself:
http://phpsec.org/projects/guide/
Chris
I did say 'AFAICS' - I should have mentioned that I took only the very
quickest of glances (with the intention of going back at a less busy time).
I did get the impression that it was quality stuff, and I actually wanted
to talk the site up a bit because I get the feeling it has the potential to
really make a positive impact... guess that didn't come over to well.
sorry about that.
for my penance I will RTFPHPSG asap.
=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] best way to handle user authentication, PHP vs. apache

2005-01-31 Thread Chris Shiflett
--- Jochem Maas <[EMAIL PROTECTED]> wrote:
> > There may not be a lot of stuff in terms of the number of resources,
> > but the PHP Security Guide is a lot by itself:
> > 
> > http://phpsec.org/projects/guide/
> 
> I did say 'AFAICS' - I should have mentioned that I took only the very
> quickest of glances (with the intention of going back at a less busy
> time).

Get it while it's hot. :-)

I figured you might have missed it. I just wanted to point it out, since
it took a pretty large effort to get it ready in time for launch.

> I did get the impression that it was quality stuff, and I actually
> wanted to talk the site up a bit because I get the feeling it has the
> potential to really make a positive impact... guess that didn't come
> over to well.

No worries - it came across just fine. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] General question: packaging in PHP

2005-01-31 Thread Jason Barnett
Vivian Steller wrote:
...
Thanks for metioning this issue! This is another point where I think OO is
done the half way in PHP:
Why do we need some implicit type check, like
public method(Type $type)
if we then loose the optional parameter advantage?
I don't know *the* answer.  So far as I can tell this is one of those 
"that's just the way it is" type of issue.

Either some polymorphism mechanism should be implemented, or something like
public method(Type $type = new MyType())
should be able being passed through the interpreter..
also the primitive datatypes should be (exceptionally) used here:
public method(string $argument)
You're not the first to ask for this.  In fact, I think this might have 
even made it into the TODO list... but don't count on it any time soon.

Otherwise (IMHO) the typecheck mechanism is useless.
Not useless, but yes it is handicapped.  You have to expect an object in 
order to tell the interpreter which type of object to expect.


Interestingly, I found that Perl has 
the possibility of function overloading (also a language that's
dynamically typed)
(http://www.math.tu-berlin.de/polymake/perl/overload.html) It also has -
like Python - operator overloading. But is there any enthusiasm for that
in the PHP community, either? Nah...
regrettably... :(

Are there any thoughts about that in future releases?
Possibly an implementation for primitive type checking in the future... 
but don't hold out on it.

What do other developers think about this issue?
Not a big deal.  I generally *like* having the flexibility.  And if I 
really want / need to check I use the is_* functions.

How do organize multiple used classnames?
The common answer is: "Use a prefix"...
but i really dislike using cryptic and long prefixes to ensure uniqueness...
dots in the classname (ok, doing it like java) would be so nice, gr**
No new advice here.  Personally I find classnames like XML_XSLT_Wrapper 
to be short enough, yet they provide enough of a "namespace" for me to 
not worry about collisions for my Wrapper class and are descriptive when 
I'm just viewing the source code.


Regards,
Terje

vivian

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP5 + SPL - Creating an object as an array.

2005-01-31 Thread Jason Barnett
Yotam Ofek wrote:
I would like to create an object like this:

class TestClass {
private $some_array;
public $just;
public $some;
public $public;
public $vars;
}
?>
Is it possible, through SPL, to make the class accessible as 
"$testclass['array_key']", which will return the value for the key 
Yes, this is exactly what the SPL is for.  Actually the exact classes 
you will want to check out are called ArrayIterator and ArrayObject. 
Although I don't know for certain about making $some_array private... it 
*might* need to be public.  No promises either way on that one, just 
look out for it ;)

'array_key' from "$some_array"? Not only that, but I want the class to 
be accessable as "$testclass->just" aswell!
Is that possible? Examples are welcome.

Thanks in advance,
Yotam Ofek!

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Autoflush

2005-01-31 Thread Robin Vickery
On Mon, 31 Jan 2005 18:37:15 +0800, Wudi <[EMAIL PROTECTED]> wrote:
> Can PHP attain autoflush?
> (See attachments.)

Yes PHP can be set to automatically flush - see
http://de.php.net/outcontrol#ini.implicit-flush

No, we can't see attachments.

  -robin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] fopen, fsockopen on my virtual host

2005-01-31 Thread Al
I've got a script that fetches a stream from a file on our virtual host. Its 
been working fine; but, yesterday they changed something and it no longer works.

$fp= fsockopen("www.oursite.org", 80, $errno, $errstr, 30);
I can use any remote site and fscockopen works fine.
Anyone have a suggestion as to how I deal with this problem?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP 5 Compile error

2005-01-31 Thread Brian V Bonini
%cat config.txt | tr -s "\n" " "
--enable-versioning --enable-memory-limit --with-layout=GNU
--with-zlib-dir=/usr --with-imap=/usr/local --disable-all
--with-regex=php --disable-cli --enable-ctype --with-gd
--enable-gd-native-ttf --with-freetype-dir=/usr/local
--with-jpeg-dir=/usr/local --with-png-dir=/usr/local
--with-mysql=/usr/local --enable-overload --with-pcre-regex=yes
--enable-posix --enable-session --enable-tokenizer
--with-expat-dir=/usr/local --enable-xml --with-zlib=yes
--with-apxs2=/usr/local/www/bin/apxs --prefix=/usr/local

/usr/src/php5-STABLE-200501311330/ext/gd/gd.c: In function `zm_info_gd':
/usr/src/php5-STABLE-200501311330/ext/gd/gd.c:504: `FREETYPE_MAJOR'
undeclared (first use in this function)
/usr/src/php5-STABLE-200501311330/ext/gd/gd.c:504: (Each undeclared
identifier is reported only once
/usr/src/php5-STABLE-200501311330/ext/gd/gd.c:504: for each function it
appears in.)
/usr/src/php5-STABLE-200501311330/ext/gd/gd.c:504: `FREETYPE_MINOR'
undeclared (first use in this function)
*** Error code 1

Stop in /usr/src/php5-STABLE-200501311330.

%ls /usr/local/include/
apache2 freetypejerror.hltdl.h 
pngconf.h
c-clientfreetype2   jinclude.h  mm.htcl8.2
expat.h ft2build.h  jmorecfg.h  mysql   tcl8.3
expect.hgd  jpegint.h   openssl tcldbg.h
expect_comm.h   glib12  jpeglib.h   php tk8.2
expect_tcl.hjconfig.h   libintl.h   png.h   tk8.3


-- 

s/:-[(/]/:-)/g


BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Autoflush

2005-01-31 Thread Jason Barnett
Robin Vickery wrote:
On Mon, 31 Jan 2005 18:37:15 +0800, Wudi <[EMAIL PROTECTED]> wrote:
Can PHP attain autoflush?
(See attachments.)

Yes PHP can be set to automatically flush - see
http://de.php.net/outcontrol#ini.implicit-flush
No, we can't see attachments.
  -robin
And don't even bother *sending* attachments for that matter!  Please! 
There are sites online where you can paste code for others to view, so 
just upload it and give us the link if you need to show a large amount 
of code / results.

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP alternative to share point portal

2005-01-31 Thread Daniel Baughman



My company is considering spending lots of dough on a share point portal and
I am trying to find an alternative (as well as an excuse to get a linux
server in here).

Anyone have any good luck with anything or have any recommendations for any
apps out there?

Regards,

 
Dan Baughman

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5 Compile error

2005-01-31 Thread Richard Lynch
Brian V Bonini wrote:
> %cat config.txt | tr -s "\n" " "
> --enable-versioning --enable-memory-limit --with-layout=GNU
> --with-zlib-dir=/usr --with-imap=/usr/local --disable-all
> --with-regex=php --disable-cli --enable-ctype --with-gd
> --enable-gd-native-ttf --with-freetype-dir=/usr/local
> --with-jpeg-dir=/usr/local --with-png-dir=/usr/local
> --with-mysql=/usr/local --enable-overload --with-pcre-regex=yes
> --enable-posix --enable-session --enable-tokenizer
> --with-expat-dir=/usr/local --enable-xml --with-zlib=yes
> --with-apxs2=/usr/local/www/bin/apxs --prefix=/usr/local
>
> /usr/src/php5-STABLE-200501311330/ext/gd/gd.c: In function `zm_info_gd':
> /usr/src/php5-STABLE-200501311330/ext/gd/gd.c:504: `FREETYPE_MAJOR'

WILD GUESS

You've asked for a bunch of TTF-related stuff, but didn't ask for TTF
itself...

Or don't have FreeType installed, or, at least, not where configure can
FIND it.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Hello

2005-01-31 Thread louka . andrea
Please answer quickly!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Access

2005-01-31 Thread Robert Sossomon
Anyone know of any classes or files for a way to write an Access readable file 
from PHP and MySQL?

Thanks!
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Some questions about if and isset.

2005-01-31 Thread Richard Lynch
Geir Anders Berge wrote:
> I'm sure that this code can be written more efficient, please tell me how,
> but that's not my problem. The problem is that when i run this script all
> lines are executed. I'm sure I'm doing something wrong, but can't find out
> just what.

Okay, it's REALLY hard to see how all three tests could return TRUE...

But what is IN $variable and $constant?

>
>  if (isset($variable))
> {
>   if ($variable < $constant)
>   {
>   Execute this code if $variable is less than $constant
>   }
>   if ($variable > $constant)
>   {
>   Execute this code if $variable is more than $constant
>   }
>   if ($variable == $constant)
>   {
>   Execute this code if $variable and $constant are equal
>   }
> }
> else
> {
> Execute this code if $variable is not set
> }
> ?>

An alternative not yet mentioned:
if (isset($variable)){
  switch (TRUE){
case ($variable < $constant):
break;
case ($variable > $constant):
break;
case ($variable == $constant):
break;
  }
}
else{
}

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sessions memory allocation problem

2005-01-31 Thread Richard Lynch
adrian zaharia wrote:
>>> while (!feof($oFp)) {
>>> echo fread ($oFp, $iReadBufferSize);

Try http://php.net/flush right here.

>>> }
>>> fclose ($oFp);
>>> exit;
>>>

> See this:
> http://bugs.php.net/bug.php?id=31763&edit=2
>
> Is not a bug but they under some configurations they cache the output :(

Perhaps a flush() there will over-ride this...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] upload file size limit

2005-01-31 Thread Richard Lynch
badlya badlu wrote:
> I have created one php file for uploading the file. i
> also made changes in /etc/php.ini for size limit. but
> i can not upload the files greater than 5mb. Is there
> any modification which has to be done in other
> configuration file.

Check your POST size limit in, errr, php.ini or httpd.conf

If you only allow 5M of POST data, you can't cram 50M files into that...

POST limit should be higher than max upload size.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Access

2005-01-31 Thread Chris Wanstrath
> Anyone know of any classes or files for a way to write 
> an Access readable file from PHP and MySQL?

Google produced http://www.phpfreaks.com/tutorials/61/0.php on a
search for "Microsoft Access" php.

Haven't read it.  Looks like what you need.

- Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fopen, fsockopen on my virtual host

2005-01-31 Thread Richard Lynch
Al wrote:
> I've got a script that fetches a stream from a file on our virtual host.
> Its
> been working fine; but, yesterday they changed something and it no longer
> works.

Can you define "no longer works" a bit more clearly...

Error messages?

Just times out?

What?

> $fp= fsockopen("www.oursite.org", 80, $errno, $errstr, 30);
>
> I can use any remote site and fscockopen works fine.
>
> Anyone have a suggestion as to how I deal with this problem?

if ($errno){
  error_log("fsockopen errored out with # $errno: $errstr");
}

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SSH system command problem

2005-01-31 Thread Richard Lynch
Linn Fagerberg wrote:
> I am trying to use a php system command to run a script and access files
> from another server using SSH. This does not seem to work in PHP or else I
> am doing it wrong because I keep on getting the system return value=255
> when
> I do
>
> system("/usr/bin/ssh 10.0.0.1", $value)

Does it output anything at all?...

Perhaps try using http://php.net/exec and the optional arguments to
capture output in a variable.

Also MAYBE try to use 2&>1 at the end to re-direct stderr so you can
capture that, or even "2&>1 > /var/log/phpmessages" at the end to get
error output.

> I tried to do a "ssh -help" command to see if the reason it did not work
> was
> that there was a problem with the server, but that did not give me a
> correct
> return value either, so I am starting to suspect that ssh is different
> from
> other system commands in php?

What value did it give you?...

Can you replace 'shh' with, say, 'ls' and get THAT to work?
This would lend creedence to your theory that 'ssh' is somehow different.

> Is it possible to run ssh using php system command or do I have to try
> something else? I found a new php library called ssh2 but I don't know if
> that could be the solution to my problem? Have anyone used it?

I don't know about 'ssh' but, for example, the 'su' command REQUIRES a
valid tty (IE, a real login to a real shell) which PHP ain't got -- It's
*possible* your ssh is doing the same, somehow...

Exactly why are you doing an ssh from PHP, though?...  Perhaps if you tell
us the Big Picture, we can advise you with a better way, or tell you why
you should never ever do that :-v

For Sure:
Your PHP user (see  output) will need an actual login
shell and home directory.

You'll need to "seed" that directory with the sub-directories SSH needs,
as well as set up the host/keys so that you can:
su PHP_USER_HERE
ssh 10.0.0.1
without *ANY* keyboard interaction to get what you want.

If you *DO* need keyboard interaction, and really want to keep that, you
might need to do something like:

system("echo $PASSWORD | ssh 10.0.0.1", $value);

Then, of course, you have to be REAL CAREFUL about how/where you
store/retrieve handle $PASSWORD

In particular, the line above would be WILDLY INAPPROPRIATE on a shared
server, since *ANYBODY* on that server could do "ps auxcw" and see
your password in plain-text if they just happen to catch it as your PHP
script is running.

This carries LESS risk on a dedicated server, though still leaves a hole
for somebody who has already broken in to gather more power...

Also note that on a shared server, once you *DO* get this to work, anybody
who can write a PHP script can log in to 10.0.0.1 -- So that's PROBABLY a
Bad Idea on a shared server, and might not be all that Good on a dedicated
server either, as, again, the person who breaks in will now be able to
rather quickly access 10.0.0.1

Apologies in advance if you're a Security Expert -- But what you are doing
is VERY RISKY and I want to be sure you understand the risks you are
taking -- Hell, I'm sure there are even MORE risks not apparent to me.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Credit card storing, for processing

2005-01-31 Thread Richard Lynch
Angelo Zanetti wrote:
> this might be slightly OT but I know that the list has quite a
> knowledgable crowd =) So here is my situation:
>
> I have a client who I have developed a site for in PHP it provides
> various models for shares forecasts, the way it works is that people
> register for free (with their credit card details-https) now if they
> are
> not satisfied after a month they must just unsubscribe. If they have
> not
> unsubscribed after the first month they become a customer and each
> month
> their credit card is charged the relevant amount depending on what
> they
> have subscribed for.
>
> Now our the complication is as follows: I know that storing client's
> credit card details online is a big NONO, so we would have to move the
> credit  card details offline when they register. Im not sure how to go
> about this. Whether to save the details in text files somewhere else
> on
> the server or save to text files not on the server but another
> location.
>
> Can anyone recommend/advise the best way to do this, also what type of
> encryption should I be using for the credit card info?

The SIMPLEST way to do this is to charge their credit card with a
recurring charge when they sign up, and then just THROW AWAY their credit
card number.

Your credit card processing vendor then has to remember their credit card
number, not you.

You'll get a one-time transaction identification from the credit card
server that you can use to manage their account -- You can then use THAT
one-time transaction number to cancel their account, issue refunds, etc.
without remembering their credit card number at all.

You MIGHT even be able to set this recurring charge to not start until a
month later, so you're all set.  Given the sheer number of sites and
services that have a free trial period, it's very very very likely that
the credit card vendors are already all set up to handle this for you.

If not, you can almost for sure set the recurring charge, then reverse out
the first month's transaction, leaving the rest intact, so they get their
free month.

You do *NOT* want to store their credit card info *ANYWHERE* at all,
period, if you can avoid it.

For sure, you do *NOT* store it in a text file on that server, and
probably not even in a text file on some other server.

If you absolutely MUST store their credit card info, re-post again,
explaning WHY, and you'll get some advice.

Be warned that that advice will probably involve buying more computer
hardware, and hours and hours of setup, as well as a physically secure
location, and an independent audit by a security expert, and ...  Let's
just say "Lots of time and money"

Go read the credit card vendor's manual -- I'm willing to bet you can have
a solution in hours that doesn't involve you storing credit card numbers.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fopen, fsockopen on my virtual host

2005-01-31 Thread Al
Richard Lynch wrote:
Al wrote:
I've got a script that fetches a stream from a file on our virtual host.
Its
been working fine; but, yesterday they changed something and it no longer
works.

Can you define "no longer works" a bit more clearly...
Error messages?
Just times out?
What?

$fp= fsockopen("www.oursite.org", 80, $errno, $errstr, 30);
I can use any remote site and fscockopen works fine.
Anyone have a suggestion as to how I deal with this problem?

if ($errno){
  error_log("fsockopen errored out with # $errno: $errstr");
}
Here is my error report:
Warning: fsockopen(): unable to connect to www.restonrunners.org:80 in 
/www/r/reston/htdocs/phpList/PQ/PQutility.php on line 364
Operation timed out (60)
fsockopen() works fine with remote URLs and even "localhost"; but, not with our 
own URL.

I'd use "localhost" but, I need to attach some GET arguments and I can't figure 
out a way to do it. e.g.,

$str= file_get_contents(localhost?page=processqueue&login=Pmin&password=x)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Access

2005-01-31 Thread Richard Lynch
Robert Sossomon wrote:
> Anyone know of any classes or files for a way to write an Access readable
> file
> from PHP and MySQL?

http://php.net/fputcsv

As a special bonus, virtually EVERY database/spreadsheet program on the
planet will be able to read/import a file created with this with NO
hassle.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Hello

2005-01-31 Thread Mikey
> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: 30 January 2005 23:30
> To: php-general@lists.php.net
> Subject: [PHP] Re: Hello
> 
> Please answer quickly!

OK. No! :-)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fopen, fsockopen on my virtual host

2005-01-31 Thread Al
Richard Lynch wrote:
Al wrote:
I've got a script that fetches a stream from a file on our virtual host.
Its
been working fine; but, yesterday they changed something and it no longer
works.

Can you define "no longer works" a bit more clearly...
Error messages?
Just times out?
What?

$fp= fsockopen("www.oursite.org", 80, $errno, $errstr, 30);
I can use any remote site and fscockopen works fine.
Anyone have a suggestion as to how I deal with this problem?

if ($errno){
  error_log("fsockopen errored out with # $errno: $errstr");
}
Same, only a minor typo correction
Here is my error report:
Warning: fsockopen(): unable to connect to www.restonrunners.org:80 in 
/www/r/restonrunners/htdocs/phpList/PQ/PQutility.php on line 364
Operation timed out (60)
fsockopen() works fine with remote URLs and even "localhost"; but, not with 
our
own URL.
I'd use "localhost" but, I need to attach some GET arguments and I can't figure
out a way to do it. e.g.,
$str= file_get_contents(localhost?page=processqueue&login=Pmin&password=x)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Question about Safe Mode

2005-01-31 Thread Marek Kilimajer
Rick Root wrote:
I have a little home made CMS that writes files... on the server I've
recently installed this CMS on, those files get written as apache:apache 
...

that file uses include to include other files that are not owned by
"apache", and this doesn't work.
Warning: main(): SAFE MODE Restriction in effect. The script whose uid
is 48 is not allowed to access ./inc_pagecontent.php owned by uid 538 in
/home/virtual/site36/fst/var/www/html/test.php on line 3
So...  how do I work around this?  Can I get php to write the files so
they aren't owned by "apache" but rather thwn owner of the php script
that creates them?
You can use ftp php functions to upload the files from within your 
script to the desired location. They will be owned by whatever user you 
used to log in.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] cancel <41FE83F4.2020207@ridersite.org>

2005-01-31 Thread news
This message was cancelled from within Mozilla.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Hello

2005-01-31 Thread ztuni ztuni
On Mon, 31 Jan 2005 18:58:04 -, Mikey <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > Sent: 30 January 2005 23:30
> > To: php-general@lists.php.net
> > Subject: [PHP] Re: Hello
> >
> > Please answer quickly!
> 
> OK. No! :-)
> 

Really, I mean, what's up with that? Umm, *brings out calculator* 32?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fopen, fsockopen on my virtual host

2005-01-31 Thread Jochem Maas
Al wrote:
Richard Lynch wrote:
...
$str= 
file_get_contents(localhost?page=processqueue&login=Pmin&password=x)

$str = 
file_get_contents('http://localhost/?page=processqueue&login=Pmin&password=x');
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP 5 Compile error

2005-01-31 Thread Brian V Bonini
On Mon, 2005-01-31 at 12:56, Richard Lynch wrote:
> Brian V Bonini wrote:
> > %cat config.txt | tr -s "\n" " "
> > --enable-versioning --enable-memory-limit --with-layout=GNU
> > --with-zlib-dir=/usr --with-imap=/usr/local --disable-all
> > --with-regex=php --disable-cli --enable-ctype --with-gd
> > --enable-gd-native-ttf --with-freetype-dir=/usr/local
> > --with-jpeg-dir=/usr/local --with-png-dir=/usr/local
> > --with-mysql=/usr/local --enable-overload --with-pcre-regex=yes
> > --enable-posix --enable-session --enable-tokenizer
> > --with-expat-dir=/usr/local --enable-xml --with-zlib=yes
> > --with-apxs2=/usr/local/www/bin/apxs --prefix=/usr/local
> >
> > /usr/src/php5-STABLE-200501311330/ext/gd/gd.c: In function `zm_info_gd':
> > /usr/src/php5-STABLE-200501311330/ext/gd/gd.c:504: `FREETYPE_MAJOR'
> 
> WILD GUESS
> 
> You've asked for a bunch of TTF-related stuff, but didn't ask for TTF
> itself...
> 
> Or don't have FreeType installed, or, at least, not where configure can
> FIND it.

Something to do with having both freetype and freetype2 on the same
machine. In this case it looks to freetype/ rather than freetype2/. Was
able to circumvent by moving the freetype dir.



-- 

s/:-[(/]/:-)/g


BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fopen, fsockopen on my virtual host

2005-01-31 Thread Richard Lynch
Al wrote:
> Richard Lynch wrote:
>> Al wrote:
>>
>>>I've got a script that fetches a stream from a file on our virtual host.
>>>Its
>>>been working fine; but, yesterday they changed something and it no
>>> longer
>>>works.
>>
>> Can you define "no longer works" a bit more clearly...
>>
>> Error messages?
>>
>> Just times out?
>>
>> What?
>>
>>>$fp= fsockopen("www.oursite.org", 80, $errno, $errstr, 30);
>>>
>>>I can use any remote site and fscockopen works fine.
>>>
>>>Anyone have a suggestion as to how I deal with this problem?
>>
>>
>> if ($errno){
>>   error_log("fsockopen errored out with # $errno: $errstr");
>> }
>>
>
> Here is my error report:
>
>> Warning: fsockopen(): unable to connect to www.restonrunners.org:80 in
>> /www/r/reston/htdocs/phpList/PQ/PQutility.php on line 364
>> Operation timed out (60)
>
> fsockopen() works fine with remote URLs and even "localhost"; but, not
> with our
> own URL.
>
> I'd use "localhost" but, I need to attach some GET arguments and I can't
> figure
> out a way to do it. e.g.,
>
> $str=
> file_get_contents(localhost?page=processqueue&login=Pmin&password=x)

Put some quotes on that, and http:// on the front, and it should work as-is.

Your own domain not working is a symptom of something else though...

Can you ping restonrunners.org?

What happens if you try to do this in a shell:
telnet restonrunners.org 80
GET / HTTP/1.0
Host: restonrunners.org


Hit 'return' twice after the 'Host:' line.

You should get your homepage.

You may have some firewall mis-configured, or DNS issues, or /etc/hosts
might be messed up or...

Many things *could* be wrong to cause this, but none of them are really
PHP-related.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] upload file size limit

2005-01-31 Thread Robert Sossomon
Look in /etc/httpd/conf.d/php.conf
For a buddy with a file upload need I set it to this:

SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 760217600

You will need to set your upload limit higher in this file for it to work 
correctly.
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Looking for ideas on scheduling

2005-01-31 Thread Chris W. Parker
Marek Kilimajer 
on Saturday, January 29, 2005 12:05 PM said:

> What about option 3:
> 
> Use at command to execute php script when the next event should be
> executed. This php script will execute this task and then set itself
> to execute at the time of the next event.

That sounds like a good idea. I'm not familiar with the 'at' command so
I'll have to read more about it. Thanks!


Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP Security Consortium

2005-01-31 Thread Chris W. Parker
Chris Shiflett 
on Sunday, January 30, 2005 10:19 PM said:

> The PHP Security Consortium has officially launched. The following is
> the press release:

Oooh cool! This looks to be a great resource. Keep up the good work
Chris.



Another,
Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file upload error

2005-01-31 Thread Marek Kilimajer
Tom wrote:
Hi
I have a very simple file upload form and script to handle it (copied 
verbatim from the php manual, except for the file target location and 
the script name).
However, it always fails, with an error code in the _FILE array or 6.
Does anyone know what this error is or what I am likely to have set 
wrong? All that I can find in the docs are errors from 0 to 4 :-(
It's there:
http://sk.php.net/manual/en/features.file-upload.errors.php
UPLOAD_ERR_NO_TMP_DIR
Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and 
PHP 5.0.3.

Note: These became PHP constants in PHP 4.3.0.
Set the correct upload_tmp_dir in php.ini and restart webserver
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Uploaded File by Form is mysteriously away.

2005-01-31 Thread Mirco Blitz
Hi,

I'm trying to upload a pic file by form (Using QuickForm, but this here also
happens in manually generates Forms).

Everything seems to work fine. 

The $_FILES["formfile"] shows everything about the file what is needed to
know.

For example: Array ( [formfile] => Array ( [name] => lindworm.jpg [type] =>
image/pjpeg [tmp_name] => /srv/www/htdocs/tmp/phpTLREuE [error] => 0 [size]
=> 15101 ) )

 

With this information I now try to make
move_uploaded_file($_FILE["formfile"],
"/srv/www/htdocs/img/".$_FILE["formfile"]["name"]) .

This also seem to work, because it gives no error back.

 

Both directories are writeable by php. I also use this dirs on other Sites
to generate file inside.

 

But and that's the problem. The File does not appear in TMP-DIR and not at
Destination dir. It is just nowhere.

 

I am Using php-4.3.4 and Apache 2 on SuSE9.1.

Fileupload is active in php.ini and phpinfo(); tells me the same.

 

Has anybody an Idea please what also could be wrong.

 

Greetings

Mirco Blitz



Re: [PHP] Uploaded File by Form is mysteriously away.

2005-01-31 Thread Marek Kilimajer
Mirco Blitz wrote:
Hi,
I'm trying to upload a pic file by form (Using QuickForm, but this here also
happens in manually generates Forms).
Everything seems to work fine. 

The $_FILES["formfile"] shows everything about the file what is needed to
know.
For example: Array ( [formfile] => Array ( [name] => lindworm.jpg [type] =>
image/pjpeg [tmp_name] => /srv/www/htdocs/tmp/phpTLREuE [error] => 0 [size]
=> 15101 ) )
 

With this information I now try to make
move_uploaded_file($_FILE["formfile"],
"/srv/www/htdocs/img/".$_FILE["formfile"]["name"]) .
move_uploaded_file($_FILE["formfile"]['tmp_name'], ...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


AW: [PHP] Uploaded File by Form is mysteriously away.

2005-01-31 Thread Mirco Blitz
Oh sorry, that move_uploaded_file is surely used with
FILE["formfile"]['tmp_name'] 
That was an error in Mail Typing.

Problem still exists.

Mirco Blitz

-Ursprüngliche Nachricht-
Von: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 1. Februar 2005 00:12
An: Mirco Blitz
Cc: php-general@lists.php.net
Betreff: Re: [PHP] Uploaded File by Form is mysteriously away.

Mirco Blitz wrote:
> Hi,
> 
> I'm trying to upload a pic file by form (Using QuickForm, but this here
also
> happens in manually generates Forms).
> 
> Everything seems to work fine. 
> 
> The $_FILES["formfile"] shows everything about the file what is needed to
> know.
> 
> For example: Array ( [formfile] => Array ( [name] => lindworm.jpg [type]
=>
> image/pjpeg [tmp_name] => /srv/www/htdocs/tmp/phpTLREuE [error] => 0
[size]
> => 15101 ) )
> 
>  
> 
> With this information I now try to make
> move_uploaded_file($_FILE["formfile"],
> "/srv/www/htdocs/img/".$_FILE["formfile"]["name"]) .

move_uploaded_file($_FILE["formfile"]['tmp_name'], ..

> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] simple question

2005-01-31 Thread Pagongski

I have this function:

function supscript($texto)
{
   print("".$texto."");
}

But when i do:

print "2".supscript("3");

I get the "3" before the "2", how is that posible?

And:

print(supscript("3")."2");

makes the 2 appear before the 3.
I am confused!

Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] simple question

2005-01-31 Thread Robby Russell
On Tue, 2005-02-01 at 01:41 +, Pagongski wrote:
> I have this function:
> 
> function supscript($texto)
> {
>print("".$texto."");
> }
> 
> But when i do:
> 
>   print "2".supscript("3");
> 
>   I get the "3" before the "2", how is that posible?
> 
> And:
> 
>   print(supscript("3")."2");
> 
>   makes the 2 appear before the 3.
>   I am confused!
> 
>   Thanks
> 

probably because it calls the function before it calls the main print.

try return instead of print.

example:

function supScript($txt)
{
  return "{$txt}";
}

print "2" . supScript("3");

You shouldn't print a function that prints.. ;-)

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting PostgreSQL 8.0! ---
/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] simple question

2005-01-31 Thread Jason Wong
On Tuesday 01 February 2005 09:41, Pagongski wrote:

Please use a *descriptive* subject.

> I have this function:
>
> function supscript($texto)
> {
>print("".$texto."");
> }
>
> But when i do:
>
>  print "2".supscript("3");
>
>  I get the "3" before the "2", how is that posible?
>
> And:
>
>  print(supscript("3")."2");
>
>  makes the 2 appear before the 3.
>  I am confused!

You're trying to use the function supscript() as though it returned a value, 
it doesn't, it just prints something out directly.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] simple question

2005-01-31 Thread Pagongski


Thank you so much, it was really stupid of me, basic mistake. I solved 
it differently, although your solution is miles away better than mine.
Heres what i did:

function supscript($texto)
{
global $supa;
$supa = "".$texto."";
}
supscript("3");
print ("2".$supa);

Complicated little thing, eh?
Thanks :-)

Pag

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Displaying a html line as html

2005-01-31 Thread Justin French
On 01/02/2005, at 1:05 PM, Todd Cary wrote:
I have the following:
$p = http://209.204.172.137/casesearch/php/home.php";>Home
try
$p = 'http://209.204.172.137/casesearch/php/home.php";>Home';
echo $p;

---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development & Graphic Design
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Displaying a html line as html

2005-01-31 Thread Jeffery Fernandez
Todd Cary wrote:
I have the following:
$p = http://209.204.172.137/casesearch/php/home.php";>Home
However, when I have
print($p); or
echo $p;
the result page does not display as a link; just as the text above.
What have I missed?
Todd
try:
http://209.204.172.137/casesearch/php/home.php";>Home';
echo $p;
?>
cheers,
Jeffery
http://melbourne.ug.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] simple question

2005-01-31 Thread John Holmes
Pagongski wrote:
I have this function:
function supscript($texto)
{
   print("".$texto."");
}
But when i do:
print "2".supscript("3");
	I get the "3" before the "2", how is that posible?
Your function should return the value, not print it. The way you have it 
now, the function must be ran before the original string can be printed. 
That's why you see the 3 before the 2.

function supscript($texto)
{ return "{$texto}"; }
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] simple question

2005-01-31 Thread Robert Cummings
On Mon, 2005-01-31 at 20:41, Pagongski wrote:
> I have this function:
> 
> function supscript($texto)
> {
>print("".$texto."");
> }
> 
> But when i do:
> 
>   print "2".supscript("3");
> 
>   I get the "3" before the "2", how is that posible?
> 
> And:
> 
>   print(supscript("3")."2");
> 
>   makes the 2 appear before the 3.
>   I am confused!

Your second example does not print the 2 before the 3. And the reason
your first example prints the 3 before the 2 is because the the print
inside the function prints first because the print that contains the
call to it can't print until it receives the return value form the
function. What you probably want is the following:

function supscript($texto)
{
   return "".$texto."";
}

print "2".supscript("3");

-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] best flow for this project

2005-01-31 Thread Dustin Krysak
ok, i have a project where:
-a user adds their email address, name, etc to a database.
-a responder sends an email to them to confirm their email address 
(within 72 hrs).
-upon confirmation of their email address, a script will generate a 
store coupon with a random coupon id # in the browser (which they can 
print at that time).

Now I guess my question relates more to the email confirmation. How 
would you go about this? Store it in a database? Every-time the script 
is run it also checks to see which requests are more than 72 hrs old 
and removes their request from the database? And those that are 
confirmed, a flag is added to the database so they are not removed?

Just looking more for ideas on the script flow to accomplish this.
Thanks!
Dustin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] SSH system command problem

2005-01-31 Thread Curt Zirzow
* Thus wrote Linn Fagerberg:
> Hi,
> 
> I am trying to use a php system command to run a script and access files
> from another server using SSH. This does not seem to work in PHP or else I
> am doing it wrong because I keep on getting the system return value=255 when
> I do 
> 
>  
> 
> system("/usr/bin/ssh 10.0.0.1", $value)
> 
>  
> 
> I tried to do a "ssh -help" command to see if the reason it did not work was
> that there was a problem with the server, but that did not give me a correct
> return value either, so I am starting to suspect that ssh is different from
> other system commands in php?

If you just do something like:

  ssh hostname

Then ssh will try and establish a terminal connection. If you're
trying to do a command of some sort it will be:

  ssh hostname command


Then of course you'll need to somehow authenticate.. you can google
'man ssh' to find out how to use ssh if you don't have shell access
to the machine.

> 
> Is it possible to run ssh using php system command or do I have to try
> something else? I found a new php library called ssh2 but I don't know if
> that could be the solution to my problem? Have anyone used it?

Yes, there is a ssh2 library available for php, it is currently in
beta release, but from my experience it is quite stable to use.

PECL Extension:
http://pecl.php.net/ssh2

Documentation:
http://php.net/ssh2


HTH,

Curt
-- 
Quoth the Raven, "Nevermore."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Autoflush

2005-01-31 Thread Wudi
Sorry, I still don't know how to attain it.
Could you give a sample?

PS: See http://wudicgi.spymac.net/pt/pt_autoflush.gif

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] upload file size limit

2005-01-31 Thread badlya badlu
thanks bobert. I have done it. thanks...


--- Robert Sossomon <[EMAIL PROTECTED]> wrote:

> Look in /etc/httpd/conf.d/php.conf
> 
> For a buddy with a file upload need I set it to
> this:
> 
> 
>  SetOutputFilter PHP
>  SetInputFilter PHP
>  LimitRequestBody 760217600
> 
> 
> 
> You will need to set your upload limit higher in
> this file for it to work correctly.
> 
> Robert
> -- 
> Robert Sossomon, Business and Technology Application
> Technician
> 4-H Youth Development Department
> 200 Ricks Hall, Campus Box 7606
> N.C. State University
> Raleigh NC 27695-7606
> Phone: 919/515-8474
> Fax:   919/515-7812
> [EMAIL PROTECTED]
> 
> 




__ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] inserting utf8 from PHP to MySQL makes text unreadable

2005-01-31 Thread Dave
PHP General,
   The Situation:
   I am creating a form for users to enter text into a MySQL 3.23 
database. The text is often in Japanese, encoded in utf-8 format.

   The Problem:
   When the utf-8 encoded text is inserted into the database, it 
becomes random ASCII gibberish.

   What I've Tried So Far:
   I've noticed that it is possible to save utf-8 encoded text in the 
database. When I insert Japanese text into the database using 
phpMyAdmin, it stores okay, and I can access the text via PHP for 
placement on web pages. So my speculation is that there is something 
wrong with my script.
   My search on the web for information has turned up indication that 
it should be possible to simply store utf-8 text without the need for 
modifications. Some places suggest that it might be best to store the 
Japanese text as binary. But since I can enter utf-8 text into fields 
and store them as text successfully in phpMyAdmin, I am sure there must 
be a way for getting around binary storage. I'd like to avoid binary 
storage if possible, for a variety of reasons.

   The Question:
   How can I preserve the text so that it does not become garbled when 
written to the database?

   For Reference:
   Here is the form and the PHP script that it accesses. $showData is 
obtained by querying the database and seeing what is already stored there.


English (256 characters)

(Japanese)(256 Characters)



if (isset ($HTTP_POST_VARS['introE']) || isset ($HTTP_POST_VARS['introJ']))
{
$updateQuery = "UPDATE events SET introE='" . $HTTP_POST_VARS['introE'] 
. "', introJ='" . $HTTP_POST_VARS['introJ'] . "' WHERE eventid = " . $show;
$updateResult = mysql_query($updateQuery);
}
?>


   Any help much appreciated.
--
Dave Gutteridge
[EMAIL PROTECTED]
Tokyo Comedy Store
http://www.tokyocomedy.com/english/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php