Re: [PHP] How to send POST info without a form?

2002-10-03 Thread Philippe Saladin

 How can I submit POST information to a php file without using an HTML
form?

You would try this function (from  Rasmus Lerdorf)

function PostToHost($host, $path, $data_to_send) {
 $fp = fsockopen($host,80);
 fputs($fp, POST $path HTTP/1.1\n);
 fputs($fp, Host: $host\n);
 fputs($fp, Content-type: application/x-www-form-urlencoded\n);
 fputs($fp, Content-length: .strlen($data_to_send).\n);
 fputs($fp, Connection: close\n\n);
 fputs($fp, $data_to_send);
 while(!feof($fp)) {
   echo fgets($fp, 128);
 }
 fclose($fp);
}

with $data_to_send = formfield1=myfieldvalue1formfield2=myfieldvalue2;

Regards,
Philippe



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




[PHP] MySQL Problem

2002-10-03 Thread OrangeHairedBoy

Hi everyone! I can't figure out why this doesn't work. The call to the
CONNECT function works and it connects with no problem, and it does save the
Resource ID in $this-DBLink[]...however, when CHOOSEDB is called, the
Resource ID just saved is gone. $this-DBLink is just empty, and I can't
figure out why...

Can anyone offer insight on this one?

class MySQL
 {
 var $DBLink = array();
 function CONNECT ( $MyVars , $MyContents )
  {
  $host = ( $MyVars[PORT] ) ? $MyVars[HOST] . : . $MyVars[PORT] :
$MyVars[HOST];
  $this-DBLink[$MyVars[NAME]] = mysql_connect( $MyVars[HOST] ,
$MyVars[USERNAME] , $MyVars[PASSWORD] );
  }
 function CHOOSEDB ( $MyVars , $MyContents )
  {
  mysql_select_db( $MyVars[DATABASE] , $this-DBLink[$MyVars[LINK]] );
  }
 }


Thanks!


Lewis



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




[PHP] -=-=-=- PHP help about Java SSL -=-=-=-=-

2002-10-03 Thread EMIN CALIKLI


Hi ,
I 'm using RedHat 7.2 +Apache 1.3.20 + Java 1.4.0 + PHP 4.2.1 (compiled with Java 
support) . I
configured php for using Java. I wrote some Java code which uses SSL certificate . I 
can run my code
from CLI (Command Line Interface) and it works fine but when I try to run from browser 
it returns
error code. Did anyone have some trick about this situation (Apache+PHP+Java+SSL).
Sincerely.

Emin CALIKLI


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




[PHP] Re: MySQL Problem

2002-10-03 Thread OrangeHairedBoy

You know...maybe I should mention where this code is...

I have my main file which loads using 'require.once' a second file called
'everything.php'.

Inside everything.php is a class called 'mainclass' which is called by the
mail file.

This class ('mainclass') loads the MySQL class from the previous post which
is stored in yet another file, using require.once.

MainClass then calls the MySQL-CONNECT and MySQL-CHOOSEDB functions.

I know this sounds a bit over the top, but it works...at least it
did...until now. I thought I'd mention the circumstances in case that makes
a difference, which I suspect it will.

Thanks again!

Lewis

Orangehairedboy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everyone! I can't figure out why this doesn't work. The call to the
 CONNECT function works and it connects with no problem, and it does save
the
 Resource ID in $this-DBLink[]...however, when CHOOSEDB is called, the
 Resource ID just saved is gone. $this-DBLink is just empty, and I can't
 figure out why...

 Can anyone offer insight on this one?

 class MySQL
  {
  var $DBLink = array();
  function CONNECT ( $MyVars , $MyContents )
   {
   $host = ( $MyVars[PORT] ) ? $MyVars[HOST] . : . $MyVars[PORT] :
 $MyVars[HOST];
   $this-DBLink[$MyVars[NAME]] = mysql_connect( $MyVars[HOST] ,
 $MyVars[USERNAME] , $MyVars[PASSWORD] );
   }
  function CHOOSEDB ( $MyVars , $MyContents )
   {
   mysql_select_db( $MyVars[DATABASE] , $this-DBLink[$MyVars[LINK]] );
   }
  }


 Thanks!


 Lewis





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




[PHP] Re: counting number of records in a MySQL table; how do I get the result?

2002-10-03 Thread OrangeHairedBoy

Hi!

$result=mysql_query(select count(*) as count from AuthNum);
$a_row=mysql_fetch_object($result);
$NumberOfRows=$a_row-count;

if ($NumberOfRows)
{
/* There is at least one row */
}
else
{
/* There are no rows */
}

Hope this helps (especially the as count part in the query)

::Lewis

Donpro [EMAIL PROTECTED] wrote in message
073901c26a53$44fdaaa0$[EMAIL PROTECTED]">news:073901c26a53$44fdaaa0$[EMAIL PROTECTED]...
 Hi,

 I need to do either an insert or update into a MySQL table.  Insert if
there
 are 0 records or update if one record exist:

 This is my code snippet:

 if (mysql_query(SELECT COUNT(*) FROM AuthNum) == 0) {
mysql_query(INSERT into AuthNum (FirstNum, LastNum, NextNum) VALUES
 (1,2,3),$dblink);
 } else {
mysql_query(Update AuthNum Set FirstNum = 1, LastNum = 2, NextNum =
 3,$dbLink);
 }

 My problem is, a record never gets inserted because the SELECT COUNT query
 is returning a resource ID of 2.  How can I get the actual number of
records
 in the table?

 Thanks,
 Don





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




[PHP] Re: MORE Problems with PHP as CGI and Flash !!!!!!!!!!

2002-10-03 Thread Brian McGarvie

Yes... get him to download the latest plug-in, IE 5.0 to IE 5.5 even are
weired with dynamic content even it it's a form built up from php...

Neway... I suggest that he should upgrade the flash plug-in and/or IE.

Rebekah Garner [EMAIL PROTECTED] wrote in message
002901c26a54$513462e0$0300a8c0@vader">news:002901c26a54$513462e0$0300a8c0@vader...
Here is the URL to a project that is far as I am concerned was finished.
http://www.overbrookfarm.myiglou.com

It is a Flash site that uses PHP for dynamically updating text in some text
fields.
If I can direct you to the Stallions menu---pick a horse.
A page should load that has a picture of a horse on the left hand side and a
green box on the right.  The box on the right is dynamic text field.  There
should already be text inside of it.

I see it.  My 4 other PCs see it.  About 5 people on this list  can see it.
A dozen of my friends can see it. The guy at tech support for where this is
being hosted can see it.  My client can't see it on his PC running IE5, but
can see it on his Mac.  His girlfriend can't see it, but one of his friends
can.

We had a fully working version up on a host that ran the PHP from Apache and
everyone can see it.  The site (and scripts) are now on a  server that runs
the PHP  as CGI.   It boggles the mind.  Has anyone EVER heard of such a
thing??  Are there security settings on the browser that won't let a CGI
script execute, even from Flash??  Already made him clear his cache.  Any
ideas?

Rebekah Garner




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




Re: [PHP] no errors ?

2002-10-03 Thread gamin

Yes,

   Short tags should be On, cause

?
phpinfo();
?

results in the exptected page.

Still unable to understand why this is happening, here are some of the
following code snippets with the errors:

?php
somejunk;
somemorejunk;
anotherlineofjunk;
?

NO ERROR REPORTED FROM PHP

[results in the Apache/access.log] 127.0.0.1 - - [03/Oct/2002:13:33:49
+0530] GET /real/1.php HTTP/1.1 200 5
---
?php
somejunk;
somemorejunk;
anotherlineofjunk;
?

Parse error: parse error, unexpected T_STRING in c:\program files\apache
group\apache\htdocs\real\1.php on line 2

[results in the Apache/access..log]  127.0.0.1 - - [03/Oct/2002:13:36:08
+0530] GET /real/1.php HTTP/1.1 200 161
---
I hope this provides enough information to  someone who can tell what is
going wrong.

thx

gamin.




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




Re: [PHP] Re: MySQL Problem

2002-10-03 Thread Tom Rogers

Hi,

Thursday, October 3, 2002, 6:01:53 PM, you wrote:
O You know...maybe I should mention where this code is...

O I have my main file which loads using 'require.once' a second file called
O 'everything.php'.

O Inside everything.php is a class called 'mainclass' which is called by the
O mail file.

O This class ('mainclass') loads the MySQL class from the previous post which
O is stored in yet another file, using require.once.

O MainClass then calls the MySQL-CONNECT and MySQL-CHOOSEDB functions.

O I know this sounds a bit over the top, but it works...at least it
O did...until now. I thought I'd mention the circumstances in case that makes
O a difference, which I suspect it will.

O Thanks again!

O Lewis

