OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 8 May 2003 20:44:36 -0000 Issue 2045

php-general-digest-helplists.php.net
Date: Thu May 08 2003 - 15:44:36 CDT


php-general Digest 8 May 2003 20:44:36 -0000 Issue 2045

Topics (messages 146804 through 146911):

Re: How to preserve instance of class within sessions ???
        146804 by: Ernest E Vogelsinger
        146835 by: Jason Sheets

Creating symlink from browser
        146805 by: Radu Manole
        146834 by: Jason Sheets

stripslashes, within a string?
        146806 by: Tristan.Pretty.risk.sungard.com
        146812 by: Ford, Mike [LSS]
        146814 by: Tristan.Pretty.risk.sungard.com

Re: Include Problem... (was Listing Declared Variables)
        146807 by: Ford, Mike [LSS]

Re: Undefined index
        146808 by: Ford, Mike [LSS]
        146861 by: Jim Lucas
        146863 by: caspar kennerdale
        146864 by: Jim Lucas

Concatinate two images with GD?
        146809 by: Martin Johansson

Re: Newbie question about variable scope in Apache 2.0 & PH P
        146810 by: Ford, Mike [LSS]

Re: PHP and GD
        146811 by: Martin Johansson

using header() to server tiff
        146813 by: hboyce.eab.co.uk
        146815 by: Ernest E Vogelsinger

array_merge_recursive again
        146816 by: David T-G

Re: Largest INT val?
        146817 by: Joel Rees
        146818 by: Ford, Mike [LSS]
        146820 by: Tom Rogers

Re: Looping output to table header
        146819 by: Chris Blake

Re: Variable Names...
        146821 by: Justin French

Calulating the Diffenece of two Dates in e.G. days
        146822 by: Torsten Ueberschar
        146823 by: Jason Wong
        146824 by: Ernest E Vogelsinger
        146825 by: Ernest E Vogelsinger
        146826 by: Jason Wong

Virtual Host creation...
        146827 by: Mohit Mittal
        146828 by: Mark Douglas
        146829 by: David T-G
        146830 by: Ryan A
        146832 by: c.williams.adnewmedia.de
        146839 by: Brian V Bonini

Writing remote data to local file
        146831 by: Dave Rosenberg
        146846 by: Jason Wong
        146851 by: Dave Rosenberg
        146855 by: Ford, Mike [LSS]
        146857 by: Dave Rosenberg
        146858 by: Jason Wong
        146859 by: Ford, Mike [LSS]
        146872 by: Ernest E Vogelsinger
        146875 by: Ford, Mike [LSS]

Counter
        146833 by: Shaun
        146838 by: Mark Douglas
        146840 by: Shaun
        146841 by: Mark Douglas
        146842 by: Chris Edwards
        146843 by: Merritt, Dave
        146845 by: bbonkosk.tampabay.rr.com
        146847 by: Chris Edwards
        146852 by: Merritt, Dave
        146877 by: bbonkosk.tampabay.rr.com
        146891 by: Steve Keller

Re: mcrypt installation
        146836 by: Jason Sheets

assigning links to a variable
        146837 by: Philippe Rousselot

UDP Packet Writing
        146844 by: Adam Voigt
        146848 by: Hugh Bothwell

database (slightly ot)
        146849 by: Ryan A
        146854 by: Ford, Mike [LSS]
        146856 by: David T-G

Re: Removing Returns / New Lines / Tabs / Extra Spaces from DB Results
        146850 by: Brent Baisley
        146869 by: Jami

mod_php4, where can I find it?
        146853 by: Joseph Maxwell
        146860 by: Cal Evans
        146868 by: Joseph Maxwell

How i can read the IP of the user
        146862 by: Rommel Samanez
        146870 by: Tom Woody
        146871 by: Andreas Cahen

Testing UDP Port
        146865 by: Charles Kline
        146874 by: Ernest E Vogelsinger

PHP newbie: I love it, but...
        146866 by: Jean
        146873 by: Jean
        146881 by: Philip Hallstrom
        146884 by: Bobby Patel
        146886 by: Greg Beaver

Quick session var ?
        146867 by: Shawn McKenzie
        146878 by: Shawn McKenzie

../ not working in path
        146876 by: Ken Tozier
        146882 by: Bobby Patel

post dates
        146879 by: Shawn McKenzie

Global Interference
        146880 by: caspar kennerdale
        146890 by: caspar kennerdale

variables wont' carry over to the next page
        146883 by: Grant
        146885 by: R'twick Niceorgaw
        146894 by: Grant
        146900 by: R'twick Niceorgaw
        146909 by: Grant

move_uploaded_file($swf,0777)
        146887 by: ruusvuu.whitney.dns2go.com
        146899 by: Jason Wong

snmpget on Win32 PHP 4.3.1
        146888 by: Daniel Maxwell

newbie question on PHP and PostgreSQL
        146889 by: m

XML Resources
        146892 by: Dan Joseph
        146896 by: Dan Joseph

ANY IDEAS?
        146893 by: Dale
        146906 by: Jason Wong

__PHP_Incomplete_Class Object
        146895 by: Juerg Zgraggen
        146898 by: Juerg Zgraggen

Oracle connection suddenly stopped working
        146897 by: Jack Baty

Zend encoding and security
        146901 by: Larry Vanyard
        146903 by: Manuel Lemos

IPTC and GetImageSize() problem
        146902 by: Jakob Öhman

PHP/Apache/MS SQL
        146904 by: Matt Giddings

Solaris 8, PHP 4.3.1, OpenLDAP 2.1.17 Install problem
        146905 by: MG

Re: Binary File Download problems.
        146907 by: Rob Lacey

All/List Admins: Questions/Requests regarding the list format (pls comment)
        146908 by: Ernest E Vogelsinger

Errors Compiling PHP 4.3.1 with Apache 2
        146910 by: Felderi Santiago

MySql question
        146911 by: Sparky Kopetzky

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


At 10:18 08.05.2003, aka MacGuru said:
--------------------[snip]--------------------
>I have class CMyApp which stores a lot of app data (like persistent
>database connections via ADODB), and instance of this class called
>$gApp (of course, as global). I am using "register globals off" and
>trying to preserve $gApp through entire execution flow of the program.
>
>However, as I am understood from the manual, objects cannot be
>preserved via session SID data, neither the object is alive in $GLOBALS
>after header("Location: script.php") with SID (not shown there).
>
>As a dubious solution I can write two functions which extract object's
>fields into plain variables, put them into global scope, and then
>recreating object back from saved global data. However, this is kinda
>awkward.
>
>The questions is how to preserve instance of the class within sessions
>(if it is possible at all, of course) with "register globals off" (or
>at least, how to turn register globals on ONLY for my program, and not
>for any other php app).
--------------------[snip]--------------------

First of all, read the manual pages on sessions thoroughly. $_GLOBALS are
never preserved across a session, that's what $_SESSION is for.

