Re: [PHP] Seemingly simple header problem, isn't!

2002-08-14 Thread @ Edwin
Well, then, in that case, your original problem about the header() has 
nothing to do with an earlier post (about IIS).

Perhaps, you can try installing the latest Apache + the latest PHP and 
everything might just work. I've ask a friend to try it on his 
Win2K(sp2)+Apache2+php4.2.2 and the code was working perfectly 
fine--without doing anything special in httpd.conf...

- E


>
>Hi, Edwin. Of course... thanks!
>
>Apache version 1.3.23. Definitely not IIS.
>
>Robert Orenstein
>Perforce Software
>
>
>
>>Try running  and  I'm sure you'll find out 
>>something about the Apache version. (If, indeed, you're running 
>>Apache... Could it be that you're running IIS and Apache is down? 
>>Of course, I could be wrong...)
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
$B2q0wEPO?$OL5NA!&=

[PHP] Re: Troubles with Classes

2002-08-14 Thread lallous

try to put any code inside the new class' constructor part,
-> move the this code:
>  $DBQuery = new DBQueries;   <--- this
> is line 134
>  $DBQuery->attrib["type"] = "select";
>  $DBQuery->attrib["query"] = "SELECT ID_Secpage, PageType,

into :
 class SubMenu {
SubMenu()
 {
  $this->DBQuery->attrib["type"] = "select";
  $this->DBQuery->attrib["query"] = "SELECT ID_Secpage,
PageType,
 }
}

Elias
"Jadiel Flores" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hey guys, I have a little problem here, I have one class to create queries
> to a mysql database, this class works fine, but, now I want to create an
> instance of this class inside another class but I'm receiving the error:
>
> Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION
> or T_FUNCTION or T_VAR or '}' in
> D:\InetPub\hispanicroot\includes\database.php on line 134
>
> This is my code:
>
> class SubMenu {
>  var $attrib = array("level"=>"", "page"=>"", "section"=>"");
>  $DBQuery = new DBQueries;   <--- this
> is line 134
>  $DBQuery->attrib["type"] = "select";
>  $DBQuery->attrib["query"] = "SELECT ID_Secpage, PageType,
> Title, PageURL FROM inf_secpages WHERE ID_Page = " . $attrib['page'] . "
> ORDER BY Slot ASC";
>  $GetData = $DBQuery->RunQuery();
>  bla bla bla ..
> }
>
> If I use:
>  var $DBQuery = new DBQueries;
> then I receive the error:
>  Parse error: parse error, unexpected T_NEW in
> D:\InetPub\hispanicroot\includes\database.php on line 134
>
> Thanks
>
>
> Jadiel Flores
> -
> http://www.abargon.com
> [EMAIL PROTECTED]
> (52-55) 52-29-80-34
>
>



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




[PHP] Variable

2002-08-14 Thread Remon Redika

this is the form
 -- insert.php  


 Nama Satu
 
   
 
   
 Nama Dua
 
   
 
   
 Nama Tiga
 
   
 
   
 variable and my query -- 

$Namak = $namasa;
$Namak = $Namak.$namadu;
$Namak = $Namak.$namati; 

$query  ="Insert into Kel (NIP,Id_kel,Nama,Status)";
$query .="Values ('$NIP','$Id_kel','$Namak','$Status')"; 

the problem is my query cant execute the variable $Namak
i got failed message from mysql query 

help 

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




RE: [PHP] Variable

2002-08-14 Thread Michael Egan

Some quick thoughts:

Is the $Namak variable being correctly passed to the query?

Have you tried to echo out the query just to see precisely what is being passed to 
MySQL?

On the first line of the query:

$query  ="Insert into Kel (NIP,Id_kel,Nama,Status)";

You might need a space after ')' before passing it to MySQL.


Michael Egan

-Original Message-
From: Remon Redika [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2002 01:23
To: [EMAIL PROTECTED]
Subject: [PHP] Variable 


this is the form
 -- insert.php  


 Nama Satu
 
   
 
   
 Nama Dua
 
   
 
   
 Nama Tiga
 
   
 
   
 variable and my query -- 

$Namak = $namasa;
$Namak = $Namak.$namadu;
$Namak = $Namak.$namati; 

$query  ="Insert into Kel (NIP,Id_kel,Nama,Status)";
$query .="Values ('$NIP','$Id_kel','$Namak','$Status')"; 

the problem is my query cant execute the variable $Namak
i got failed message from mysql query 

help 

-- 
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: Session, error occurs

2002-08-14 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I have jsut recently installed a php development kit on my windows platform.
> Im interested in using the session functions but I am recieving this error
> when I use session_start():
> 
> Warning: open(/tmp\sess_540ded508edf231c47fe85bd970f936a, O_RDWR) failed: m
> (2) in d:\phpdev\www\phpdev4\samples\samp13.htm on line 4
> 
>  Im assuming it has got to do something with the location it store the
> seesion id file. I had a look in my php.ini file and here is the the
> following configuration:
> 
> [Session]
> ; Handler used to store/retrieve data.
> session.save_handler = files
> 
> ; Argument passed to save_handler.  In the case of files, this is the path
> ; where data files are stored.
> session.save_path = D:\phpdev\php\temp;

Does this directory exist? If not, you may have problems.


> Im not to sure why this is all ways happening. If anyone haas a solution or
> knows why this might occur could you please respond or email me at
> [EMAIL PROTECTED]
> 
> Much appreaciated
> 
> Daniel
> 
> 
> 

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: newbie PHP/HTML pull down menu problem

2002-08-14 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi,
> 
> I want to pull information out of my mySQL database and use it as a pull
> down menu ona web page.  There are two sets of information that I need, one
> is a color, and the other is the color_id, so I want to use it in the way
> below but without having to physically enter all the data.  I'd like to use
> color_id as the value and the actual color name as the text in the pull down
> button.  Can someone please help me on how to pass the info into a useable
> way to get the info out of PHP and into HTML?  I've haad no problems going
> from HTML to PHP, but can't seem to grasp going the other way, especially
> with a list of things.  I've been banging my head against this for two days,
> but something tells me it's extremely easy.
> 
> Thanks,
> 
> Brian

Just the pseudocode to give you an idea...

query = Select color, colorid from table
run dbquery


 

loop through dbresults
  
end loop

 


See the mysql functions for exampls of how to submit a query and use the 
results in a while loop.


Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] crypt(): How to make it use blowfish?

2002-08-14 Thread Jean-Christian Imbeault

I'd like to use the crypt() function and have it use Blowfish 
encryption. However it seems that my system doesn't support blowfish 
encryption since I get:

CRYPT_BLOWFISH = 0

My system is a linux RH7.2 box. How can I make blowfish encryption 
available to PHP's crypt?

Jc


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




[PHP] ldap_rename refused to work

2002-08-14 Thread Roger Thomas

built: php-4.2.2 with openldap 2.0.25

i tried using the ldap_rename function to modify the dn of my ldap db but
nothing seems to happen. the record was not change at all. i have followed
closely the code-snippet that was given by Mr Stig Venaas at:
http://marc.theaimsgroup.com/?l=php-general&m=100949195224325&w=2

following is my short code to do this:

";
 exit();
}

if (!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Failed to set protocol version";
exit;
}

//we bind to ldap server AFTER the ldap_set_option is successfull
//this is an authenticated bind
$r=ldap_bind($ds,"cn=admin,o=Administrators,dc=mydomain,dc=net", "secret");
if (!$r) {
 echo "LDAP bind failed";
 exit();
}

// we want to transfer user roger from Civil Engineering to Credit section in
Finance
$r=ldap_rename($ds,
"uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net",
"uid=roger,ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net",
"dc=mydomain,dc=net",TRUE);


//Close the LDAP connection.
ldap_close($ds);

print "modification done";
?>

please advise.

--
roger


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




[PHP] SSL/sessions & password question

2002-08-14 Thread Jean-Christian Imbeault

Sorry for the vagueness of the subject line but I wasn't sure what to put.

Here's what I'd like to do:

1- user comes to my web site with normal (non-SSL) connection
2- user enter login name and password
3- data is submitted to a PHP script via SSL connection to same web server
4- PHP script checks password
5- If everything is ok user is directed to restricted page

The reason I want to use SSL is simple, so that sniffers can pick up a 
clear text password. The reason I don't want to whole site using SSL is 
because of the overhead in incurs.

I figure I can use sessions to force people to log in. If someone 
doesn't log in the proper session variables are not set and they cannot 
get any of the pages on my web site. (each page would check that the 
proper session var was registered).

Is this approached do-able? Is it recommended?

If this approach is ok what I can't figure out is how to get my login 
page to submit data via SSL.

Suggestions welcomed!

Jc


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




[PHP] Re: wanto uninstall php manual

2002-08-14 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hi,
> 
> I upgraded php from 4.0.4p11 to 4.0.6 with up2date (a RedHat Update 
> Agent). The new php includes a huge manual but I cannot find where is
> it after installed, and I don't know how can access it. And more, my free
> disk space is only 120M. So I am thinking to uninstall this manual. Any
> one know how can do uninstallation? Thanks in advance!
> 
> Alex
> 
> P.S. thank @ Edwin for your suggestion for upgrading.
> 
> 

Getting a bit off topic from php - but have you tried 'man up2date' to 
find out how to determine 1) what was installed where and 2) how to 
uninstall it.

As a Slackware user I am unfamiliar with up2date.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] crypt(): How to make it use blowfish?

2002-08-14 Thread Dan Hardiker


> My system is a linux RH7.2 box. How can I make blowfish encryption
> available to PHP's crypt?

Use mcrypt. See the manual.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer
First Creative Ltd



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




php-general Digest 14 Aug 2002 09:40:57 -0000 Issue 1524

2002-08-14 Thread php-general-digest-help


php-general Digest 14 Aug 2002 09:40:57 - Issue 1524

Topics (messages 112440 through 112504):

Re: File Upload size limit
112440 by: Rasmus Lerdorf
112442 by: Oliver Schönrock
112475 by: RPS Internet

Re: Need a Web Host for php/mySQl
112441 by: vic
112444 by: David T-G
112456 by: The Doctor

Read file dates for most recent
112443 by: Mike Davis
112446 by: Bas Jobsen

Re: Web host withdraws support for PHP extensions - supposed secuity risks
112445 by: David T-G
112448 by: Manuel Lemos
112455 by: The Doctor

Re: mailing list managers
112447 by: Justin French
112450 by: Manuel Lemos
112454 by: Justin French
112457 by: Michael Sims
112459 by: Manuel Lemos

no HTML in a form textarea field
112449 by: Roger Thomas
112451 by: Bas Jobsen

determining which link was clicked
112452 by: Gui Guy
112490 by: Joni Järvinen

Comparing Data
112453 by: Justin
112458 by: Peter Houchin
112460 by: Justin
112464 by: Michael Sims

client-side form validation
112461 by: Jean-Christian Imbeault