O Orangehairedboy [EMAIL PROTECTED] wrote in message
O [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everyone! I can't figure out why this doesn't work. The call to the
 CONNECT function works and it connects with no problem, and it does save
O the
 Resource ID in $this-DBLink[]...however, when CHOOSEDB is called, the
 Resource ID just saved is gone. $this-DBLink is just empty, and I can't
 figure out why...

 Can anyone offer insight on this one?

 class MySQL
  {
  var $DBLink = array();
  function CONNECT ( $MyVars , $MyContents )
   {
   $host = ( $MyVars[PORT] ) ? $MyVars[HOST] . : . $MyVars[PORT] :
 $MyVars[HOST];
   $this-DBLink[$MyVars[NAME]] = mysql_connect( $MyVars[HOST] ,
 $MyVars[USERNAME] , $MyVars[PASSWORD] );
   }
  function CHOOSEDB ( $MyVars , $MyContents )
   {
   mysql_select_db( $MyVars[DATABASE] , $this-DBLink[$MyVars[LINK]] );
   }
  }


 Thanks!


 Lewis



Looks like you change the name of the index from NAME to LINK
and it should be  $this-DBLink[$MyVars['LINK']]

-- 
regards,
Tom


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




Re: [PHP] Re: MySQL Problem

2002-10-03 Thread OrangeHairedBoy

I thought someone might mention that, but that is actually correct.

The problem is that the variable assigned on the line
$this-DBLink[$MyVars[NAME]] = mysql_connect( $MyVars[HOST] ,
$MyVars[USERNAME] , $MyVars[PASSWORD] ); dissapears and can't be retreived
on the line mysql_select_db( $MyVars[DATABASE] ,
$this-DBLink[$MyVars[LINK]] );.

For instance, if the first line saves $this-DBLink[TEST], when CHOOSEDB
is called, the command PRINT $this-DBLink[TEST] will print nothing when
the same line right after the variable is saved would produce something like
Resource ID #38.

That's the brain twister.

Thanks though!


::Lewis

Tom Rogers [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Thursday, October 3, 2002, 6:01:53 PM, you wrote:
 O You know...maybe I should mention where this code is...

 O I have my main file which loads using 'require.once' a second file
called
 O 'everything.php'.

 O Inside everything.php is a class called 'mainclass' which is called by
the
 O mail file.

 O This class ('mainclass') loads the MySQL class from the previous post
which
 O is stored in yet another file, using require.once.

 O MainClass then calls the MySQL-CONNECT and MySQL-CHOOSEDB functions.

 O I know this sounds a bit over the top, but it works...at least it
 O did...until now. I thought I'd mention the circumstances in case that
makes
 O a difference, which I suspect it will.

 O Thanks again!

 O Lewis

 O Orangehairedboy [EMAIL PROTECTED] wrote in message
 O [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi everyone! I can't figure out why this doesn't work. The call to the
  CONNECT function works and it connects with no problem, and it does
save
 O the
  Resource ID in $this-DBLink[]...however, when CHOOSEDB is called, the
  Resource ID just saved is gone. $this-DBLink is just empty, and I
can't
  figure out why...
 
  Can anyone offer insight on this one?
 
  class MySQL
   {
   var $DBLink = array();
   function CONNECT ( $MyVars , $MyContents )
{
$host = ( $MyVars[PORT] ) ? $MyVars[HOST] . : . $MyVars[PORT] :
  $MyVars[HOST];
$this-DBLink[$MyVars[NAME]] = mysql_connect( $MyVars[HOST] ,
  $MyVars[USERNAME] , $MyVars[PASSWORD] );
}
   function CHOOSEDB ( $MyVars , $MyContents )
{
mysql_select_db( $MyVars[DATABASE] , $this-DBLink[$MyVars[LINK]] );
}
   }
 
 
  Thanks!
 
 
  Lewis
 
 

 Looks like you change the name of the index from NAME to LINK
 and it should be  $this-DBLink[$MyVars['LINK']]

 --
 regards,
 Tom




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




Re: [PHP] using fopen() to download remote files

2002-10-03 Thread Marek Kilimajer

The server never sends you somethink you don't request. Simply get the 
page and there will be no images. If you would want to do the oposite 
you would have much more trouble.

Rusty Small wrote:

I have written a script in which the main purpose is to download html pages
from multiple web servers.  I'm using the fopen() function to download these
pages.  I would like to be able to download only the source (text) and no
binary data as this would greatly improve the speed of my script.

I've seen this on the client side with browsers being set to text only mode.
Is there a way to do this with php on the sever side to tell the remote web
server to not download the images associated a particular URL?  I'm running
Red Hat 7.3 and Apache web server.

Any help would be greatly appreciated.

Cliff



  



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




Re: [PHP] How do you strip Header Info from displaying on your browser?

2002-10-03 Thread Marek Kilimajer

Throw out everything untill you get second empty line

Phil Powell wrote:

If you go to http://valsignalandet.com/feedback.php you can get a clearer indication 
of what I am trying to get rid of.  Following is my function using to produce the 
stuff up there, which I don't want, instead, I either want cookie-driven information 
or nothing (if no cookie is set):

function WebGet($address, $port = 80, $url = '/', $post = false, $cookie = false) {
   // Use fsockopen to catch the URL 
   $fp = fsockopen ( $address, $port);

   // Zero Fill 
   $ret = '';

   if ($fp) {
  // Success.  Now check to see the type of request 
  if ($post) {
 $request = POST $url HTTP/1.1\n;
 $request .= Host: $address\n;
 $request .= Content-Length:  . strlen( $post ). \n;
 $request .= Content-Type: application/x-www-form-urlencoded\n;

 if ($cookie) $request .= Cookie: $cookie\n;

 $request .= Connection: Close\n\n;
 $request .= $post;
  } else {
 $request = GET $url HTTP/1.1\n;
 $request .= Host: $address\n;
 $request .= Content-Type: text/html\n;

 if ($cookie) $request .= Cookie: $cookie\n;

 $request .= Connection: Close\n\n;
  }

  $ret = '';

  // Write the Request 
  fputs ($fp, $request);

  // Get the response 
  while (!feof($fp)) $ret .= fgets ( $fp, 128 );

  // close the connection 
  fclose ($fp);
   }

   return $ret;

 }

I do not want to change WebGet as I wish to keep it a universal function that can be 
used for cookies or not.

So, how can I get rid of the trash on my page?

Thanx
Phil

  



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




[PHP] Re: MySQL Problem

2002-10-03 Thread OrangeHairedBoy

Here's a simplier version...and I'm still having a problem with it. It's
driving me insane!!! :)

class MySQL
 {
 function SET ( )
  {
  $this-MYVAR = Hello World!;
  }
 function RETREIVE ( )
  {
  print $this-MYVAR;
  }
 }
$helpme = new MySQL;
$helpme-SET;
$helpme-RETREIVE; /* Prints NOTHING */





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




[PHP] Re: Trouble with understanding arrays

2002-10-03 Thread OrangeHairedBoy

Why don't you just wright your own little debug thing?

foreach ($TickersCurrent as $Ticker=$Value)
{
print $Ticker - $Valuebr\n;
}

::Lewis


Christopher J. Crane [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am having problems with arrays. I guess I just don't understand them all
 that well.
 I have an simple array of stock tickers. Then for each ticker I go to
Yahoo
 to get their current price and try to push the Name of the ticker and it's
 value into an associative array(I think). Then I want to sort the array so
 the the values are in order from highest to lowest, so I can see the
highest
 amount as the first position and the lowest as the last position.

 Here is my problem; for debuggin purposes I do a print_r(array_values());
 and I get the following for output.
 Array
 (
 [0] = 7.28
 [1] = 5.20
 [2] = 1.969
 [3] = 59.63
 [4] = 4.43
 )

 I am not sure why I am getting this. I guess I expected the numerical
 positions to be the keys something like:
 Array
 (
 [ikn] = 7.28
 [xrx] = 5.20
 [danky] = 1.969
 [ibm] = 59.63
 [rhat] = 4.43
 )

 Since I am not getting the results I expected I am not sure if the rest is
 working correctly because I do not know how to access the first position
in
 the array, or the last. When I get this working, I will be adding 200
 tickers and I would like to get the first 5 and the last 5, expecting them
 to be the highest 5 and the lowest 5 respectively. I hope someone will
take
 the time to halp me.

 Thank you in advance.

 Here is the code I am working on:

 $Tickers = array(ikn, xrx, danky, ibm, rhat);
 $TickersCurrent = array();

  foreach($Tickers as $Ticker) {
$LookupUrl =
 http://finance.yahoo.com/d/quotes.csv?s=$Tickerf=l1e=.txt;;
$Current = implode('', file($LookupUrl));
$Current = rtrim($Current);
$TickersCurrent[$Ticker]=$Current;
}

 // Done for debuggin only
print pre\n;
print_r(array_values($TickersCurrent));
print /pre\n;


asort ($TickersCurrent);
reset ($TickersCurrent);

echo CTC Indice =  . array_sum($TickersCurrent) . br\n;

echo The highest Stock is $TickersCurrent[0];








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




[PHP] Export email addresses from Outlook Express with PHP

2002-10-03 Thread Arnaud Castéran

Do you think it is possible to export email addresses from Outook Express
with PHP.
I looking for a script using COM but i only found exemples for MSOutlook.
What i want to do is an address book for each members of my site
(www.universemail.net  a directory of email addresses) : if they have
Outlook Express, the site connect to Outlook and export addresses to add
them in their address book

Thanks for your help

Arnaud Castéran




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




[PHP] newbie question

2002-10-03 Thread Remon Redika

I am newbie in php
I have var $query_string in my address page.
I want get value of query string.
For example I give string on my query string like 
www.mypages.com?var=numberx
I just want get a value of var or numberx
I usually do this var on asp
request.querystring(var) , so I'll get the value = numberx
how i do it on php...?
sorry about my English. 

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




RE: [PHP] newbie question

2002-10-03 Thread M.A.Bond

It depends on the version of PHP, in older versions you just use the
variable name ie in your example just use $var to access it's contents. In
new versions, with register globals turned off use $_GET['var'] to access it
ie:

Print $_GET['var']

Will print numberx

Thanks

Mark


-Original Message-
From: Remon Redika [mailto:[EMAIL PROTECTED]] 
Sent: 02 October 2002 12:24
To: [EMAIL PROTECTED]
Subject: [PHP] newbie question


I am newbie in php
I have var $query_string in my address page.
I want get value of query string.
For example I give string on my query string like 
www.mypages.com?var=numberx
I just want get a value of var or numberx
I usually do this var on asp
request.querystring(var) , so I'll get the value = numberx how i do it
on php...? sorry about my English. 

-- 
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




Re: [PHP] newbie question

2002-10-03 Thread Scott Houseman

This is very simple

To access variables from GET form, which you would use request.querystring( ) for in 
ASP,
use the $_GET array in PHP, e.g. $var = $_GET{'var'}
To access POST form values, which you would use request.form( ) for in ASP, use the 
$_POST
array in PHP e.g. $var = $_POST{'var'}.

Cheers!

Scott

On 10/2/2002 1:24 PM, Remon Redika wrote:
 I am newbie in php
 I have var $query_string in my address page.
 I want get value of query string.
 For example I give string on my query string like 
 www.mypages.com?var=numberx
 I just want get a value of var or numberx
 I usually do this var on asp
 request.querystring(var) , so I'll get the value = numberx
 how i do it on php...?
 sorry about my English.


-- 
////
// Scott Houseman //
// Jam Warehouse http://www.jamwarehouse.com/ //
// Smart Business Innovation  //
// +27 21 4477440 / +27 82 4918021//
////


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




Re: [PHP] Incrementing the value

2002-10-03 Thread Uma Shankari T.




Hello,

  
PNa href=Delay.php?hid=?php echo $_GET['hid']+1; ?img 
PNsrc=Gif/nextque.gif
PN border=0/a

 i have written code such that initially it will display the value 
correspond to the value 1..after every click it will increment the value 
2,3...so on..but now it is displaying the value 1 and for after each click 
again it is displaying 1 and 2...so on

I have intiallised the value for the variable as 

if(!$_GET['hid'])
$hid=1;

like that..Can anyone please tell me how to avoid displaying the value 1 
again..??

Regards,
Uma 


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




[PHP] RE: Incrementing the value

2002-10-03 Thread Tim Ward

I think you mean ++$hid, otherwise the value is inserted before it is
incremented,
and why not change to $_GET[hid] for future compatibility and just to make
sure.
Are there any scoping issues we don't know about, e.g. is this snippet
within a function?

Tim Ward
www.chessish.com

 -Original Message-
 From: Jason Young [mailto:[EMAIL PROTECTED]]
 Sent: 03 October 2002 05:15
 To: [EMAIL PROTECTED]
 Subject: Re: Incrementing the value 
 
 
 Try $hid++;
 
 This automatically increments by one, its just much easier to 
 deal with 
 than +1 .. besides, it wouldn't work on my Win32 platform, either.
 
 --Jason
 
 Uma Shankari T. wrote:
   Hello ,
  
   a href=Delay.php?hid=?php echo $hid+1; ?img 
 src=Gif/nextque.gif
   border=0/a
  
   While clicking this link the $hid value get incremented 
 and fetch the value
   from the database according to that..the same thing is 
 working in linux
   platform and it is not working for the windows 
 platform..the value is not
   getting increment..Can anyone please tell me how to go 
 about with this..??
  
   Regards,
   Uma
  
 
 

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




[PHP] Re: using fopen() to download remote files

2002-10-03 Thread gamin


Rusty Small [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have written a script in which the main purpose is to download html
pages
 from multiple web servers.  I'm using the fopen() function to download
these
 pages.  I would like to be able to download only the source (text) and no
 binary data as this would greatly improve the speed of my script.

 I've seen this on the client side with browsers being set to text only
mode.
 Is there a way to do this with php on the sever side to tell the remote
web
 server to not download the images associated a particular URL?  I'm
running
 Red Hat 7.3 and Apache web server.

 Any help would be greatly appreciated.

fopen() will open only the HTML document specified.

It does not open or download any of the images etc, not even external styles
etc.

HTH
gamin.



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




Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-03 Thread Debbie Dyer

I have just double checked my facts and in both Java and C++ you cannot
access members of an ordinary class without first instantiating the class.
In both cases the only way you can do so is if that class contains a member
specifically declared as being special ie a class member as opposed to an
instance member  specifically declared to be static.

PHP on the other hand will let you access any functions of any class without
instantiation.

Maybe this is because, as I said before, PHP has no concept of the different
class/var/method types usually associated with classes. This is all very
different to what I know and does (is) causing confusion.

Debbie

- Original Message -
From: Debbie Dyer [EMAIL PROTECTED]
To: Rasmus Lerdorf [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, October 02, 2002 11:41 PM
Subject: Re: [PHP] Inheritance and a class function: on what class was it
called?


 Without them being defined in some special way?

 I am very surprised that after 7 years of OOP I dont know that but I will
 check it out tomorrow.

 Debbie

 - Original Message -
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: Nick Eby [EMAIL PROTECTED]
 Cc: Debbie Dyer [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, October 02, 2002 11:28 PM
 Subject: Re: [PHP] Inheritance and a class function: on what class was it
 called?


  Since static method calls are completely disconnected from any class
  instance asking which class the method call is from is rather
meaningless,
  and no, I don't think there is any way to get that.
 
  -Rasmus
 
  On Wed, 2 Oct 2002, Nick Eby wrote:
 
   PHP allows static method calls...  But back to my original question...
   inside a method that has been called statically, can I determine for
 what
   class the method was called?  Again, obviously the question is only
   applicable if there is some inheritance involved, and the child class
 does
   not declare the method in question.  Below is my original example
 spelled
   out in code... the call to get_class is not valid since there won't be
a
   $this variable in the context of the static method...  Can I replace
it
 with
   something that will cause it to echo B?
  
   Class A {
   function staticFunc() { echo get_class($this); }
   }
  
   Class B extends A {}
  
   B::staticFunc();
  
   thanks again
   /nick
  
   - Original Message -
   From: Rasmus Lerdorf [EMAIL PROTECTED]
   To: Debbie Dyer [EMAIL PROTECTED]
   Cc: Nick Eby [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Wednesday, October 02, 2002 3:08 PM
   Subject: Re: [PHP] Inheritance and a class function: on what class was
 it
   called?
  
  
 The mistake is mine not yours. I know about the :: operator I use
it
 all
   the
 time (but within classes parent::function() etc) - but I never
 realised
 until now that PHP will let you use any class before instantiation
 (and
 nearly all my PHP work uses classes). I have never even attempted
to
 try
   it
 because in all other languages I know trying to use an ordinary
 class
   before
 instantiation will just result in a null pointer error or the
 equivalent
   of
 one.

 PHP OOP is different I know, one big example is that there is no
   provision
 for data encapsulation - one of the main objectives of OOP,
neither
 can
   you
 differentiate between types of classes/methods (which is probably
 what
   is
 causing the confusion).

 Now it seems it is even more different than I thought. All I can
say
 is
 mmhh...
   
Most OO languages allow static method calls.  C++, Java, Python,
Ruby,
etc.  PHP may have some OO differences, but this is not one of them.
   
-Rasmus
  
 
 


 --
 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] Thank's

2002-10-03 Thread Remon Redika

Okay, IC  thank's 
:) 

Scott Houseman writes: 

 This is very simple 
 
 To access variables from GET form, which you would use 
 request.querystring( ) for in ASP,
 use the $_GET array in PHP, e.g. $var = $_GET{'var'}
 To access POST form values, which you would use request.form( ) for in 
 ASP, use the $_POST
 array in PHP e.g. $var = $_POST{'var'}. 
 
 Cheers! 
 
 Scott 
 
 On 10/2/2002 1:24 PM, Remon Redika wrote:
 I am newbie in php
 I have var $query_string in my address page.
 I want get value of query string.
 For example I give string on my query string like 
 www.mypages.com?var=numberx
 I just want get a value of var or numberx
 I usually do this var on asp
 request.querystring(var) , so I'll get the value = numberx
 how i do it on php...?
 sorry about my English.
  
 
 -- 
 ////
 // Scott Houseman //
 // Jam Warehouse http://www.jamwarehouse.com/ //
 // Smart Business Innovation  //
 // +27 21 4477440 / +27 82 4918021//
 //// 
 
 

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




[PHP] mysql problem

2002-10-03 Thread BB

I seem to have a php-mysql problem on my new Sun Qube3 (RH Linux).
php works fine, mysql works fine, apache works fine, only the combination of
the three seems troublesome.
php does not recognize commands like mysql_connect()
when trying to start phpMyAdmin I get: cannot load MySQL extension
In my php.ini
extension_dir is set correctly
and I un-commented
extension=mysql.so
What more is there I could try?
Thank you.
Bert Bulder, Amsterdam NL



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




[PHP] Just cant figure out how this could be happening...

2002-10-03 Thread Owen Parker

hi all

have a really simple query:

$twowksworth = mysql_query(SELECT updates.MODELCODE, updates.SETNO,
updates.FRPICNO, updates.TOPICNO, updates.CPOSTDATE, updates.ZIPFILENAME,
updates.TOTPICS, models.MODELNAME FROM updates LEFT JOIN models ON
updates.MODELCODE = models.MODELCODE WHERE updates.CPOSTDATE = (
CURDATE() - 14 )AND updates.CPOSTDATE = CURDATE() ORDER BY
updates.CPOSTDATE  ) ;

When this was originally written it worked like a charm.  I purposefully
let it 'run out' of data by not adding any more to the table.  each day for
two weeks the list resulting from this query got shorter as expected.  The
day after there was no data, it started listing the entire contents of the
table.  What the...

So i added a few weeks worth of data and now it correctly cuts off at
today's dat but it completely ignores the curdate() - 14 portion and lists
the entire table up to today's date.

this is so basic i cant figure it out.  besides, it used to work.  what
gives?  I'm really new to php and mysql, but until now felt i had made good
progress in the past couple
weeks.  just cant figure out how to troubleshoot this error due to lack of
experience and knowledge.

is there something really basic i am missing here?  any pointers would be
greatly appreciated!!

tia

owen






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




Re: [PHP] Just cant figure out how this could be happening...

2002-10-03 Thread Chris Wesley

SELECT CURDATE() - 14 ... this isn't doing what you think it's doing.

The CURDATE() function returns a string like 2002-10-03.
Subtracting 14 from that gets you 20020989 as a result from MySQL.
Pretty useless, right?  If that ever worked for you, it was a total
coincidence.

Try this instead:
  SELECT DATE_SUB( CURDATE(), INTERVAL 14 DAY )
That will get you the date from 14 days ago.

See the MySQL manual for descriptions of the functions.
I'm sure that the MySQL site has references to MySQL mailing lists too, to
help with MySQL questions.

g.luck,
~Chris

On Thu, 3 Oct 2002, Owen Parker wrote:

 hi all

 have a really simple query:

 $twowksworth = mysql_query(SELECT updates.MODELCODE, updates.SETNO,
 updates.FRPICNO, updates.TOPICNO, updates.CPOSTDATE, updates.ZIPFILENAME,
 updates.TOTPICS, models.MODELNAME FROM updates LEFT JOIN models ON
 updates.MODELCODE = models.MODELCODE WHERE updates.CPOSTDATE = (
 CURDATE() - 14 )AND updates.CPOSTDATE = CURDATE() ORDER BY
 updates.CPOSTDATE  ) ;

 When this was originally written it worked like a charm.  I purposefully
 let it 'run out' of data by not adding any more to the table.  each day for
 two weeks the list resulting from this query got shorter as expected.  The
 day after there was no data, it started listing the entire contents of the
 table.  What the...

 So i added a few weeks worth of data and now it correctly cuts off at
 today's dat but it completely ignores the curdate() - 14 portion and lists
 the entire table up to today's date.

 this is so basic i cant figure it out.  besides, it used to work.  what
 gives?  I'm really new to php and mysql, but until now felt i had made good
 progress in the past couple
 weeks.  just cant figure out how to troubleshoot this error due to lack of
 experience and knowledge.

 is there something really basic i am missing here?  any pointers would be
 greatly appreciated!!

 tia

 owen






 --
 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




Re: [PHP] using fopen() to download remote files

2002-10-03 Thread Jason Wong

On Thursday 03 October 2002 15:00, Rusty Small wrote:
 I have written a script in which the main purpose is to download html pages
 from multiple web servers.  I'm using the fopen() function to download
 these pages.  I would like to be able to download only the source (text)
 and no binary data as this would greatly improve the speed of my script.

That is what fopen() does anyway ...

 I've seen this on the client side with browsers being set to text only
 mode. Is there a way to do this with php on the sever side to tell the
 remote web server to not download the images associated a particular URL? 

... in other words there's nothing that you need do to get this behaviour.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Iron Law of Distribution:
Them that has, gets.
*/


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




Re: [PHP] mysql problem

2002-10-03 Thread Marek Kilimajer

Look into the logs, they should be more verbose. How did you install the 
three.

BB wrote:

I seem to have a php-mysql problem on my new Sun Qube3 (RH Linux).
php works fine, mysql works fine, apache works fine, only the combination of
the three seems troublesome.
php does not recognize commands like mysql_connect()
when trying to start phpMyAdmin I get: cannot load MySQL extension
In my php.ini
extension_dir is set correctly
and I un-commented
extension=mysql.so
What more is there I could try?
Thank you.
Bert Bulder, Amsterdam NL



  



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




RE: [PHP] Re: MySQL Problem

2002-10-03 Thread Ford, Mike [LSS]

 -Original Message-
 From: OrangeHairedBoy [mailto:[EMAIL PROTECTED]]
 Sent: 03 October 2002 09:39
 
 Here's a simplier version...and I'm still having a problem 
 with it. It's
 driving me insane!!! :)
 
 class MySQL
  {
  function SET ( )
   {
   $this-MYVAR = Hello World!;
   }
  function RETREIVE ( )
   {
   print $this-MYVAR;
   }
  }
 $helpme = new MySQL;
 $helpme-SET;
 $helpme-RETREIVE; /* Prints NOTHING */

I'm pretty sure you have to add () on the end of those function names to get
PHP to actually *call* the function, so you need:

  $helpme-SET();
  $helpme-RETREIVE();

Without the parentheses, PHP evaluates the name of the function (returning
its handle), but then doesn't know what to do with it so just throws it
away on seeing the terminating semicolon.  As far as PHP is concerned, you
could quite legitimately want to do something entirely different with the
handle, such as assigning it to a variable -- PHP won't assume you want to
call it as a function just because it happens to be a function name.  For
instance, the following should work (I think! - although I haven't tested
it):

  $method = $helpme-SET;
  $method();

In fact, you can ask PHP to try and call anything as a function by appending
parentheses, so this should work too:

  $method = SET;
  $helpme-$method();


Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] MORE Problems with PHP as CGI and Flash !!!!!!!!!!

2002-10-03 Thread Jay Blanchard

[snip]
It is a Flash site that uses PHP for dynamically updating text in some text
fields.
If I can direct you to the Stallions menu---pick a horse.
A page should load that has a picture of a horse on the left hand side and a
green box on the right.  The box on the right is dynamic text field.  There
should already be text inside of it.

I see it.  My 4 other PCs see it.  About 5 people on this list  can see it.
A dozen of my friends can see it. The guy at tech support for where this is
being hosted can see it.  My client can't see it on his PC running IE5, but
can see it on his Mac.  His girlfriend can't see it, but one of his friends
can.

We had a fully working version up on a host that ran the PHP from Apache and
everyone can see it.  The site (and scripts) are now on a  server that runs
the PHP  as CGI.   It boggles the mind.  Has anyone EVER heard of such a
thing??  Are there security settings on the browser that won't let a CGI
script execute, even from Flash??  Already made him clear his cache.  Any
ideas?
[/snip]

Rebekah,

When I click link to go to the second index (using IE6, WinXP) at
http://www.overbrookfarm.myiglou.com/index2.html my browser hangs and I
never get the menus. However it all works fine in Mozilla 1.0 on the same
platform. (Beautifully done site by the way, but ignores AFAICS
accessibility, and folks with lower bandwidths. Have you thought about a
non-Flash version as well, to allow a choice? I am not anti-Flash, just
pro-accessibility.)

HTH!

Jay




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




RE: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread Jay Blanchard

[snip]
Or another way if you don't want a result when it's zero.
$rslt = mysql_query(SELECT count(*) as cnt FROM tbl having cnt  0);
[/snip]

$result = mysql_query(SELECT * FROM tbl);
$number_of_rows = mysql_num_rows($result);

You don't have to do the count in the SQL, as John said earlier a SELECT
COUNT(*) FROM tbl will always return one row, even if the value of the row
is 0. Of course you could always test for that.

CountingRows Solution #317 :^]

HTH!

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort  Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




Re: [PHP] Re: MySQL Problem

2002-10-03 Thread OrangeHairedBoy

Well, that's just a typo...of course there should be a () to make it call a
function...

The whole point to my postings is that I can't get the darn variable to stay
in place!!! Look where it says Prints NOTHING.

Does anyone know why it doesn't print Hello World???

::Lewis


Mike Ford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  -Original Message-
  From: OrangeHairedBoy [mailto:[EMAIL PROTECTED]]
  Sent: 03 October 2002 09:39
 
  Here's a simplier version...and I'm still having a problem
  with it. It's
  driving me insane!!! :)
 
  class MySQL
   {
   function SET ( )
{
$this-MYVAR = Hello World!;
}
   function RETREIVE ( )
{
print $this-MYVAR;
}
   }
  $helpme = new MySQL;
  $helpme-SET;
  $helpme-RETREIVE; /* Prints NOTHING */

 I'm pretty sure you have to add () on the end of those function names to
get
 PHP to actually *call* the function, so you need:

   $helpme-SET();
   $helpme-RETREIVE();

 Without the parentheses, PHP evaluates the name of the function (returning
 its handle), but then doesn't know what to do with it so just throws it
 away on seeing the terminating semicolon.  As far as PHP is concerned, you
 could quite legitimately want to do something entirely different with the
 handle, such as assigning it to a variable -- PHP won't assume you want to
 call it as a function just because it happens to be a function name.  For
 instance, the following should work (I think! - although I haven't tested
 it):

   $method = $helpme-SET;
   $method();

 In fact, you can ask PHP to try and call anything as a function by
appending
 parentheses, so this should work too:

   $method = SET;
   $helpme-$method();


 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211



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




[PHP] Two PHP questions

2002-10-03 Thread Liam . Gibbs

First of all, what exactly is get/set_magic_quotes_runtime? (I know what a
get/set function does, and I know what magic_quotes does, but I'm unclear
about what magic_quotes_runtime is as opposed to _gpc). Does it get the
magic_quotes setting at runtime, before anything has been
set_magic_quotes_runtime'd? I sort of get that it has to do with returning
slashes with quotes in a function as opposed to doing it when a function is
called. Any clarifications? The only comment on the PHP list says that it's
being turned off, so I guess it's not that important.

Secondly, is there any way of counting how long in pixels my page runs?
Basically, my situation is this: I want to know if my page runs more than a
screen and a half (or so... still deciding) of the user's screen so that I
can put a Go to Top link on the bottom if it's useful. Any ideas?

Thanks in advance!

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




[PHP] problem: readdir returns old (cached) directory listing

2002-10-03 Thread sergey

After calling unlink for a specific file in a directory on a Linux system,
the file is deleted but subsequent calls to readdir return
old directory listing until the script finishes. The next time
I execute the script, it does not list the deleted file.
But I need to reread directory just after calling unlink.
I couldn't find any information regarding this behavior of readdir.
I also tried clearstatcache() but without success.

Can anyone help?




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




Re: [PHP] Two PHP questions

2002-10-03 Thread Justin French

on 03/10/02 10:55 PM, [EMAIL PROTECTED]
([EMAIL PROTECTED]) wrote:

 Secondly, is there any way of counting how long in pixels my page runs?
 Basically, my situation is this: I want to know if my page runs more than a
 screen and a half (or so... still deciding) of the user's screen so that I
 can put a Go to Top link on the bottom if it's useful. Any ideas?

U, it's too hard to tell -- if not impossible!!  There are too many
variables... font size, leading, etc etc to calculate how long your page
will be and then you'd have to get information back about screen
size/resolution from javascript (yuk).

Perhaps you could do it in a simpler way, based on the length of the main
body of content... in the case of an article/tutorial/news based site, you
could evaluate the length of the main content (article for ex), and if it's
more than 500 words or something, put a link in not as pin-point as you
want though.


Justin


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




[PHP] PHP Generated web pages

2002-10-03 Thread Peter Goggin

I want to transfer from a web page to a transient page to display a message
and carry out some database updates and then transfer back to the original
page after a pause of 5 seconds.  Is this possible using php?

Regards

Peter Goggin


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




RE: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread Jason D

An alternative way is to add a primary or unique key and make the code 
snippet like this:

mysql_query(INSERT ignore into AuthNum (FirstNum, LastNum, NextNum, KeyField) VALUES 
(1,2,3,1),$dblink);
mysql_query(Update AuthNum Set FirstNum = 1, LastNum = 2, NextNum = 3,$dbLink);

If there is a record already the insert won't work because it will have the same 
value in the key field. The update query is unchanged and there is no counting of
records.

I get the impression it's just a 1-record table.

 I need to do either an insert or update into a MySQL table.  Insert if there
 are 0 records or update if one record exist:

 This is my code snippet:

 if (mysql_query(SELECT COUNT(*) FROM AuthNum) == 0) {
mysql_query(INSERT into AuthNum (FirstNum, LastNum, NextNum) VALUES
 (1,2,3),$dblink);
 } else {
mysql_query(Update AuthNum Set FirstNum = 1, LastNum = 2, NextNum =
 3,$dbLink);
 }

 My problem is, a record never gets inserted because the SELECT COUNT query
 is returning a resource ID of 2.  How can I get the actual number of records
 in the table?



Tired of all the SPAM in your inbox? Switch to LYCOS MAIL PLUS
http://www.mail.lycos.com/brandPage.shtml?pageId=plus

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




[PHP] Informix Connection

2002-10-03 Thread Mark Colvin

I have php 4.1.2 running on a linux 7.2 box. I want to make a connection to
an Informix 7.2SE database running on a HP-UX 10.2 box. My issues are as
follows -
1) Do I need informix software of any description running on the linux web
server?
2) Can I configure the php informix modules into and up and running php
build that doesn't currently have these modules.
3) Is there a step by step or guide on this type of connection anywhere?



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




