php-windows Digest 13 Feb 2003 19:26:32 -0000 Issue 1586

Topics (messages 18511 through 18525):

Re: Need Help with Classes
        18511 by: Matt Hillebrand

Re: PHP or Apache isn't playing nice
        18512 by: wisi
        18515 by: Rico Derks
        18516 by: Rico Derks
        18522 by: Chris Kranz

Re: copying a mysql table within a database
        18513 by: Leo G. Divingracia III

Re: Getting HTML Content as a variable
        18514 by: Leo G. Divingracia III

Re: mhash extension module
        18517 by: Rico Derks
        18518 by: Matt Hillebrand

ISP
        18519 by: Pat Johnston

[introduction - Import text file]
        18520 by: RG
        18521 by: J.Veenhuijsen

Re:Subject: Need Help with Classes
        18523 by: Neil Smith
        18524 by: Paul Dymecki

basic variable question
        18525 by: paradiddles

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I'm not sure what you're expecting to see. You don't have any code that
produces output, nor do you invoke the myFunc() method.

Matt

|-----Original Message-----
|From: Paul Dymecki [mailto:[EMAIL PROTECTED]] 
|Sent: Wednesday, February 12, 2003 8:23 PM
|To: [EMAIL PROTECTED]
|Subject: [PHP-WIN] Need Help with Classes
|
|
|Ya it seems like a pain indeed.  I guess i'll pose the 
|question though: for the following class
|
|class myClass
|{
|var myVar;
|function myFunc($myVarA,$myVarB)
|{
|   ....
|   $this -> myVar = array("b" => 55,"c" => 66);
|}
|}
|
|Now i try
|$somveVar = new myClass();
|
|and finally i try and acces myVar from outside the class:
|
|$x = ($someVar->$myVar["u"]);
|$y = ($someVar->$myVar["v"]);
|
|Nada, rien, nicht, no dice...
|Any help would be appreciated,
|
|Paul
|
|
|>From: "Matt Hillebrand" <[EMAIL PROTECTED]>
|>To: "'Paul Dymecki'" <[EMAIL PROTECTED]>
|>Subject: OOP in PHP
|>Date: Wed, 12 Feb 2003 16:50:12 -0600
|>
|>I like OOP as well. I'm a big fan of Java. However, I'm 
|waiting for PHP 
|>5 to do any OO in PHP since it's so limited in the current version.
|>
|>
|>|-----Original Message-----
|>|From: Paul Dymecki [mailto:[EMAIL PROTECTED]]
|>|Sent: Wednesday, February 12, 2003 4:47 PM
|>|To: [EMAIL PROTECTED]
|>|Subject: RE: [PHP-WIN] general question on Globals
|>|
|>|
|>|Thanks that clears things up a bit, i may go with classes in 
|any case. 
|>|Paul
|>|
|>|
|>|
|>|>From: "Matt Hillebrand" <[EMAIL PROTECTED]>
|>|>To: "'Paul Dymecki'" <[EMAIL PROTECTED]>
|>|>Subject: RE: [PHP-WIN] general question on Globals
|>|>Date: Wed, 12 Feb 2003 15:50:38 -0600
|>|>
|>|>Functions in PHP behave just like those in C, Perl, and Java
|>|(methods).
|>|>I noticed you said that you "declared a global variable inside a 
|>|>function." You don't "declare" a global variable inside a
|>|function, you
|>|>use the global keyword inside a function to tell PHP to look in the 
|>|>global scope for that variable.
|>|>
|>|>For Example:
|>|>
|>|><?
|>|>     $x = 444;  // this is a variable in the global scope
|>|>
|>|>     function my_func() {
|>|>        global $x;
|>|>        print $x;  // prints "444"
|>|>     }
|>|>?>
|>|>
|>|>Matt
|>|>
|>|>|-----Original Message-----
|>|>|From: Paul Dymecki [mailto:[EMAIL PROTECTED]]
|>|>|Sent: Wednesday, February 12, 2003 3:44 PM
|>|>|To: [EMAIL PROTECTED]
|>|>|Cc: [EMAIL PROTECTED]
|>|>|Subject: Re: [PHP-WIN] general question on Globals
|>|>|
|>|>|
|>|>|I guess i'm not out of the woods,
|>|>|   What i'm actually trying to do is re-use a function across php 
|>|>|files which isn't working to well. I'm not sure if i'll have to 
|>|>|declare a class. In any case what i'm tryin to do is an ordinary 
|>|>|function call passing in 2
|>|>|arguments and getting one return value.  I know how to declare
|>|>|classes(i've
|>|>|been working in java for the past few years) but i don't get
|>|>|php's calling
|>|>|structure.  Any help would be appreciated.
|>|>|thx,
|>|>|Paul
|>|>|
|>|>|
|>|>|
|>|>|>From: Dash McElroy <[EMAIL PROTECTED]>
|>|>|>To: Paul Dymecki <[EMAIL PROTECTED]>
|>|>|>Subject: Re: [PHP-WIN] general question on Globals
|>|>|>Date: Wed, 12 Feb 2003 12:21:56 -0800 (PST)
|>|>|>
|>|>|>More than happy to help. I thought I was going insane 
|last night...
|>|>|>
|>|>|>-Dash
|>|>|>
|>|>|>If mathematically you end up with the wrong answer, try
|>|>|multiplying by
|>|>|>the page number.
|>|>|>
|>|>|>On Wed, 12 Feb 2003, Paul Dymecki wrote:
|>|>|>
|>|>|> > Cool thanks,
|>|>|> > Paul
|>|>|> >
|>|>|> >
|>|>|> >
|>|>|> > >From: Dash McElroy <[EMAIL PROTECTED]>
|>|>|> > >To: Paul Dymecki <[EMAIL PROTECTED]>
|>|>|> > >CC: [EMAIL PROTECTED]
|>|>|> > >Subject: Re: [PHP-WIN] general question on Globals
|>|>|> > >Date: Wed, 12 Feb 2003 11:46:47 -0800 (PST)
|>|>|> > >
|>|>|> > >I actually just did this last night. I could not for the
|>|>|life of me
|>|>|>figure
|>|>|> > >out why my variable wasn't working. Until I remembered it
|>|>|was in a
|>|>|> > >function and I had to do a global $varname; command.
|>|>|> > >
|>|>|> > >Works just fine.
|>|>|> > >
|>|>|> > >-Dash
|>|>|> > >
|>|>|> > >Age before beauty; and pearls before swine.
|>|>|> > >              -- Dorothy Parker
|>|>|> > >
|>|>|> > >On Wed, 12 Feb 2003, Paul Dymecki wrote:
|>|>|> > >
|>|>|> > > > I have a general question on Global vars.  If you 
|declare a 
|>|>|> > > > Global
|>|>|> > >variable
|>|>|> > > > within a function in a program called x.php.  Do you
|>|>|have access
|>|>|> > > > to
|>|>|>this
|>|>|> > > > variable in another program say y.php that has
|>|>|>include_once("x.php")?
|>|>|> > > > thx,
|>|>|> > > > Paul Dymecki
|>|>|> > > >
|>|>|> > > >
|>|>|> > > >
|>|>|> > > >
|>|>|> > > >
|>|>|> > > >
|>|>|________________________________________________________________
|>|>|> > > > _
|>|>|> > > > Protect your PC - get McAfee.com VirusScan Online 
|>|>|> > > > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|>|>|> > > >
|>|>|> > > >
|>|>|> > > > --
|>|>|> > > > PHP Windows Mailing List (http://www.php.net/)
|>|>|> > > > To unsubscribe, visit: http://www.php.net/unsub.php
|>|>|> > > >
|>|>|> > > >
|>|>|> > >
|>|>|> > >
|>|>|> > >--
|>|>|> > >PHP Windows Mailing List (http://www.php.net/)
|>|>|> > >To unsubscribe, visit: http://www.php.net/unsub.php
|>|>|> >
|>|>|> >
|>|>|> > 
|________________________________________________________________
|>|>|> > _
|>|>|> > MSN 8 with e-mail virus protection service: 2 months FREE*
|>|>|> > http://join.msn.com/?page=features/virus
|>|>|> >
|>|>|> >
|>|>|
|>|>|
|>|>|_________________________________________________________________
|>|>|Help STOP SPAM with the new MSN 8 and get 2 months FREE* 
|>|>|http://join.msn.com/?page=features/junkmail
|>|>|
|>|>|
|>|>|--
|>|>|PHP Windows Mailing List (http://www.php.net/)
|>|>|To unsubscribe, visit: http://www.php.net/unsub.php
|>|>|
|>|>|
|>|>|
|>|
|>|
|>|_________________________________________________________________
|>|MSN 8 with e-mail virus protection service: 2 months FREE* 
|>|http://join.msn.com/?page=features/virus
|>|
|>|
|>|
|
|
|_________________________________________________________________
|Protect your PC - get McAfee.com VirusScan Online  
|http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|
|
|-- 
|PHP Windows Mailing List (http://www.php.net/)
|To unsubscribe, visit: http://www.php.net/unsub.php
|
|
|


--- End Message ---
--- Begin Message ---
register_globals must be turned ON.



"O-Juice" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello. I've got the following set-up and working at home (on a Win98SE
> workstation):
>
> Apache 2.0.43
> PHP 4.2.1
>
> For some reason the following code (which works fine on my on-line PHP
host)
> refuses to work at home:
>
> <?php
> if ($mod) {
>   switch($mod) {
>     case "news":
>     case "links":
>       include ("../" . $mod . "/content.php");
>     break;
>     default:
>       include ("../errorpages/404.php");
>   }
> } else {
>   include ("../news/content.php");
> }
> ?>
>
> The way it's supposed to work is a user clicks on a link, e.g.
> "http://www.blah.com/index.php?mod=news"; and the page with the content
that
> they're requesting is then displayed. Is there some setting missing in
> Apache or PHP on my home system or is there some other explanation for why
> things are going awry my side?
>
> I'd appreciate any help. Thanks. :-)
>
> --
> [EMAIL PROTECTED]
>
>


--- End Message ---
--- Begin Message --- Hi,

Try removing the ../ part from the include functions. I had more or less the same problem!

Cheers,
RICO.

At 00:27 13/02/2003, o-juice wrote:
Hello. I've got the following set-up and working at home (on a Win98SE
workstation):

Apache 2.0.43
PHP 4.2.1

For some reason the following code (which works fine on my on-line PHP host)
refuses to work at home:

<?php
if ($mod) {
  switch($mod) {
    case "news":
    case "links":
      include ("../" . $mod . "/content.php");
    break;
    default:
      include ("../errorpages/404.php");
  }
} else {
  include ("../news/content.php");
}
?>

The way it's supposed to work is a user clicks on a link, e.g.
"http://www.blah.com/index.php?mod=news"; and the page with the content that
they're requesting is then displayed. Is there some setting missing in
Apache or PHP on my home system or is there some other explanation for why
things are going awry my side?

I'd appreciate any help. Thanks. :-)

--
[EMAIL PROTECTED]



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

--- End Message ---
--- Begin Message ---
Hi,

I forgot something. Check your php.ini where your includes are stored.

Cheers,
RICO.

At 00:27 13/02/2003, o-juice wrote:
Hello. I've got the following set-up and working at home (on a Win98SE
workstation):

Apache 2.0.43
PHP 4.2.1

For some reason the following code (which works fine on my on-line PHP host)
refuses to work at home:

<?php
if ($mod) {
  switch($mod) {
    case "news":
    case "links":
      include ("../" . $mod . "/content.php");
    break;
    default:
      include ("../errorpages/404.php");
  }
} else {
  include ("../news/content.php");
}
?>

The way it's supposed to work is a user clicks on a link, e.g.
"http://www.blah.com/index.php?mod=news"; and the page with the content that
they're requesting is then displayed. Is there some setting missing in
Apache or PHP on my home system or is there some other explanation for why
things are going awry my side?

I'd appreciate any help. Thanks. :-)

--
[EMAIL PROTECTED]



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

--- End Message ---
--- Begin Message ---
Ah, missed this when I first looked at your problem.

If you can't change register_globals in the php.ini file, try using

$_GET[mod]

instead of $mod

chris kranz
fatcuban.com


-----Original Message-----
From: wisi [mailto:[EMAIL PROTECTED]] 
Sent: 10 February 2003 03:57
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: PHP or Apache isn't playing nice

register_globals must be turned ON.



"O-Juice" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello. I've got the following set-up and working at home (on a Win98SE
> workstation):
>
> Apache 2.0.43
> PHP 4.2.1
>
> For some reason the following code (which works fine on my on-line PHP
host)
> refuses to work at home:
>
> <?php
> if ($mod) {
>   switch($mod) {
>     case "news":
>     case "links":
>       include ("../" . $mod . "/content.php");
>     break;
>     default:
>       include ("../errorpages/404.php");
>   }
> } else {
>   include ("../news/content.php");
> }
> ?>
>
> The way it's supposed to work is a user clicks on a link, e.g.
> "http://www.blah.com/index.php?mod=news"; and the page with the content
that
> they're requesting is then displayed. Is there some setting missing in
> Apache or PHP on my home system or is there some other explanation for
why
> things are going awry my side?
>
> I'd appreciate any help. Thanks. :-)
>
> --
> [EMAIL PROTECTED]
>
>



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