Session, error occurs
112462 by: Daniel Canil
112498 by: David Robley

howto disable cron output
112463 by: Roger Thomas
112465 by: Michael Sims
112466 by: Jean-Christian Imbeault
112467 by: Roger Thomas

URL path question
112468 by: Seairth Jacobs
112472 by: Jason Reid

Trying to delete
112469 by: César Aracena
112474 by: David Robley
112479 by: César Aracena
112483 by: Brad Bulger

upgrading error
112470 by: Alex Shi
112473 by: . Edwin
112492 by: EdwardSPL.ita.org.mo

location headers are crisco to cookie headers?
112471 by: Scott A Connerly
112476 by: Michael Sims

mysql error
112477 by: victor.argilent.com
112478 by: . Edwin
112482 by: Brad Bulger
112484 by: victor.argilent.com

abstract question
112480 by: Brad Bulger

newbie PHP/HTML pull down menu problem
112481 by: Brian & Shannon Windsor
112485 by: . Edwin
112499 by: David Robley

wanto uninstall php manual
112486 by: Alex Shi
112487 by: . Edwin
112488 by: Alex Shi
112503 by: David Robley

Seemingly simple header problem, isn't!
112489 by: Robert Orenstein
112491 by: . Edwin
112493 by: Robert Orenstein
112494 by: . Edwin

Re: Troubles with Classes
112495 by: lallous

Variable
112496 by: Remon Redika
112497 by: Michael Egan

Re: How to make it use blowfish?
112500 by: Jean-Christian Imbeault
112504 by: Dan Hardiker

ldap_rename refused to work
112501 by: Roger Thomas

SSL/sessions & password question
112502 by: Jean-Christian Imbeault

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

> Thanks for quick response. Just a couple of silly questions:
>
> - changed where? in php or apache? My host is running the "three week old"
> v 4.2.2 of php so I guess you mean apache?

No, I mean PHP.  The 4.2.2 release was a security fix for 4.2.1 only.
None of the changes for the past couple of months, including this one, is
in it.

> - If I can in fact get them to change it in http.conf for my virtual host
> block then I will have these huge (!) settings for my whole site rather
> than just the necessary scripts. Is there any downside to this (other than
> misbehaved scripts being really misbehaved)?

Yes, you will have them for your whole site.  If you want to limit them to
a certain directory or a certain file, tell them to put the settings
inside appropriate  or  blocks.

-Rasmus


--- End Message ---
--- Begin Message ---

> No, I mean PHP.  The 4.2.2 release was a security fix for 4.2.1 only.
> None of the changes for the past couple of months, including this one, is
> in it.

OK, but you said originally

> post_max_size and upload_max_filesize could not be set in your .htaccess
> file until recently.  It was changed about 3 weeks ago, so unless your
> provider is running a recent snapshot, you won't be able to get this to
> work.

and upload_max_file_size IS being changed by my .htaccess settings...(only 
post_max_size is not working)?! confused..! 8-)

> Yes, you will have them for your whole site.  If you want to limit them to
> a certain directory or a certain file, tell them to put the settings
> inside appropriate  or  blocks.

OK, got it.


- Oliver



--- End Message ---
--- Begin Message ---

You can also do this all in a php file without changing the directives in
either .htaccess or the httpd.conf file.

Here 

Re: [PHP] crypt(): How to make it use blowfish?

2002-08-14 Thread Jean-Christian Imbeault

Dan Hardiker wrote:

> 
> Use mcrypt. See the manual.


I don't want to use mcrypt :) It requires me install a separate library.
Or do you mean that the only to get crypt() to use Blowfish is to 
install mcrypt?

What does crypt() require, on a RH7.2 Linux machine, in order to use 
Blowfish?

Jc


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




[PHP] Re: SSL/sessions & password question

2002-08-14 Thread Wayne

Hi,

All you need is:
https://domain/filename method=post>

https is for SSL.

Wayne



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




[PHP] Re: Session, error occurs

2002-08-14 Thread Per

Daniel Canil wrote:
> I have jsut recently installed a php development kit on my windows platform.
> Im interested in using the session functions but I am recieving this error
> when I use session_start():
> 
> Warning: open(/tmp\sess_540ded508edf231c47fe85bd970f936a, O_RDWR) failed: m
> (2) in d:\phpdev\www\phpdev4\samples\samp13.htm on line 4

Run a phpinfo() to see what session.save_path you have registred. It 
seems like php tries to open from the default directory /tmp.
Maybe you have not restarted the web server after altering the php.ini.

/Per


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




RE: [PHP] determining which link was clicked

2002-08-14 Thread Moose Magin

If I understand what you're trying to do, just put an identifier in the url,
and on the page you link to, use an if statement to display the part you
want.

eg

email form
Forum

and on the 'newpage.php'

if($content == "emailform") {
//Put your stuff to be displayed here

}
elseif ($content == "forum") {
//Again, more stuff to be displayed
}

And so on ;)



-Original Message-
From: Gui Guy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 14 August 2002 10:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP] determining which link was clicked


if I have a page full of links and I want to generate another page.  The
contents of the new page will depend on the link I click.
How can I determine which link was clicked?

Thanks.



--
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] Destroy session variable when IE close

2002-08-14 Thread Christian Ista

Hello,

Is it possible to set to null (or destroy) the session variables when I
close IE ?

Bye


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




[PHP] Re: SSL/sessions & password question

2002-08-14 Thread Jean-Christian Imbeault

Wayne wrote:

> 
> All you need is:
> https://domain/filename method=post>


Sounds too easy, there must be a catch ;)

Thanks!

Jc


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




[PHP] fopen and sort by date modified

2002-08-14 Thread electroteque

hi there i was wondering how i could fopen a directory and then sort the
files by date modified is there a way ?



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




[PHP] Re: fopen and sort by date modified

2002-08-14 Thread lallous

checkout:

opendir()
readdir()
fstat()
closedir()

Elias
"Electroteque" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi there i was wondering how i could fopen a directory and then sort the
> files by date modified is there a way ?
>
>



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




[PHP] help with making appropriate indexes.

2002-08-14 Thread lallous

give this query:

  SELECT
table_routing.id  AS   routeid,
table_pricing.units   AS   price,
table_routing.providerAS   providerid,
table_country.nameAS   countryname,
table_country.id  AS   countrycode
  FROM
table_pricing,
table_routing,
table_country
  WHERE
table_country.id = table_routing.country
   AND
table_routing.country = table_pricing.country
   AND
table_routing.provider = table_pricing.provider
   AND
table_country.enabled = 1
  ORDER BY routeid

what keys / indexes should I create on whatever tables to make this query
efficient?
I don't know if this query can be re-written even with JOINs and stuff.

Please advise,

If you've got an online doc. about that it will help too.


Elias



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




[PHP] Header utilisation problem

2002-08-14 Thread Christian Ista

Hello,

I'd like to know why this code not work :
case "  ":
include("act_create_new_compte.php");
header("Location: ../manager/index.php");
  break;

I receive this error :
Warning: Cannot add header information - headers already sent by (output
started at
d:\inetpub\wwwroot\website\test2\login\act_create_new_compte.php:31) in
d:\inetpub\wwwroot\ website\test2\login\index.php on line 18

But when I place header("Location: ../manager/index.php");
in the end of the file act_create_new_compte.php and remove the line in
the case, like that :
case "":
include("act_create_new_compte.php");
  break;

That's work. 

Could you explain me that ?

Bye



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




[PHP] Destroy session variable when IE close

2002-08-14 Thread Christian Ista

Hello,

Is it possible to set to null (or destroy) the session variables when I
close IE ?

Bye


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




Re: [PHP] Header utilisation problem

2002-08-14 Thread Peter Hicks

Hi Christian

I suspect act_create_new_compte.php is sending headers. Once HTTP headers have
been sent, and HTML has started to be sent, you can send no more headers.

Try using another method of causing the browser to reload - maybe a META tag?
(urgh).


Peter.



On Wed, 14 Aug 2002, Christian Ista wrote:

> Hello,
>
> I'd like to know why this code not work :
> case "  ":
>   include("act_create_new_compte.php");
>   header("Location: ../manager/index.php");
>   break;
>
> I receive this error :
> Warning: Cannot add header information - headers already sent by (output
> started at
> d:\inetpub\wwwroot\website\test2\login\act_create_new_compte.php:31) in
> d:\inetpub\wwwroot\ website\test2\login\index.php on line 18
>
> But when I place header("Location: ../manager/index.php");
> in the end of the file act_create_new_compte.php and remove the line in
> the case, like that :
> case "":
>   include("act_create_new_compte.php");
>   break;
>
> That's work.
>
> Could you explain me that ?
>
> Bye
>
>
>
>


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




[PHP] Redhat Linux 7.2

2002-08-14 Thread Tim Haynes

I have just installed Redhat Linux 7.2, the installation was fine at it
installed apache with php 4.0.6 as default, that runs without problems.
Unfortunately I noticed that PHP was not compiled with mysql support and
there was no distribution of mysql with linux so please can anyone help by
explaining what I need to do to resolve these problems.

Many Thanks

Tim



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




[PHP] Retrieving variables

2002-08-14 Thread Michael Hazelden

Hi all,

I'm attempting to store variables inside a database and then recall them.

What I want to do is store them dynamically though - so for instance - a
path to a file will be stored in the DB as
$_SERVER[DOCUMENT_ROOT]."/path/to/file"

But, obviously, when I retrieve this value, it retrieves it as a literal ...
not much help because I want to parse it as a proper value.

Is there any way to retrieve that value and then parse it within the PHP to
create the "c:/webconsole/path/to/file" string that can be stored within
another variable?

Anybody got any thoughts?

Cheers,

Michael.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




Re: [PHP] fopen and sort by date modified

2002-08-14 Thread Bas Jobsen

Op woensdag 14 augustus 2002 13:04, schreef electroteque:
> hi there i was wondering how i could fopen a directory and then sort the
> files by date modified is there a way ?




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




[PHP] Re: Retrieving variables

2002-08-14 Thread Bogdan Stancescu

You may add "\$_SERVER[DOCUMENT_ROOT].\"/path/to/file\"" to the database 
and then use eval() to evaluate. The better solution is obviously to 
store "/path/to/file" and append it to $_SERVER[DOCUMENT_ROOT] whenever 
you need the full path.

Bogdan

Michael Hazelden wrote:
> Hi all,
> 
> I'm attempting to store variables inside a database and then recall them.
> 
> What I want to do is store them dynamically though - so for instance - a
> path to a file will be stored in the DB as
> $_SERVER[DOCUMENT_ROOT]."/path/to/file"
> 
> But, obviously, when I retrieve this value, it retrieves it as a literal ...
> not much help because I want to parse it as a proper value.
> 
> Is there any way to retrieve that value and then parse it within the PHP to
> create the "c:/webconsole/path/to/file" string that can be stored within
> another variable?
> 
> Anybody got any thoughts?
> 
> Cheers,
> 
> Michael.
> 
> This message has been checked for all known viruses by the MessageLabs Virus Control 
>Centre.
> 
>   
> *
> 
> Notice:  This email is confidential and may contain copyright material of Ocado 
>Limited (the "Company"). Opinions and views expressed in this message may not 
>necessarily reflect the opinions and views of the Company.
> If you are not the intended recipient, please notify us immediately and delete all 
>copies of this message. Please note that it is your responsibility to scan this 
>message for viruses.
> 
> Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY
> 
> *



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




Re: [PHP] mailing list managers

2002-08-14 Thread David T-G

Justin, Michael, et al --

...and then Michael Sims said...
% 
% On Wed, 14 Aug 2002 01:09:32 +1000, you wrote:
% 
% >I was hoping that maybe there's an opensource or commercial product out
% >there that I can install in my doc root (ie, PHP + MySQL support) which will
% >handle this in a more effective manner (ie, space the mailout across an hour
% >or so, etc etc).
% 
% Take a look at some of the dedicated mailing list managers, and see if

I would agree here.  Use a real mailing list manager instead of trying to
roll your own.


% perhaps you can modify them to get their subscriber list from your
% database.  EZMLM by all accounts is very nice, although I believe it
% requires Qmail.  Majordomo is another option.

While it doesn't truly *require* qmail, that's nonetheless a fairly
accurate statement.  It is, however, very robust and easy to use.


% 
% If you don't want the complexity of those types of programs, look at
% some Perl-based solutions.  I've been learning Perl as time allows,
% and I've found that it's not too difficult if you're already a PHP
% person to pick up Perl.  A search on www.hotscripts.com or
% www.freshmeat.net may turn up something.

Absolutely agreed; the languages are very similar.  [Rumor has it that
php is perl-based or perl-inspired, but I haven't done any independent
digging to see one way or another -- and there are *some* noticeable
differences.]


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg75474/pgp0.pgp
Description: PGP signature


RE: [PHP] Re: Retrieving variables

2002-08-14 Thread Michael Hazelden

Thanks to all,

What I've come up with in the end (since I want the flexibility of being
able to store the $_SERVER portion or not depending on the need of the
variable) is this:

I retrieve the variable from the database in the following way:

select concatenate('$',name,'=',value,';') as a from variables

I can then eval() that result with no problems.

Cheers,

Michael.

-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2002 12:56
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Retrieving variables


You may add "\$_SERVER[DOCUMENT_ROOT].\"/path/to/file\"" to the database 
and then use eval() to evaluate. The better solution is obviously to 
store "/path/to/file" and append it to $_SERVER[DOCUMENT_ROOT] whenever 
you need the full path.

Bogdan

Michael Hazelden wrote:
> Hi all,
> 
> I'm attempting to store variables inside a database and then recall them.
> 
> What I want to do is store them dynamically though - so for instance - a
> path to a file will be stored in the DB as
> $_SERVER[DOCUMENT_ROOT]."/path/to/file"
> 
> But, obviously, when I retrieve this value, it retrieves it as a literal
...
> not much help because I want to parse it as a proper value.
> 
> Is there any way to retrieve that value and then parse it within the PHP
to
> create the "c:/webconsole/path/to/file" string that can be stored within
> another variable?
> 
> Anybody got any thoughts?
> 
> Cheers,
> 
> Michael.
> 
> This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.
> 
>   
> *
> 
> Notice:  This email is confidential and may contain copyright material of
Ocado Limited (the "Company"). Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the Company.
> If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.
> 
> Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY
> 
> *



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




[PHP] php classes

2002-08-14 Thread Tom Kohnen

Hi!

Can anyone recommend me some entry-level php-classes tutorials, because
the php.net page about classes is not that helpful and difficult to
understand IMO. 

Thanks in advance,
- Tom

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




[PHP] Re: Destroy session variable when IE close

2002-08-14 Thread lallous

Afaik, the session will die automatically when IE gets closed.
Or at least the cookie that links to that session.

Elias

"Christian Ista" <[EMAIL PROTECTED]> wrote in message
000101c24384$442ab9b0$c000a8c0@p3portable">news:000101c24384$442ab9b0$c000a8c0@p3portable...
> Hello,
>
> Is it possible to set to null (or destroy) the session variables when I
> close IE ?
>
> Bye
>



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




Re: [PHP] Redhat Linux 7.2

2002-08-14 Thread Jason Wong

On Wednesday 14 August 2002 19:21, Tim Haynes wrote:
> I have just installed Redhat Linux 7.2, the installation was fine at it
> installed apache with php 4.0.6 as default, that runs without problems.
> Unfortunately I noticed that PHP was not compiled with mysql support and
> there was no distribution of mysql with linux so please can anyone help by
> explaining what I need to do to resolve these problems.

RH7.2 does come with everything to get Apache/MySQL/PHP working together. To 
get MySQL support in PHP, install the php-mysql-X.rpm.

For further help ask on the RH7.2 (Enigma) mailing list.

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

/*
The wise man seeks everything in himself; the ignorant man tries to get
everything from somebody else.
*/


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




[PHP] Is Voice Over IP possible in PHP

2002-08-14 Thread usha

Hi

Can anyone tell me if Voice Over IP is possible in PHP.  Such that a client  machine 
can voice chat to My apache Web Server. I want this to be done via web based so that 
the client has no overhead of installing any softwares.

Regards



[PHP] imagecreatfrompng() only work for 24bits png ?

2002-08-14 Thread NoWhErEMan

Hi all,
I use following script to generate a resized png image on the fly.  I tried
for several hours and found that it
not works for every png image. And finally i found that the
imagecreatfrompng() only works for 24bits png.
i.e my script does not works on my abc.png which is 8bpp(bitsperpixel),
after i increased it;s color depth to 24bits,
it works perfectly. Is it true that the png function only works on 24bpp png
image? (i'm not sure...)

Or put it on this way, how can i increase the color depth in php before
process following script?

I use apache 2.x on win2k, php4.2.2 with php_gd.dll enabled.




Thanks in advance.
NoWhErEMaN



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




Re: [PHP] Is Voice Over IP possible in PHP

2002-08-14 Thread Adam Voigt

Umm, I'm fairly sure you can't do this unless you wanted
to rig up a client side application in PHP, but if you want
it so they don't have to get any software, I would suggest
Java, check out www.dialpad.com they do something fairly cool
like this.

Adam Voigt
[EMAIL PROTECTED]

On Wed, 2002-08-14 at 13:32, usha wrote:
> Hi
> 
> Can anyone tell me if Voice Over IP is possible in PHP.  Such that a client  machine 
>can voice chat to My apache Web Server. I want this to be done via web based so that 
>the client has no overhead of installing any softwares.
> 
> Regards



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




[PHP] Setting the line number for debugging

2002-08-14 Thread Thomas Lochmatter

Is it possible to set the line number and file name to show in error
messages?

I'm looking for something similar to the perl's expression
#line 298 myscript.pl
which tells the compiler explicitely that here is line 298 of myscript.pl.
If an error occurs 5 lines later, it would show something like "compile
error at line 303 in myscript.pl", whatever the real line number and
filename is.

Thomas
[EMAIL PROTECTED]






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




Re: [PHP] Setting the line number for debugging

2002-08-14 Thread Chris Boget

> Is it possible to set the line number and file name to show in error
> messages?

__FILE__
__LINE__

Chris



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




[PHP] [Class] Behaviour global variables

2002-08-14 Thread Tim Stoop

Hi there,

I'm forgetting something, but I can't seem to get to it... Consider the 
following Class.

class Test
{
var $a;
var $b;

function Test()
{
$this->a = 2;
$this->b = 5;
}

function Show()
{
global $a, $b;

echo("a: ".$a);
echo("a: ".$this->a);
echo("b: ".$b);
echo("b: ".$this->b);
}
}

After proper initialisation, calling the function Show() gives:

a:
a: 2
b:
b: 5

What am I forgetting here? Tia for answers!

-- 
Kind regards,
Tim

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




RE: [PHP] Redhat Linux 7.2

2002-08-14 Thread Daniel Masson


Usually in the RedHat cd´s you can find php-mysql-*.*.rpm, after
installing this package you´re ready to go !!

=> Daniel.


On Wednesday 14 August 2002 19:21, Tim Haynes wrote:
> I have just installed Redhat Linux 7.2, the installation was fine at 
> it installed apache with php 4.0.6 as default, that runs without 
> problems. Unfortunately I noticed that PHP was not compiled with mysql

> support and there was no distribution of mysql with linux so please 
> can anyone help by explaining what I need to do to resolve these 
> problems.

RH7.2 does come with everything to get Apache/MySQL/PHP working
together. To 
get MySQL support in PHP, install the php-mysql-X.rpm.

For further help ask on the RH7.2 (Enigma) mailing list.

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

/*
The wise man seeks everything in himself; the ignorant man tries to get
everything from somebody else. */


-- 
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] [Class] Behaviour global variables

2002-08-14 Thread Richard Black

Not done any OO stuff with PHP, but I would hazard a guess that the
problem is one of scope.

Rather than global making available class variables, it makes available
GLOBAL variables. And I'm guessing there isn't a global variable a or b,
which is why they show up blank.

HTH,

Richy
==
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED] 

-Original Message-
From: Tim Stoop [mailto:[EMAIL PROTECTED]] 
Sent: 14 August 2002 14:27
To: [EMAIL PROTECTED]
Subject: [PHP] [Class] Behaviour global variables


Hi there,

I'm forgetting something, but I can't seem to get to it... Consider the 
following Class.

class Test
{
var $a;
var $b;

function Test()
{
$this->a = 2;
$this->b = 5;
}

function Show()
{
global $a, $b;

echo("a: ".$a);
echo("a: ".$this->a);
echo("b: ".$b);
echo("b: ".$this->b);
}
}

After proper initialisation, calling the function Show() gives:

a:
a: 2
b:
b: 5

What am I forgetting here? Tia for answers!

-- 
Kind regards,
Tim

-- 
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] [Class] Behaviour global variables

2002-08-14 Thread Bas Jobsen

$TEST= new TEST;
$a=3;
$b=4;
$TEST->Show();

works, fine

better to use $GLOBALS['a'] instead of global $a

Op woensdag 14 augustus 2002 15:27, schreef Tim Stoop:
> Hi there,
>
> I'm forgetting something, but I can't seem to get to it... Consider the
> following Class.
>
> class Test
> {
> var $a;
> var $b;
>
> function Test()
> {
> $this->a = 2;
> $this->b = 5;
> }
>
> function Show()
> {
> global $a, $b;
>
> echo("a: ".$a);
> echo("a: ".$this->a);
> echo("b: ".$b);
> echo("b: ".$this->b);
> }
> }
>
> After proper initialisation, calling the function Show() gives:
>
> a:
> a: 2
> b:
> b: 5
>
> What am I forgetting here? Tia for answers!

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