[PHP] Novice Question

2002-10-03 Thread ThinkNetSolutions

Hello,
I don't know if I'm in the right place to ask for help or not...

First...I am not a hardcore coder...I'm a designer - so I'm still trying to
learn the other side. :)
I am being hosted on a Windows 2000 server. It supports PHP. I have a simple
script (refer a friend) on a Linux server that works. The same script will
not work on this Windows server.

Question:
Does PHP4 code have to be written differently for Windows servers? If so, is
there a code resource describing the differences?
(the only information I can find is on installation on Win servers)

Thank you in advance for your help!

Kim Strawn
[EMAIL PROTECTED]


www.ThinkNetSolutions.com




Re: [PHP] Novice Question

2002-10-03 Thread Justin French

Run a small phpinfo() script on both servers... take note of the version
numbers being used, and take not of the config setting register_globals on
both... my guess is that register_glabals is set to OFF on your local
machine, being a newer install.

If it isn't that, it may be an issue with the mail()


Report back :)


Justin


on 03/10/02 11:17 PM, ThinkNetSolutions ([EMAIL PROTECTED]) wrote:

 Hello,
 I don't know if I'm in the right place to ask for help or not...
 
 First...I am not a hardcore coder...I'm a designer - so I'm still trying to
 learn the other side. :)
 I am being hosted on a Windows 2000 server. It supports PHP. I have a simple
 script (refer a friend) on a Linux server that works. The same script will
 not work on this Windows server.
 
 Question:
 Does PHP4 code have to be written differently for Windows servers? If so, is
 there a code resource describing the differences?
 (the only information I can find is on installation on Win servers)
 
 Thank you in advance for your help!
 
 Kim Strawn
 [EMAIL PROTECTED]
 
 
 www.ThinkNetSolutions.com
 
 


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