--- End Message ---
--- Begin Message ---
here's the mysql syntax:

http://www.mysql.com/doc/en/CREATE_TABLE.html

create table SPORTLASER select * from MICROLIGHT

just call that from PHP...

Frank Tudor wrote:
I know this is not the right group but the mysql group
is very quite.

how do I copy a table and rename it inside a database

Like if

database = microlight

table = microlight

copy table microlight to table called sportlaser

Please help.

Frank

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

--
Leo G. Divinagracia III
[EMAIL PROTECTED]

zzzzz

--- End Message ---
--- Begin Message ---
1.  use SESSIONS to pass authentication between pages.

2.  register_globals ON or OFF?   ;)

[EMAIL PROTECTED] wrote:
Hi,

I've been directed to use file() or implode() to get the html content of a web page, like this: $html = implode ('', file ('http://192.168.1.100/PHP/index.php'));

1 ) How do I pass authentication to websites that require username & password? In Cold Fusion the CFHTTP tag allows you to pass USERNAME="myusername" PASSWORD="mypassword", there must be an equivalent parameter in PHP.

2) When I output the content of $html, which is the web page stored as a variable, the images are not there. Again, in Cold Fusion the CFHTTP tag takes care of this when you specify RESOLVEURL="YES", and I'm guessing there is a way in PHP to store the web page WITH images intact?