And yes, you _can_ make objects session persistent, PROVIDED that the
necessary class definitions are loaded/included/defined _before_ the
session gets reconstructed.

Working example:

    class A {
       function A() {
           $this->time = time();
       }
       function say() {
           return date('H:m:s', $this->time);
       }
    }
    session_start();
    if (!$_SESSION['instance_A'])
        $_SESSION['instance_A'] = new A();
    $a =&$_SESSION['instance_A'];
    echo 'The object's time is ', $a->say(), '<br />';

If however you would put session_start() before the class definition, or
have session.auto_start enabled in php.ini, this cannot work - PHP needs to
know the class definition when reconstructing an object from session data.
If this is missing it will resort to a default class where all data
properties are preserved, but of course no methods are available.

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


You can serialize and unserialize the object in $_SESSION.

Jason

Andrei Verovski (aka MacGuru) wrote:

> Hi,
>
> I have programmed in C++ before (with class libraries). I am always
> had global variable (instance of CApplication class) which carries
> application properties and data all the time program is running. When
> I have tried to use the same tactic in PHP, some curious difficulties
> arise.
>
> I have class CMyApp which stores a lot of app data (like persistent
> database connections via ADODB), and instance of this class called
> $gApp (of course, as global). I am using "register globals off" and
> trying to preserve $gApp through entire execution flow of the program.
>
> However, as I am understood from the manual, objects cannot be
> preserved via session SID data, neither the object is alive in
> $GLOBALS after header("Location: script.php") with SID (not shown there).
>
> As a dubious solution I can write two functions which extract object's
> fields into plain variables, put them into global scope, and then
> recreating object back from saved global data. However, this is kinda
> awkward.
>
> The questions is how to preserve instance of the class within sessions
> (if it is possible at all, of course) with "register globals off" (or
> at least, how to turn register globals on ONLY for my program, and not
> for any other php app).
>
> Thanks in advance for any suggestion.
>
> *********************************************
> * Best Regards --- Andrei Verovski
> *
> * Personal Home Page
> * http://snow.prohosting.com/guru4mac
> * Mac, Linux, DTP, Development, IT WEB Site
> *********************************************
>
>

attached mail follows:


Hi guys,

I have this server with PHP is installed as an apache module on a linux box
and I want to create a symlink from browser.