Re: [PHP] Novice Question

2002-10-03 Thread Liam . Gibbs

First...I am not a hardcore coder...I'm a designer - so I'm still trying
to learn the other side. :) I am being hosted on a Windows 2000 server. It
supports PHP. I have a simple script (refer a friend) on a Linux server that
works. The same script will not work on this Windows server.

What's an example error message that you're getting? As said, it may just be
a difference in versions.



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


Re: [PHP] Informix Connection

2002-10-03 Thread Adam Williams

Speaking form experience, get ready for a few headaches on this.

edit /usr/informix/etc/sqlhosts and have it look like this:

demo_on onipcshmon_hostname on_servername
demo_se seipcpipse_hostname sqlexec
archives1 setlitcp  archives1.mdah.state.ms.us  sqlexec

where archives1 is your host name.

Have /usr/informix/lib/sqlexecd archives1 running (I have it start on
startup and then wait 5 seconds and then start apache, seems to need this
elay for whatever reason.

You will need the Informix SDK installed on your box, it has the
nessessary libs and stuff that php will need.  You will need to compile
php using --with-informix.

I'll email you back in a second with an email sent to me on how to compile
it all.

Adam

On Thu, 3 Oct 2002, Mark Colvin wrote:

 I have php 4.1.2 running on a linux 7.2 box. I want to make a connection to
 an Informix 7.2SE database running on a HP-UX 10.2 box. My issues are as
 follows -
 1) Do I need informix software of any description running on the linux web
 server?
 2) Can I configure the php informix modules into and up and running php
 build that doesn't currently have these modules.
 3) Is there a step by step or guide on this type of connection anywhere?


 
 This e-mail is intended for the recipient only and
 may contain confidential information. If you are
 not the intended recipient then you should reply
 to the sender and take no further ation based
 upon the content of the message.
 Internet e-mails are not necessarily secure and
 CCM Limited does not accept any responsibility
 for changes made to this message.
 Although checks have been made to ensure this
 message and any attchments are free from viruses
 the recipient should ensure that this is the case.
 




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




Re: [PHP] Two PHP questions

2002-10-03 Thread Liam . Gibbs

U, it's too hard to tell -- if not impossible!!  There are too many
variables... font size, leading, etc etc to calculate how long your page
will be and then you'd have to get information back about screen
size/resolution from javascript (yuk).

I thought there might be a way to compare the pixel height of the output (??
Hey, why not?) to the screen resolution returned by some setting (Browscap
setting? I'm still looking into it). Hope so...!

Perhaps you could do it in a simpler way, based on the length of the main
body of content... in the case of an article/tutorial/news based site, you
could evaluate the length of the main content (article for ex), and if it's
more than 500 words or something, put a link in not as pin-point as you
want though.

Yeah, that's not exactly as pinpoint as I would have hoped.

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




[PHP] how to redirect from one page to an other page in PHP ?

2002-10-03 Thread Iguider


Hi

please how to redirect from one page to an onther in php ?  ( like it is in ASp : 
redirect(../index.asp)
exemple 
switch (condition1) {
case 1;
   go to page page1.php;
case 2;
   go to page page2.php;
}

thanks in advance



RE: [PHP] how to redirect from one page to an other page in PHP ?

2002-10-03 Thread Liam . Gibbs

I think this is what you'll want.

switch (condition1) {
case 1;
   header(Location: page1.php);
case 2;
   header(Location: page2.php);   
}

You need to be careful that you haven't output anything beforehand or you'll
get an error message. Even having a blank line before the ?PHP tag will
screw you up.

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




Re: [PHP] Setting date fields in mysql queries

2002-10-03 Thread Brad Harriger

I ran the query in PhpMyAdmin.  It work fine.  It still doesn't work 
when I try to run it in another script.

Frank wrote:

 
 Hi,
 
 it's a great tip to install PhpMyAdmin - or phpPgAdmin for PostgresSQL - 
 this will only take you at most half an hour even for a newcomer.
 
 You can then easily test queries, see any error messages and see what 
 result they have on tables.
 
 In this case I'd echo out the query
 
 echo $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id
 
 and try to cut-and-paste it into the query-field in PhpMyAdmin.
 
 When you say nothing happens you'd probably discover that ID is a 
 number not matching anything _or_ that $nDate and the field are not 
 proper date values ;-)
 
 Hope it helps!
 
 Frank, U5
 
 
 PHP work!
 
 Looking for PHP work over the net? Or would like to try to work in South 
 East Asia's most exiting place, Bangkok?
 Then jump to http://www.u5.com/ and fill out the Developers Form.
 We are urgently looking for new people in October 2002
 
 
 
 
 At 15:16 2/10/2002 -0400, you wrote:
 
 I have the following line in a program I'm working on:

 $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id

 $ndate is a properly formated date read from a text field on a form on 
 the previous page.  When I run the query using mysql_query, it returns 
 TRUE each time, but the field is not updated.  The only explanation I 
 can think of is that there is something wrong with the date value.  
 I've echoed it to the screen and it looks fine, but the query still 
 doesn't work.  Any suggestions?

 Thanks in advance,

 Brad


 -- 
 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] Automatically (or dynamically ) displaying parts of web forms

2002-10-03 Thread Gregory Hernandez

Hello everyone.

Does anyone know of PHP scripts dealing with dynamically displaying
parts of forms?

For example:
A user chooses option 'C' of question 2, which then instructs the user
to continue with question 5 (skipping questions 3 and 4).  

This being the case, the user does not need to see the questions to be
skipped.  Rather, the user's choice should automatically (or
dynamically) display the question he/she needs to continue filling out
the form.

Does anyone know of PHP scripts (or cross- platform/browser) solutions
for this?

Any help is greatly appreciated in advance.


Gregory Hernandez
[EMAIL PROTECTED]

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




Re: [PHP] Novice Question

2002-10-03 Thread 1LT John W. Holmes

 Question:
 Does PHP4 code have to be written differently for Windows servers? If so,
is
 there a code resource describing the differences?
 (the only information I can find is on installation on Win servers)

No, not really. There are a few functions that won't work on windows because
they access things that are in unix (crypt() for one, I think). But, any
basic code will run on any server with PHP.

Now, if you're using special modules, then they must be installed on each
server, obviously.

---John Holmes...


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




Re: [PHP] PHP Generated web pages

2002-10-03 Thread 1LT John W. Holmes

 I want to transfer from a web page to a transient page to display a
message
 and carry out some database updates and then transfer back to the original
 page after a pause of 5 seconds.  Is this possible using php?

Yes

---John Holmes

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-an
swers.html


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




Re: [PHP] Two PHP questions

2002-10-03 Thread 1LT John W. Holmes

 First of all, what exactly is get/set_magic_quotes_runtime? (I know what a
 get/set function does, and I know what magic_quotes does, but I'm unclear
 about what magic_quotes_runtime is as opposed to _gpc). Does it get the
 magic_quotes setting at runtime, before anything has been
 set_magic_quotes_runtime'd? I sort of get that it has to do with returning
 slashes with quotes in a function as opposed to doing it when a function
is
 called. Any clarifications? The only comment on the PHP list says that
it's
 being turned off, so I guess it's not that important.

magic_quotes_runtime boolean

If magic_quotes_runtime is enabled, most functions that return data from any
sort of external source including databases and text files will have quotes
escaped with a backslash. If magic_quotes_sybase is also on, a single-quote
is escaped with a single-quote instead of a backslash.


http://www.php.net/manual/en/printwn/ref.info.php#ini.magic-quotes-runtime



 Secondly, is there any way of counting how long in pixels my page runs?
 Basically, my situation is this: I want to know if my page runs more than
a
 screen and a half (or so... still deciding) of the user's screen so that I
 can put a Go to Top link on the bottom if it's useful. Any ideas?



Not with PHP.

---John Holmes...


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




Re: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread 1LT John W. Holmes

 $result = mysql_query(SELECT * FROM tbl);
 $number_of_rows = mysql_num_rows($result);

 You don't have to do the count in the SQL, as John said earlier a SELECT
 COUNT(*) FROM tbl will always return one row, even if the value of the row
 is 0. Of course you could always test for that.

 CountingRows Solution #317 :^]

That's a really ineffecient solution, though. COUNT() of optimized to return
a quick result. Why would you select everything and use up all of those
resources to just get a count of the rows?

---John Holmes...


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




[PHP] Does anyone knows File Maker

2002-10-03 Thread Webmaster MBTRADINGCO

I ran yesterday into a company that wants me to implement a solution
with PHP and File Maker. I don't even know if it is possible, so I was
wondering:

A) Does anyone has any experience with filemaker?
b) Can PHP save data from internet via ODBC to a database (other than
the ones it supports) in a windows server?
c) Does anyone knows if PHP supports file maker?

Thanks in advance.


Elliot J. Balanza



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





[PHP] mcrypt vs. libmcrypt

2002-10-03 Thread Scott Fletcher

I saw on Google search result about PHP and mcrypt.  I read the manual on
http://php.net/mcrypt and it spoke about downloading libmcrypt and use the
php configure option, --with-mcrypt= for libmcrypt-2.x.x.  So, on the
Google search result, one of hte posting talk about using both the libmcrypt
and mcrypt.

So, what is the difference between these two?  Do I need to install both of
them or just libmcrypt??

Thanks,
 FletchSOD



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




Re: [PHP] reg exp matching/replacing

2002-10-03 Thread Jason D

Jen,

Don't use eregi_replace when str_replace will do.

$contents = str_replace($matches[0][$i], $blah, $contents);

Also the dots should be escaped or gif and jpg without 
dots before them will be matched.

preg_match_all('{\/*[A-z0-9_/-]+(\.gif|\.jpg)}', $contents, $matches);



Tired of all the SPAM in your inbox? Switch to LYCOS MAIL PLUS
http://www.mail.lycos.com/brandPage.shtml?pageId=plus

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




[PHP] progessive jpg

2002-10-03 Thread Sephiroth

Hi,
there a way to determine if the uploaded image is a standard jpeg or a progressive 
image?

I'm looking at the GD documentation but i can't find anything

--
---
Alessandro Crugnola [sephiroth]
Flash | PHP Developer
http://www.sephiroth.it

Team Macromedia Volunteer for Flash
http://www.macromedia.com/go/team




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




Re: [PHP] Does anyone knows File Maker

2002-10-03 Thread Bill Leonard

There is something out there called FXPHP which might fill your needs:

http://www.iviking.org/

on 10/3/02 11:23 AM, Webmaster MBTRADINGCO at [EMAIL PROTECTED]
wrote:

 I ran yesterday into a company that wants me to implement a solution
 with PHP and File Maker. I don't even know if it is possible, so I was
 wondering:
 
 A) Does anyone has any experience with filemaker?
 b) Can PHP save data from internet via ODBC to a database (other than
 the ones it supports) in a windows server?
 c) Does anyone knows if PHP supports file maker?


-- 
Bill Leonard   [EMAIL PROTECTED]
www.machinemen.com407.464.0147

XrackHosting.com - Mac OS X hosting done right!
http://www.xrackhosting.com/


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




[PHP] Complete development software

2002-10-03 Thread Ray, James A

Other then Abriasoft, is there another complete software package that
contains PHP, MYSQL, APACHE and PERL for Windows?
 
Thank you
 
Jim



RE: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread Jay Blanchard

[snip]
 $result = mysql_query(SELECT * FROM tbl);
 $number_of_rows = mysql_num_rows($result);

 You don't have to do the count in the SQL, as John said earlier a SELECT
 COUNT(*) FROM tbl will always return one row, even if the value of the row
 is 0. Of course you could always test for that.

 CountingRows Solution #317 :^]

That's a really ineffecient solution, though. COUNT() of optimized to return
a quick result. Why would you select everything and use up all of those
resources to just get a count of the rows?
[/snip]

I was thinking along the lines that there needed to be a query that returned
some results that may also be displayed or used within the script. For
instance, I use a paging script that queries for certain conditions and
returns 40 records per page. I also display a line that says, There are x
records based on the criteria that you have selected.. x comes from
mysql_num_rows. Now, if all I had to do was get the number of records I
would use sql COUNT and test for the condition by seeing what number was
returned by the COUNT.

HTH!

Jay



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




[PHP] Glaring problem with libmcrypt!!!

2002-10-03 Thread Scott Fletcher

Hi!  I ran through the phpinfo and here's the result.  That's explain why
I'm unable to get most of the mcrypt functions to work.  Features like
mcrypt_module_open, mcrypt_list_algorithms, mcrypt_get_block_size,
etc.  So, what's the problem here?  PHP bugs?  Please spill your gut out on
this one if you know of one.  Thansk!

--clip--

mcrypt

--
|  mcrypt support|  enabled  |
--
|  Version   |  2.4.x  |
|  Supported Ciphers  |  none  |
|  Supported Modes   |  none  |
--

-
|  Directive |  Local Value  |  Master Value  |
-
|  mcrypt.algorithms_dir  |  no value   |  no value  |
|  mcrypt.modes_dir   |  no value   |  no value  |
-

--clip--



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




Re: [PHP] Complete development software

2002-10-03 Thread Scott Houseman

http://www.nusphere.com/

On 10/3/2002 4:51 PM, Ray, James A wrote:
 Other then Abriasoft, is there another complete software package that
 contains PHP, MYSQL, APACHE and PERL for Windows?
  
 Thank you
  
 Jim
 


-- 
////
// Scott Houseman //
// Jam Warehouse http://www.jamwarehouse.com/ //
// Smart Business Innovation  //
// +27 21 4477440 / +27 82 4918021//
////


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




[PHP] DATE_FORMAT (MySQL function)

2002-10-03 Thread Mark Colvin

I'm not sure if this is a php or mysql issue but I run the following query
from a php script -

$query = select d1.code, d1.type, d1.descr, d1.grouptype, d1.cusref,
d1.stock, d1.minstock, d1.appmeth, d1.supplier, d1.suppref, d1.leadtime,
d1.price, d1.reorder, d1.code1, d1.code2, d1.notes, d1.usr, d1.usr,
d1.cusname, d1.colours, d1.stitchcount, d1.height, d1.width,
DATE_FORMAT(d1.created, '%d-%m-%Y'), DATE_FORMAT(d1.amended, '%d-%m-%Y'),
d2.extdescr from decheader as d1, decextdescr as d2 where d1.code = d2.code
and d1.code = '00042' ;

The problem I am having is with the DATE_FORMAT. Running the above query
returns the following for the ‘width’ column.

94.40 DATE_FORMAT(d1.created, '%d-%m-%Y'): NULL DATE_FORMAT(d1.amended,
'%d-%m-%Y'): 03-10-2002

The ‘width’ column should only return 94.40. Why does this query put 3
columns into one?



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




RE: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread Jay Blanchard

[snip]
I still think it's more effecient to use two queries in your case. One with
a COUNT(*) to get total records, and one with a LIMIT to just get the 40 you
want. With a smaller table, it may not matter, but with large tables, you
could be using up a lot of resources by selecting everything, but then only
using 40 rows of it.
[/snip]

I see your point John, and I used a bad example. I was just pointing out
that mysql_num_rows() would return the number of rows for any query and
prevents from having to do 2 queries where one would suffice if you need to
also use the data. Consider (some code left out for clarity);

?php
// do database connection etc. $connection
// select names by state for mailing list
$query = SELECT name, address, city, state, zip FROM customer WHERE
state='TX';

// run query and do error checking
if(!($results = mysql_query($query, $connection))){
   print(MySQL reports:  . mysql_error() . \n);
   exit();
}
// get the number of customers in this state
$x = mysql_num_rows($result);

// print mailing list
while($data = mysql_fetch_object($result)){
   print($data-name . ,  . $data-address . ,  . $data-city . ,  .
$data-state . ,  . $data-zip . \n);
}
print(There are  . $x .  customers in this state.\n);

// close the database connection
?

I agree that COUNT is an optimized return, but for a situation where you are
retrieving data from the query for whatever use it is more efficient to use
mysql_num_rows() to return the count of this particular query than it would
be to issue a second query, no?

I guess we could get into some semantical discussion at this point about
efficiency. I am an old school coder, and as such I have been taught to
conserve CPU cycles and round trips to other servers. As technology grows
some of these things could go by the wayside because processing power has
increased multi-fold since I began my foray many years ago. I always seek to
send the fewest queries to the database server where possible... efficient
query design, use of other functions available in the programming language
to provide additional data, or any number of other tricks, tips, and magic
tricks have helped to keep things clean.

So, is mysql_num_rows() less efficient than a second query asking SELECT
COUNT(*)? Is there any way to time the two where doing a query like the
above example?

Thanks!

Jay



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




Re: [PHP] MORE Problems with PHP as CGI and Flash !!!!!!!!!!

2002-10-03 Thread Jennifer Swofford

FEI, it works fine on my IE6/WinXP.  :)  (And NS7.)

 Rebekah,
 
 When I click link to go to the second index (using IE6, WinXP) at
 http://www.overbrookfarm.myiglou.com/index2.html my browser hangs and I
 never get the menus. However it all works fine in Mozilla 1.0 on the same
 platform. (Beautifully done site by the way, but ignores AFAICS
 accessibility, and folks with lower bandwidths. Have you thought about a
 non-Flash version as well, to allow a choice? I am not anti-Flash, just
 pro-accessibility.)
 
 HTH!
 
 Jay




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




Re: [PHP] DATE_FORMAT (MySQL function)

2002-10-03 Thread Maurits Lawende

Hi,

You could try this query...

$query = SELECT `d1.code`, `d1.type`, `d1.descr`, `d1.grouptype`, `d1.cusref`,
`d1.stock`, `d1.minstock`, `d1.appmeth` , `d1.supplier`, `d1.suppref`, `d1.leadtime`,
`d1.price`, `d1.reorder`, `d1.code1`, `d1.code2`, `d1.notes`, `d1.usr`, `d1.usr`,
`d1.cusname`, `d1.colours`, `d1.stitchcount`, `d1.height`, `d1.width`,
DATE_FORMAT(`d1.created`, '%d-%m-%Y'), DATE_FORMAT(`d1.amended`, '%d-%m-%Y'),
`d2.extdescr` FROM `decheader` AS `d1`, `decextdescr` AS `d2` WHERE (`d1.code` = 
`d2.code`)
AND (`d1.code` = '00042');

If the code above doesn't work, try it in phpmyadmin and read the error 
if you get one.

hope it helps,
Maurits Lawende


Mark Colvin wrote:

I'm not sure if this is a php or mysql issue but I run the following query
from a php script -

$query = select d1.code, d1.type, d1.descr, d1.grouptype, d1.cusref,
d1.stock, d1.minstock, d1.appmeth, d1.supplier, d1.suppref, d1.leadtime,
d1.price, d1.reorder, d1.code1, d1.code2, d1.notes, d1.usr, d1.usr,
d1.cusname, d1.colours, d1.stitchcount, d1.height, d1.width,
DATE_FORMAT(d1.created, '%d-%m-%Y'), DATE_FORMAT(d1.amended, '%d-%m-%Y'),
d2.extdescr from decheader as d1, decextdescr as d2 where d1.code = d2.code
and d1.code = '00042' ;

The problem I am having is with the DATE_FORMAT. Running the above query
returns the following for the 'width' column.

94.40 DATE_FORMAT(d1.created, '%d-%m-%Y'): NULL DATE_FORMAT(d1.amended,
'%d-%m-%Y'): 03-10-2002

The 'width' column should only return 94.40. Why does this query put 3
columns into one?



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


  





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




[PHP] force download and file size issue

2002-10-03 Thread christian haines

hi all,

i have successfully created a download script to force a user to
download, however attempting to download large files causes an error
saying that the file cannot be found.

my code 
  header(Cache-control: private);
  header(Content-Type: application/force-download; name=\$file\);
  header(Content-Disposition: attachment; filename=\$file \);
  header(Content-Transfer-Encoding: binary);
  header(Content-Length: $content_length);
  $fp = fopen($file_fullpath,r);
  fpassthru($fp);
  fclose($fp);
 my code

this is a memory issue in the php.ini i.e. memory_limit = 8M then the
largest file i can download is 8M

is there anyway to force a download without having to use the system
hungry fpassthru function?

this is driving me nuts so any help would be greatly appreciated

cheers
christian

ps i read the following at php.net fpassthru man page but could not make
sense of it (it appears to be some kind of solution) 

fpassthru() works best for small files. In download manager scripts,
it's best to determine the URL of the file to download (you may generate
it locally in your session data if you need so), and then use HTTP
__temporary__ redirects (302 status code, with a Location: header
specifying the effective download URL).
This saves your web server from maintaining PHP scripts running for long
times during the file downloadn and instead the download will be managed
directly by the web server without scripting support (consequence: less
memory resources used by parallel downloads)...



[PHP] Re: Two PHP questions

2002-10-03 Thread Owen Parker

Hi

firstly, magic quotes have something to do with how your php server
interprets the embedded php commands, or at least that's what I took it too
be.  I dont really know the details but it is definitely a setting in your
php.ini.  Maybe you can research it to your needed detail from that.

Secondly, if your page is of variable length, there must be someway to
calculate the number of rows according to the variable part.  I'd count the
number of set lines (ie: the titles, forced spaceing, etc) and add to it the
variable number of rows or whatever you are displaying in real time.  a
simple if statement somewhere in the display routine should take care of
inserting a top of page link.

HTH

l8r
owen

Liam Gibbs [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 First of all, what exactly is get/set_magic_quotes_runtime? (I know what a
 get/set function does, and I know what magic_quotes does, but I'm unclear
 about what magic_quotes_runtime is as opposed to _gpc). Does it get the
 magic_quotes setting at runtime, before anything has been
 set_magic_quotes_runtime'd? I sort of get that it has to do with returning
 slashes with quotes in a function as opposed to doing it when a function
is
 called. Any clarifications? The only comment on the PHP list says that
it's
 being turned off, so I guess it's not that important.

 Secondly, is there any way of counting how long in pixels my page runs?
 Basically, my situation is this: I want to know if my page runs more than
a
 screen and a half (or so... still deciding) of the user's screen so that I
 can put a Go to Top link on the bottom if it's useful. Any ideas?

 Thanks in advance!



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




Re: [PHP] force download and file size issue

2002-10-03 Thread Rasmus Lerdorf

readfile()

On Fri, 4 Oct 2002, christian haines wrote:

 hi all,

 i have successfully created a download script to force a user to
 download, however attempting to download large files causes an error
 saying that the file cannot be found.

 my code 
   header(Cache-control: private);
   header(Content-Type: application/force-download; name=\$file\);
   header(Content-Disposition: attachment; filename=\$file \);
   header(Content-Transfer-Encoding: binary);
   header(Content-Length: $content_length);
   $fp = fopen($file_fullpath,r);
   fpassthru($fp);
   fclose($fp);
  my code

 this is a memory issue in the php.ini i.e. memory_limit = 8M then the
 largest file i can download is 8M

 is there anyway to force a download without having to use the system
 hungry fpassthru function?

 this is driving me nuts so any help would be greatly appreciated

 cheers
 christian

 ps i read the following at php.net fpassthru man page but could not make
 sense of it (it appears to be some kind of solution) 

 fpassthru() works best for small files. In download manager scripts,
 it's best to determine the URL of the file to download (you may generate
 it locally in your session data if you need so), and then use HTTP
 __temporary__ redirects (302 status code, with a Location: header
 specifying the effective download URL).
 This saves your web server from maintaining PHP scripts running for long
 times during the file downloadn and instead the download will be managed
 directly by the web server without scripting support (consequence: less
 memory resources used by parallel downloads)...



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




RE: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread John W. Holmes

[snip]
 I agree that COUNT is an optimized return, but for a situation where
you
 are
 retrieving data from the query for whatever use it is more efficient
to
 use
 mysql_num_rows() to return the count of this particular query than it
 would
 be to issue a second query, no?

Yes, it all depends on what you are doing with the results. If you are
selecting everything, and using everything in your page, then, yeah, use
mysql_num_rows. A second query of the same thing just for COUNT(*) would
be inefficient. 

 I guess we could get into some semantical discussion at this point
about
 efficiency. I am an old school coder, and as such I have been taught
to
 conserve CPU cycles and round trips to other servers. As technology
grows
 some of these things could go by the wayside because processing power
has
 increased multi-fold since I began my foray many years ago. I always
seek
 to
 send the fewest queries to the database server where possible...
efficient
 query design, use of other functions available in the programming
language
 to provide additional data, or any number of other tricks, tips, and
magic
 tricks have helped to keep things clean.
 
 So, is mysql_num_rows() less efficient than a second query asking
SELECT
 COUNT(*)? Is there any way to time the two where doing a query like
the
 above example?

The two query method is efficient when you have large tables and you are
only going to use a subset of the results. Like in showing X records out
of Y. 

I could do a little benchmarking script to see what kind of time
differences we are talking about. Maybe it's so minor that it doesn't
matter...

I think we're arguing with each other even though we agree on
everything. :)

---John Holmes...



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




Re: [PHP] Export email addresses from Outlook Express with PHP

2002-10-03 Thread Marek Kilimajer

You still can tell members to upload their address books and use this 
class to get addresses from the files:
http://www.phpclasses.org/browse.html/package/778.html

Arnaud Castran wrote:

Do you think it is possible to export email addresses from Outook Express
with PHP.
I looking for a script using COM but i only found exemples for MSOutlook.
What i want to do is an address book for each members of my site
(www.universemail.net  a directory of email addresses) : if they have
Outlook Express, the site connect to Outlook and export addresses to add
them in their address book

Thanks for your help

Arnaud Castran




  



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




RE: [PHP] counting number of records in a MySQL table; how do I get

2002-10-03 Thread Jay Blanchard

[snip]
I think we're arguing with each other even though we agree on
everything. :)
[/snip]

I prefer to think of it as healthy discussion :^] It is like two quantum
physicists discussing light, with one leaning towards the particle side and
the other leaning towards the wave side. They agree on everything but are
shedding light (pun not intended) on the differing viewpoints.

Anyhow John, I would never argue with you. Discuss...yes, argue...no. :^]

We've essentially proven to others and lurkers that there is more than one
way to accomplish something, sometimes it comes down to efficieny, sometimes
preference, sometimes ignorance (the real kind, not the derogatory kind) and
more often a combination of them all. There are many ways to count records
in a results set... as there are many ways to do lots of things. Learning
the many ways helps me to be better at my job.

:^]

Jay



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




Re: [PHP] HYML Forms to Validate?

2002-10-03 Thread Justin French

Check out Kevin Yank's article on webmasterbase.com/sitepoint.com

Cheers,

Justin


on 04/10/02 3:27 AM, Stephen ([EMAIL PROTECTED]) wrote:

 Hello,
 
 I've been reading tutorials lately on user authentication in PHP and they all
 are for the HTTP way of authentication. How can I use the same system but with
 forms instead of that ugly pop-up box?
 
 Thanks,
 Stephen Craton


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




[PHP] Calling Files from a different directory

2002-10-03 Thread Rick Beckman

I have a page set up that loads the contents of a text file into an HTML
template using PHP. (i.e. something.com/page.php?include=1 where 1 is a
simple no-extension text file in the same directoy as page.php). Is there a
way to modify the PHP code in the template page to search for the included
page in another directory? Right now, the only way to do it is to have the
URL as page.php?include=files/1.

Currently, here is the code I use to takes the $include URL variable and
makes the file accessible in the template:

$info = file($include);

-- 
Kyrie Eleison,
Rick
www.spiritsword.com/phpBB2/


---
Outgoing mail is certified Virus Free because I care. Jesus Saves!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/02



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




[PHP] Is there a difference in this??

2002-10-03 Thread Roberto Ramírez

I dont get the difference between this two instructions...


mail([EMAIL PROTECTED], Subject, Message) or die(It suck);


mail($mailto,$subject,$content) or die(It suck);



Im just getting a server error on the second instruction... I've checked the
vars with the is_string() function and all are strings... Ive used this mail
function many times... and it already worked in the script...but suddenly it
didnt work.

Im thinking about the smtp server, but i dont understand why the first
instruction is sent by the server and when i use the second, i get a server
error.
I dont get it!!!  why is that #$%% server error!!!

Note: I cant chage the second instruction's vars to simple text, because its
inside a for loop.


Using:
Apache/PHP 4.2.1 in Win2k

The SMTP is a Unix Service in another Server.

Any help would be appreciated...im gonna get bald if i stay like this...

Roberto Ramírez..


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




Re: [PHP] no errors ?

2002-10-03 Thread gamin

GOT IT,

   basically in a script like this
?
kadsf;
kasdjfdsfj;garbage;
?

php  treats these as contants, and issues a notice saying that undefined
constants are being used. The default setting for the php.ini file is :

error_reporting = E_ALL ~E_NOTICE

thus all notices are not displayed. setting error_reporting to E_ALL solves
this

thx everybody

gamin.



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




Re: [PHP] Is there a difference in this?

2002-10-03 Thread Leif K-Brooks

Try echoing those vars in the loop to see if their values are correct...
Roberto Ramírez wrote:

I dont get the difference between this two instructions...


mail([EMAIL PROTECTED], Subject, Message) or die(It suck);


mail($mailto,$subject,$content) or die(It suck);



Im just getting a server error on the second instruction... I've checked the
vars with the is_string() function and all are strings... Ive used this mail
function many times... and it already worked in the script...but suddenly it
didnt work.

Im thinking about the smtp server, but i dont understand why the first
instruction is sent by the server and when i use the second, i get a server
error.
I dont get it!!!  why is that #$%% server error!!!

Note: I cant chage the second instruction's vars to simple text, because its
inside a for loop.


Using:
Apache/PHP 4.2.1 in Win2k

The SMTP is a Unix Service in another Server.

Any help would be appreciated...im gonna get bald if i stay like this...

Roberto Ramírez..


  




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




[PHP] fopen() limit

2002-10-03 Thread gamin

Hi,

  what sort of size limtis does fopen() have on a Linux based system ?




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




[PHP] Installing PHP

2002-10-03 Thread Dan

I am trying to create a message board. I setup a windows 2000 server and
installed IIS. In order to setup this messageboard i need to have PHP
installed. I downloaded the PHP installer and tried to run it but i get a
error message stating that there was a missing OCX component and it cant
configure the webserver. Does any know where i can get step by step
instructions in setting this up. The instructions that come from php.net are
too confusing.


THanks

Dan





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




[PHP] Re: using fopen() to download remote files

2002-10-03 Thread Rusty Small

Thanks for the help.  I made the assumption that all data from each page was
being downloaded but it is not.

I do have one other question.  I've used microtime() to test how long it
takes to download each page and have noticed that some pages may take as
long as 45 seconds to download!!!  I know that this lag is out of my control
as it is depends upon the status of the remote server.  However, I would
like to tell the script that if x amount of time has passed and the
fopen() function is not complete then stop and move on.  I've tried using
while and if...else statements using microtime() as the timeout limit but I
didn't have any success.  What kind of flow control mechanism should I use
for this??

RS
Rusty Small [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have written a script in which the main purpose is to download html
pages
 from multiple web servers.  I'm using the fopen() function to download
these
 pages.  I would like to be able to download only the source (text) and no
 binary data as this would greatly improve the speed of my script.

 I've seen this on the client side with browsers being set to text only
mode.
 Is there a way to do this with php on the sever side to tell the remote
web
 server to not download the images associated a particular URL?  I'm
running
 Red Hat 7.3 and Apache web server.

 Any help would be greatly appreciated.

 Cliff





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




[PHP] Solution to MORE Problems with PHP as CGI and Flash !!!!!!!!!!

2002-10-03 Thread Rebekah Garner

I wrote in a message:
 Here is the URL to a project that is far as I am concerned was finished.
 http://www.overbrookfarm.myiglou.com
 It is a Flash site that uses PHP for dynamically updating text in some
text
 fields. snip.  There should already be text inside of it.
 I see it.  snipMy client can't see it snip
snipAny ideas?


Ready people? Here is the solution:
He was using the url of
http://overbrookfarm.myiglou.com

Take note of the missing www.  Anyone familiar with Flash will see where
the problem is with that. Sorry to bother the list with a problem that in
the end really ended up not being a PHP problem persay.  But something to
remember if you ever come across in the future.

Rebekah Garner
Remember kiddies: CONTRACTS! CONTRACTS! CONTRACTS!










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




[PHP] Re: using fopen() to download remote files

2002-10-03 Thread gamin


Rusty Small [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks for the help.  I made the assumption that all data from each page
was
 being downloaded but it is not.

 I do have one other question.  I've used microtime() to test how long it
 takes to download each page and have noticed that some pages may take as
 long as 45 seconds to download!!!  I know that this lag is out of my
control
 as it is depends upon the status of the remote server.  However, I would
 like to tell the script that if x amount of time has passed and the
 fopen() function is not complete then stop and move on.  I've tried using
 while and if...else statements using microtime() as the timeout limit but
I
 didn't have any success.  What kind of flow control mechanism should I use
 for this??

Hi,

  I have never done this give this is shot, try it it should work.

you can use passthru()/system() to call wget (you can specify the timeout in
wget) (wget will let u know the success or failure) and donwload the file in
a temporary folder. then you can use fopen to open the file.

HTH

gamin.



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




[PHP] Include

2002-10-03 Thread Matias Silva

This might sound like a dumb question but I just need verification so that
I can convince myself that I'm going insane!

I have this error in which I include 3 files (common_html.inc,
common_db.inc, common_functions.inc)
well I have a clean() function in the common_functions.inc file. But it
seems that it is not getting called
and then my script crashes.  If I comment out the clean() function then it
works.  The clean() function
is just for added security.

Is there a maximum number of times you can include different files?

-Matias



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




[PHP] Re: Include

2002-10-03 Thread Philip Hallstrom

To my knowledge you can include as many files as you want.

If by commenting out the clean() function, I'd say you have a syntax error
in that function and you're just not seeing the error message.  Turn on
full error reporting and see what happens.

-philip

On Thu, 3 Oct 2002, Matias Silva wrote:

 This might sound like a dumb question but I just need verification so that
 I can convince myself that I'm going insane!

 I have this error in which I include 3 files (common_html.inc,
 common_db.inc, common_functions.inc)
 well I have a clean() function in the common_functions.inc file. But it
 seems that it is not getting called
 and then my script crashes.  If I comment out the clean() function then it
 works.  The clean() function
 is just for added security.

 Is there a maximum number of times you can include different files?

 -Matias



 --
 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] time of day

2002-10-03 Thread Bryan Koschmann - GKT

Hello,

I was wondering if anyone has a good example of a way to do this. Kinda
lame, but like if the time is between 8am and 12pm, say good morning,
between 12pm and 6pm, say good afternoon, and so on.

I know this is probably pretty trivial, but I just wanted to see what
ideas where out there.

Thanks in advance!

Bryan


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




Re: [PHP] HYML Forms to Validate?

2002-10-03 Thread Stephen

Thanks! But, are there any others? This doesn't really explain the whole
multiple page part...

- Original Message -
From: Justin French [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Thursday, October 03, 2002 12:33 PM
Subject: Re: [PHP] HYML Forms to Validate?


 Check out Kevin Yank's article on webmasterbase.com/sitepoint.com

 Cheers,

 Justin


 on 04/10/02 3:27 AM, Stephen ([EMAIL PROTECTED]) wrote:

  Hello,
 
  I've been reading tutorials lately on user authentication in PHP and
they all
  are for the HTTP way of authentication. How can I use the same system
but with
  forms instead of that ugly pop-up box?
 
  Thanks,
  Stephen Craton


 --
 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




Re: [PHP] time of day

2002-10-03 Thread Kevin Stone

PHP can give you the server time, but for this I think it would be better to
have the user's local time, in which case Javascript would provide a better
solution.
-Kevin

- Original Message -
From: Bryan Koschmann - GKT [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Thursday, October 03, 2002 3:43 PM
Subject: [PHP] time of day


 Hello,

 I was wondering if anyone has a good example of a way to do this. Kinda
 lame, but like if the time is between 8am and 12pm, say good morning,
 between 12pm and 6pm, say good afternoon, and so on.

 I know this is probably pretty trivial, but I just wanted to see what
 ideas where out there.

 Thanks in advance!

 Bryan


 --
 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] Re: Mime Types

2002-10-03 Thread Manuel Lemos

Hello,

On 10/03/2002 07:41 PM, Php List wrote:
 Hi,
 Is it possible to get a mime type of a file? 
 I need to be able to attach files, but I won't always know the mime type of what is 
being attached.
 I could look at the extension of the file for a general Idea, but I wouldn't know if 
a .jpg file is an image/jpg or image/jpeg.(progressive) and there seems to be a 
difference between the two. 

This class that can compose and send messages with attachments already 
guess the MIME type for you from the file name extension:

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos


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




[PHP] Thumbnail with GD

2002-10-03 Thread net php

Hi, I am pretty lost..
I am trying to create a php thumbnail with php without using any *sql database.this 
script was supposed to open a directory then read it resize the images without losing 
quality and displays it on screen.

ok, here is what I am trying to do and its now working:


   ?
$dir = imagestrips;
if($abre = opendir($dir)) {

 
 while($arq = readdir($abre))
   {$filename = imagestrips/ . $arq;
   if(is_file($filename)) 
 {
   $neww = 100;
   $newh = 100;
   header(Content-type: image/jpeg);
   $dst_img=imagecreate($neww, $newh);
   $src_img=imagecreatefromjpeg($filename);
   
imagecopyresized($dst_img,$src_img,0,0,0,0,$neww,$newh,imagesx($src_img),imagesy($src_img));
   imagejpeg($dst_img);
   

 }
 }
   } 
   
   closedir($abre);
   ?

THANKS!
net.
-- 
Get your free email from www.linuxmail.org 


Powered by Outblaze

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




RE: [PHP] Calling Files from a different directory

2002-10-03 Thread John W. Holmes

 I have a page set up that loads the contents of a text file into an
HTML
 template using PHP. (i.e. something.com/page.php?include=1 where 1
is a
 simple no-extension text file in the same directoy as page.php). Is
there
 a
 way to modify the PHP code in the template page to search for the
included
 page in another directory? Right now, the only way to do it is to have
the
 URL as page.php?include=files/1.
 
 Currently, here is the code I use to takes the $include URL variable
and
 makes the file accessible in the template:
 
 $info = file($include);

Can I get the URL to your server, please, so I can pull up
page.php?include=/etc/passwd ?? Thanks, I would really appreciate that.

But seriously, I really hope you are validating what $include is. 

If you want the file to be included from a different directory, then you
have to pass some flag/variable to PHP to tell it where to look. If you
always want it to be in the same dir, then use

$info = file('files/' . $include);

---John Holmes...



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




Re: [PHP] HYML Forms to Validate?

2002-10-03 Thread Peter J. Schoenster

On 3 Oct 2002 at 12:27, Stephen wrote:

 I've been reading tutorials lately on user authentication in PHP and
 they all are for the HTTP way of authentication. How can I use the same
 system but with forms instead of that ugly pop-up box?

Of course the best solution for this is mod_perl (for those who know 
some Perl) but you can cheat in PHP. The problem in PHP is that you 
cannot intercept the Apache request phases as you can with mod_perl. 
I've mentioned this in other posts and even have an example up on my 
site:

http://www.schoenster.com/login.php

I tell apache to use my handler for access/authentication. 

One way to do this in PHP is to have ONE index.php or whatever you set 
the index file to in a folder. It determines who is requesting what and 
then determines if this person is is authorized to access what they 
wanted. You'd have to put the actual *data* outside the document root 
otherwise they might just find it. Your index.php could grab the files 
(if html) and just print them back. I used the same system in Perl 
before learning of mod_perl. So far this is the only case where I can 
do something in mod_perl that I cannot do as eloquently in PHP but 
since I don't mind the pop up box that's not a big deal and since most 
of my apps go through just a few php handlers I do my own auth/access 
for every request and return my custom login page when needed.

Peter



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




Re: [PHP] Calling Files from a different directory

2002-10-03 Thread Rick Beckman

Sarcasm aside, I do have the script set up (although I didn't note so in the
last response) to not accept files with '.' or '..' in the path. The URL can
accept directories within the one the PHP script is in, but not in a
different path or any directory above its own (i.e., the server files).

-- 
Kyrie Eleison,
Rick
www.spiritsword.com/phpBB2/


John W. Holmes wrote:
 I have a page set up that loads the contents of a text file into an
 HTML template using PHP. (i.e. something.com/page.php?include=1
 where 1 is a simple no-extension text file in the same directoy as
 page.php). Is there a
 way to modify the PHP code in the template page to search for the
 included page in another directory? Right now, the only way to do it
 is to have the URL as page.php?include=files/1.

 Currently, here is the code I use to takes the $include URL variable
 and makes the file accessible in the template:

 $info = file($include);

 Can I get the URL to your server, please, so I can pull up
 page.php?include=/etc/passwd ?? Thanks, I would really appreciate
 that.

 But seriously, I really hope you are validating what $include is.

 If you want the file to be included from a different directory, then
 you have to pass some flag/variable to PHP to tell it where to look.
 If you always want it to be in the same dir, then use

 $info = file('files/' . $include);

 ---John Holmes...



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




[PHP] Looking for feedback

2002-10-03 Thread Erich Kolb

I have setup a web-frontend to the PHP.net Usenet/Mailing List Groups. 
Could anyone take a look and give me some recommendations on enhancements?


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




RE: [PHP] PHP Generated web pages

2002-10-03 Thread John W. Holmes

What have you tried so far?

Just make your PHP page that shows the message and does the updates...

Then use a META-REFRESH to redirect after 5 seconds...

---John Holmes...

 -Original Message-
 From: Peter Goggin [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, October 03, 2002 10:25 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP Generated web pages
 
 Can anyone refer me to the appropriat functions to be used for this?
 
 Thanks in advance
 
 Regards
 
 Peter Goggin
 
 - Original Message -
 From: 1LT John W. Holmes [EMAIL PROTECTED]
 To: Peter Goggin [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Sent: Friday, October 04, 2002 12:17 AM
 Subject: Re: [PHP] PHP Generated web pages
 
 
   I want to transfer from a web page to a transient page to display
a
  message
   and carry out some database updates and then transfer back to the
 original
   page after a pause of 5 seconds.  Is this possible using php?
 
  Yes
 
  ---John Holmes
 
 

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-n
o-
 an
  swers.html
 
 
  --
  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] time of day

2002-10-03 Thread Michael Sims

On Thu, 3 Oct 2002 14:43:37 -0700 (PDT), you wrote:

Hello,

I was wondering if anyone has a good example of a way to do this. Kinda
lame, but like if the time is between 8am and 12pm, say good morning,
between 12pm and 6pm, say good afternoon, and so on.

I know this is probably pretty trivial, but I just wanted to see what
ideas where out there.

How about this:

function getgreetingtime() {

  $hour = date(G);

  switch(true) {
case($hour  12):
  $time = morning;
  break;
case($hour = 12  $hour  18):
  $time = afternoon;
  break;
case($hour = 18):
  $time = evening;
  break;
  }

  return $time;

}

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




Re: [PHP] force download and file size issue

2002-10-03 Thread christian haines

thanks rasmus,

i have tried read file but it gave me the same issues as fpassthru.. both cap
on the memory_limit directive withint the php.ini file

any other suggestions maybe?

cheers
christian

Rasmus Lerdorf wrote:

 readfile()

 On Fri, 4 Oct 2002, christian haines wrote:

  hi all,
 
  i have successfully created a download script to force a user to
  download, however attempting to download large files causes an error
  saying that the file cannot be found.
 
  my code 
header(Cache-control: private);
header(Content-Type: application/force-download; name=\$file\);
header(Content-Disposition: attachment; filename=\$file \);
header(Content-Transfer-Encoding: binary);
header(Content-Length: $content_length);
$fp = fopen($file_fullpath,r);
fpassthru($fp);
fclose($fp);
   my code
 
  this is a memory issue in the php.ini i.e. memory_limit = 8M then the
  largest file i can download is 8M
 
  is there anyway to force a download without having to use the system
  hungry fpassthru function?
 
  this is driving me nuts so any help would be greatly appreciated
 
  cheers
  christian
 
  ps i read the following at php.net fpassthru man page but could not make
  sense of it (it appears to be some kind of solution) 
 
  fpassthru() works best for small files. In download manager scripts,
  it's best to determine the URL of the file to download (you may generate
  it locally in your session data if you need so), and then use HTTP
  __temporary__ redirects (302 status code, with a Location: header
  specifying the effective download URL).
  This saves your web server from maintaining PHP scripts running for long
  times during the file downloadn and instead the download will be managed
  directly by the web server without scripting support (consequence: less
  memory resources used by parallel downloads)...
 


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




[PHP] Re: Glaring problem with libmcrypt!!!

2002-10-03 Thread Jeff Bluemel

yea - I'm having the exact same problem - trying to use that nice little
piece of encrypt /decript stuff that was posted earlier


Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!  I ran through the phpinfo and here's the result.  That's explain why
 I'm unable to get most of the mcrypt functions to work.  Features like
 mcrypt_module_open, mcrypt_list_algorithms, mcrypt_get_block_size,
 etc.  So, what's the problem here?  PHP bugs?  Please spill your gut out
on
 this one if you know of one.  Thansk!

 --clip--

 mcrypt

 --
 |  mcrypt support|  enabled  |
 --
 |  Version   |  2.4.x  |
 |  Supported Ciphers  |  none  |
 |  Supported Modes   |  none  |
 --

 -
 |  Directive |  Local Value  |  Master Value  |
 -
 |  mcrypt.algorithms_dir  |  no value   |  no value  |
 |  mcrypt.modes_dir   |  no value   |  no value  |
 -

 --clip--





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




[PHP] Looking for feedback

2002-10-03 Thread Erich Kolb

Sorry for the ID10T, the address is: http://www.phpdiscuss.com


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




[PHP] Re: using fopen() to download remote files

2002-10-03 Thread Cliff Small

Thanks for the help Gamin.  I've been reading some posts and have noticed
that lots of people are having the same problem as I.  I'm using php 4.1.2
which came with redhat 7.3.  I think that there was a bug in 4.1.2 regarding
fopen() and unusually long delays with HTTP files.  I may try and compile
and install 4.2.3 and see if this resolves my problems.

Your suggestions may not be suited for what I need to do as I think that
writing to the disk would cause more overhead than I could live.  Although
it sounds very interesting.

Thanks,
Cliff
Rusty Small [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have written a script in which the main purpose is to download html
pages
 from multiple web servers.  I'm using the fopen() function to download
these
 pages.  I would like to be able to download only the source (text) and no
 binary data as this would greatly improve the speed of my script.

 I've seen this on the client side with browsers being set to text only
mode.
 Is there a way to do this with php on the sever side to tell the remote
web
 server to not download the images associated a particular URL?  I'm
running
 Red Hat 7.3 and Apache web server.

 Any help would be greatly appreciated.

 Cliff





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




Re: [PHP] force download and file size issue

2002-10-03 Thread Rasmus Lerdorf

readfile() reads 8k blocks at a time and dumps them out.  It does not read
the entire thing into ram, so that wouldn't be what was causing you to hit
a memory limit.  You must have done something else wrong then.

-Rasmus

On Fri, 4 Oct 2002, christian haines wrote:

 thanks rasmus,

 i have tried read file but it gave me the same issues as fpassthru.. both cap
 on the memory_limit directive withint the php.ini file

 any other suggestions maybe?

 cheers
 christian

 Rasmus Lerdorf wrote:

  readfile()
 
  On Fri, 4 Oct 2002, christian haines wrote:
 
   hi all,
  
   i have successfully created a download script to force a user to
   download, however attempting to download large files causes an error
   saying that the file cannot be found.
  
   my code 
 header(Cache-control: private);
 header(Content-Type: application/force-download; name=\$file\);
 header(Content-Disposition: attachment; filename=\$file \);
 header(Content-Transfer-Encoding: binary);
 header(Content-Length: $content_length);
 $fp = fopen($file_fullpath,r);
 fpassthru($fp);
 fclose($fp);
my code
  
   this is a memory issue in the php.ini i.e. memory_limit = 8M then the
   largest file i can download is 8M
  
   is there anyway to force a download without having to use the system
   hungry fpassthru function?
  
   this is driving me nuts so any help would be greatly appreciated
  
   cheers
   christian
  
   ps i read the following at php.net fpassthru man page but could not make
   sense of it (it appears to be some kind of solution) 
  
   fpassthru() works best for small files. In download manager scripts,
   it's best to determine the URL of the file to download (you may generate
   it locally in your session data if you need so), and then use HTTP
   __temporary__ redirects (302 status code, with a Location: header
   specifying the effective download URL).
   This saves your web server from maintaining PHP scripts running for long
   times during the file downloadn and instead the download will be managed
   directly by the web server without scripting support (consequence: less
   memory resources used by parallel downloads)...
  


 --
 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] recent encrpyt decrypt code... (problems)

2002-10-03 Thread Jeff Bluemel

I've seen a few other post on this, and it sounds like there is more then
one of use that is trying this script.  I've got it so that I can use the
commands, but I still get errors on the page...

here is what I have done.

I downloaded libmycrpt from
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt and configured it with
the following options;

./configure \
 --with-included-algos=rijndael-128 arcfour stream cbc cfb\
 --disable-posix-threads

I then reconfigured php with the --with-mcrpty option.  now when I try to
run the code I get the following errors;  (the php code I will repost inc
ase there are any questions)

 Usage
Warning: key size is 0 in /usr/local/apache/htdocs/test.phtml on line 15

Warning: mcrypt_generic_init: Key length incorrect in
/usr/local/apache/htdocs/test.phtml on line 15

Warning: mcrypt_generic(): 1 is not a valid MCrypt resource in
/usr/local/apache/htdocs/test.phtml on line 16

Warning: mcrypt_generic_deinit(): 1 is not a valid MCrypt resource in
/usr/local/apache/htdocs/test.phtml on line 17
encrypted =

Warning: key size is 0 in /usr/local/apache/htdocs/test.phtml on line 25

Warning: mcrypt_generic_init: Key length incorrect in
/usr/local/apache/htdocs/test.phtml on line 25

Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in
/usr/local/apache/htdocs/test.phtml on line 26

Warning: mcrypt_generic_deinit(): 2 is not a valid MCrypt resource in
/usr/local/apache/htdocs/test.phtml on line 29
decrypted =
Oops they don't match



?PHP
class encrypt_decrypt
{
var $secret;
function encrypt_class(){
$this-secret = 'this is a very long key, even too long for
the cipher';
}
Function encode($id){
$eid = $iv = 0;
$len = strlen($id);
$id = $len.'-'.$id;
$td = mcrypt_module_open(MCRYPT_TripleDES, ,
MCRYPT_MODE_ECB, );
$key = substr($this-secret, 0, mcrypt_enc_get_key_size
($td));
$iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
mcrypt_generic_init ($td, $key, $iv);
$eid = base64_encode(mcrypt_generic ($td, $id));
mcrypt_generic_deinit($td);
  return $eid;
}
Function decode($eid){
$id = $iv = 0;
$td = mcrypt_module_open (MCRYPT_TripleDES, ,
MCRYPT_MODE_ECB, );
$key = substr($this-secret, 0, mcrypt_enc_get_key_size
($td));
$iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
mcrypt_generic_init ($td, $key, $iv);
$id = mdecrypt_generic ($td, base64_decode($eid));
$len = strtok($id,'-');
$id = substr($id,(strlen($len)+1),$len);
mcrypt_generic_deinit($td);
return $id;
}
}
?

Usage

?
$word = 'Hello';
$e = new encrypt_decrypt();
$encrypted = $e-encode($word);
echo encrypted = $encrypted br;
$decrypted = $e-decode($encrypted);
echo decrypted = $decrypted br;
if($word == $decrypted){
echo They match br;
}
else{
echo Oops they don't match br;
}
?


--
Jeff Bluemel



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




Re: [PHP] Looking for feedback

2002-10-03 Thread Justin French

I'd really appreciate it if you masked email address with javascript or
something... or perhaps only showed email address' to logged in and
confirmed users... I already have my email address plastered all over the
marc archives... one more means twice as much spam :)

Justin


on 04/10/02 2:44 PM, Erich Kolb ([EMAIL PROTECTED]) wrote:

 Sorry for the ID10T, the address is: http://www.phpdiscuss.com
 


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




[PHP] No ouput until program end, why?

2002-10-03 Thread Jean-Christian Imbeault

I am running a PHP program under Linux on the command line. The problem 
I have is that I get no output to the screen until the program finishes.

I have lots of echo statements throughout the program to help me debug 
but none of them are printed until the program finishes, which is really 
a pain since the prog takes 30 minutes to run ...

The main() looks something like this. Can someone help me figure out why 
it is not printing anything until the program exists?

pg_exec($CONN, BEGIN);
for ($i = 0; $i  6001; $i++) {
   $retval = process($aFields);
   if ( ($i % 100) == 0 ) echo $i\n;
   if ($retval == 1) echo error on line $i \n;
}

echo COMMIT \n;
pg_exec($CONN, COMMIT);

Thanks,

Jc


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




  1   2   >