thanks! ph_Greg
--
Leo G. Divinagracia III
[EMAIL PROTECTED]

zzzzz

--- End Message ---
--- Begin Message --- Hi Matt,

Maybe you checked it already. How is the extensions_dir specified in your php.ini. Should be something like: c:/php/extensions

Cheers,
RICO.



At 20:55 12/02/2003, Matt Hillebrand wrote:
Does anyone know how to use the php_mhash.dll that comes with PHP for
Windows? If I uncomment that line in my php.ini file and restart Apache,
it says that that module can't be found. I know the file is in my
extension directory. What's up?

Thanks.

Matt

--- End Message ---
--- Begin Message ---
Yeah, I checked it. Other extensions are working fine. I read elsewhere
that the mhash dll just doesn't work in Windows.... So why even have the
.dll in the first place? Something is fishy about this.


|-----Original Message-----
|From: Rico Derks [mailto:[EMAIL PROTECTED]] 
|Sent: Thursday, February 13, 2003 1:30 AM
|To: Matt Hillebrand; [EMAIL PROTECTED]
|Subject: Re: [PHP-WIN] mhash extension module
|
|
|Hi Matt,
|
|Maybe you checked it already. How is the extensions_dir 
|specified in your 
|php.ini. Should be something like: c:/php/extensions
|
|Cheers,
|RICO.
|
|
|
|At 20:55 12/02/2003, Matt Hillebrand wrote:
|>Does anyone know how to use the php_mhash.dll that comes with PHP for 
|>Windows? If I uncomment that line in my php.ini file and restart 
|>Apache, it says that that module can't be found. I know the 
|file is in 
|>my extension directory. What's up?
|>
|>Thanks.
|>
|>Matt
|
|
|
|-- 
|PHP Windows Mailing List (http://www.php.net/)
|To unsubscribe, visit: http://www.php.net/unsub.php
|
|
|


--- End Message ---
--- Begin Message ---
Hello all
Just a query I want to ask what is meant by include files being in a folder
'outside' the web root.

For example, I use an ISP (linux box) to upload all my stuff to the site I
see "/html as the folder to store all web files. So if I go up one to "/",
is this outside the web root, or is this the web root?

Regards, Pat


--- End Message ---
--- Begin Message ---
Let me introduce myself :

I write to this list from Corsica (the nearest of the farest french 
overseas territories),  and I am a newbie in Php, for those who 
have'nt realized yet :)


and my error is :

I try to do an import text file into a mysql table with the php 
script provided with Manucorp Easyphp, but it does not work.

The message is :

<<Erreur 
requête SQL: 

LOAD DATA LOCAL INFILE 'C:\WINDOWS\TEMP\phpC255.TMP'  INTO TABLE 
abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY 
'\r\n' (dp_indpri,dp_nom,dp_ville)
MySQL a répondu:File 'c:windowstempphpc255.tmp' not found 
(Errcode:2)>>

The path above seems to be incorrect, but i have not found where to 
modify it.


Environment is :

Win 98 SE
Apache 1.3.17 win32
PHP 4.0.5-dev
MySQL client API version 3.23.32

An idea ??
RG
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Try LOAD DATA LOCAL INFILE 'C:\\WINDOWS\\TEMP\\phpC255.TMP'

Rg wrote:
Let me introduce myself :

I write to this list from Corsica (the nearest of the farest french overseas territories), and I am a newbie in Php, for those who have'nt realized yet :)


and my error is :

I try to do an import text file into a mysql table with the php script provided with Manucorp Easyphp, but it does not work.

The message is :

<<Erreur requête SQL:
LOAD DATA LOCAL INFILE 'C:\WINDOWS\TEMP\phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville)
MySQL a répondu:File 'c:windowstempphpc255.tmp' not found (Errcode:2)>>

The path above seems to be incorrect, but i have not found where to modify it.


Environment is :

Win 98 SE
Apache 1.3.17 win32
PHP 4.0.5-dev
MySQL client API version 3.23.32

An idea ??
RG
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message --- I thought PHP worked like this : to instantiate a class, you need to name a constructor function with the same name as your class. Also var myVar should be var $myVar -- I think setting myVar will create a constant not a variable. Try turning error_reporting(E_ALL) on in your code to catch this sort of error :

class myClass
{
var $myVar;
var $myVarA;
var $myVarB

function myClass($myVarA,$myVarB)
{
....
$this -> myVar = array("b" => 55,"c" => 66);
}
}

That *should* work. No warranty express or implied etc etc lol

Cheers,
Neil Smith.

At 02:23 13/02/2003 +0000, you wrote:
Subject: Need Help with Classes

Ya it seems like a pain indeed.  I guess i'll pose the question though:
for the following class

class myClass
{
var myVar;
function myFunc($myVarA,$myVarB)
{
  ....
  $this -> myVar = array("b" => 55,"c" => 66);
}
}

Now i try
$somveVar = new myClass();

and finally i try and acces myVar from outside the class:

$x = ($someVar->$myVar["u"]);
$y = ($someVar->$myVar["v"]);

Nada, rien, nicht, no dice...
Any help would be appreciated,

Paul

--- End Message ---
--- Begin Message --- Ya i actually got it working yesterday thanks to Matt who sent me some sample class code to execute. I put it in a seperate file and it worked fine. So thin i put the class i was trying to call in a seperate class as well and that did it. ie., the problem(besides all the ones you mentioned) was that i had included the class along with other non-class code in the same file. When i tried to call it from another file using the inlcude_once function the other code was trying to execute as well...
cheers


Paul






From: Neil Smith <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re:Subject: Need Help with Classes
Date: Thu, 13 Feb 2003 13:02:32 +0000

I thought PHP worked like this : to instantiate a class, you need to name a constructor function with the same name as your class. Also var myVar should be var $myVar -- I think setting myVar will create a constant not a variable. Try turning error_reporting(E_ALL) on in your code to catch this sort of error :

class myClass
{
var $myVar;
var $myVarA;
var $myVarB

function myClass($myVarA,$myVarB)
{
....
$this -> myVar = array("b" => 55,"c" => 66);
}
}

That *should* work. No warranty express or implied etc etc lol

Cheers,
Neil Smith.

At 02:23 13/02/2003 +0000, you wrote:
Subject: Need Help with Classes

Ya it seems like a pain indeed.  I guess i'll pose the question though:
for the following class

class myClass
{
var myVar;
function myFunc($myVarA,$myVarB)
{
  ....
  $this -> myVar = array("b" => 55,"c" => 66);
}
}

Now i try
$somveVar = new myClass();

and finally i try and acces myVar from outside the class:

$x = ($someVar->$myVar["u"]);
$y = ($someVar->$myVar["v"]);

Nada, rien, nicht, no dice...
Any help would be appreciated,

Paul

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
  Hi everyone. Why does my code work when I enter just 1 for the quantity, but only 
returns $1.10 when I enter a quantity of 2 or more? 

 

   $totalqty = 0.00;
   $totalamount = 0.00;

   define("HALLTABLE", 800);

   $totalqty =  $_POST["hallqty"]; //quantity

   $totalamount =  $_POST["hallqty"] * HALLTABLE; //total cost

    $totalamount = number_format($totalamount, 2);
 echo $totalamount;
 echo "<br>\n";
 echo "Items ordered:  ".$totalqty."<br>\n";
 echo "Subtotal:   $".$totalamount."<br>\n";

 $taxrate = 0.10; // local sales tax is %10
 $totalamount = $totalamount * (1 + $taxrate);

 $totalamount = number_format($totalamount, 2);


 echo "<br>\n";
 echo "Total including tax: $".$totalamount."<br>\n";

 



----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. You can 
do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard
--- End Message ---

Reply via email to