1. When running the PHP script from shell (using #!/usr/local/bin/php)
everything works fine.
but
2. I copied the file into cgi-bin directory and called it from browser
and it did not worked. The log file said something like
"glob failed ...<_GEN_0> chunk1"

3. tried exec(), symlink() but no luck

Any ideas about how can I do this are appreciated.

many thanks,
Radu

attached mail follows:


Check the file permissions, if you are running it from your shell the
PHP script is running as the user you are logged in as. When you are
running it from the web the script is running as the user the web server
is running as.

Jason

Radu Manole wrote:

>Hi guys,
>
>I have this server with PHP is installed as an apache module on a linux box
>and I want to create a symlink from browser.
>
>1. When running the PHP script from shell (using #!/usr/local/bin/php)
>everything works fine.
>but
>2. I copied the file into cgi-bin directory and called it from browser
>and it did not worked. The log file said something like
>"glob failed ...<_GEN_0> chunk1"
>
>3. tried exec(), symlink() but no luck
>
>Any ideas about how can I do this are appreciated.
>
>many thanks,
>Radu
>
>
>
>
>
>

attached mail follows:


I wanna use a variable within a string.
But I need to strip slashes first.

I've used this, but it fails...?

$email = addslashes($email); // variable from a previous form

//Add $email to database

$body = "The following E-mail address: " . stripslashes($email); . "Has
been recieved";

mail($mailto, $subject, $body);

Line 3 give me an error... (Parse error: parse error.....)

What monkey mistake am I making?

Cheers all
Tris...

"Radu Manole" <raduu-zine.com>
08/05/2003 10:13
Please respond to "Radu Manole"

 
        To: <php-generallists.php.net>
        cc:
        Subject: [PHP] Creating symlink from browser

Hi guys,

I have this server with PHP is installed as an apache module on a linux
box
and I want to create a symlink from browser.

1. When running the PHP script from shell (using #!/usr/local/bin/php)
everything works fine.
but
2. I copied the file into cgi-bin directory and called it from browser
and it did not worked. The log file said something like
"glob failed ...<_GEN_0> chunk1"

3. tried exec(), symlink() but no luck

Any ideas about how can I do this are appreciated.

many thanks,
Radu

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

***********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
************************************************************************

attached mail follows:


> -----Original Message-----
> From: Tristan.Prettyrisk.sungard.com
> [mailto:Tristan.Prettyrisk.sungard.com]
> Sent: 08 May 2003 10:29
> To: php-generallists.php.net
> Subject: [PHP] stripslashes, within a string?
>
>
> I wanna use a variable within a string.
> But I need to strip slashes first.
>
> I've used this, but it fails...?
>
> $email = addslashes($email); // variable from a previous form
>
> //Add $email to database
>
> $body = "The following E-mail address: " .
> stripslashes($email); . "Has
> been recieved";
>
> mail($mailto, $subject, $body);
>
> Line 3 give me an error... (Parse error: parse error.....)
>
> What monkey mistake am I making?

You've got a superfluous semicolon after the stripslashes() call.

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Perfect!

Cheers...
Stupid mistake... ;-)

"Ford, Mike [LSS]" <M.Fordlmu.ac.uk>
08/05/2003 10:41

 
        To: "'Tristan.Prettyrisk.sungard.com'" <Tristan.Prettyrisk.sungard.com>,
php-generallists.php.net
        cc:
        Subject: RE: [PHP] stripslashes, within a string?

> -----Original Message-----
> From: Tristan.Prettyrisk.sungard.com
> [mailto:Tristan.Prettyrisk.sungard.com]
> Sent: 08 May 2003 10:29
> To: php-generallists.php.net
> Subject: [PHP] stripslashes, within a string?
>
>
> I wanna use a variable within a string.
> But I need to strip slashes first.
>
> I've used this, but it fails...?
>
> $email = addslashes($email); // variable from a previous form
>
> //Add $email to database
>
> $body = "The following E-mail address: " .
> stripslashes($email); . "Has
> been recieved";
>
> mail($mailto, $subject, $body);
>
> Line 3 give me an error... (Parse error: parse error.....)
>
> What monkey mistake am I making?

You've got a superfluous semicolon after the stripslashes() call.

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: m.fordlmu.ac.uk
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

***********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
************************************************************************

attached mail follows:


> -----Original Message-----
> From: Dan Tappin [mailto:dan.tappinorourke-eng.com]
> Sent: 07 May 2003 16:18
> To: php-generallists.php.net
>
>
> Now I have an existing page where I want to add the geoip
> feature to display
> the country name and flag based on an IP address. I have a
> stats page where
> I am pulling log data fram a mySQL db and displaying a table
> view. On each
> line of the table I added my call to the geoip functions to
> display the
> counrty info.
>
> On this particular site my links are like this:
>
> http://mysite.com/index.php?inc=stats&id=1
>
> I set this up so that I can have a generic index.php page
> which includes a
> 'stats.inc' file which parses based on the 'id=1' data.
>
> The problem is that if I now add the geoip include in the
> 'stats.inc' it
> fails. No error - no data echoed back. If I add the geoip
> calls in the
> base index.php it works fine.

You need to show us some more code -- at least the relevant bits of index.php and stats.inc would be a good starting point.

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


> -----Original Message-----
> From: caspar kennerdale [mailto:casparthetuckshop.com]
> Sent: 07 May 2003 16:37
>
>
> I have a basic switch defining the structure of my page. (see below)
>
> Whenever the default case is loaded I get a message that
> "action" is an
> undefined index. I understand that this is because "action"
> has no value. If
> I go to any of the other cases of my switch and thus giving
> "action" a value
> then I do not get the message.
>
>
> <?php
>
> switch ($_GET['action']) {
> default:
> echo "<a href=\"index.php?action=Test&variable=yes\">test</a>";
>
> break;
>
> case "Test":
> $variable=$_GET["variable"];
> echo $variable;
> break;
>
> }

To me, this is an ideal occasion to use the operator:

   switch ($_GET['action']) {
     default:
         echo "<a href=\"index.php?action=Test&variable=yes\">test</a>";
 
     break;
 
     case "Test":
         $variable=$_GET["variable"];
       echo $variable;
     break;
 
   }

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


yes, you can

if ( empty($_GET['action']) )
  $_GET['action'] = '';

Jim
----- Original Message -----
From: "caspar kennerdale" <casparthetuckshop.com>
To: <adamcryptocomm.com>
Cc: <php-generallists.php.net>
Sent: Wednesday, May 07, 2003 8:46 AM
Subject: RE: [PHP] Undefined index

> Thanks that 'covers' up the error message, but is there no way to give the
> index a value then when it is the default of a switch?
>
>
> Cheers
>
> Caspar
>
>
> Just at the top of your page, or in an include, put:
>
> error_reporting(E_ALL ^ E_NOTICE);
>
> (This is according to the error_reporting manual page).
>
>
> On Wed, 2003-05-07 at 11:37, caspar kennerdale wrote:
> > I have a basic switch defining the structure of my page. (see below)
> >
> > Whenever the default case is loaded I get a message that "action" is an
> > undefined index. I understand that this is because "action" has no
value.
> If
> > I go to any of the other cases of my switch and thus giving "action" a
> value
> > then I do not get the message.
> >
> > How do I give action an initial value so this message does not appear
> > initally? (I dont want to rely on isps turing messaging off!)
> >
> > If this isnt possible can you turn messaging off in .htaccess in the
same
> > way you can control register globals?
> >
> >
> >
> > <?php
> >
> > switch ($_GET['action']) {
> > default:
> > echo "<a href=\"index.php?action=Test&variable=yes\">test</a>";
> >
> > break;
> >
> > case "Test":
> > $variable=$_GET["variable"];
> > echo $variable;
> > break;
> >
> > }
> >
> > ?>
> --
> Adam Voigt (adamcryptocomm.com)
> Linux/Unix Network Administrator
> The Cryptocomm Group
>
>
> --
> 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
>
>

attached mail follows:


Thanks for everyone replies

This bit works now

-----Original Message-----
From: Jim Lucas [mailto:phplistzonedzero.net]
Sent: 08 May 2003 17:00
To: caspar kennerdale; adamcryptocomm.com
Cc: php-generallists.php.net
Subject: Re: [PHP] Undefined index

yes, you can

if ( empty($_GET['action']) )
  $_GET['action'] = '';

Jim
----- Original Message -----
From: "caspar kennerdale" <casparthetuckshop.com>
To: <adamcryptocomm.com>
Cc: <php-generallists.php.net>
Sent: Wednesday, May 07, 2003 8:46 AM
Subject: RE: [PHP] Undefined index

> Thanks that 'covers' up the error message, but is there no way to give the
> index a value then when it is the default of a switch?
>
>
> Cheers
>
> Caspar
>
>
> Just at the top of your page, or in an include, put:
>
> error_reporting(E_ALL ^ E_NOTICE);
>
> (This is according to the error_reporting manual page).
>
>
> On Wed, 2003-05-07 at 11:37, caspar kennerdale wrote:
> > I have a basic switch defining the structure of my page. (see below)
> >
> > Whenever the default case is loaded I get a message that "action" is an
> > undefined index. I understand that this is because "action" has no
value.
> If
> > I go to any of the other cases of my switch and thus giving "action" a
> value
> > then I do not get the message.
> >
> > How do I give action an initial value so this message does not appear
> > initally? (I dont want to rely on isps turing messaging off!)
> >
> > If this isnt possible can you turn messaging off in .htaccess in the
same
> > way you can control register globals?
> >
> >
> >
> > <?php
> >
> > switch ($_GET['action']) {
> > default:
> > echo "<a href=\"index.php?action=Test&variable=yes\">test</a>";
> >
> > break;
> >
> > case "Test":
> > $variable=$_GET["variable"];
> > echo $variable;
> > break;
> >
> > }
> >
> > ?>
> --
> Adam Voigt (adamcryptocomm.com)
> Linux/Unix Network Administrator
> The Cryptocomm Group
>
>
> --
> 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

attached mail follows:


even better yet. this is how i have things.

<?php

function alternate(&$a, $b) {
  return( $a = ( $a ? $a : $b ) );
}

then in your script do this.

echo $_GET['action']; // this will give you an error if you didn't pass
anything.
alternate($_GET['action'], 'action is now set to this string');
echo $_GET['action']; // this will echo 'action is now set to this string'

?>

now, if $_GET['action'] is blank, null, or not set at all, then it will set
$_GET['action'] to whatever you give as the second argument.

----- Original Message -----
From: "Jim Lucas" <phplistzonedzero.net>
To: "caspar kennerdale" <casparthetuckshop.com>; <adamcryptocomm.com>
Cc: <php-generallists.php.net>
Sent: Thursday, May 08, 2003 9:00 AM
Subject: Re: [PHP] Undefined index

> yes, you can
>
> if ( empty($_GET['action']) )
> $_GET['action'] = '';
>
> Jim
> ----- Original Message -----
> From: "caspar kennerdale" <casparthetuckshop.com>
> To: <adamcryptocomm.com>
> Cc: <php-generallists.php.net>
> Sent: Wednesday, May 07, 2003 8:46 AM
> Subject: RE: [PHP] Undefined index
>
>
> > Thanks that 'covers' up the error message, but is there no way to give
the
> > index a value then when it is the default of a switch?
> >
> >
> > Cheers
> >
> > Caspar
> >
> >
> > Just at the top of your page, or in an include, put:
> >
> > error_reporting(E_ALL ^ E_NOTICE);
> >
> > (This is according to the error_reporting manual page).
> >
> >
> > On Wed, 2003-05-07 at 11:37, caspar kennerdale wrote:
> > > I have a basic switch defining the structure of my page. (see below)
> > >
> > > Whenever the default case is loaded I get a message that "action" is
an
> > > undefined index. I understand that this is because "action" has no
> value.
> > If
> > > I go to any of the other cases of my switch and thus giving "action" a
> > value
> > > then I do not get the message.
> > >
> > > How do I give action an initial value so this message does not appear
> > > initally? (I dont want to rely on isps turing messaging off!)
> > >
> > > If this isnt possible can you turn messaging off in .htaccess in the
> same
> > > way you can control register globals?
> > >
> > >
> > >
> > > <?php
> > >
> > > switch ($_GET['action']) {
> > > default:
> > > echo "<a href=\"index.php?action=Test&variable=yes\">test</a>";
> > >
> > > break;
> > >
> > > case "Test":
> > > $variable=$_GET["variable"];
> > > echo $variable;
> > > break;
> > >
> > > }
> > >
> > > ?>
> > --
> > Adam Voigt (adamcryptocomm.com)
> > Linux/Unix Network Administrator
> > The Cryptocomm Group
> >
> >
> > --
> > 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
>
>

attached mail follows:


Is there anyway to concatinate two image identifiers?
I have one pngimage, created in photoshop and another image dynamically
created with gd. Now I would like to put my photoshop-image above my
dynamically created gd-image. is that possible?

/Martin

attached mail follows:


> -----Original Message-----
> From: Wendell Brown [mailto:wbrownarkie.net]
> Sent: 07 May 2003 18:11
>
> On Wed, 7 May 2003 11:31:25 -0400, Steve Henderson wrote:
>
> >I am having trouble with variables remaining in scope
> between forms and
> >scripts. I keep getting errors saying $val1 is not defined
> etc. This
>
> I suspect that the problem is that you have "register_globals" turned
> off (it's a safety default in newer versions of PHP). There are a few
> possible solutions:
>
> 1) Turn on register_globals on... this can be set in the php.ini or
> (under Apache) in the .htaccess file.
>
> 2) Use the "long name" for the variable. Instead of:
>
> echo "$val2";

Uh, oh! Attack of the superfluous quotes!
  
  echo $val2;

>
> try this:
>
> echo "$_POST(\"val2\")";

  echo $_POST['val2'];

>
> 3) Or extract the $_POST array....
>
> extract( $_POST );
> echo "$val2";

  echo $val2;

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