[PHP] Re: [Class] Behaviour global variables

2002-08-14 Thread lallous

hmmmwhat are you missing?

globals $a and $b are not defined!

try to set error reporting to E_ALL and try running your code again.

Elias

"Tim Stoop" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I'm forgetting something, but I can't seem to get to it... Consider the
> following Class.
>
> class Test
> {
> var $a;
> var $b;
>
> function Test()
> {
> $this->a = 2;
> $this->b = 5;
> }
>
> function Show()
> {
> global $a, $b;
>
> echo("a: ".$a);
> echo("a: ".$this->a);
> echo("b: ".$b);
> echo("b: ".$this->b);
> }
> }
>
> After proper initialisation, calling the function Show() gives:
>
> a:
> a: 2
> b:
> b: 5
>
> What am I forgetting here? Tia for answers!
>
> --
> Kind regards,
> Tim



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




[PHP] Persistant Connections

2002-08-14 Thread John Wards

I am running a website which generates around 100,000 pageviews a day and I
am wondering if I stop using persistent conections to the database and use
normal open and close conections this would reduce the load onto my server?

Most conections are either made through my "main" file or the phorum message
board system.

Thanks in advance
John Wards



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




Re: [PHP] $HTTP_SESSION_VARS vs $_SESSION - cont.

2002-08-14 Thread Analysis & Solutions

On Tue, Aug 13, 2002 at 10:07:57AM -0700, Rasmus Lerdorf wrote:
> >  while ( list($Key, $Val) = each($_SESSION) ) {
> > $$Key = $Val;
> >  }
> 
> extract($_SESSION) is a better way to do that.

Yeah.  Old habits die hard! :)

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Credit Card Transactions and Micropayment

2002-08-14 Thread Sascha Braun

Hello,

while I'm building a very nive page for buying images over the web, but there are some 
parts of the site where the development not is evaluated to the end. (Hope you all 
understand this sentence.)

One part will be the payment module. I read the parts about the creditcard security in 
this mailinglist very carefully and got some new questions about that theme.

Are there some ways of using a micropayment system together with PHP? - Maybe 
something where Customers can see the Amount of Money they have to pay, and then they 
do a phonecall to e specific number and then the page redirects teh customer to a 
downloads page where the user can receive his picturepackage.

Or how does the cybercash module in PHP work? I saw it in the php.ini, but could not 
find it in the extensions dir.

What else can I do for my customers to have an secure payment possibility?

It would be very usefull for me and maybe for others to discuss these points in the 
list.

So I hope, somebody will share his or hers knowledge.

Thanks

Sascha Braun

-
www.weitsicht.org




[PHP] Introducing eNetwizard Server: An Open Source Project for Users of PHP

2002-08-14 Thread Robert Samuel White

INTRODUCTION 

eNetwizard is a cutting-edge web application server and content
management system. It includes an advanced runtime engine capable of
rendering and managing an unlimited number of websites across an
unlimited number of domains (referred to as the matrix), all from a
central web space environment. eNetwizard is platform independent and
runs on both public and private networks, making it suitable for
Internet, Intranet, and Extranet solutions. Indeed, by its very design,
eNetwizard can run all three of them (in unlimited numbers) with a
single running copy of the distribution. eNetwizard is ideal for the
individual to the largest of enterprises, as well as for internet
service providers who wish to offer truly unique web hosting and web
design services. 

FEATURES 

eNetwizard was designed with five main concepts in mind: security,
flexibility, configurability, efficiency, and expandability. 

eNetwizard includes its own API and registry that allow programmers to
interact with the system; the API is expanded using an included
components library, which can be easily added to; this allows
programmers to expand the capabilities of eNetwizard without interfering
with the core API. 

eNetwizard includes modules (as part of the core class library) for
advanced session management, complete error handling, thorough user
authentication, and the following of precise security protocols. Nothing
gets past eNetwizard. An example of one of the components is an entire
suite of logging functions which are so comprehensive it can even log
attempts at treachery! And, if you want it to, block the user
immediately. 

eNetwizard includes a full set of wizards (which are automatically
available to all of the websites in the matrix.) An example of one of
the wizards is the Sign Up Wizard, which allows a user to sign up for
membership to the matrix; users have the ability to indicate which
websites in the matrix may have access to their personal information,
and what information they may have access to; if a website needs this
information to offer a customized service and the user has not yet given
the website permission, eNetwizard will prompt the user and ask if it is
okay. This is just one of the many wizards available as part of the
standard distribution. 

eNetwizard itself is fully-customizable, as is all of the content that
it is responsible for rendering. Individual websites (and even groups of
websites) can be owned by different individuals, unlimited in number of
course, giving each of them access to their own Website Wizard. The main
administrator makes use of the Matrix Wizard to govern eNetwizard. 

eNetwizard also contains a full set of plug-in applications (referred to
as objects) which add to the functionality of individual websites; a
simple object would be a newsletter or web directory; once an object is
added to a web matrix, it runs flawlessly, even in the style and colors
that have already been chosen as the theme of the website. 

These are just a few of the many wonderful things that eNetwizard can
do! 

SYSTEM REQUIREMENTS 

eNetwizard is primarily written in PHP and uses MySQL as its backend
database server. In the future, eNetwizard will provide support for
other databases as well. eNetwizard runs best on Apache, regardless of
platform, and makes use of the mod_rewrite module to force Apache to
serve all requests through the eNetwizard Runtime Engine; it's a very
simple setup. It may be possible to use eNetwizard with other web
servers, such as IIS, if the web server contains a similar method to
mod_rewrite. So in essence, eNetwizard is designed to work on most
standard web server configurations. Future projects that will complement
eNetwizard will be written in Perl and Java as well. eNetwizard
licensing is based on the Open Source Artistic License. 

BACKGROUND INFORMATION 

I began eNetwizard as an independent project at the age of twenty-one as
a way to simplify my role as a web programmer and as a workaround to the
limitations I found myself facing on a shared hosting server. eNetwizard
began its life at Swift eNetwork ,
presently offline. Over the course of four years, I would develop it to
a certain point when suddenly I would have a revelation about how to
substantially improve the product; several times, five or six so far, I
have completely scrapped the code and completely started it all over
again! I wanted it to be perfect before I ever considered releasing it
to the public. 

Now, at the age of twenty-five, over four years later, eNetwizard has
finally begun to live up to the grand vision in my mind that it was
always meant to become. It has become a stable solution that I honestly
believe will become an invaluable resource to the web programming
community. 

The latest version of eNetwizard is used on several different systems
already, Windows and Linux, including internally by one of the largest
cable companies in America. 

CALL FOR HELP 


Re: [PHP] Setting the line number for debugging

2002-08-14 Thread Thomas Lochmatter

As far as I know, __LINE__ and __FILE__ are "magic constants" which return
the current line number and file name.

But what I'm looking for is a way to set these two things. I want to say on
line 30 that this is not line 30, but line 40 for example. And php should
then return all following errors with the new line numbering.

The reason for this is that I have a kind of preprocessor which puts some
php code parts of code in one large script and then runs the whole script.
If now an error occurs on line 362 for example, it is not easy to find the
buggy code part, because this might be on line 15 in one of the source
scripts.

Perl has a nice feature to achieve this, and I was wondering if something
similar exists in php.

- Thomas

"Chris Boget" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
008801c24396$580393a0$8c01a8c0@ENTROPY">news:008801c24396$580393a0$8c01a8c0@ENTROPY...
> > Is it possible to set the line number and file name to show in error
> > messages?
>
> __FILE__
> __LINE__
>
> Chris
>
>



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




Re: [PHP] newbie PHP/HTML pull down menu problem

2002-08-14 Thread Justin French

You have a while loop that pulls values out of the MySQL table row by row,
and for each row, you output an option in the select box.

Something like:



{$color}";
}
?>




Season to taste :)
Justin French



on 14/08/02 2:30 PM, Brian & Shannon Windsor ([EMAIL PROTECTED])
wrote:

> Hi,
> 
> I want to pull information out of my mySQL database and use it as a pull
> down menu ona web page.  There are two sets of information that I need, one
> is a color, and the other is the color_id, so I want to use it in the way
> below but without having to physically enter all the data.  I'd like to use
> color_id as the value and the actual color name as the text in the pull down
> button.  Can someone please help me on how to pass the info into a useable
> way to get the info out of PHP and into HTML?  I've haad no problems going
> from HTML to PHP, but can't seem to grasp going the other way, especially
> with a list of things.  I've been banging my head against this for two days,
> but something tells me it's extremely easy.
> 
> Thanks,
> 
> Brian
> 
> 
> 
> red
> blue
> black
> ice
> purple
> 
> 
> 
> 
> 


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




Re: [PHP] Setting the line number for debugging

2002-08-14 Thread Chris Boget

> As far as I know, __LINE__ and __FILE__ are "magic constants" which
> return the current line number and file name.

Sorry, I misunderstood exactly what you were looking for.
 
> whole script. If now an error occurs on line 362 for example, it is
> not easy to find the buggy code part, because this might be on line
> 15 in one of the source scripts.

How do you include the source scripts into the main scripts?  By using
include() or require()?  IIRC, __LINE__ and __FILE__ should work in 
cases like that telling you the line and file name of the source script, 
not the main script.

> Perl has a nice feature to achieve this, and I was wondering if
> something similar exists in php.

Apart from those two variables, none that I know of.  Though, that's not
to say something similar doesn't exist.

Chris



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




RE: [PHP] fopen and sort by date modified

2002-08-14 Thread electroteque

sweet , damn filemtime this was hiding from me :)

-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 8:48 PM
To: electroteque; [EMAIL PROTECTED]
Subject: Re: [PHP] fopen and sort by date modified


Op woensdag 14 augustus 2002 13:04, schreef electroteque:
> hi there i was wondering how i could fopen a directory and then sort the
> files by date modified is there a way ?




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




Re: [PHP] determining which link was clicked

2002-08-14 Thread Gui Guy

Thanks for your help
Thats what I am trying to do but the variable $content does not get over to
newpage.php


- Original Message -
From: "Moose Magin" <[EMAIL PROTECTED]>
To: "Gui Guy" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 3:52 AM
Subject: RE: [PHP] determining which link was clicked


> If I understand what you're trying to do, just put an identifier in the
url,
> and on the page you link to, use an if statement to display the part you
> want.
>
> eg
>
> email form
> Forum
>
> and on the 'newpage.php'
>
> if($content == "emailform") {
> //Put your stuff to be displayed here
>
> }
> elseif ($content == "forum") {
> //Again, more stuff to be displayed
> }
>
> And so on ;)
>
>
>
> -Original Message-
> From: Gui Guy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 14 August 2002 10:08 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] determining which link was clicked
>
>
> if I have a page full of links and I want to generate another page.  The
> contents of the new page will depend on the link I click.
> How can I determine which link was clicked?
>
> Thanks.
>
>
>
> --
> 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] Setting the line number for debugging

2002-08-14 Thread Thomas Lochmatter

> How do you include the source scripts into the main scripts?  By using
> include() or require()?  IIRC, __LINE__ and __FILE__ should work in
> cases like that telling you the line and file name of the source script,
> not the main script.

Unfortunately none of them. I really put them together in the same file. The
reason is that there are many small pieces of code which all together give a
complete script. Technically, I could use require/include instead, but this
would mean that every generated script consists of a dozen of files.

Thank you anyway.

- Thomas




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




RE: [PHP] fopen and sort by date modified

2002-08-14 Thread electroteque

unfortunately this isnt sorting by date modified ?

-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 8:48 PM
To: electroteque; [EMAIL PROTECTED]
Subject: Re: [PHP] fopen and sort by date modified


Op woensdag 14 augustus 2002 13:04, schreef electroteque:
> hi there i was wondering how i could fopen a directory and then sort the
> files by date modified is there a way ?




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




[PHP] Shared network server failing to include files

2002-08-14 Thread Julio Nobrega

  Hi all,

  I am not 100% sure if this is a PHP problem, so I apologize in advance if
it is an off-topic problem.

  I have a Linux server where I develop my websites. A Windows 2000 takes
care of our network internet connectivity. I need to show to a client the
progress of our work, so I've shared through Samba a directory from Linux,
and installed Apache on the Windows 2000 and used the Alias option to point
to this Linux share:

Alias /cs/ //192.168.0.253/apachedir/

  When I access my development website locally, or use a browser and input
the IP address, everything goes fine. But when I am on the Windows 2000 and
type:

http://localhost/cs/

  An include error occurs:

Fatal error: Failed opening required 'gerador.inc.php' (include_path='') in
//192.168.0.253\apachedir\index.php on line 3

  Anyone knows the fix? Perhaps I should ask what basically I have in mind
since the beggining: How can I server webpages from a networked Linux
through the Windows 2000 that is connected to the Internet?

  Any help is sincerely appreciated.

  Thanks,

--
Julio Nobrega



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




[PHP] Shared network server failing to include files

2002-08-14 Thread Julio Nobrega

  Hi all,

  I am not 100% sure if this is a PHP problem, so I apologize in advance if
it is an off-topic problem.

  I have a Linux server where I develop my websites. A Windows 2000 takes
care of our network internet connectivity. I need to show to a client the
progress of our work, so I've shared through Samba a directory from Linux,
and installed Apache on the Windows 2000 and used the Alias option to point
to this Linux share:

Alias /cs/ //192.168.0.253/apachedir/

  When I access my development website locally, or use a browser and input
the IP address, everything goes fine. But when I am on the Windows 2000 and
type:

http://localhost/cs/

  An include error occurs:

Fatal error: Failed opening required 'gerador.inc.php' (include_path='') in
//192.168.0.253\apachedir\index.php on line 3

  Anyone knows the fix? Perhaps I should ask what basically I have in mind
since the beggining: How can I server webpages from a networked Linux
through the Windows 2000 that is connected to the Internet?

  Any help is sincerely appreciated.

  Thanks,

--
Julio Nobrega





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




[PHP] online petition

2002-08-14 Thread M.E. Suliman

Hi

Anyone know of a online petition system in PHP similar to what is offered on
www.PetitionOnline.com

Thanks

Mohamed




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




Re: [PHP] ldap_rename refused to work

2002-08-14 Thread Stig Venaas

On Wed, Aug 14, 2002 at 02:18:58AM -0700, Roger Thomas wrote:
> built: php-4.2.2 with openldap 2.0.25
> 
> i tried using the ldap_rename function to modify the dn of my ldap db but
> nothing seems to happen. the record was not change at all. i have followed
> closely the code-snippet that was given by Mr Stig Venaas at:
> http://marc.theaimsgroup.com/?l=php-general&m=100949195224325&w=2

But you're not doing what I wrote...

> // we want to transfer user roger from Civil Engineering to Credit section in
> Finance
> $r=ldap_rename($ds,
> "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net",
> "uid=roger,ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net",
> "dc=mydomain,dc=net",TRUE);

The third parameter should be the new rdn (which is the same as the old),
and the fourth should be new parent. So it should look like this:

$r=ldap_rename($ds,
"uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net",
"uid=roger",
"ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", TRUE);

Stig

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




[PHP] regex match problem

2002-08-14 Thread Dave [Hawk-Systems]

as part of a larger application we have a bit of code that processes whois to
determine domain name expiry dates.  Most formats are easily parsed, but
Register.Com has thrown the little regex for a loop and I am unsure as to a
clean workaround.

Here is what we have;

...


$pregmatchstring="/([\s])*(Renewal\DDate|Registered\sthrough|Expires|Record\sExp
ires|Domain\sExpires|Expiry\sDate)([\D\s]*)(.*)/i";

...

exec($command,$cresult,$cstatus); # puts all lines into array
$expire='';
for($i=0;$i strip space characters from the front (some indent)
([\s])*
> identify the exipery date line from other verbose entries containing "expir"
or similar

(Renewal\DDate|Registered\sthrough|Expires|Record\sExpires|Domain\sExpires|Expir
y\sDate)
> any other spaces, .:, or other verbose crap afterwards **except for
numbers**
> essentially grabs everything else up to the first number
> thought I was being slick with this one
([\D\s]*)
> grab numbers/date - gets the 2002/12/01, 09-APR-03, 2002-08-19 00:00:00.000
(.*)
> and make case insensitive
/i

takes care of
Renewal-Date: 2002/12/01
Registered through- 08/16/02 00:00:00
Expires on: 09-APR-03
expires: 2003-01-17 02:16:03
Domain expires on 03-Apr-2003
Record expires on 2002-08-19 00:00:00.000
Record expires on 29-Mar-2003.
Record expires on 2003-03-25.
DOMAIN EXPIRES : 2003-03-25.
Expiry Date..2003.03.25

HOWEVER...  this simple solution breaks for register.com because of their date
format
Expires on..: Tue, Jul 29, 2003

because the regex only returns "29, 2003" as the date which barfs for the
strtotime()

not the regex fault of the strtotime fault, as they are doing what instructed...

Any ideas on a way to simply overcome the register.com format and still keep a
simple all inclusive regex for all registrars?

Thanks

Dave


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




[PHP] Re: requesting sites running OS X

2002-08-14 Thread Jerry

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Michael Geary) wrote:
> I have been asked by a rep at a large software dev company about any 
> websites live-to-the-world running OS X. We are, but we're not exactly 
> huge (max hits/day = approx. 1000, mostly internal).
> 
> So, what sites are you aware of? They don't even have to be running PHP. 
> Please let me know.

We're running our search engine on OS X Server 
(http://spike.sandiego.edu/); it's great--there's practically no system 
administration that needs to be done (that's all handled by Apple), and 
I can concentrate on the search engine software (we use ht://Dig).

We do use PHP on it, but for legacy links--I've got a PHP script that 
translates requests to the old search engine into requests that ht://Dig 
understands.

We've just purchased an XServe to replace our main web server, but have 
not yet installed it. That will use PHP extensively.

We're also using OS X Server to handle our mysql databases. 
(http://www.sandiego.edu/ac/classes/ to see one front end to one of the 
databases)

Jerry
-- 
http://www.hoboes.com/jerry/
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.hoboes.com/jerry/Murder/)

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




[PHP] problem with mail()

2002-08-14 Thread Gui Guy

I'm trying to send email from php and nothing happens.  Sendmail is
correctly setup in php.ini.
When I checked the maillog file I see:

...: SYSERR(nobody): Can't create transcript file ./xfg7E9Jlr03988:
Permission denied
: SYSERR(nobody): Cannot create ./dfg7E9Jlr03988: Permission denied

Does it mean that php is trying to send mail from user nobody?
How do I set up nobody as mail user?
Thanks



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




[PHP] fgets question

2002-08-14 Thread Monte Ohrt

Hi, I have a question about fgets(), it seems to pick up an extra line 
at the end of a text file.

example, I open a new file named "test" with the vi editor and make it 8 
lines long like so (showing newlines as \n):

1\n
2\n
3\n
4\n
5\n
6\n
7\n
8\n

I create this PHP program and run it:



Here is the output (showing newlines as \n):

buffer is 1\n
buffer is 2\n
buffer is 3\n
buffer is 4\n
buffer is 5\n
buffer is 6\n
buffer is 7\n
buffer is 8\n
buffer is


My question, why is there an extra line? Or in other words, how do I get 
this to loop exactly 8 times if there are only 8 lines?

TIA
Monte


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




Re: [PHP] Shared network server failing to include files

2002-08-14 Thread Andrew Brampton

Hi, I don't think this is a PHP question, but the line
Alias /cs/ //192.168.0.253/apachedir/
try
Alias /cs/ \\192.168.0.253/apachedir/

Because //isn't valid for UNCs, but \\ is..

If this doesn't work, then with dos map \\192.168.0.253/apachedir/ to a
network drive and point apache at that

Andrew

- Original Message -
From: "Julio Nobrega" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 4:58 PM
Subject: [PHP] Shared network server failing to include files


>   Hi all,
>
>   I am not 100% sure if this is a PHP problem, so I apologize in advance
if
> it is an off-topic problem.
>
>   I have a Linux server where I develop my websites. A Windows 2000 takes
> care of our network internet connectivity. I need to show to a client the
> progress of our work, so I've shared through Samba a directory from Linux,
> and installed Apache on the Windows 2000 and used the Alias option to
point
> to this Linux share:
>
> Alias /cs/ //192.168.0.253/apachedir/
>
>   When I access my development website locally, or use a browser and input
> the IP address, everything goes fine. But when I am on the Windows 2000
and
> type:
>
> http://localhost/cs/
>
>   An include error occurs:
>
> Fatal error: Failed opening required 'gerador.inc.php' (include_path='')
in
> //192.168.0.253\apachedir\index.php on line 3
>
>   Anyone knows the fix? Perhaps I should ask what basically I have in mind
> since the beggining: How can I server webpages from a networked Linux
> through the Windows 2000 that is connected to the Internet?
>
>   Any help is sincerely appreciated.
>
>   Thanks,
>
> --
> Julio Nobrega
>
>
>
>
>
> --
> 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] fgets question

2002-08-14 Thread Kevin Stone

The only explaination is that 'vi' is putting an extra line in there that
you're not seeing.
-Kevin

- Original Message -
From: "Monte Ohrt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 11:05 AM
Subject: [PHP] fgets question


> Hi, I have a question about fgets(), it seems to pick up an extra line
> at the end of a text file.
>
> example, I open a new file named "test" with the vi editor and make it 8
> lines long like so (showing newlines as \n):
>
> 1\n
> 2\n
> 3\n
> 4\n
> 5\n
> 6\n
> 7\n
> 8\n
>
> I create this PHP program and run it:
>
>  $fd = fopen ("test","r");
> while (!feof ($fd)) {
>  $buffer = fgets($fd, 4096);
>  echo "buffer is $buffer";
> }
> fclose ($fd);
> ?>
>
> Here is the output (showing newlines as \n):
>
> buffer is 1\n
> buffer is 2\n
> buffer is 3\n
> buffer is 4\n
> buffer is 5\n
> buffer is 6\n
> buffer is 7\n
> buffer is 8\n
> buffer is
>
>
> My question, why is there an extra line? Or in other words, how do I get
> this to loop exactly 8 times if there are only 8 lines?
>
> TIA
> Monte
>
>
> --
> 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] Detecting Browser Closing...

2002-08-14 Thread Kondwani Spike Mkandawire

Is there a function that can detect if anyone has closed
the browser?



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




[PHP] Detecting Browser Closing (2)...

2002-08-14 Thread Kondwani Spike Mkandawire

Sorry I din't quite phrase that right...  Here goes I am
manipulating variables according to various user reactions...
I want to be able to alter a certain variable to its default
if the user decides to say, well
"to hell with it" and closes his browser...

Are there any php functions that would determine if
the browser on which the code is being viewed
has just been closed?

Thanks in Advance...

Spike...



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




Re: [PHP] Detecting Browser Closing...

2002-08-14 Thread Chris Boget

> Is there a function that can detect if anyone has closed
> the browser?

Not in PHP.  You can using JavaScript, however.

Chris



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




[PHP] addslashes() and stripslashes()

2002-08-14 Thread ed

Is it a good idea to always use addslashes() on a 
value gathered from a text field or textarea?
If you use addslashes() to "INSERT" the stuff into a
db, should you always use stripslashes() when you
"SELECT" it from the database?


tia,
--ed

__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




Re: [PHP] Shared network server failing to include files

2002-08-14 Thread @ Edwin
And still, if this doesn't work, why not install PHP as well--with 
Apache... (Perhaps, there must really be some good reason why not...)

I'm not sure what was meant by

> > A Windows 2000 takes
> > care of our network internet connectivity

but if a router is present, why not just map HTTP request to the linux 
server?

Just wondering,

- E

>
>Hi, I don't think this is a PHP question, but the line
>Alias /cs/ //192.168.0.253/apachedir/
>try
>Alias /cs/ \\192.168.0.253/apachedir/
>
>Because //isn't valid for UNCs, but \\ is..
>
>If this doesn't work, then with dos map \\192.168.0.253/apachedir/ to a
>network drive and point apache at that
>
>Andrew
>
>- Original Message -
>From: "Julio Nobrega" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, August 14, 2002 4:58 PM
>Subject: [PHP] Shared network server failing to include files
>
>
> >   Hi all,
> >
> >   I am not 100% sure if this is a PHP problem, so I apologize in 
advance
>if
> > it is an off-topic problem.
> >
> >   I have a Linux server where I develop my websites. A Windows 2000 
takes
> > care of our network internet connectivity. I need to show to a client 
the
> > progress of our work, so I've shared through Samba a directory from 
Linux,
> > and installed Apache on the Windows 2000 and used the Alias option to
>point
> > to this Linux share:
> >
> > Alias /cs/ //192.168.0.253/apachedir/
> >
> >   When I access my development website locally, or use a browser and 
input
> > the IP address, everything goes fine. But when I am on the Windows 2000
>and
> > type:
> >
> > http://localhost/cs/
> >
> >   An include error occurs:
> >
> > Fatal error: Failed opening required 'gerador.inc.php' 
(include_path='')
>in
> > //192.168.0.253\apachedir\index.php on line 3
> >
> >   Anyone knows the fix? Perhaps I should ask what basically I have in 
mind
> > since the beggining: How can I server webpages from a networked Linux
> > through the Windows 2000 that is connected to the Internet?
> >
> >   Any help is sincerely appreciated.
> >
> >   Thanks,
> >
> > --
> > Julio Nobrega
> >
> >
> >
> >
> >
> > --
> > 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




_
$B$-$C$H8+$D$+$k$"$J$?$N?75o!!ITF0;:>pJs$O(B MSN $B=;Bp$G(B http://house.msn.co.jp/


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


RE: [PHP] addslashes() and stripslashes()

2002-08-14 Thread Matt Schroebel

> -Original Message-
> From: ed [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, August 14, 2002 1:48 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] addslashes() and stripslashes()
> 
> 
> Is it a good idea to always use addslashes() on a 
> value gathered from a text field or textarea?

Yes, always.

> If you use addslashes() to "INSERT" the stuff into a
> db, should you always use stripslashes() when you
> "SELECT" it from the database?

No, the slashes are there for so the SQL engine can separate the data from the sql 
statement.  What's inserted or updates is the pre-addslashes value. Generally, if you 
don't addslashes() the sql statement won't execute.

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




Re: [PHP] Detecting Browser Closing...

2002-08-14 Thread Kondwani Spike Mkandawire


"Chris Boget" <[EMAIL PROTECTED]> wrote in message
075f01c243ba$2a9d11b0$8c01a8c0@ENTROPY">news:075f01c243ba$2a9d11b0$8c01a8c0@ENTROPY...
> > Is there a function that can detect if anyone has closed
> > the browser?
>
> Not in PHP.  You can using JavaScript, however.
>
> Chris
>
Thanks for the prompt response...  Would this mean I would
embedd the Java Script in my php Script and alter the php
variable accordingly...  Now I am aware that this is not a
JavaScript Forum and I don't want to have to subscribe to one
for one simple Q which I will probably never have use for again
but how would I detect this via Java Script and then embed change
back to php mode (if that's possible)?

Folks please non of the smart 'This is not a JavaScript group!"
I am aware of that but there should be someone who knows how
to use php and Java Script hand in hand...  I don't want to have to
convert a PHP variable to and HTML variable then to JavaScript
then back to HTML then to PHP...

Thanks in advance...



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




Re: [PHP] Detecting Browser Closing...

2002-08-14 Thread Chris Boget

> Thanks for the prompt response...  Would this mean I would
> embedd the Java Script in my php Script and alter the php
> variable accordingly...  

No, because JS is client side and PHP is server side.  What
you would need to do is have JS detect when the browser
closed and make one last server request and whatever page
you go to with that would do whatever you needed done.  That
means you'd have to open up another browser instance on the
user's machine and that might really annoy said user.

Chris



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




Re: [PHP] fgets question

2002-08-14 Thread Monte Ohrt

That was my first thought but that wasn't it. To be sure, I urlencoded 
the file and looked at it:

1%0A2%0A3%0A4%0A5%0A6%0A7%0A8%0A

No extra newlines that I could see.

FYI, if you run the program from the command line, you have to pipe the 
output to a pager or you will not see the last (extra) line since there 
is no newline character.

I'm using PHP 4.2.2 on Solaris sparc.

Monte

Kevin Stone wrote:
> The only explaination is that 'vi' is putting an extra line in there that
> you're not seeing.
> -Kevin
> 
> - Original Message -
> From: "Monte Ohrt" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 14, 2002 11:05 AM
> Subject: [PHP] fgets question
> 
> 
> 
>>Hi, I have a question about fgets(), it seems to pick up an extra line
>>at the end of a text file.
>>
>>example, I open a new file named "test" with the vi editor and make it 8
>>lines long like so (showing newlines as \n):
>>
>>1\n
>>2\n
>>3\n
>>4\n
>>5\n
>>6\n
>>7\n
>>8\n
>>
>>I create this PHP program and run it:
>>
>>>$fd = fopen ("test","r");
>>while (!feof ($fd)) {
>> $buffer = fgets($fd, 4096);
>> echo "buffer is $buffer";
>>}
>>fclose ($fd);
>>?>
>>
>>Here is the output (showing newlines as \n):
>>
>>buffer is 1\n
>>buffer is 2\n
>>buffer is 3\n
>>buffer is 4\n
>>buffer is 5\n
>>buffer is 6\n
>>buffer is 7\n
>>buffer is 8\n
>>buffer is
>>
>>
>>My question, why is there an extra line? Or in other words, how do I get
>>this to loop exactly 8 times if there are only 8 lines?
>>
>>TIA
>>Monte
>>
>>
>>--
>>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] how many files are in a directory

2002-08-14 Thread Harry.de

does anybody now a way in php to read out,
how many files are in a directory




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




[PHP] ADVANCED PHP (SOCKETS)

2002-08-14 Thread Gustavo Almeida



I would like to know, what I have to do to make my application handle
multiple connections?

My current application only handle one user per time.

Sorry about my English, but i live in Brazil, if anybody could help me
answer me [EMAIL PROTECTED] .

Thanky you


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




RE: [PHP] fgets question

2002-08-14 Thread Jay Blanchard

[snip]
1%0A2%0A3%0A4%0A5%0A6%0A7%0A8%0A
No extra newlines that I could see.
>>
>>1\n
>>2\n
>>3\n
>>4\n
>>5\n
>>6\n
>>7\n
>>8\n
>>
>>I create this PHP program and run it:
>>
>>>$fd = fopen ("test","r");
>>while (!feof ($fd)) {
>> $buffer = fgets($fd, 4096);
>> echo "buffer is $buffer";
>>}
>>fclose ($fd);
>>?>

The only way that I can see to do this is to test the output before printing
while (!feof ($fd)) {
 $buffer = fgets($fd, 4096);
if($buffer > 0){
  echo "buffer is $buffer";
}
}

Or I suppose you could say if(!$buffer), will make for less code

HTH!

Jay

***
* Texas PHP Developers Conf  Spring 2003  *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* San Antonio Area PHP Developers Group   *
* Interested? Contact [EMAIL PROTECTED] *
***



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




[PHP] error reporting

2002-08-14 Thread Georgie Casey

rite,

without access to the php.ini file, how can i get php to print all errors on
my web server. it runs linux
--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



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




RE: [PHP] online petition

2002-08-14 Thread César Aracena

I guess you could search for "petition" on hotscripts.com but it could
take you longer to find and configure one properly, than making your own
one.

C.

> -Original Message-
> From: M.E. Suliman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 1:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] online petition
> 
> Hi
> 
> Anyone know of a online petition system in PHP similar to what is
offered
> on
> www.PetitionOnline.com
> 
> Thanks
> 
> Mohamed
> 
> 
> 
> 
> --
> 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] fgets question

2002-08-14 Thread DL Neil

Hi Monte,

> Hi, I have a question about fgets(), it seems to pick up an extra line
> at the end of a text file.
...
> 8\n
...
> Here is the output (showing newlines as \n):
> buffer is 1\n
> buffer is 2\n
> buffer is 3\n
> buffer is 4\n
> buffer is 5\n
> buffer is 6\n
> buffer is 7\n
> buffer is 8\n
> buffer is
> My question, why is there an extra line? Or in other words, how do I get
> this to loop exactly 8 times if there are only 8 lines?


The answer is that there isn't an 'extra' line, there are as many as you
put/PHP reads!
The question to ask is: how does a stream file end?
Answer: with an EOF character (not an LF).

Lines in a (*nix) stream file are separated by LF or \n character, therefore
there is a ninth 'line' (of absolutely nothing) between the last LF and the
EOF. Take out that last \n and things should work the way you want.

Regards,
=dn




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




Re: [PHP] how many files are in a directory

2002-08-14 Thread Bas Jobsen

Op woensdag 14 augustus 2002 20:00, schreef Harry.de:
> does anybody now a way in php to read out,
> how many files are in a directory




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




Re: [PHP] error reporting

2002-08-14 Thread Bas Jobsen

start your file with :
error_reporting(E_ALL);

Op woensdag 14 augustus 2002 20:09, schreef Georgie Casey:
> rite,
>
> without access to the php.ini file, how can i get php to print all errors
> on my web server. it runs linux
> --
> Regards,
> Georgie Casey
> [EMAIL PROTECTED]
>
> ***
> http://www.filmfind.tv
> Online Film Production Directory
> ***

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




[PHP] !== (was Re: [PHP] how many files are in a directory)

2002-08-14 Thread Chris Boget

> // Note that !== did not exist until 4.0.0-RC2

I took a quick look at the docs to find out what !== meant
(because I'd never seen it before).  I'm not sure I understand
what it's use is.  Could someone explain why you would use
it and for what purpose?  
I couldn't really infer from the example that was included in
the previous message.

thnx,
Chris



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




[PHP] Sessions...

2002-08-14 Thread Kondwani Spike Mkandawire



';

  if(empty($verif)){

Display Some message...
   $counter++;
   fputs($file, "\r\n");


  }
  else{
Display SomeOther message...
   $counter++;
   fputs($file, "\r\n");
}
}
else{
reset counter to 0
destroy session...
}

 I want this set up such that given someone hits the close button on the
 browser, the counter is set to 0...  Coz at the moment if someone gets
 fed up of trying and closes the browser, the next person has less than
4 attempts to login in...  Any idea of how I can go about using this
sessions idea coupled with the self modifying code to achieve this?
I can't exactly stick in an:
if(session_is_registered) statement, coz it appears as though
 the session is restarted every time the code is modified..



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




[PHP] problem with $_POST

2002-08-14 Thread Adam Williams

Hi,

I am having a problem with $_POST which I will explain below.  My
configuration is Redhat 7.3 Linux 2.4.18 with Apache 2.0.39, PHP 4.2.2,
and MySQL 3.23.49.

I have an SQL table which was created by:

CREATE TABLE testTable (id nut null primary key aut_increment, testField
varchar (75));

I have an HTML form using POST:



Insert Form



Text to add:









and I have a PHP script that uses $_POST to put the value from the form
into the SQL table:


";
echo "$sql";


if ($result = mysql_query($sql, $conn))
{
echo "record added!";
}
else
{
echo "something went wrong";
}


?>




when I open up insert_form.html in a browser and put in a value of
"Testing the form" and then submitting it to insert.php, this is the
result:

the value is Testing the formtestField=Testing the form
INSERT INTO testTable VALUES ('', 'Testing the formtestField=Testing the
form')
record added!



and when I go to MySQL to see what was inserted into the table I have:

mysql> select * from testTable;
+++
| id | testField  |
+++
| 19 | Testing the formtestField=Testing the form |
+++
1 row in set (0.00 sec)

Which that is not correct, it should be | 19 | Testing the Form |

If I change the method=POST to method=GET and the $_POST to $_GET and use
"Testing the form" it works correctly:

the value is Testing the form
INSERT INTO testTable VALUES ('', 'Testing the form')
record added!

mysql> select * from testTable;
+++
| id | testField  |
+++
| 20 | Testing the form   |
| 19 | Testing the formtestField=Testing the form |
+++
2 rows in set (0.00 sec)


Does anyone know why it is not working with $_POST but works fine with
$_GET?

Thanks,
Adam





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




[PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

Hello,  To begin.. i'm new to the list...

I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.

What I'm trying to figure out is the proper way to call a class from a
class.  I dont mean by extending the class, but actaully just getting the
functions...

For instance...

I'm trying to connect to a Database (database class) from my gen_XML class.
Do I include the database class in the gen_XML constructor?  Do I set a
gen_XML variable as a database object (i.e. $this->mydb)?

I hope my question makes some sense...

Your help is appreciated...

Mark Armendariz



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




Re: [PHP] Persistant Connections

2002-08-14 Thread Nick Oostveen

Persistent connections are typically a good thing to use on high traffic 
sites as they offer better performance than opening and closing connections 
for each database request. The reason for this is the overhead used in 
opening a database connection is actually quite high.

While keeping them open when they are no longer needed may seem 
counter-intuitive, the connection isn't being saved for a particular user 
or page, instead it remains open and will automatically be used by any page 
requiring database connectivity on your site.  If there are no free 
connections when a page request comes in, a new one is open.  Conversely if 
a connection has not been utilized for a specific period of time (usually a 
couple minutes) it will be closed.

At 02:46 PM 8/14/2002 +0100, John Wards wrote:
>I am running a website which generates around 100,000 pageviews a day and I
>am wondering if I stop using persistent conections to the database and use
>normal open and close conections this would reduce the load onto my server?
>
>Most conections are either made through my "main" file or the phorum message
>board system.
>
>Thanks in advance
>John Wards
>
>
>
>--
>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] !== (was Re: [PHP] how many files are in a directory)

2002-08-14 Thread Jay Blanchard

[snip]
> // Note that !== did not exist until 4.0.0-RC2

I took a quick look at the docs to find out what !== meant
(because I'd never seen it before).  I'm not sure I understand
what it's use is.  Could someone explain why you would use
it and for what purpose?
[/snip]

$a !== $b Not identical TRUE if $a is not equal to $b, or they are not the
same data type

$a = 2
$b = "2"
If $a and $b are not the same data type they ARE NOT IDENTICAL
$a is an integer, $b is a string

or

$a = 2
$b = 3

They are the same data type (integer), but they ARE NOT EQUAL

I would use strcomp() to compare strings against other strings though, since
data types like this may cause problems since PHP variables are loosely
typed.

HTH!

Jay



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




RE: [PHP] PHP - class question

2002-08-14 Thread Steve Bradwell

I would suggest you write a method (called mydb() for example) that connects
to your database, and if needed, call it from your constructor like:
$this->mydb(); This way you can always reuse the method from other code.

hth,
Steve.

-Original Message-
From: Mark Armendariz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 2:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP - class question


Hello,  To begin.. i'm new to the list...

I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.

What I'm trying to figure out is the proper way to call a class from a
class.  I dont mean by extending the class, but actaully just getting the
functions...

For instance...

I'm trying to connect to a Database (database class) from my gen_XML class.
Do I include the database class in the gen_XML constructor?  Do I set a
gen_XML variable as a database object (i.e. $this->mydb)?

I hope my question makes some sense...

Your help is appreciated...

Mark Armendariz



-- 
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] PHP - class question

2002-08-14 Thread Nick Oostveen

If you are just trying to access a classes functions without creating an 
instance of it you're probably looking to use the scope resolution operator 
::.  For this to work all you have to do is ensure that the definition for 
the class you wish to use is included into the file containing the class 
you are trying to call the functions from.

You would then call the functions as follows:

ClassName::FunctionName();

At 02:43 PM 8/14/2002 -0400, you wrote:
>Hello,  To begin.. i'm new to the list...
>
>I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
>to OOP in general, but I've done quite a bit of reading and playing around
>with it in the past couple of months.
>
>What I'm trying to figure out is the proper way to call a class from a
>class.  I dont mean by extending the class, but actaully just getting the
>functions...
>
>For instance...
>
>I'm trying to connect to a Database (database class) from my gen_XML class.
>Do I include the database class in the gen_XML constructor?  Do I set a
>gen_XML variable as a database object (i.e. $this->mydb)?
>
>I hope my question makes some sense...
>
>Your help is appreciated...
>
>Mark Armendariz
>
>
>
>--
>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] fgets question

2002-08-14 Thread Monte Ohrt

I don't have the option of editing the text files to work right. I want 
to be able to read an arbitrary text file line by line and process each 
one. So I suppose I could do this (?)



DL Neil wrote:
> Hi Monte,
> 
> 
>>Hi, I have a question about fgets(), it seems to pick up an extra line
>>at the end of a text file.
> 
> ...
> 
>>8\n
> 
> ...
> 
>>Here is the output (showing newlines as \n):
>>buffer is 1\n
>>buffer is 2\n
>>buffer is 3\n
>>buffer is 4\n
>>buffer is 5\n
>>buffer is 6\n
>>buffer is 7\n
>>buffer is 8\n
>>buffer is
>>My question, why is there an extra line? Or in other words, how do I get
>>this to loop exactly 8 times if there are only 8 lines?
> 
> 
> 
> The answer is that there isn't an 'extra' line, there are as many as you
> put/PHP reads!
> The question to ask is: how does a stream file end?
> Answer: with an EOF character (not an LF).
> 
> Lines in a (*nix) stream file are separated by LF or \n character, therefore
> there is a ninth 'line' (of absolutely nothing) between the last LF and the
> EOF. Take out that last \n and things should work the way you want.
> 
> Regards,
> =dn
> 
> 
>


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




[PHP] Re: !== (was Re: [PHP] how many files are in a directory)

2002-08-14 Thread Justin Garrett

Here is an example that might help.

$a = 1;

if($a)
echo '1';

if($a == true)
echo '2';

if($a === true)
echo '3';

The first and second conditional statements execute but the third doesn't.
This is because $a evaluates to true but is not of type 'boolean'.  === and
!== not only compare value but type as well.

Justin Garrett

"Chris Boget" <[EMAIL PROTECTED]> wrote in message
07bb01c243c2$1b3045a0$8c01a8c0@ENTROPY">news:07bb01c243c2$1b3045a0$8c01a8c0@ENTROPY...
> > // Note that !== did not exist until 4.0.0-RC2
>
> I took a quick look at the docs to find out what !== meant
> (because I'd never seen it before).  I'm not sure I understand
> what it's use is.  Could someone explain why you would use
> it and for what purpose?
> I couldn't really infer from the example that was included in
> the previous message.
>
> thnx,
> Chris
>
>



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




[PHP] Array question

2002-08-14 Thread Brad Harriger

I have a program containing an array called $thisArray.  At some point 
in the program, the value of next($thisArray) is an array ($subArray). 
How can I echo the name of the of the second array (subArray)?  The name 
of the sub array may change at any time, so I can't just hard code it.

Thanks in advance,

Brad


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




Re: [PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

Well, I actually have a full db class which has a connect  and close method
as well as query, fetch_array, etc... What I really want to know is how to
use the methods in my db class from another class (myclass for example)..

Do I include the db class from the myclass constructor and then set a
myclass variable = to the db object?

ie.

class my_class {
var $db;

function my_class() {
include('class_database.php');

$this->db = new database;
}

...
}

or is there a differnet or better way?

Thanks

Mark

"Steve Bradwell" <[EMAIL PROTECTED]> wrote in message
57A1618E7109D311A97D0008C7EBB3A10119EF03@KITCHENER">news:57A1618E7109D311A97D0008C7EBB3A10119EF03@KITCHENER...
> I would suggest you write a method (called mydb() for example) that
connects
> to your database, and if needed, call it from your constructor like:
> $this->mydb(); This way you can always reuse the method from other code.
>
> hth,
> Steve.
>
> -Original Message-
> From: Mark Armendariz [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP - class question
>
>
> Hello,  To begin.. i'm new to the list...
>
> I'm trying to learn good practices in OOP based PHP.  I'm actually a bit
new
> to OOP in general, but I've done quite a bit of reading and playing around
> with it in the past couple of months.
>
> What I'm trying to figure out is the proper way to call a class from a
> class.  I dont mean by extending the class, but actaully just getting the
> functions...
>
> For instance...
>
> I'm trying to connect to a Database (database class) from my gen_XML
class.
> Do I include the database class in the gen_XML constructor?  Do I set a
> gen_XML variable as a database object (i.e. $this->mydb)?
>
> I hope my question makes some sense...
>
> Your help is appreciated...
>
> Mark Armendariz
>
>
>
> --
> 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] PHP - class question

2002-08-14 Thread Mark Armendariz

That seems more like what I'm looking for..

Thank you, Nick...

Mark



"Nick Oostveen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you are just trying to access a classes functions without creating an
> instance of it you're probably looking to use the scope resolution
operator
> ::.  For this to work all you have to do is ensure that the definition for
> the class you wish to use is included into the file containing the class
> you are trying to call the functions from.
>
> You would then call the functions as follows:
>
> ClassName::FunctionName();
>
> At 02:43 PM 8/14/2002 -0400, you wrote:
> >Hello,  To begin.. i'm new to the list...
> >
> >I'm trying to learn good practices in OOP based PHP.  I'm actually a bit
new
> >to OOP in general, but I've done quite a bit of reading and playing
around
> >with it in the past couple of months.
> >
> >What I'm trying to figure out is the proper way to call a class from a
> >class.  I dont mean by extending the class, but actaully just getting the
> >functions...
> >
> >For instance...
> >
> >I'm trying to connect to a Database (database class) from my gen_XML
class.
> >Do I include the database class in the gen_XML constructor?  Do I set a
> >gen_XML variable as a database object (i.e. $this->mydb)?
> >
> >I hope my question makes some sense...
> >
> >Your help is appreciated...
> >
> >Mark Armendariz
> >
> >
> >
> >--
> >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] php and xml problem

2002-08-14 Thread Pafo

i got 2 problems with this code:

ServerStatusPopulation<
/TR>\n";
  print "$da_server";
  if ($da_type) { print "($da_type)"; }
  print "";
  print "$da_status";
  print "$da_population\n";
  print "\n";
  print
"LastguildupdateLastcharupdate<
/TR>\n";
  print
"$da_lastguildupdate$da_lastcharupdate\n";
 }
 elseif ($tagName == "RELIC" && $server == true) {
  if (!$printed) { print "\n"; print "Relic
NameRelic OwnerRelic Type\n";
$printed = true; }
  print "";
  if ($da_relicorig == "Albion") { print "$da_relicname"; }
  elseif ($da_relicorig == "Midgard") { print "$da_relicname"; }
  else { print "$da_relicname"; }
  print "";
  if ($da_relicowner == "Albion") { print "$da_relicowner"; }
  elseif ($da_relicowner == "Midgard") { print "$da_relicowner"; }
  else { print "$da_relicowner"; }
  print "$da_relictype\n";
 }
 elseif ($tagName == "KEEP" && $server == true) {
  if (!$printedkeep) {  print "\n"; print "Keep
NameKeep OwnerClaimant\n";
$printedkeep = true; }
  print "";
  if ($da_keeporig == "Albion") { print "$da_keepname"; }
  elseif ($da_keeporig == "Midgard") { print "$da_keepname"; }
  else { print "$da_keepname"; }
  print "";
  if ($da_keepowner == "Albion") { print "$da_keepowner"; }
  elseif ($da_keepowner == "Midgard") { print "$da_keepowner"; }
  else { print "$da_keepowner"; }
  print "$da_keepclaimant\n";
 }

  $da_server = "";
  $da_lastguildupdate = "";
  $da_lastcharupdate = "";
  $da_population = "";
  $da_type = "";
  $da_status = "";
  $da_relicorig = "";
  $da_relicname = "";
  $da_relictype = "";
  $da_relicowner = "";
  $da_keeporig = "";
  $da_keepname = "";
  $da_keepowner = "";
  $da_keepclaimant = "";
  $insideitem = false;
  $insiderelic = false;
  $insidekeep = false;
}



// gotta have this for the php-NUKE block stuff to work
global $da_totalpop;

// Create an XML parser
$xml_parser = xml_parser_create();

// Set the functions to handle opening and closing tags
xml_set_element_handler($xml_parser, "startElement", "endElement");

// Set the function to handle blocks of character data
xml_set_character_data_handler($xml_parser, "characterData");


// print "\n";
print "\n";
print "Guild: Obliteration/Midgard\n\n";


// Open the XML file for reading
$fp = fopen("http://www.camelotherald.com/xml/servers.xml","r";)  or
die("Error reading RSS data.");

// Read the XML file 4KB at a time
while ($data = fread($fp, 4096))
// Parse each 4KB chunk with the XML parser created above
xml_parse($xml_parser, $data, feof($fp))
  or die(sprintf("XML error: %s at line %d",
   xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
// Close the XML filef
fclose($fp);

print "\n";


// Free up memory used by the XML parser
xml_parser_free($xml_parser);

?>

this code is suppose to take SOME information from
http://www.camelotherald.com/xml/servers.xml and print it out as
HTML-text...

'''
problem 1:
 while (list ($key, $val) = each ($attrs)) {
 if ($key == "NAME" && $val == "Guinevere") { $server = true;  $da_server =
$val; }
 else { $server = false; }
 } // end WHILE

i am trying to find a way to only retrive the information in
  // copied from the url
above


there is alot of servers and i only need to retrive the information from
this server.
So i am trying to see if this is the server and if it is the server the
flag, $server will be true,, but i dunno if it works as it should... ?

''
problem 2:
this is alittle bit of the xml code:
- 
  1002
  Up
- 
  Midgard
  
- 
  Hibernia
  
- 
  Midgard
  
- 
  Hibernia
  
- 
  Midgard
  
- 
  Hibernia
  

i want to get the information about the relics, but that dosent work with
this code:
   elseif ($tagName == "RELIC" && $server) {
 $insiderelic = true;
 while (list ($key, $val) = each ($attrs)) {
   if ($key == "TYPE") { $da_relictype = $val; }
 if ($key == "NAME") { $da_relicname = $val; }
 if ($key == "REALM") { $da_relicorig = $val; }
 } // End While
 }

any ideas of how to solve this??
'**'

any help would be appresiated!

regards
patrick



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




Re: [PHP] regex match problem

2002-08-14 Thread Bas Jobsen

To Match: Tue, Jul 29, 2003

> $pregmatchstring="/([\s])*(Renewal\DDate|Registered\sthrough|Expires|Record
>\sExp ires|Domain\sExpires|Expiry\sDate)([\D\s]*)(.*)/i";

You can change the last part of $pregmatchstring in:

Expiry\sDate)([\D\s]*|\w{3},\s\w{3}\s\d{2},\s\d{4})(.*)/i";
You can feed this match also to strtotime().

See:


this will echos zero, zo i think it works.





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




Re: [PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

Do you know where I can find more info on how to use the  scope resolution
operator?

My searches aren't giving much (at leant not mcuh regarding php) and in the
manual, it only shows up momentarily as a note in the operators section...

Mark


"Nick Oostveen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you are just trying to access a classes functions without creating an
> instance of it you're probably looking to use the scope resolution
operator
> ::.  For this to work all you have to do is ensure that the definition for
> the class you wish to use is included into the file containing the class
> you are trying to call the functions from.
>
> You would then call the functions as follows:
>
> ClassName::FunctionName();
>
> At 02:43 PM 8/14/2002 -0400, you wrote:
> >Hello,  To begin.. i'm new to the list...
> >
> >I'm trying to learn good practices in OOP based PHP.  I'm actually a bit
new
> >to OOP in general, but I've done quite a bit of reading and playing
around
> >with it in the past couple of months.
> >
> >What I'm trying to figure out is the proper way to call a class from a
> >class.  I dont mean by extending the class, but actaully just getting the
> >functions...
> >
> >For instance...
> >
> >I'm trying to connect to a Database (database class) from my gen_XML
class.
> >Do I include the database class in the gen_XML constructor?  Do I set a
> >gen_XML variable as a database object (i.e. $this->mydb)?
> >
> >I hope my question makes some sense...
> >
> >Your help is appreciated...
> >
> >Mark Armendariz
> >
> >
> >
> >--
> >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] PHP AND JAVA

2002-08-14 Thread Alexandra Aguiar

may i use php with JAVA (note. not JAVASCRIPT , but JAVA APPLETS) !?!
any helps !?
thx

xanda



Re: [PHP] Shared network server failing to include files

2002-08-14 Thread Julio Nobrega

@ Edwin em Wednesday 14 August 2002 14:51 foi agraciado com uma resposta 
por:

> And still, if this doesn't work, why not install PHP as well--with
> Apache... (Perhaps, there must really be some good reason why not...)

  Yes ;-)

  It connects to 12 different mysql databases and has a few Linux-only 
tweaks.

> 
> I'm not sure what was meant by> 
>> > A Windows 2000 takes
>> > care of our network internet connectivity
> server?

  I meant our Adsl modem is connected to the Windows 2000 machine, and the 
rest of the network use it.

  Anyway, now I am 100% it's a php configuration issue because HTML pages 
are served normally. The problem is when I use require() (and similar) 
functions. It can't find the files. I've edited php.ini and used .htaccess 
to specify the include_path() but no luck yet...

  Still researching!  

-- 
Julio Nobrega
http://gnet.inerciasensorial.com.br

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




Re: [PHP] Array question

2002-08-14 Thread Bas Jobsen

> How can I echo the name of the of the second array (subArray)?  The name
for value
array('1','2'.'3'),
'c'=>array('6','5'.'4'),
'd'=>array('8','9'.'10'),
);


$r=next($test);
echo $r[0].' or :'."\n";
foreach (next($test) as $value) echo $value;
?>

or do you need the keys?
something like:
echo implode(",",array_keys(next($test))); 

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




  1   2   3   >