The only thing you need to do is to to make it work is to uncomment the
extention parameter named
extension=php_gd2.dll in your php.ini

/Martin

"James" <jamesglobalvision.com> skrev i meddelandet
news:20030506170347.36029.qmailpb1.pair.com...
> Yes - with FreeType installed.
>
> "Spyproductions Support Team" <supportspyproductions.com> wrote in
message
> news:GKEFLEHIPEGIFEECKBNEOEJPKOAA.supportspyproductions.com...
> >
> > I have a friend who is swearing up and down that the most recent release
> of
> > PHP comes with GD bundled. I haven't been able to find much on this -
> > including anything from this list! :\
> >
> > Does anyone know if this is really true? I just installed PHP Version
> > 4.3.2-RC2 - I don't see anything mentioned about the GD libraries
> anywhere.
> >
> > Is there a bundled version? He quotes this from the manual:
> >
> > "Note: Since PHP 4.3 there is a bundled version of the GD lib. This
> bundled
> > version
> > has some additional features like alpha blending, and should be used in
> > preference
> > to the external library since it's codebase is better maintained and
more
> > stable."
> >
> > Thanks for any information,
> >
> > -Mike
> >
> >
>
>

attached mail follows:


I'm trying to write an image server script to serve tif/tiff files so that
they will open in a browser using an appropriate plug-in. If I just do
an href to the file they open fine, however for security reasons we
want to keep the files outside the document root. The result is a
screen of binary displayed in ascii characters. The code I am using
is:

<?php
        $file = "test.tif";
        header("Cache-control: private");
        header ("Content-Type: image/tiff");
        header("Content-Length: ".filesize($file));
        header ("Content-transfer-encoding: binary");
        header ("Content-Disposition: inline; filename = \"$file\"");
        $fp = fopen($file, 'rb');
        fpassthru($fp);

Has anyone had to do this before? Any help gratefully appreciated.

Hilary--
Hilary Boyce
Enterprise AB Ltd
hboyceeab.co.uk
Tel: 01727 751455

attached mail follows:


At 11:57 08.05.2003, hboyceeab.co.uk said:
--------------------[snip]--------------------
>I'm trying to write an image server script to serve tif/tiff files so that
>they will open in a browser using an appropriate plug-in. If I just do
>an href to the file they open fine, however for security reasons we
>want to keep the files outside the document root. The result is a
>screen of binary displayed in ascii characters. The code I am using
>is:
>
><?php
> $file = "test.tif";
> header("Cache-control: private");
> header ("Content-Type: image/tiff");
> header("Content-Length: ".filesize($file));
> header ("Content-transfer-encoding: binary");
> header ("Content-Disposition: inline; filename = \"$file\"");
> $fp = fopen($file, 'rb');
> fpassthru($fp);
>
>Has anyone had to do this before? Any help gratefully appreciated.
--------------------[snip]--------------------

This should work as expected, as far as I can see.
I suspect that some data has already been sent before your binary file,
maybe some space after a closing ?> tag, so PHP transmits the default
text/html content header.

If you're on X, you can inspect the effective server output with lynx:

lynx --mime_header http://myhost/myscript?somemore | less

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


Hi again, all --

Thanks to Mike pointing out my huge overlooking of the obvious, I'm
tinkering with array_merge_recursive for my parsed ini files. I still
have some undesired behavior, though.

The idea is that I'll have a host-wide master ini file where I set
defaults (tools to use, colors, session name, ...), a site-wide ini file
where the client sets his defaults (name, contact numbers, tag line, ...),
and a a per-directory ini file where things can be tweaked for a special
case.

Using array_merge_recursive I am able to combine all of these things;
yay. The problem is when I have something like

  host.ini:
    ...
    listcols = 2
    ...

  site.ini
    ...
    listcols = 3
    ...

In that case, instead of stepping on the old listcols value, I suddenly
have an indexed array $listcols which points to the various values!

Maybe I do need to write my own parser because of these perhaps-special
requirements. Maybe I'm also approaching it in the wrong way, though; I
find it hard to believe that I'm the first person to need this sort of
functionality. The bottom line of what I need is:

  - a cascading parameter framework giving more precedence to more
    localized settings (ie the per-directory file)

  - something easy enough to parse that I can build a 'settings' web
    page, accept input, and rewrite the file

(at least, I think that's a complete spec ;-) Anyone have any ideas?

TIA again & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+ujCmGb7uCXufRwARAsY2AKCjO9kLXveCEfDmFbi9l/11x8VEywCfeiFZ
+CuEuFGRcfCDE2GQhI4upsk=
=MNUL
-----END PGP SIGNATURE-----

attached mail follows:


> http://www.php.net/manual/en/language.types.integer.php
> Read the manual
> "The size of an integer is platform-dependent, although a maximum value of
> about two billion is the usual value (that's 32 bits signed). PHP does not
> support unsigned integers."

Where would I post a request for PHP 5 to make the implementation limits
available (as in C's limits.h)?

--
Joel Rees <joelalpsgiken.gr.jp>

attached mail follows:


> -----Original Message-----
> From: Joel Rees [mailto:joelalpsgiken.gr.jp]
> Sent: 08 May 2003 11:32
> To: php-generallists.php.net
> Subject: Re: [PHP] Largest INT val?
>
>
> > http://www.php.net/manual/en/language.types.integer.php
> > Read the manual
> > "The size of an integer is platform-dependent, although a
> maximum value of
> > about two billion is the usual value (that's 32 bits
> signed). PHP does not
> > support unsigned integers."
>
> Where would I post a request for PHP 5 to make the
> implementation limits
> available (as in C's limits.h)?

http://bugs.php.net/report.php (set the "Type of bug" selector to "Feature/Change Request").

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Hi,

Thursday, May 8, 2003, 4:43:55 AM, you wrote:
JC> Hi

JC> Does any know what the largest +/- INTEGER value that PHP supports?

JC> Thanks,
JC> Jason

You can get the integer size in bytes like this

echo 'Integer size '.strlen(pack("i",-1)).' bytes <br>';

--
regards,
Tom

attached mail follows:


Howdy,

I have resolved this one.....

Thanks

Chris

On Thu, 2003-05-08 at 10:27, Chris Blake wrote:
> Greetings learned PHP(eople),
>
> I have a text file, the content of which is made into an array.
> I want to strip out the first line of the text file which contains the
> column headers, and output them to a table row as headers for the table.
>
> Instead of referencing each element of the first line by using its array
> element number, I want to put the number of elements into a loop and
> generate the table header using $i, but its not working.
>
> Here`s the snippet code for making the <th>
> I tried using while() nested below the for() loop, but my browser hangs
> and CPU usage maxes out.....
> ------------------------------------------------------------
> echo "<table border='0'>\n";
> echo "<tr>\n";
> //Get column headers (first line) from text file
> for ($i = 0; $i < 1; $i++)
> {
> $headers = explode( "\t", $products[$i]);
> }
> //THIS WORKS BY USING THE ARRAY ELEMENT NUMBER< BUT I WANT $i
> echo "<th bgcolor='#ccccff'>" . $headers[0] . "</th>\n";
>
> echo "</tr>\n\n";
> -----------------------------------------------------------
>
> Ideas ?
>
> --
> Chris Blake
> Office : (011) 782-0840
> Cell : 083 985 0379
> The right half of the brain controls the left half of the body. This
> means that only left handed people are in their right mind.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
The right half of the brain controls the left half of the body. This
means that only left handed people are in their right mind.

attached mail follows:


Start by describing what the values of $macad and $count are, and what you'd
like to register to the session.

The more you tell us what you're expecting the resulting session variables
to be named and what they'll contain, the more we can help.

Justin

on 08/05/03 7:11 PM, Inpho (inphormgmx.net) wrote:

> Hey all,
>
> I'm trying to register a variable in a session:
>
> session_register("macad$count");
>
> so I want to define it as:
>
> $macad$count = "$macad[$count]";
>
> php doesn't like the double variables... .how do I define it then???
>
> cheers
>
> - paul -
>
>

attached mail follows:


Hi List,

i am looking for an algorithm whitch makes something like this:

echo div_dates("2003-05-01", "2003-05-02");

output: 1.

Tnx fer help.

Torsten

attached mail follows:


On Thursday 08 May 2003 20:14, Torsten Ueberschar wrote:

> i am looking for an algorithm whitch makes something like this:
>
> echo div_dates("2003-05-01", "2003-05-02");

Convert both to unix timestamps then subtract one from the other.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Keep grandma off the streets -- legalize bingo.
*/

attached mail follows:


At 14:26 08.05.2003, Jason Wong spoke out and said:
--------------------[snip]--------------------
>On Thursday 08 May 2003 20:14, Torsten Ueberschar wrote:
>
>> i am looking for an algorithm whitch makes something like this:
>>
>> echo div_dates("2003-05-01", "2003-05-02");
>
>Convert both to unix timestamps then subtract one from the other.
--------------------[snip]--------------------

This will return 86400, being the number of seconds within exactly one day.

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


At 14:26 08.05.2003, Jason Wong spoke out and said:
--------------------[snip]--------------------
>On Thursday 08 May 2003 20:14, Torsten Ueberschar wrote:
>
>> i am looking for an algorithm whitch makes something like this:
>>
>> echo div_dates("2003-05-01", "2003-05-02");
>
>Convert both to unix timestamps then subtract one from the other.
--------------------[snip]--------------------

This will return 86400, being the number of seconds within exactly one day.

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


On Thursday 08 May 2003 20:28, Ernest E Vogelsinger wrote:
> At 14:26 08.05.2003, Jason Wong spoke out and said:
> --------------------[snip]--------------------
>
> >On Thursday 08 May 2003 20:14, Torsten Ueberschar wrote:
> >> i am looking for an algorithm whitch makes something like this:
> >>
> >> echo div_dates("2003-05-01", "2003-05-02");
> >
> >Convert both to unix timestamps then subtract one from the other.
>
> --------------------[snip]--------------------
>
> This will return 86400, being the number of seconds within exactly one day.

I was hoping it was obvious that one had to divide by 60x60x24 to get the
number of days ;-)

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Always store beer in a dark place.
                -- Lazarus Long
*/

attached mail follows:


Hi,
        I have an Apache Web Server running on a Linux machine. I want to create
two alias web sites for this server. I made the following entries in my
httpd.conf file

NameVirtualHost 192.168.88.90

<VirtualHost 192.168.88.90>
        DocumentRoot "/var/www/html/alice-1.0/secure"
        ServerName staff.abnamroaptlending.com
</VirtualHost>

<VirtualHost 192.168.88.90>
        DocumentRoot "/var/www/html/alice-1.0/secure"
        ServerName appraiser.abnamroaptlending.com
</VirtualHost>

I also made the required entries in the /etc/hosts file on the linux server.
But for some reason, when I type the url in the browser, the IP address of
the server is not getting resolved.

        If somebosy can tell me, where I am going wrong, it will be a big help.

Mohit Mittal
Software Engineer
Patni Computer Systems (P) Ltd.
Noida,
Office Tel:
91 120 2516880 - 83
Ext: 1261
Residence Tel:
91 11 26890175

attached mail follows:


Please explain how this belongs on the PHP list instead of an Apache list.

-----Original Message-----
From: Mohit Mittal [mailto:mohit.mittalpatni.com]
Sent: Thursday, May 08, 2003 9:16 PM
To: php-generallists.php.net
Subject: [PHP]Virtual Host creation...

Hi,
        I have an Apache Web Server running on a Linux machine. I want to
create
two alias web sites for this server. I made the following entries in my
httpd.conf file

NameVirtualHost 192.168.88.90

<VirtualHost 192.168.88.90>
        DocumentRoot "/var/www/html/alice-1.0/secure"
        ServerName staff.abnamroaptlending.com
</VirtualHost>

<VirtualHost 192.168.88.90>
        DocumentRoot "/var/www/html/alice-1.0/secure"
        ServerName appraiser.abnamroaptlending.com
</VirtualHost>

I also made the required entries in the /etc/hosts file on the linux server.
But for some reason, when I type the url in the browser, the IP address of
the server is not getting resolved.

        If somebosy can tell me, where I am going wrong, it will be a big
help.

Mohit Mittal
Software Engineer
Patni Computer Systems (P) Ltd.
Noida,
Office Tel:
91 120 2516880 - 83
Ext: 1261
Residence Tel:
91 11 26890175

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

attached mail follows:


Mohit --

...and then Mohit Mittal said...
%
% Hi,
% I have an Apache Web Server running on a Linux machine. I want to create

Perhaps I've missed the point here... Did you use php to generate this
conf file? Is this a new version of apache written entirely in php,
perhaps? Are you even getting to a php script to have a php problem?

Does this, in fact, have *anything* to do with php?

...
% If somebosy can tell me, where I am going wrong, it will be a big help.

Well, you might try an apache list for starters...

Good luck & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+ulJfGb7uCXufRwARAlMpAKC1IOprbaXVcV2wSovc1uhZcaQxjACgqY55
jTIXB/ehMidyiMof2aEfbow=
=t4WT
-----END PGP SIGNATURE-----

attached mail follows:


Hi Mohit,
Its really extremly simple what you have done wrong...

and if you scroll down I will explain

the first

thing

that

you

did

wrong

was

you

wrote

to

the

wrong

list.

This

list

is

FOR PHP NOT APACHE.

Have a nice day.

:-D

Cheers,
-Ryan

----- Original Message -----
From: "Mohit Mittal" <mohit.mittalpatni.com>
To: <php-generallists.php.net>
Sent: Friday, May 09, 2003 3:16 AM
Subject: [PHP]Virtual Host creation...

> Hi,
> I have an Apache Web Server running on a Linux machine. I want to create
> two alias web sites for this server. I made the following entries in my
> httpd.conf file
>
> NameVirtualHost 192.168.88.90
>
> <VirtualHost 192.168.88.90>
> DocumentRoot "/var/www/html/alice-1.0/secure"
> ServerName staff.abnamroaptlending.com
> </VirtualHost>
>
> <VirtualHost 192.168.88.90>
> DocumentRoot "/var/www/html/alice-1.0/secure"
> ServerName appraiser.abnamroaptlending.com
> </VirtualHost>
>
> I also made the required entries in the /etc/hosts file on the linux
server.
> But for some reason, when I type the url in the browser, the IP address of
> the server is not getting resolved.
>
> If somebosy can tell me, where I am going wrong, it will be a big help.
>
> Mohit Mittal
> Software Engineer
> Patni Computer Systems (P) Ltd.
> Noida,
> Office Tel:
> 91 120 2516880 - 83
> Ext: 1261
> Residence Tel:
> 91 11 26890175
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Ryan,

You are a rude and mean person. How do you sleep at night? HAHAHA. tooooo
friggin funny. Thanks for the laugh.

chuck

----- Original Message -----
From: "Ryan A" <ryanjumac.com>
To: <mohit.mittalpatni.com>
Cc: <php-generallists.php.net>
Sent: Thursday, May 08, 2003 2:58 PM
Subject: Re: [PHP]Virtual Host creation...

> Hi Mohit,
> Its really extremly simple what you have done wrong...
>
> and if you scroll down I will explain
>
> the first
>
>
> thing
>
>
>
> that
>
>
>
> you
>
>
> did
>
>
> wrong
>
>
>
> was
>
>
>
> you
>
>
>
> wrote
>
>
>
> to
>
>
>
> the
>
>
>
>
> wrong
>
>
>
>
> list.
>
>
>
>
> This
>
>
>
> list
>
>
>
> is
>
>
> FOR PHP NOT APACHE.
>
> Have a nice day.
>
> :-D
>
> Cheers,
> -Ryan
>
>
>
> ----- Original Message -----
> From: "Mohit Mittal" <mohit.mittalpatni.com>
> To: <php-generallists.php.net>
> Sent: Friday, May 09, 2003 3:16 AM
> Subject: [PHP]Virtual Host creation...
>
>
> > Hi,
> > I have an Apache Web Server running on a Linux machine. I want to create
> > two alias web sites for this server. I made the following entries in my
> > httpd.conf file
> >
> > NameVirtualHost 192.168.88.90
> >
> > <VirtualHost 192.168.88.90>
> > DocumentRoot "/var/www/html/alice-1.0/secure"
> > ServerName staff.abnamroaptlending.com
> > </VirtualHost>
> >
> > <VirtualHost 192.168.88.90>
> > DocumentRoot "/var/www/html/alice-1.0/secure"
> > ServerName appraiser.abnamroaptlending.com
> > </VirtualHost>
> >
> > I also made the required entries in the /etc/hosts file on the linux
> server.
> > But for some reason, when I type the url in the browser, the IP address
of
> > the server is not getting resolved.
> >
> > If somebosy can tell me, where I am going wrong, it will be a big help.
> >
> > Mohit Mittal
> > Software Engineer
> > Patni Computer Systems (P) Ltd.
> > Noida,
> > Office Tel:
> > 91 120 2516880 - 83
> > Ext: 1261
> > Residence Tel:
> > 91 11 26890175
> >
> >
> >
> > --
> > 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
>
>

attached mail follows:


On Thu, 2003-05-08 at 21:16, Mohit Mittal wrote:
> Hi,
> I have an Apache Web Server running on a Linux machine. I want to create
> two alias web sites for this server. I made the following entries in my
> httpd.conf file
>

I'm sure plenty here could answer that but I was just curious what it had to do with PHP.

attached mail follows:


Hi,

I'm trying to write the data from a remote file (on the web) to a local
file (test.txt). I tried the code below, but rather than the contents
of the remote file being written to the local file, the local file
contains a resource ID. I'd appreciate a push in the right direction as
  far as pulling all the data from the remote file to the text file.

| $remotefile = fopen('http://mydomain.org/testo.html','r');
|
| $localfile = fopen('/home/dave/public_html/test.txt','w');
|
| fwrite($localfile,$remotefile);
|
| fclose($localfile);
|
| fclose($remotefile);

Thanks

Dave

attached mail follows:


On Thursday 08 May 2003 20:46, Dave Rosenberg wrote:

> I'm trying to write the data from a remote file (on the web) to a local
> file (test.txt). I tried the code below, but rather than the contents
> of the remote file being written to the local file, the local file
> contains a resource ID. I'd appreciate a push in the right direction as
> far as pulling all the data from the remote file to the text file.
>
> | $remotefile = fopen('http://mydomain.org/testo.html','r');
> |
> | $localfile = fopen('/home/dave/public_html/test.txt','w');
> |
> | fwrite($localfile,$remotefile);
> |
> | fclose($localfile);
> |
> | fclose($remotefile);

Lookup each of the above functions in the manual and see _what arguments_ they
take and what they _return_. Then examine and try the examples given for each
of the functions and understand how they work.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
All I ask of life is a constant and exaggerated sense of my own importance.
*/

attached mail follows:


Jason Wong wrote:
> On Thursday 08 May 2003 20:46, Dave Rosenberg wrote:
>
>>I'm trying to write the data from a remote file (on the web) to a local
>>file (test.txt). I tried the code below, but rather than the contents
>>of the remote file being written to the local file, the local file
>>contains a resource ID. I'd appreciate a push in the right direction as
>> far as pulling all the data from the remote file to the text file.
>>
>>| $remotefile = fopen('http://mydomain.org/testo.html','r');
>>|
>>| $localfile = fopen('/home/dave/public_html/test.txt','w');
>>|
>>| fwrite($localfile,$remotefile);
>>|
>>| fclose($localfile);
>>|
>>| fclose($remotefile);
>
>
> Lookup each of the above functions in the manual and see _what arguments_ they
> take and what they _return_. Then examine and try the examples given for each
> of the functions and understand how they work.
>

Obviously that's the first thing I did, but they do not offer any
guidance beyond where I've gotten. I also tried this....

| $localfile = fopen('test.txt','w');
|
| fwrite($localfile,"<?php include '$remotefile'; ?>");
|
| fclose($localfile);
|
| mysql_query("LOAD DATA INFILE LOCAL '/home/dave/public_html/test.txt'
INTO TABLE `shows` FIELDS TERMINATED BY '/'");

However, the data that was entered into the database was the text of the
include rather than the result of it. This makes sense, but I've gotten
no farther.

Any real help would be appreciated.

attached mail follows:


> -----Original Message-----
> From: Dave Rosenberg [mailto:daverosearches.uga.edu]
> Sent: 08 May 2003 16:04
> To: php-generallists.php.net
> Subject: Re: [PHP] Writing remote data to local file
>
>
> Jason Wong wrote:
> > On Thursday 08 May 2003 20:46, Dave Rosenberg wrote:
> >
> >>I'm trying to write the data from a remote file (on the
> web) to a local
> >>file (test.txt). I tried the code below, but rather than
> the contents
> >>of the remote file being written to the local file, the local file
> >>contains a resource ID. I'd appreciate a push in the right
> direction as
> >> far as pulling all the data from the remote file to the text file.
> >>
> >>| $remotefile = fopen('http://mydomain.org/testo.html','r');
> >>|
> >>| $localfile = fopen('/home/dave/public_html/test.txt','w');
> >>|
> >>| fwrite($localfile,$remotefile);
> >>|
> >>| fclose($localfile);
> >>|
> >>| fclose($remotefile);
> >
> >
> > Lookup each of the above functions in the manual and see
> _what arguments_ they
> > take and what they _return_. Then examine and try the
> examples given for each
> > of the functions and understand how they work.
> >
>
> Obviously that's the first thing I did, but they do not offer any
> guidance beyond where I've gotten. I also tried this....

Well, obviously you did not look at the right bits, so try this little quiz:

(1) what does fopen return?

(2) what does fwrite() expect its second argument to be?

(3) are these the same?

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Mike Ford wrote:
>>-----Original Message-----
>>From: Dave Rosenberg [mailto:daverosearches.uga.edu]
>>Sent: 08 May 2003 16:04
>>To: php-generallists.php.net
>>Subject: Re: [PHP] Writing remote data to local file
>>
>>
>>Jason Wong wrote:
>>
>>>On Thursday 08 May 2003 20:46, Dave Rosenberg wrote:
>>>
>>>
>>>>I'm trying to write the data from a remote file (on the
>>>
>>web) to a local
>>
>>>>file (test.txt). I tried the code below, but rather than
>>>
>>the contents
>>
>>>>of the remote file being written to the local file, the local file
>>>>contains a resource ID. I'd appreciate a push in the right
>>>
>>direction as
>>
>>>> far as pulling all the data from the remote file to the text file.
>>>>
>>>>| $remotefile = fopen('http://mydomain.org/testo.html','r');
>>>>|
>>>>| $localfile = fopen('/home/dave/public_html/test.txt','w');
>>>>|
>>>>| fwrite($localfile,$remotefile);
>>>>|
>>>>| fclose($localfile);
>>>>|
>>>>| fclose($remotefile);
>>>
>>>
>>>Lookup each of the above functions in the manual and see
>>
>>_what arguments_ they
>>
>>>take and what they _return_. Then examine and try the
>>
>>examples given for each
>>
>>>of the functions and understand how they work.
>>>
>>
>>Obviously that's the first thing I did, but they do not offer any
>>guidance beyond where I've gotten. I also tried this....
>
>
> Well, obviously you did not look at the right bits, so try this little quiz:
>
> (1) what does fopen return?
>
> (2) what does fwrite() expect its second argument to be?
>
> (3) are these the same?
>

No, or I wouldn't be asking. I was looking for some assistance.
Judging by these two responses, I guess this is not the right place to
ask questions?

attached mail follows:


On Thursday 08 May 2003 23:23, Dave Rosenberg wrote:

[snip]

> >>>>| $remotefile = fopen('http://mydomain.org/testo.html','r');
> >>>>|
> >>>>| $localfile = fopen('/home/dave/public_html/test.txt','w');
> >>>>|
> >>>>| fwrite($localfile,$remotefile);
> >>>>|
> >>>>| fclose($localfile);
> >>>>|
> >>>>| fclose($remotefile);
> >>>
> >>>Lookup each of the above functions in the manual and see
> >>
> >>_what arguments_ they
> >>
> >>>take and what they _return_. Then examine and try the
> >>
> >>examples given for each
> >>
> >>>of the functions and understand how they work.
> >>
> >>Obviously that's the first thing I did, but they do not offer any
> >>guidance beyond where I've gotten. I also tried this....
> >
> > Well, obviously you did not look at the right bits, so try this little
> > quiz:
> >
> > (1) what does fopen return?
> >
> > (2) what does fwrite() expect its second argument to be?
> >
> > (3) are these the same?
>
> No, or I wouldn't be asking. I was looking for some assistance.
> Judging by these two responses, I guess this is not the right place to
> ask questions?

"Give a man a fish and you will feed him for a day. Teach him how to fish and
you will feed him for a lifetime." (or something like that)

Did you try the examples in the manual, in particular the one(s) for fwrite()?
Once you get that working, modify it to suit your purpose.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
One good reason why computers can do more work than people is that they
never have to stop and answer the phone.
*/

attached mail follows:


> -----Original Message-----
> From: Dave Rosenberg [mailto:daverosearches.uga.edu]
> Sent: 08 May 2003 16:24
> To: php-generallists.php.net
> Subject: Re: [PHP] Writing remote data to local file
>
>
> Mike Ford wrote:
> >>-----Original Message-----
> >>From: Dave Rosenberg [mailto:daverosearches.uga.edu]
> >>Sent: 08 May 2003 16:04
> >>To: php-generallists.php.net
> >>Subject: Re: [PHP] Writing remote data to local file
> >>
> >>
> >>Jason Wong wrote:
> >>
> >>>On Thursday 08 May 2003 20:46, Dave Rosenberg wrote:
> >>>
> >>>
> >>>>I'm trying to write the data from a remote file (on the
> >>>
> >>web) to a local
> >>
> >>>>file (test.txt). I tried the code below, but rather than
> >>>
> >>the contents
> >>
> >>>>of the remote file being written to the local file, the local file
> >>>>contains a resource ID. I'd appreciate a push in the right
> >>>
> >>direction as
> >>
> >>>> far as pulling all the data from the remote file to the
> text file.
> >>>>
> >>>>| $remotefile = fopen('http://mydomain.org/testo.html','r');
> >>>>|
> >>>>| $localfile = fopen('/home/dave/public_html/test.txt','w');
> >>>>|
> >>>>| fwrite($localfile,$remotefile);
> >>>>|
> >>>>| fclose($localfile);
> >>>>|
> >>>>| fclose($remotefile);
> >>>
> >>>
> >>>Lookup each of the above functions in the manual and see
> >>
> >>_what arguments_ they
> >>
> >>>take and what they _return_. Then examine and try the
> >>
> >>examples given for each
> >>
> >>>of the functions and understand how they work.
> >>>
> >>
> >>Obviously that's the first thing I did, but they do not offer any
> >>guidance beyond where I've gotten. I also tried this....
> >
> >
> > Well, obviously you did not look at the right bits, so try
> this little quiz:
> >
> > (1) what does fopen return?
> >
> > (2) what does fwrite() expect its second argument to be?
> >
> > (3) are these the same?
> >
>
> No,

Correct. So now you need to work out how to use the File Resource returned in (1) to get the text string required for (2). Well, you clearly know how to use the File Resource returned into $localfile to *write* some text to the associated file, so a little bit of cogitating should quickly tell you how to use the File Resource returned into $remotefile to *read* some text from the associated file.

> or I wouldn't be asking. I was looking for some assistance.
> Judging by these two responses, I guess this is not the right
> place to
> ask questions?

Of course it is -- we were just trying to assist you by giving you a fishing rod rather than a fish!

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


At 14:46 08.05.2003, Dave Rosenberg spoke out and said:
--------------------[snip]--------------------
>Hi,
>
>I'm trying to write the data from a remote file (on the web) to a local
>file (test.txt). I tried the code below, but rather than the contents
>of the remote file being written to the local file, the local file
>contains a resource ID. I'd appreciate a push in the right direction as
> far as pulling all the data from the remote file to the text file.
>
>| $remotefile = fopen('http://mydomain.org/testo.html','r');
>|
>| $localfile = fopen('/home/dave/public_html/test.txt','w');
>|
>| fwrite($localfile,$remotefile);
>|
>| fclose($localfile);
>|
>| fclose($remotefile);
>
--------------------[snip]--------------------

Well, if you'*d rather need a fish...

$remotefile = fopen('http://mydomain.org/testo.html','r');
$localfile = fopen('/home/dave/public_html/test.txt','w');
while ($buffer = fread($remotefile, 4096))
    fwrite($localfile,$buffer);
fclose($localfile);
fclose($remotefile);

Should work...

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


> -----Original Message-----
> From: David Rosenberg [mailto:davecviog.uga.edu]
> Sent: 08 May 2003 16:43
>
> Okay, Mike, just making sure I wasn't supposed to be a p.help or
> something of that nature. Anyway, I understand that fopen
> brings back a
> resource ID the same way as if you try to print the result of a query
> without using a while array. But I haven't been able to find
> anything
> on the php.net manual as far as how to actually pull a
> result. This is
> the only part of a lengthy script that I haven't been able to
> figure out
> and it's annoying the heck out of me. Is there a manual with more
> complete help out there?

Oh, for crying out loud! Are you really not capable of doing a simple logical association: if fwrite() WRITEs to a file, then what the heck do you suppose READs from a file? For goodness sake, it's even in the "See Also" list of the manual page for fwrite().

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: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Hi,

I have a client who wants a counter on their site showing a number which
rises by 7000 a day and visibly clocks up whilst a user is on the site. This
is meant to show the number of products they sell a a day. I'm just not sure
how this would work though, would i have to store the ammount in a database,
how would it increment whilst no one is one the site.

Thanks for your help

attached mail follows:


I'm not awake enough to provide example code, but something like this should
work:

- Set a base date
- Set a base counter value
- Get the current date, subtract base date, gives you number of days since
start of counter
- multiple number of days since start of counter by 7000
- add this value to base counter value, giving you start of day value
- divide 86400 by 7000 to give number of seconds that needs to pass to
increment value
- count number of seconds that has passed in the day, divide by number of
seconds to increment, giving todays current addition to counter
- add current addition to start of day value

Voila, you have a piece of code that you can put in a header/footer on every
page and will be different every time a user loads a page. This is asssuming
you're just going on the 7000/day value, and not actually caring about the
real number of units sold.

I hope that didn't confuse too much.

Mark

-----Original Message-----
From: Shaun [mailto:shaunmania.plus.com]
Sent: Thursday, May 08, 2003 9:13 AM
To: php-generallists.php.net
Subject: [PHP] Counter

Hi,

I have a client who wants a counter on their site showing a number which
rises by 7000 a day and visibly clocks up whilst a user is on the site. This
is meant to show the number of products they sell a a day. I'm just not sure
how this would work though, would i have to store the ammount in a database,
how would it increment whilst no one is one the site.

Thanks for your help

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

attached mail follows:


Thanks for your reply mark,

but they want to see the counter actually incrementing whilst the user is on
the site...

"Mark Douglas" <Mark.DouglasQ9.com> wrote in message
news:05924A4A9DEDAD46A21EE3C8C64B090D02B6CDC6cheetah.zoo.q9networks.com...
> I'm not awake enough to provide example code, but something like this
should
> work: