Re: [PHP] php development environment

2002-11-01 Thread Jason Wong
On Thursday 31 October 2002 18:34, Simon Taylor wrote:
 Hi All,
 Does anyone know if there is a good php development environment around, you
 know something that will hold a list of functions/classes so you don't have
 to scroll through thousands of line of code looking for a few lines of
 spurious code...

Maguma Studio

 and all the other goodies that come with that sort of
 thing.. 

Biggest downside to it is that it doesn't manage your projects. 

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

/*
You've got to think about tomorrow!
TOMORROW!  I haven't even prepared for *_yesterday* yet!
*/


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




[PHP] Simple Problems taking me hours to solve!

2002-11-01 Thread Steve Jackson
This is the query I am running on my database:
 
$query = select orderid from receipts order by receipt_id DESC LIMIT
0,1;
 $orderid = mysql_query($query);
 
That should return the last record in the DB? Correct?
 
I currently get a number returned which is the number plus 1.
IE if 423 is the last DB record then 424 is returned.
 
Any ideas why this happens?
 
Also in the same table I have a shipping price variable.
My query for this is:
$query = select shipping from receipts order by receipt_id DESC LIMIT
0,1;
 $shipping_cost = mysql_query($query);
 
Again this should return the last record?
It doesn't return anything however. Any ideas?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com http://www.violasystems.com/ 
[EMAIL PROTECTED]
Mobile +358 50 343 5159



 



Re: [PHP] ^M at the end of each line when I use php to write file

2002-11-01 Thread Gerard Samuel
Im not sure, but I believe Ive noticed this when I fopen() a file with
the 'b' value like fopen($foo, 'wb');
I may be totally wrong...


Brandon Orther wrote:


Hello,

Does anyone know a way around all the ^M at the end of each line that my
php file writes to on a linux box?


 

Brandon Orther 

WebIntellects Design/Development Manager

mailto:brandon;webintellects.com [EMAIL PROTECTED]
800-994-6364

http://www.webintellects.com/ www.webintellects.com





 


--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




Re: [PHP] Simple Problems taking me hours to solve!

2002-11-01 Thread Petre Agenbag
No, it should not return what you want.
When you do 
$orderid = mysql_query($query);
all this does is actually execute the query, and returns an array
containing the actual result set.

What you need to do from here is to do:

$myrow = mysql_fetch_assoc($orderid);
Now, what you have is an associative array in $myrow containing the row
with identifiers being the collumn names in the db, 

So, from your query, you should do:

$my_id = $myrow[orderid];

$my_id will now contain the id you want...


On Fri, 2002-11-01 at 10:21, Steve Jackson wrote:
 This is the query I am running on my database:
  
 $query = select orderid from receipts order by receipt_id DESC LIMIT
 0,1;
  $orderid = mysql_query($query);
  
 That should return the last record in the DB? Correct?
  
 I currently get a number returned which is the number plus 1.
 IE if 423 is the last DB record then 424 is returned.
  
 Any ideas why this happens?
  
 Also in the same table I have a shipping price variable.
 My query for this is:
 $query = select shipping from receipts order by receipt_id DESC LIMIT
 0,1;
  $shipping_cost = mysql_query($query);
  
 Again this should return the last record?
 It doesn't return anything however. Any ideas?
 
 Steve Jackson
 Web Developer
 Viola Systems Ltd.
 http://www.violasystems.com http://www.violasystems.com/ 
 [EMAIL PROTECTED]
 Mobile +358 50 343 5159
 
 
 
  


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




Re: [PHP] New Server advice

2002-11-01 Thread @ Edwin
Hello,
(B
(B"David Russell" [EMAIL PROTECTED] wrote:
(B
(B Hi all,
(B 
(B I am setting up a new production server. Assuming that I do not need
(B register globals, what does everyone suggest for setting it up:
(B 
(B Linux machine
(B Apache 
(B PHP 4.2.3
(B 
(B My real question is whether I should install with Apache 1.3.27 or
(B Apache 2.0.43 This implies 3 questions:
(B 1. Does PHP 4.2.3 work properly with Apache 2.0.43? In a production
(B server?
(B
(BNot yet supported. Stick to the latest 1.3.x
(B
(B 2. Are there features in Apache 2.0 that would be beneficial?
(B
(BI think this will help:
(B
(B  http://httpd.apache.org/docs-2.0/new_features_2_0.html
(B
(B 3. What is the learning curve line from moving to installing,
(B configuring and running Apache 1.3 to 2.0?
(B
(B  http://httpd.apache.org/docs-2.0/upgrading.html
(B
(B- E
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



[PHP] xml parser breaking on legal xml chars

2002-11-01 Thread Gerard Samuel
Im some what new to xml but I've put together a basic xml parsing 
script, and for some reason, on data like -
descriptionItapos;s been a few days since.../description
the parser thinks its 3 lines.  Its parsing a new line on htmlentities 
like apos;
So with the above line the looped output is like -

Data -- It
Data -- '
Data -- s been a few days since

Here is a downsized version of the script Im working with -
-
?php

class XMLParser
{
   var $xmlparser;

   function XMLParser()
   {
   $this-xmlparser = xml_parser_create();
   xml_set_object($this-xmlparser, $this);
   xml_set_element_handler($this-xmlparser, 'start_tag', 
'ending_tag');
   xml_set_character_data_handler($this-xmlparser, 
'character_handler');
   xml_parser_set_option ($this-xmlparser, 
XML_OPTION_CASE_FOLDING, FALSE);
   }

  function parse($data)
   {
   xml_parse($this-xmlparser, $data);
   }

   function parse_File($xmlfile)
   {
   $fp = fopen($xmlfile, 'r');
   while ($xmldata = fread($fp, 4096))
   {
   // parse the data chunk
   if (!xml_parse($this-xmlparser, $xmldata))
   {
   // if parsing fail print the error description and line 
number
   echo 'ERROR: ';
   echo 
xml_error_string(xml_get_error_code($this-xmlparser)) . 'br';
   echo 'Line: ';
   echo xml_get_current_line_number($this-xmlparser) . 'br';
   echo 'Column: ';
   echo xml_get_current_column_number($this-xmlparser) . 
'br';
   }
   }

   fclose($fp);
   }

   function start_tag($xmlparser, $tag, $attributes)
   {
   echo 'Opening tag: ' . $tag . \n;
   }

   function ending_tag($xmlparser, $tag)
   {
  echo 'Ending tag: ' . $tag . \n;
   }

   function character_handler($xmlparser, $data)
   {
   echo 'Data -- ' . $data . \n;
   }

   function close_Parser()
   {
   xml_parser_free($this-xmlparser);
   }
}

?
-

Thanks for any input you may provide.

--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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



Re: [PHP] client-side zip of POST or GET data, auto unzip on server.

2002-11-01 Thread @ Edwin
Hello,
(B
(B"Petre Agenbag" [EMAIL PROTECTED] wrote:
(B Hi
(B I'm wondering if something like this will be possible.
(B
(B I am correct in thinking that POST and GET data are sent as plain text?
(B
(BNot always. (POST - SSL)
(B
(B And, that being plain text, they should probably be highly compactable
(B by zip utils?
(B
(BNot really sure how you can do this...
(B
(B The reason I'm thinking this route is that I have a couple of forms for
(B some client websites that are particularly large, some of the POST data
(B sent are more than 2 MB, but obviously it can vary depending on the
(B amount of data entered by the user ( I cannot limit this, as these forms
(B are assessment forms, and they need to contain all relevant info,
(B regardless of size ).
(B All fields are text fields.
(B
(B2MB of TEXT? If my calculation is correct hat would be over 2 million
(Bcharacters! I'm sure you can limit the size depending on when and where they
(Benter "relevant info".
(B
(B So, what happens now is that for some users on slow connections, these
(B forms can either take years or they simply time out every time.
(B
(BI'm afraid so...
(B
(B Being a specific application with controlled number of users, I wouldn't
(B think it bad practise to force the user to install a "zip" package on
(B his pc; that's to say if it would be possible to write some client side
(B script (JS?) that will receive the form data, zip it, then send the
(B
(BI don't think this is possible.
(B
(B zipped packet via POST or GET as per usual to the server, where, upon
(B receipt, the POST package is "unzipped" and the handled as per usual.
(B
(BHow?
(B
(B Would something like this be possible or feasible at all? Are there
(B other better ways to accomplish this?
(B
(BI think it'd be better to divide your form(s) in different sections and POST
(Bdata in smaller units. Or, perhaps, you can just ask them to (1) create a
(Btext file (better if it's XML) then (2) zip it if it's big and then (3)
(Bupload them to the server.
(B
(BThen, perhaps, you can write a script that would parse the file and do
(Bwhatever is needed. (Unzip it first if necessary.)
(B
(BJust an idea...
(B
(B- E
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Require_once problem

2002-11-01 Thread Kerry Kobashi
The problem is that under Windows, case sensitivity is important on
require_once

require_once(DB.php)
is different than
require_once(db.php);

Arh! I hate you Windows.


Kerry Kobashi [EMAIL PROTECTED] wrote in message
news:20021101073558.1581.qmail;pb1.pair.com...
 Whats the difference between require_once and include_once?

 I been running into a problem, perhaps someone can help.

 I require_once in a Pear database extension. Inside that pear database
 extension
 is a require_once(pear.php) and a require_once(db.php)

 This file, Thomas Voxs' DbPage.php file, gets require_once inside yet
 another
 file (my file).

 The problem is, my file brings in many require_once file's, some of which
 require_once(db.php) inside of it. All I get redefinition problems all
over
 the place.

 It appears to me that require_once doesn't work as advertised? For if it
 did,
 there should never be redefinition problems.

 Why didn't all PHP code do like we do in C/C++ with
 #define BLAH
 if !defined(BLAH)
 {
your code here.
 }

 I realize the #define trick works as I used it in my own PHP code... but
 when
 the basic PHP core files don't have this in them, it sort of  makes
 require_once
 and include_once hacks! (that don't work)

 Any ideas suggestions?






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




Re: [PHP] php development environment

2002-11-01 Thread @ Edwin
Hello,
(B
(B"Simon Taylor" [EMAIL PROTECTED] wrote:
(B Hi All,
(B Does anyone know if there is a good php development environment around,
(Byou
(B
(BZend Studio ?
(Bhttp://www.zend.com/store/products/zend-studio.php
(B
(B- E
(B
(B...[snip]...
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] client-side zip of POST or GET data, auto unzip on server.

2002-11-01 Thread Petre Agenbag
Hi
Yes, I thought your last comment would also be doable, but it would be
nice to have this zipping done on the user' behalf. The whole reason why
I *think* this is possible, is because you can unzip and process the
data on the server side in an automatic way, so it *should* be possible
to do this on client side as well, I just don't know how...
Something like a zip-wrapper for form data, or any data for that
matter...

Hope someone else can shed some ideas???

On Fri, 2002-11-01 at 10:56, @ Edwin wrote:
 Hello,
 
 Petre Agenbag [EMAIL PROTECTED] wrote:
  Hi
  I'm wondering if something like this will be possible.
 
  I am correct in thinking that POST and GET data are sent as plain text?
 
 Not always. (POST - SSL)
 
  And, that being plain text, they should probably be highly compactable
  by zip utils?
 
 Not really sure how you can do this...
 
  The reason I'm thinking this route is that I have a couple of forms for
  some client websites that are particularly large, some of the POST data
  sent are more than 2 MB, but obviously it can vary depending on the
  amount of data entered by the user ( I cannot limit this, as these forms
  are assessment forms, and they need to contain all relevant info,
  regardless of size ).
  All fields are text fields.
 
 2MB of TEXT? If my calculation is correct hat would be over 2 million
 characters! I'm sure you can limit the size depending on when and where they
 enter relevant info.
 
  So, what happens now is that for some users on slow connections, these
  forms can either take years or they simply time out every time.
 
 I'm afraid so...
 
  Being a specific application with controlled number of users, I wouldn't
  think it bad practise to force the user to install a zip package on
  his pc; that's to say if it would be possible to write some client side
  script (JS?) that will receive the form data, zip it, then send the
 
 I don't think this is possible.
 
  zipped packet via POST or GET as per usual to the server, where, upon
  receipt, the POST package is unzipped and the handled as per usual.
 
 How?
 
  Would something like this be possible or feasible at all? Are there
  other better ways to accomplish this?
 
 I think it'd be better to divide your form(s) in different sections and POST
 data in smaller units. Or, perhaps, you can just ask them to (1) create a
 text file (better if it's XML) then (2) zip it if it's big and then (3)
 upload them to the server.
 
 Then, perhaps, you can write a script that would parse the file and do
 whatever is needed. (Unzip it first if necessary.)
 
 Just an idea...
 
 - E


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




[PHP] Re: why does eregi match for whitespace when there is none?

2002-11-01 Thread Erwin
Peter J. Schoenster wrote:
 Here is the example:

 ?php

 $string = 'asfddsaz';

 if (eregi('\s', $string)) {
 echo Whitespace present;
 }else {
 echo NO Whitespace present;
 }
 ?

 Why does the above return true? There is no whitespace in the string.
 What am I missing?

Try using [[:space:]] when using eregi. See also
http://www.developers-resources.com/stories.php?story=01/10/25/0549771

Grtz Erwin


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




RE: [PHP] php development environment

2002-11-01 Thread @ Darwin
I use the Maguma Studio environment (http://www.maguma.com/). It features
some pretty little colors in the code too. It also makes it easy to find
what you need from all your classes and other files in a convenient style,
and it is almost totally customizable. You can even customize PHP and HTML
tags and variables, etc. Not to forget that all lines are numbered and it
has a find feature. It has it's own browser that acts like IE's browser to
test your scripts while you write them. It also has an autocomplete feature
(kind of like with Interdev). Give it a try, I'm sure you'll like it. I like
it better than Homesite, Dreamweaver, Interdev or lower-end environments.

-- Darwin

 -Original Message-
 From: Simon Taylor [mailto:simon.taylor;afritol.co.za]
 Sent: Thursday, October 31, 2002 4:34 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php development environment


 Hi All,
 Does anyone know if there is a good php development environment
 around, you
 know something that will hold a list of functions/classes so you
 don't have
 to scroll through thousands of line of code looking for a few lines of
 spurious code...and all the other goodies that come with that sort of
 thing.. At the moment I use homesite which is pretty cool and makes all me
 lines come out in pretty colours, but I am getting frustrated as
 things are
 growing..
 Thanks..
 _
 Simon Taylor
 AfriTol (Pty) Ltd.

 --
 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] Require_once problem

2002-11-01 Thread @ Darwin
Well, the way I've read it is that if you use require within control
structures then all files are included, regardless of whether the script
exits before it reaches its next if...elseif...else or case statement. With
include that does not happen. So the general rule of thumb would be to use
require() if you are not using it within these control structures, and use
include() if you actually do need to use include statements in your control
structures. Now, that said, I'm really not sure if that is true for the
require_once and include_once functions also. You might want to look into
that. Hope this helps a little.

-- Darwin

 -Original Message-
 From: Kerry Kobashi [mailto:kkobashi;thegrid.net]
 Sent: Friday, November 01, 2002 1:36 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Require_once problem


 Whats the difference between require_once and include_once?

 I been running into a problem, perhaps someone can help.

 I require_once in a Pear database extension. Inside that pear database
 extension
 is a require_once(pear.php) and a require_once(db.php)

 This file, Thomas Voxs' DbPage.php file, gets require_once inside yet
 another
 file (my file).

 The problem is, my file brings in many require_once file's, some of which
 require_once(db.php) inside of it. All I get redefinition
 problems all over
 the place.

 It appears to me that require_once doesn't work as advertised? For if it
 did,
 there should never be redefinition problems.

 Why didn't all PHP code do like we do in C/C++ with
 #define BLAH
 if !defined(BLAH)
 {
your code here.
 }

 I realize the #define trick works as I used it in my own PHP code... but
 when
 the basic PHP core files don't have this in them, it sort of  makes
 require_once
 and include_once hacks! (that don't work)

 Any ideas suggestions?




 --
 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] Apache Installation Problem

2002-11-01 Thread Ramesh Pillai
Hai!
I had downloaded Apache2.0.43 from apache site and
installed on my linux7.1 box, the configure/make .make
install went smooth, after that I started Apache
server. 

Now my problem is when I tried to access localhost
through any browser(ie http://localhost) its saying
host not found(or unknownhost), Why is it so?
and when try to restart Apache it shrows follwing
error
[ address already in use make_sock:coudnt bind to
address 127.0.0.1:80 no listening sockets available,
shutting down, Unable to open logs]

Any one please help me out. Since I  didnt find any
general mailing list for Apache installation I am
asking in this mailing Please excuse me.

Regards
Ramesh N


__
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

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




[PHP] Array solution...

2002-11-01 Thread Davíð Örn Jóhannsson
I have two arrays and I have complete list of numbers in one of them,
lets call it $complete[] 
and another that has some values of the complete one, lets call that one
$part[], now if I want to
return an array with all the values that are in $complete[] but not in
$part[], how would I do that?
 
Regards, David
 



Re: [PHP] Array solution...

2002-11-01 Thread Jason Wong
On Friday 01 November 2002 19:22, Davíð Örn Jóhannsson wrote:
 I have two arrays and I have complete list of numbers in one of them,
 lets call it $complete[]
 and another that has some values of the complete one, lets call that one
 $part[], now if I want to
 return an array with all the values that are in $complete[] but not in
 $part[], how would I do that?

array_diff()

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

/*
viro scanf is tough -- programmer Barbie...

- Al Viro on #kernelnewbies
*/


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




RE: [PHP] Simple Problems taking me hours to solve!

2002-11-01 Thread Petre Agenbag
Well, OK
I think your problem is here:
You sql *could* and probably does return more than one row.
Yet, your code as it is now will only return the first row.

You need to cycle through the result rows with a while statement, like
this:

while ($myrow = mysql_fetch_assoc($result)) {
$my_id = $myrow[shipping];
echo $my_id;
echo br;
}

Now, this will probably be a bit difficult to incorporate as is into
your function, as you will have multiple returns, and each will
override the previous value, so you'll end up with only the last row's
id..

Some pointers:

Use something like $result = mysql_query($sql) instead of saying
$shipping = mysql_query()

It will work the same, but it is easier to read throuhgh your code and
see where you actually invoke a result, and where you are simply
assigning a value to a variable ( which you are NOT doing with this
command, $result only contains the result set identifier of the query,
not the actual result, that's why you pass the $result to a
mysql_fetch_assoc(), only then do you have any kind of workable data)

Next, use mysql_fetch_assoc(), instead of ...fetch_array()

Difference is:

array = [0,pointer1,value1,1,pointer2,value2,2,pointer3,value3.]
associative array = [pointer1,value1,pointer2,value2,pointer3,value3
]

So, they hold the same data, but assoc's are smaller as they don't
have the numerical pointer, which you don't use anyway.
When you do the 
$my_id = $myrow[shipping];
what you are doing is retrieving the shipping-th value from the array,
and you would never do a 
$my_id = $myrow[2]; for instance...

So, assoc's are generally better to use. You can safely change it in
your code, the previous errors you got was not because of this, it was
simply because your result set was empty, and mysql_fetch_array OR
mysql_fetch_assoc would have given the error...

I would suggest you try to accomplish your goal without a function at
this point as to allow you to understand what you are trying to do
better. 
You will have to either build a loop into your function, or call your
function from within a loop, and both can be quite difficult to grasp
initially...


On Fri, 2002-11-01 at 12:24, Steve Jackson wrote:
 Ok thanks.
 Still having problems though.
 This is the function now:
 function get_shipping_cost()
   {
   //Get order ID from DB to pass to receipt.
   $conn = db_connect();
   //$query = select * from receipts order by receipt_id DESC
 LIMIT 0,1;
   $query = select shipping from receipts order by receipt_id DESC
 LIMIT 0,1;
   $shipping = mysql_query($query);
   $myrow = mysql_fetch_array($shipping);
   $my_id = $myrow[shipping];
   $shipping_cost = $my_id;
   return $shipping_cost;
   }
 Still zero DB results. There is definitely a connection as DB_connect()
 works.
 
  No!!!
  Why are you doing this?
  $my_id = $myrow[shipping];
 $my_id = $shipping_cost;
 return $shipping_cost;
  
  $my_id already contains the value you want, just return 
  $my_id, the reason it doesn't work now, is because 
  $shipping_cost has no value. If you really want to have the 
  value stored in $shipping_cost, you must
  do:
  $shipping_cost = $my_id.
  
  You see, $my_id has a value in it the moment you say:
  $my_id = $my_row[shipping];
  but when you do $my_id = $shipping_cost, you are overwriting 
  the value inside $my_id with $shipping_cost, which is like 
  saying $my_id = 0;
  
  
  
  
  On Fri, 2002-11-01 at 11:07, Steve Jackson wrote:
   Okay. Now I have this and it still returns nothing.
   
   function get_shipping_cost($shipping_cost)
 {
 //Get order ID from DB to pass to receipt.
 $conn = db_connect();
 $query = select shipping from receipts order by 
  receipt_id DESC 
   LIMIT 0,1;
 $shipping = mysql_query($query);
 $myrow = mysql_fetch_array($shipping);
 $my_id = $myrow[shipping];
 $my_id = $shipping_cost;
 return $shipping_cost;
 }
   
   And I still get one added to the variable in this function 
  which pulls 
   orderid from the same table.
   
   function get_order_id_receipt($orderid)
 {
 //Get order ID from DB to pass to receipt.
 $conn = db_connect();
 $query = select orderid from receipts order by 
  receipt_id DESC LIMIT 
   0,1;
 $order = mysql_query($query);
 $myrow = mysql_fetch_array($order);
 $my_id = $myrow[orderid];
 $my_id = $orderid;
 return $orderid;
 }
   
   Well and truly confused!
   
   Steve Jackson
   Web Developer
   Viola Systems Ltd.
   http://www.violasystems.com
   [EMAIL PROTECTED]
   Mobile +358 50 343 5159
   
   
   
-Original Message-
From: Petre Agenbag [mailto:internet;vsa.co.za]
Sent: 1. marraskuuta 2002 10:23
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Simple Problems taking me hours to solve!


No, it should not return what you want.
When you do
$orderid = mysql_query($query);

Re: [PHP] Apache Installation Problem

2002-11-01 Thread Jason Wong
On Friday 01 November 2002 19:11, Ramesh Pillai wrote:
 Hai!
 I had downloaded Apache2.0.43 from apache site and
 installed on my linux7.1 box, the configure/make .make
 install went smooth, after that I started Apache
 server.

 Now my problem is when I tried to access localhost
 through any browser(ie http://localhost) its saying
 host not found(or unknownhost), Why is it so?
 and when try to restart Apache it shrows follwing
 error
 [ address already in use make_sock:coudnt bind to
 address 127.0.0.1:80 no listening sockets available,
 shutting down, Unable to open logs]

Probably something is already using 127.0.0.1:80. 
As root, run 'netstat -lp' to find out what process it is.

 Any one please help me out. Since I  didnt find any
 general mailing list for Apache installation I am
 asking in this mailing Please excuse me.

How hard did you look? Going to www.apache.org or httpd.apache.org will 
display a link to mailing lists.

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

/*
He is the MELBA-BEING ... the ANGEL CAKE ... XEROX him ... XEROX him --
*/


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




[PHP] Need help with regexp for preg_split

2002-11-01 Thread David Brannlund
Hi,

I need some help with a regexp for preg_split. I want the string

  str = this is 'a string that' contains phrases;

to be split into:

  arr[] = this;
  arr[] = is;
  arr[] = a string that;
  arr[] = contains;
  arr[] = phrases;

but I'm having some trouble coming up a good regexp that would do the job.
Any regexp gurus out there who can point me in the right direction?



Thanks,
David Brännlund




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




[PHP] Serverside script

2002-11-01 Thread Davíð Örn Jóhannsson
I need to write a stand alone script runing on a server that checks and
updates a database every week, is this posable and if so
could some one direct me to a tutorial or to any info on doing this.
 
Regards, David



Re: [PHP] Serverside script

2002-11-01 Thread Petre Agenbag
Are you familiar with PHP, or are you more worried about how to call
and execute the script from the server itself on a weekly basis ( cron
job) ?

On Fri, 2002-11-01 at 14:41, Davíð Örn Jóhannsson wrote:
 I need to write a stand alone script runing on a server that checks and
 updates a database every week, is this posable and if so
 could some one direct me to a tutorial or to any info on doing this.
  
 Regards, David


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




RE: [PHP] Serverside script

2002-11-01 Thread John W. Holmes
 I need to write a stand alone script runing on a server that checks
and
 updates a database every week, is this posable and if so
 could some one direct me to a tutorial or to any info on doing this.

Yes, it's possible. Look into cron to run your script on a schedule. 

---John Holmes...



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




[PHP] php4 Mac OSX

2002-11-01 Thread Pierre Vaudrey
I installed PHP 4.2.3 on Mac OS 10.2.1 , activating the PHP Module with 
the following commands on terminal window

cd /etc/httpd
sudo apxs -e -a -n php4 libexec/httpd/libphp4.so
echo 'echo AddType application/x-httpd-php .php  
/etc/httpd/httpd.conf' | sudo sh -s

It works fine and I would like install xpl library but I don't have a 
php.ini file .

Could you help me to configure that ?

Thanks for your help


Pierre Vaudrey
email [EMAIL PROTECTED]


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



[PHP] Cookies

2002-11-01 Thread Shaun
Hi,

When the user logs in , i create a session with session varialbles, the
session cookie is saved on clients computer.

When i log off i say

session_unset();
session_destroy();
setcookie(session_name());

The session in the tmp is deleted , but the cookie is still there , i know
this because when i login , the same session id is used ! Why is that ?

Thanks
Shaun





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




[PHP] Cookies

2002-11-01 Thread Shaun
Hi,

When the user logs in , i create a session with session varialbles, the
session cookie is saved on clients computer.

When i log off i say

session_unset();
session_destroy();
setcookie(session_name());

The session in the tmp is deleted , but the cookie is still there , i know
this because when i login , the same session id is used ! Why is that ?

Thanks
Shaun







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




[PHP] how to avoid security thread when user able to press back button?

2002-11-01 Thread James Ting
hi.. a newbie here

a user fill up a form with username and password
passing the form through 'POST'
a session was created,
a user login,
a user logout + session destroy,

but after that if the user press back button
on the browser seems like the browser
will repost the username and password back
through the form so the user need not to reenter
his/hers username/password

how to avoid this problem?
thx

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

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




[PHP] Help please.

2002-11-01 Thread Steve Jackson
Hi,

I have been trying for most of the day to pull a variable from a db.
Finally managed that. Now I need to pass the result of a function to
another function.
How do you do this?
I assume the following if called in another page can be used?

function get_shipping($shipping)
{
$conn = db_connect();
$query = SELECT * FROM receipts ORDER BY receipt_id DESC LIMIT 1;
$result = mysql_query($query);
//$shippingvar = $myrow[shipping];
if(mysql_numrows($result)0)
$shipping = mysql_result($result, 0, shipping);
return $shipping;
}

If I return $shipping how can I display that?

I have called it in another page by doing
get_shipping($shipping)

And then 

Echo test $shipping;

But that doesn't work.

Ideas where I'm going wrong this time?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


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




Re: [PHP] Help please.

2002-11-01 Thread Jason Wong
On Friday 01 November 2002 22:04, Steve Jackson wrote:

Please use a descriptive subject!

 I have called it in another page by doing
 get_shipping($shipping)

 And then

 Echo test $shipping;

$returned_variable = get_shipping($shipping);
echo $returned_variable;

Or you can use the returned value directly:

echo get_shipping($shipping);


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

/*
The computing field is always in need of new cliches.
-- Alan Perlis
*/


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




[PHP] String Expression for aplpahnumeric password

2002-11-01 Thread Adam
I need a string expression to verify an alpha numeric password. This is what
i've come up with , however it does not work:

elseif ( (!ereg (^[a-zA-Z]+$, $password)) || (!ereg (^[0-9]+$,
$password)))

can anybody help? Thanks in advance
ADAM



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




[PHP] PHP WebDAV

2002-11-01 Thread GC
I'm using WebDAV in Apache 2, whenever I try to get an html file it works
fine, but when I try to get a PHP file I get an error saying it cannot get
filename.php.  How come I can only get html files through WebDAV?  Is there
a way to change this?  Thanks!!



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




RE: [PHP] Require_once problem

2002-11-01 Thread Ford, Mike [LSS]
 -Original Message-
 From:  Darwin [mailto:superbus22;attbi.com]
 Sent: 01 November 2002 10:17
 
 Well, the way I've read it is that if you use require within control
 structures then all files are included, regardless of whether 
 the script
 exits before it reaches its next if...elseif...else or case 
 statement. With
 include that does not happen. So the general rule of thumb 
 would be to use
 require() if you are not using it within these control 
 structures, and use
 include() if you actually do need to use include statements 
 in your control
 structures.

That's how it *used* to work (somewhere back around 4.0.3, if memory
serves).  Now, the only difference is that the require versions will produce
a fatal error if the file is not present, whereas the include versions will
only generate a warning.

Cheers!

Mike


Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Beckett Park
Tel: extn 4730Fax: extn 3211 

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




Re: [PHP] php4 Mac OSX

2002-11-01 Thread Matt T. Galvin
Did you install from the source code or a pre-compiled bin? (from Marc 
Liyanage.?)

If so there is usually no php.ini file with it. If you are using Marc's 
binary package then create a blank php.ini
file:

sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini

Then you will have to add the appropriate configuration options to it. You 
can find an example php.ini file in the
php source code file php4.2.3.tar.gz or whatever it is called. There will 
be a file called php.ini-recommended, you can
copy the options in this file and use it, or the php.ini-dist file.

--

At 02:10 PM 11/1/2002 +0100, you wrote:
I installed PHP 4.2.3 on Mac OS 10.2.1 , activating the PHP Module with 
the following commands on terminal window

cd /etc/httpd
sudo apxs -e -a -n php4 libexec/httpd/libphp4.so
echo 'echo AddType application/x-httpd-php .php  
/etc/httpd/httpd.conf' | sudo sh -s

It works fine and I would like install xpl library but I don't have a 
php.ini file .

Could you help me to configure that ?

Thanks for your help


Pierre Vaudrey
email [EMAIL PROTECTED]


--
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] OT - mysql question...

2002-11-01 Thread Kelly Meeks
Sorry for the OT post, quick mysql question...

I've found a couple of cool utilites that will create basic forms from a mysql table 
(add/edit/delete/search), which look they could save some time coding.

However, I can't connect with them because my server is setup as localhost.  I

How do you create a user/host configuration that will allow you to connect to mysql 
other than via localhost?

Thanks in advance,

Kelly



[PHP] phpinfo

2002-11-01 Thread David Russell
Hi all,

I upgraded php and apache on my development machine (Windows XP). I am
now running apache 1.3.27 and php 4.2.3.

When I run a phpinfo(), I get my full list of stuff as expected, except
that the apache version reported is 1.3.24.

Has anyone else seen this. Have I done something wrong? 

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com



smime.p7s
Description: application/pkcs7-signature


Re: [PHP] OT - mysql question...

2002-11-01 Thread John Nichel
http://www.mysql.com/doc/en/Adding_users.html
http://www.mysql.com/documentation/lists.html

Kelly Meeks wrote:

Sorry for the OT post, quick mysql question...

I've found a couple of cool utilites that will create basic forms from a mysql table (add/edit/delete/search), which look they could save some time coding.

However, I can't connect with them because my server is setup as localhost.  I

How do you create a user/host configuration that will allow you to connect to mysql other than via localhost?

Thanks in advance,

Kelly





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




[PHP] Get shipping problem continued!

2002-11-01 Thread Steve Jackson
Sorry to keep on at you guys but this is really getting to me now!

I want to pull a shipping quantity (the very last record in the Db) into
a page and am still having problems. Tried looping through the records
and I can't seem to get it to return anything:

function get_shipping($shippingvar)
{
$conn = db_connect();
$query = mysql_query(SELECT MAX(receipt_id) from receipts);
$myrow = mysql_fetch_row($query);
$shippingvar = $myrow[shipping];
return $shippingvar;

}

Surely it can't be much more complicated than that? 
Help please. Smoked 10 fags already!

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


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




[PHP] Re: Get shipping problem continued!

2002-11-01 Thread Michael T. Babcock
Steve Jackson wrote:


function get_shipping($shippingvar)
{
$conn = db_connect();
$query = mysql_query(SELECT MAX(receipt_id) from receipts);
$myrow = mysql_fetch_row($query);
$shippingvar = $myrow[shipping];
return $shippingvar;
 


Check http://php.net/mysql_fetch_row ... specifically, mysql_fetch_row 
specifically is not mysql_fetch_array and the latter is probably what 
you want.  You may also want some error checking in that function if you 
don't already have any.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



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



[PHP] How do I check if a checkbox has been checked?

2002-11-01 Thread DonPro
Hi,

I have a form with a checkbox like so:
input type=checkbox value=ON name=shipper_save

When I submit, the value is always shown as ON regardless of whether I've
checked the checkbox or not.  So this begets the question, How can I code my
PHP form processing script to determine whether the checkbox was checked?

Thanks,
Don



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




Re: [PHP] How do I check if a checkbox has been checked?

2002-11-01 Thread John Nichel
if ( isset ( $_POST['shipper_save'] ) ) {
	echo ( It's Checked );
}

Or use $_GET['shipper_save'] depending on your forum method.

DonPro wrote:

Hi,

I have a form with a checkbox like so:
input type=checkbox value=ON name=shipper_save

When I submit, the value is always shown as ON regardless of whether I've
checked the checkbox or not.  So this begets the question, How can I code my
PHP form processing script to determine whether the checkbox was checked?

Thanks,
Don







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




Re: [PHP] php4 Mac OSX

2002-11-01 Thread Pierre Vaudrey



Did you install from the source code or a pre-compiled bin? (from Marc 
Liyanage.?)
I installed PHP from Marc Liyanage pre-compiled bin


If so there is usually no php.ini file with it. If you are using 
Marc's binary package then create a blank php.ini
file:

sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini
Done !


Then you will have to add the appropriate configuration options to it. 
You can find an example php.ini file in the
php source code file php4.2.3.tar.gz or whatever it is called. There 
will be a file called php.ini-recommended, you can
copy the options in this file and use it, or the php.ini-dist file.

I would like to install eXtremePHP - Installation document says :

  1.  Uncompress the contents of the archive to the document root of 
your
  web server.

  2.  You will have to auto prepend the xpl/common/common.inc.php file. 
 This
  can be done of one of two ways.

  a) In the PHP.INI, find the field that says auto_prepend_file 
and change
 it to look like below on Unix

	 auto_prepend_file = /www/xpl/common/common.inc.php

	 where www is the document root of the webserver.
	

  b) If you are running Apache, create an .htaccess file under your
 document root directory and enter the following line and save 
the file.

	 php_value auto_prepend_file /www/xpl/common/common.inc.php

	



My document root is : /Users/pierreva/Sites
Could you tell me what I have to change in php.ini-recommmended ?

Thanks for your help.

Pierre Vaudrey
email [EMAIL PROTECTED]


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




Re: [PHP] How do I check if a checkbox has been checked?

2002-11-01 Thread Tom Woody
The syntax as I have used it is (not the cleanest or best way to do
it by a long run - but it works):

?php
if ($_POST['shipper_save'] == off) {
  $shipper_save = ;
}
else {
  $shipper_save = checked;
}
?
input type=checkbox name=shipper_save ?=$shipper_save?

this will have the checkbox be checked by default, also you can do what
ever other things you need to do based on the on/off conditions.

On Fri, 1 Nov 2002 10:47:43 -0500
DonPro [EMAIL PROTECTED] wrote:

 Hi,
 
 I have a form with a checkbox like so:
 input type=checkbox value=ON name=shipper_save
 
 When I submit, the value is always shown as ON regardless of whether
 I've checked the checkbox or not.  So this begets the question, How
 can I code my PHP form processing script to determine whether the
 checkbox was checked?
 
 Thanks,
 Don
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
Tom Woody
Systems Administrator
NationWide Flood Research, Inc.
phone: 214-631-0400 x209
  fax: 214-631-0800

Don't throw your computer out the window, 
throw the Windows out of your computer! 


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




[PHP] search

2002-11-01 Thread samug
There's no php.sql, so I'll put it here.

I'm trying to do a search from mysql database like this:

if (!$inquiry = mysql_query(select id,link,heading,desc from links where
heading like '%$entry%' or desc like '%$entry%'
or keyword like '%$entry%',$connection)){
print LISearch was unsuccesful!;
}
else{
while ($link = mysql_fetch_row($inquiry)){
print LIA HREF=\ . $link[1];
print \ . $link[2];
print /A I . $link[3] . /I ;
}

}

But everytime I get all the possible entries, even though I'm sure it
doesn't match.

Thanks for your answers.






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




Re: [PHP] php4 Mac OSX

2002-11-01 Thread Matt T. Galvin
uncompress eXtremePHP. It may get have a weird directory name. Change the 
directory name to xpl.

copy xpl to /Users/pierreva/Sites/xpl either from the CLI or just drag the 
xpl dir into your Site dir

cd /usr/local/lib
sudo vi php.ini

while in vi type ESC /auto_prepend
   (this is to search to the auto_prepend line in the php.ini file)
move to the end of the auto_prepend line then type:
a to append to the file then space 
/Users/pierreva/Sites/xpl/common/common.inc.php

then type ESC:wqENTER to save the changes

then type

sudo apachectl graceful

to restart apache, just in case ;)

That should be all that you have to do. Now try using the libraries and 
other xpl stuff.

Good Luck,

Matt

At 05:00 PM 11/1/2002 +0100, you wrote:


Did you install from the source code or a pre-compiled bin? (from Marc 
Liyanage.?)
I installed PHP from Marc Liyanage pre-compiled bin


If so there is usually no php.ini file with it. If you are using Marc's 
binary package then create a blank php.ini
file:

sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini
Done !


Then you will have to add the appropriate configuration options to it. 
You can find an example php.ini file in the
php source code file php4.2.3.tar.gz or whatever it is called. There will 
be a file called php.ini-recommended, you can
copy the options in this file and use it, or the php.ini-dist file.

I would like to install eXtremePHP - Installation document says :

  1.  Uncompress the contents of the archive to the document root of your
  web server.

  2.  You will have to auto prepend the xpl/common/common.inc.php file.  This
  can be done of one of two ways.

  a) In the PHP.INI, find the field that says auto_prepend_file and 
change
 it to look like below on Unix

auto_prepend_file = /www/xpl/common/common.inc.php

where www is the document root of the webserver.


  b) If you are running Apache, create an .htaccess file under your
 document root directory and enter the following line and save 
the file.

php_value auto_prepend_file /www/xpl/common/common.inc.php



My document root is : /Users/pierreva/Sites
Could you tell me what I have to change in php.ini-recommmended ?

Thanks for your help.

Pierre Vaudrey
email [EMAIL PROTECTED]


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

2002-11-01 Thread Robert Cummings
Echo your query and ensure that $entry has data in it, otherwise
matching '%%' will match everything as you are getting.

Cheers,
Rob.

samug wrote:
 
 There's no php.sql, so I'll put it here.
 
 I'm trying to do a search from mysql database like this:
 
 if (!$inquiry = mysql_query(select id,link,heading,desc from links where
 heading like '%$entry%' or desc like '%$entry%'
 or keyword like '%$entry%',$connection)){
 print LISearch was unsuccesful!;
 }
 else{
 while ($link = mysql_fetch_row($inquiry)){
 print LIA HREF=\ . $link[1];
 print \ . $link[2];
 print /A I . $link[3] . /I ;
 }
 
 }
 
 But everytime I get all the possible entries, even though I'm sure it
 doesn't match.
 
 Thanks for your answers.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:robert.cummings;webmotion.com |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] search

2002-11-01 Thread John Nichel
And you may want to try

$query = select `id`, `link`, `heading`, `desc` from `links` where 
`heading` like '% . $entry . %' or `desc` like '% . $entry% . ' or 
`keyword` like ' . %$entry% . ';
if ( ! $inquiry = mysql_query ( $query, $connection ) )

Robert Cummings wrote:
Echo your query and ensure that $entry has data in it, otherwise
matching '%%' will match everything as you are getting.

Cheers,
Rob.

samug wrote:


There's no php.sql, so I'll put it here.

I'm trying to do a search from mysql database like this:

if (!$inquiry = mysql_query(select id,link,heading,desc from links where
heading like '%$entry%' or desc like '%$entry%'
or keyword like '%$entry%',$connection)){
   print LISearch was unsuccesful!;
}
else{
   while ($link = mysql_fetch_row($inquiry)){
   print LIA HREF=\ . $link[1];
   print \ . $link[2];
   print /A I . $link[3] . /I ;
   }

}

But everytime I get all the possible entries, even though I'm sure it
doesn't match.

Thanks for your answers.

--
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] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-11-01 Thread Steve Keller
At 10/31/2002 03:00 PM, John Wards wrote:


On Thursday 31 Oct 2002 3:00 pm, jianking wrote:
 Who can tell me where I can get the cracked Zend Encoder 3.0 ?



Are you a muppet?

This list is run by the people who make Zend Encoder!

FOOL


Ah, my first laugh of the day.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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




RE: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-11-01 Thread Liam . Gibbs
  Who can tell me where I can get the cracked Zend Encoder 3.0 ?

Are you a muppet?

This list is run by the people who make Zend Encoder!

FOOL

Ah, my first laugh of the day.

Okay, that's enough. I'm incredibly disappointed in this list. It's very
helpful at times, but at other times can degenerate into immature
namecalling and fingerpointing like the above and other examples. So this
poster made a mistake. Cut him or her some slack. But I guess since none of
the fingerpointers here have ever made a mistake, then I guess you all have
the right to go ahead and make fun. This person made a post that he or she
shouldn't have made, and since then has been ridiculed on a public forum by
about four or five of us. If we all can look past this mistake and get back
to posting constructive comments, this poster can get back to feeling a
little sense of community here when needing legitimate help. So can we give
this poster a break, or should we continue and then respond to every
fingerpointer with the same lack of respect next time a mistake is made?

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




php-general Digest 1 Nov 2002 18:19:05 -0000 Issue 1679

2002-11-01 Thread php-general-digest-help

php-general Digest 1 Nov 2002 18:19:05 - Issue 1679

Topics (messages 122384 through 122438):

PHP-GTK 0.5.2 released
122384 by: Andrei Zmievski

Re: Displaying Data of a MySQL Table in PHP
122385 by: Jason Wong

php development environment
122386 by: Simon Taylor
122392 by: Jason Wong
122400 by: . Edwin
122403 by: . Darwin

client-side zip of POST or GET data, auto unzip on server.
122387 by: Petre Agenbag
122398 by: . Edwin
122401 by: Petre Agenbag

Re: counting clicks on a flash ad
122388 by: James Redfern

New Server advice
122389 by: David Russell
122391 by: John Nichel
122396 by: . Edwin

Require_once problem
122390 by: Kerry Kobashi
122399 by: Kerry Kobashi
122404 by: . Darwin
122424 by: Ford, Mike   [LSS]

Simple Problems taking me hours to solve!
122393 by: Steve Jackson
122395 by: Petre Agenbag
122408 by: Petre Agenbag

Re: ^M at the end of each line when I use php to write file
122394 by: Gerard Samuel

xml parser breaking on legal xml chars
122397 by: Gerard Samuel

Re: why does eregi match for whitespace when there is none?
122402 by: Erwin

Apache Installation Problem
122405 by: Ramesh Pillai
122409 by: Jason Wong

Array solution...
122406 by: Davíð Örn Jóhannsson
122407 by: Jason Wong

Need help with regexp for preg_split
122410 by: David Brannlund

Serverside script
122411 by: Davíð Örn Jóhannsson
122412 by: Petre Agenbag
122413 by: John W. Holmes

Get shipping problem continued!
122414 by: Steve Jackson
122420 by: Michael T. Babcock

php4 Mac OSX
122415 by: Pierre Vaudrey
122425 by: Matt T. Galvin
122431 by: Pierre Vaudrey
122434 by: Matt T. Galvin

Cookies
122416 by: Shaun
122417 by: Shaun

how to avoid security thread when user able to press back button?
122418 by: James Ting

Help please.
122419 by: Steve Jackson
122421 by: Jason Wong

String Expression for aplpahnumeric password
122422 by: Adam

PHP  WebDAV
122423 by: GC

OT - mysql question...
122426 by: Kelly Meeks
122428 by: John Nichel

phpinfo
122427 by: David Russell

How do I check if a checkbox has been checked?
122429 by: DonPro
122430 by: John Nichel
122432 by: Tom Woody

search
122433 by: samug
122435 by: Robert Cummings
122436 by: John Nichel

Re: Who can tell me where I can get the cracked Zend Encoder3.0 ?
122437 by: Steve Keller
122438 by: Liam.Gibbs.dfait-maeci.gc.ca

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]


--

---BeginMessage---
To all crazy users of PHP-GTK,

Version 0.5.2 has been released (after a half a year hiatus). This
release has some bug fixes and also some minor feature enhancements,
mostly in the graphics area.

Download the releaes from;

http://gtk.php.net/download.php

Version 0.5.2 Bass does a body good 01-Nov-2002
~
- simplified GdkPixbuf constructor parameters. (Andrei)
- fixed setting of tile/stipple/clip_mask/bg_pixmap properties of
  GdkGC. (Andrei)
- implemented GdkPixbuf::fill(). (Andrei)
- changed failure to allocate color to output only a notice instead
  of a warning. (Andrei)
- made depth parameter of GdkPixmap constructor optional. (Andrei)
- added copy_area() method for drawables. (Andrei)
- added group() and set_group() methods for
  GtkRadioButton/GtkRadioMenuItem. (Andrei)
- added GDK functions pointer_grab(), pointer_ungrab(),
  keyboard_grab(), keyboard_ungrab(). (Andrei)
- added utf8 support to GtkRadioButton, GtkToggleButton,
  GtkCheckMenuItem, and GtkCheckButton. (Frank)
- fixed a crash bug when using non-string variables to access
  overloaded object's properties. (Andrei)
- fixed a crash bug in GtkCheckButton constructor. (Andrei)

Enjoy,

-Andrei   http://www.gravitonic.com/
* Reality isn't all it's cracked up to be. *

---End Message---
---BeginMessage---
On Friday 01 November 2002 14:14, Ben C. wrote:
 I want to create a table in PHP with data from a MySQL database table.  Can
 someone please help with a sample script.  I know this is probably easy but
 I need quick help.  I searched the archives and couldn't find something
 this simple.

google - mysql php tutorial

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

/*
Mother 

Re: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-11-01 Thread John Nichel
I for one think that poster didn't enough grief.  I mean, you go on and 
on about making a 'mistake', but it's not like his mistake was to ask a 
JavaScript or MySQL question in a php mailing list.  He asked for an 
illegal version of software from those who make / contribute to the 
software.  That's not a mistake, that's disrespect.  Regardless, I 
didn't post anything to him, nor will I say anything else about it.

[EMAIL PROTECTED] wrote:
Who can tell me where I can get the cracked Zend Encoder 3.0 ?





Are you a muppet?

This list is run by the people who make Zend Encoder!

FOOL




Ah, my first laugh of the day.



Okay, that's enough. I'm incredibly disappointed in this list. It's very
helpful at times, but at other times can degenerate into immature
namecalling and fingerpointing like the above and other examples. So this
poster made a mistake. Cut him or her some slack. But I guess since none of
the fingerpointers here have ever made a mistake, then I guess you all have
the right to go ahead and make fun. This person made a post that he or she
shouldn't have made, and since then has been ridiculed on a public forum by
about four or five of us. If we all can look past this mistake and get back
to posting constructive comments, this poster can get back to feeling a
little sense of community here when needing legitimate help. So can we give
this poster a break, or should we continue and then respond to every
fingerpointer with the same lack of respect next time a mistake is made?





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




Re: [PHP] Who can tell me where I can get the cracked Zend Encode r3.0 ?

2002-11-01 Thread nicos
Okay enough now.

--

M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

John Nichel [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 I for one think that poster didn't enough grief.  I mean, you go on and
 on about making a 'mistake', but it's not like his mistake was to ask a
 JavaScript or MySQL question in a php mailing list.  He asked for an
 illegal version of software from those who make / contribute to the
 software.  That's not a mistake, that's disrespect.  Regardless, I
 didn't post anything to him, nor will I say anything else about it.

 [EMAIL PROTECTED] wrote:
 Who can tell me where I can get the cracked Zend Encoder 3.0 ?
 
 
 Are you a muppet?
 
 This list is run by the people who make Zend Encoder!
 
 FOOL
 
 
 Ah, my first laugh of the day.
 
 
  Okay, that's enough. I'm incredibly disappointed in this list. It's very
  helpful at times, but at other times can degenerate into immature
  namecalling and fingerpointing like the above and other examples. So
this
  poster made a mistake. Cut him or her some slack. But I guess since none
of
  the fingerpointers here have ever made a mistake, then I guess you all
have
  the right to go ahead and make fun. This person made a post that he or
she
  shouldn't have made, and since then has been ridiculed on a public forum
by
  about four or five of us. If we all can look past this mistake and get
back
  to posting constructive comments, this poster can get back to feeling a
  little sense of community here when needing legitimate help. So can we
give
  this poster a break, or should we continue and then respond to every
  fingerpointer with the same lack of respect next time a mistake is made?
 





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




RE: [PHP] Who can tell me where I can get the cracked Zend Encode r3.0 ?

2002-11-01 Thread Liam . Gibbs
I for one think that poster didn't enough grief.  I mean, you go on and 
on about making a 'mistake', but it's not like his mistake was to ask a 
JavaScript or MySQL question in a php mailing list.  He asked for an 
illegal version of software from those who make / contribute to the 
software.  That's not a mistake, that's disrespect.  Regardless, I 
didn't post anything to him, nor will I say anything else about it.

Disrespect or not, anyone ever copy a game? Or a CD or tape? Or a movie?
Anyone ever download anything off the Internet? It's all the same, and I
doubt any of the people on the list showing the same disrespect this person
may have showed have never done that. Again, cut this poster some slack and
let him or her move on. Maybe if the poster is still on the list, that same
person can save someone a lot of headache with the solution to a coding
problem.

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




RE: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-11-01 Thread Jay Blanchard
Easy Liam, the guy posted to the list asking for something illegal. It is
not like he had posted something like we have all seen before where a broad
question is asked and a broader answer given.

Jay



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




[PHP] Regular expression problem

2002-11-01 Thread Stuart
I just moved some *working* code from a Win2k server running PHP 4.2.1 
to a FreeBSD server running 4.2.3 and the following code no longer 
works...

$templatetext = preg_replace(/!-- include\(\([[:ascii:]]+?)\\) 
--/e, g_includecallback(\\\1\), $templatetext);

if (!preg_match(/([[:ascii:]]+?)!-- begin set 
--([[:ascii:]]+?)!-- end set --([[:ascii:]]+?)$/i, $templatetext, 
$matches))
{
// Report the error and stop processing the page
g_Halt(Could not find set definition in set list template: 
$g_setlisttemplate);
}

The first line that processes includes works and after that line 
$templatetext contains the full template with the include statements 
replaced with the contents of the file. After the preg_match statement 
has run (and succeeded), $matches[0] should contain the same as 
$templatetext did after the previous line. However, this is not the 
case. A sizable chunk of the text at the start of the variable has been 
lost and I cannot figure out why. Can anyone give me any pointers?

Thanks.

--
Stuart


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



Re: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-11-01 Thread @ Edwin
Asking for something illegal is *wrong*.

But, there's always a better/proper way of dealing with this kind of
person/situation.

Let's get busy coding--jokes and laughs (and ...whatever) can be found
somewhere else...

- E

--

Do not answer anyone stupid according to his foolishness,
  that you yourself also may not become equal to him.

- Proverbs 26:4

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




Re: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0?

2002-11-01 Thread ed

 Asking for something illegal is *wrong*.

But just stealing it without asking is OK?



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




Re: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-11-01 Thread @ Edwin

[EMAIL PROTECTED] wrote:

 
  Asking for something illegal is *wrong*.
 
 But just stealing it without asking is OK?
 

Tell me.

if (that was a joke){
  I need to rephrase myself...
   Let's get busy coding--jokes and laughs (and ...whatever) 
   can be found somewhere else...
  should read:
   Let's get busy coding--_unwholesome_ jokes and laughs (and
   immature namecalling and fingerpointing - from Liam) can be
   found somewhere else...
  because
  I thought there's some sort of sense of humor in your question...
} else {
  $alertmessage = ERROR - Stupid Question!
}

- E

PS
BTW, stealing even *after* asking is NOT ok...

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




[PHP] PHP Login Sessions

2002-11-01 Thread Jay Fitzgerald
What am I doing wrong here? I have a login form that visitors enter their 
usename and use_psswrd in to log in...the form action is this code:

SNIP 1==
?
session_start();

if ($_REQUEST[use_name]  $_REQUEST[use_psswrd])
{
$connection = mysql_connect(SERVER,USER,PASS) or die 
(Couldn't make connection.);
$db = mysql_select_db(DB, $connection) or die (Couldn't select 
the database.);
$sql = select * from TABLE where use_name = '$_REQUEST[use_name]' 
and use_psswrd = '$_REQUEST[use_psswrd]';
$sql_result = mysql_query($sql) or die (Couldn't execute query.);

if (mysql_num_rows($sql_result) 0 )
{
list($valid_id, $valid_user) = mysql_fetch_row($sql_result);
session_register(valid_id, valid_user);
// echo $valid_id, $valid_user;
header(Location: 
modify_profile.php?uid=$valid_idun=$valid_user);
}
else
{
header(Location: profile_login.php);
exit;
}
}
mysql_free_result($sql_result);
mysql_close($connection);
?
==END SNIP 1===

That page is supposed to register a session that holds both the valid_id 
and valid_user variables and continue on the the next page (which it 
does) - BUT once the user gets to the next page:

===SNIP 2
?
session_start();

if (isset(valid_id))
{
echo $_SESSION[valid_id]P;
}
else
{
echo DUMBASS!;
}

?
==END SNIP 2===

Nothing gets displayed.Am I not setting or requesting them correctly?? 
The one thing I cant understand is why the URI now reflects the user is 
logged in: (modify_profile.php?uid=1un=jerry)


TIA,

Jay




Re: [PHP] String Expression for aplpahnumeric password

2002-11-01 Thread @ Edwin
Hello,
(B
(B"Adam" [EMAIL PROTECTED] wrote in message
(B[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
(B I need a string expression to verify an alpha numeric password. This is
(Bwhat
(B i've come up with , however it does not work:
(B
(B elseif ( (!ereg ("^[a-zA-Z]+$", $password)) || (!ereg ("^[0-9]+$",
(B $password)))
(B
(B
(BHow about this?
(B
(B  elseif (!eregi("^[[:alnum:]]+$", $password))
(B
(BHTH,
(B
(B- E
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] phpinfo

2002-11-01 Thread @ Edwin
Hello,
(B
(B"David Russell" [EMAIL PROTECTED] wrote:
(B Hi all,
(B 
(B I upgraded php and apache on my development machine (Windows XP). I am
(B now running apache 1.3.27 and php 4.2.3.
(B 
(B When I run a phpinfo(), I get my full list of stuff as expected, except
(B that the apache version reported is 1.3.24.
(B 
(B Has anyone else seen this. Have I done something wrong? 
(B 
(B
(BNot sure. Perhaps, a simple restart would fix the problem.
(B
(BJust guessing...
(B
(B- E
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] search

2002-11-01 Thread @ Edwin
Hello,

samug [EMAIL PROTECTED] wrote in message
news:20021101163718.65263.qmail;pb1.pair.com...
 There's no php.sql, so I'll put it here.


There's php.db, however... :)

- E

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




[PHP] uploading files

2002-11-01 Thread Shaun Thornburgh
I am attempting to upload image files to the server from a users browser
using the following code, however, the images seem to get corrupted, they
look completely different and the file sizes are generally smaller, also it
sometimes says file upload unsuccessful, even when it does upload the file?

Any ideas?

Thank you



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




Re: [PHP] phpinfo

2002-11-01 Thread Matt T. Galvin
Restart apache... that should be it

on XP use the Restart Script in you apache program group

on unix do a

/usr/local/apache/bin/apachectl graceful

or just

apachectl graceful

if it is in your path

HTH,

Matt

At 05:50 AM 11/2/2002 +0900, you wrote:

[EMAIL PROTECTED]




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




[PHP] Re: uploading files

2002-11-01 Thread Shaun Thornburgh
My apologies, here is the code!

 //copy image to server
 if ($image != none) {
  if (copy ($image, $dir.$image_name)){
 echo pFile upload successful!/p;
  } else {
   echo pFile upload unsuccessful!/p;
  }

  //new name of image
  $new_name = $property_id-$category_id-$sub_category_id.jpg;

  //rename the file
  rename($dir.$image_name, $dir.$new_name);
 }


Shaun Thornburgh [EMAIL PROTECTED] wrote in message
news:20021101205003.11053.qmail;pb1.pair.com...
 I am attempting to upload image files to the server from a users browser
 using the following code, however, the images seem to get corrupted, they
 look completely different and the file sizes are generally smaller, also
it
 sometimes says file upload unsuccessful, even when it does upload the
file?

 Any ideas?

 Thank you





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




Re: [PHP] PHP Login Sessions

2002-11-01 Thread @ Edwin
Hello,


Jay Fitzgerald [EMAIL PROTECTED] wrote:

[snip]

 ===SNIP 2
 ?
 session_start();
 
 if (isset(valid_id))
 {
  echo $_SESSION[valid_id]P;
 }
 else

[/snip]

Perhaps, it's because you need to ask

  if (isset($_SESSION['valid_id']))  ?

- E

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




Fw: [PHP] Re: uploading files

2002-11-01 Thread Kevin Stone
Confirm that you're using the proper header information in your HTML form
tag..
form action=upload.php method=POST enctype=multipart/form-data
-Kevin

- Original Message -
From: Shaun Thornburgh [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 01, 2002 1:51 PM
Subject: [PHP] Re: uploading files


 My apologies, here is the code!

  //copy image to server
  if ($image != none) {
   if (copy ($image, $dir.$image_name)){
  echo pFile upload successful!/p;
   } else {
echo pFile upload unsuccessful!/p;
   }

   //new name of image
   $new_name = $property_id-$category_id-$sub_category_id.jpg;

   //rename the file
   rename($dir.$image_name, $dir.$new_name);
  }


 Shaun Thornburgh [EMAIL PROTECTED] wrote in message
 news:20021101205003.11053.qmail;pb1.pair.com...
  I am attempting to upload image files to the server from a users browser
  using the following code, however, the images seem to get corrupted,
they
  look completely different and the file sizes are generally smaller, also
 it
  sometimes says file upload unsuccessful, even when it does upload the
 file?
 
  Any ideas?
 
  Thank you
 
 



 --
 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] Re: uploading files

2002-11-01 Thread Shaun Thornburgh
Thats all fine

Here is my form header

form enctype=\multipart/form-data\ name=\Edit_Category_Form\
method=\post\
action=\edit_images_form.php?property_id=$property_idcategory_id=$category
_idsub_category_id=$sub_category_idsub_category_title=$sub_category_title
sub_category_description=$sub_category_description\


Kevin Stone [EMAIL PROTECTED] wrote in message
news:020201c281ec$04515820$6601a8c0;kevin...
 Confirm that you're using the proper header information in your HTML
form
 tag..
 form action=upload.php method=POST enctype=multipart/form-data
 -Kevin

 - Original Message -
 From: Shaun Thornburgh [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, November 01, 2002 1:51 PM
 Subject: [PHP] Re: uploading files


  My apologies, here is the code!
 
   //copy image to server
   if ($image != none) {
if (copy ($image, $dir.$image_name)){
   echo pFile upload successful!/p;
} else {
 echo pFile upload unsuccessful!/p;
}
 
//new name of image
$new_name = $property_id-$category_id-$sub_category_id.jpg;
 
//rename the file
rename($dir.$image_name, $dir.$new_name);
   }
 
 
  Shaun Thornburgh [EMAIL PROTECTED] wrote in message
  news:20021101205003.11053.qmail;pb1.pair.com...
   I am attempting to upload image files to the server from a users
browser
   using the following code, however, the images seem to get corrupted,
 they
   look completely different and the file sizes are generally smaller,
also
  it
   sometimes says file upload unsuccessful, even when it does upload the
  file?
  
   Any ideas?
  
   Thank you
  
  
 
 
 
  --
  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] Check box with same name

2002-11-01 Thread ppf

Hi all:
I am having  a problem in accessing form data from
multiple check box
of same name with different values, like this

input type=checkbox name=searchStr
value=Where
Where/td
   
  td width=40%nbsp;nbsp; 
input type=checkbox
name=searchStr value=would
would/td
   
  td width=40%nbsp;nbsp; 
input type=checkbox
name=searchStr value=Luluk,
Luluk,/td
/trtr  
  td
width=40%nbsp;nbsp; 
input type=checkbox
name=searchStr value=Indonesian
Indonesian/td
   
  td width=40%nbsp;nbsp; 
ons,/td
 How can i access these multiple selected value in
same name?
 I am trying to move my asp code to PHP, 
Thanks in advance
   Prad


__
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

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




[PHP] Security - Maybe a silly question

2002-11-01 Thread SED
When I use sessions in PHP or just plain login/password in $_POST, can
3rd parties or hackers monitor the transmission, between me and user,
and somehow decode the transmission and use the variables to login other
time or overtake the current session?

If so, how likely is for someone to manage it (get the
username/password)?


Regards,
Sumarlidi E. Dadason

SED - Graphic Design
_
Tel: +354-896-0376, +354-461-5501
E-mail: [EMAIL PROTECTED]
website: www.sed.is


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




[PHP] Extracting email addresses

2002-11-01 Thread jr
Hello Everyone,

Does anyone have an regular expression or other way to extract an email
address out of a string.

I have been using:

if (ereg (^ .
[a-z0-9]+([_\\.-][a-z0-9]+)* .//user
@ .
([a-z0-9]+([\.-][a-z0-9]+)*)+ .   //domain
\\.[a-z]{2,} .//sld, tld 
$ , $body[$line], $regs))

It will match an email address by itself for example;
[EMAIL PROTECTED]

What it won't do is extract [EMAIL PROTECTED] from; a
href=mailto:jr;johnrudnick.com[EMAIL PROTECTED]/a.

Any help would be appreciated.

Thanks in Advance!

JR

-

SallyJo, Inc., offers Top Notch Dedicated  Virtual Hosting.
Visit: http://www.SallyJoInc.com


 


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




[PHP] Theory question

2002-11-01 Thread Daniel Masson

Hi   every1

This is a theorical question about the best way to use classes.

I have a class named anything, and also theres a table named ahything ..
The class attributes are the same fields of the table like this

Class anything {
var $something1;
var $something2;
var $something3;
}

And the table 'anything' has 3 fields they are something1 , something2,
something3, my question:

I have a method in the class that retrieves the values for the 3
attributes from the table, there are many scripts that use this method
to get the data, but not all the scripts uses the 3 attributes, for
example a script calls the method just because only needs the attribute
something1. should i write one method to retrieve each attribute ? Or is
just fine that one method gets all data, and the scripts only uses what
it needs ?? Of course, the real class has more than 3 attributes it has
10 attributes


Thanks
Any help would be very useful.

Daniel.



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




Re: [PHP] Security - Maybe a silly question

2002-11-01 Thread @ Edwin
Hello,

SED [EMAIL PROTECTED] wrote:
 When I use sessions in PHP or just plain login/password in $_POST, can
 3rd parties or hackers monitor the transmission, between me and user,
 and somehow decode the transmission and use the variables to login other
 time or overtake the current session?

Yes. (But, I'm not really sure what you meant by between me and user...)

 If so, how likely is for someone to manage it (get the
 username/password)?

By sniffing.

- E

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




[PHP] Re: Capitalizing names etc. part II - found a solution

2002-11-01 Thread -[ Rene Brehmer ]-
Hi Richard Archer,

On Thu, 31 Oct 2002 12:24:15 -, you wrote about RE: Capitalizing
names etc. part II - found a solution something that looked like this:

You should consider the fact that, even as surnames, names like
Mackintosh and Mackenzie (and as someone else suggested here 'Macon')
generally should NOT have a capital letter. Mackintosh is an English
name, not Scottish, and people who spell it with a capital K have gotten
their ancestry mixed up somewhere!

I've been made aware of this by a few others in private mail. When writing
this scripple I was doing something I don't usually do: I was blindingly
stearing at getting it to handle the few names I have to deal with, and
not considering that it may have to handle other names sometime in the
future. Normally when I program things like this, I try to make it take
into account every exception to the rule (not error-exception) I can come
up with. Atleast my Excel macros are made that way ... 

Anyway, perhaps a way around this would be to have a known exceptions
list? You could just stick all your Mc/Mac code inside:
   if (in_array($lastname, $mcExceptions)) {
   ...
   }

I considered that after the responses I got ... but it will be a kludge in
the end ... but a necessary one until I come up with a better solution.

At the end of the day, it's really up to the person how they capitalise
their own name, but I guess mind reading is (currently) a bit beyond
PHP.

My own idea for the perfect solution to this, would be to have it take the
incoming contracted name, compare it to a list, and then find the real
name in the list that corresponds to that name.

My problem is, how'd you do that ??? I've got no access to MySQL, so I
can't use that. The incoming name string is the first part of the file
name that holds the biography for that person (if you take a peek at my
site at metalbunny.net/girlz/bios.php you'll know what I mean, haven't
uploaded the revised capper yet), so it will still need that string to
find the correct include for the body of the page.

I haven't even sniffed at the File I/O functions yet...

Rene
-- 
Rene Brehmer
System developer in the making...

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




Re: [PHP] Theory question

2002-11-01 Thread Matt T. Galvin
Well, what you could do is write one function that gets all the 
values that you need and fills the variables up with them, AND write a 
bunch of functions that get one value at a time. Then depending on the 
conditions or parameters/values needed or recieved and such, you can call 
the function best suited for the situation. If all the values are needed, 
call the function to get them all, if only a few are need, call only the 
functions that get the needed values, or some combination of this. You 
could argue that what if you need all of the values but one, well then just 
call the function that gets all the vars and just ignore that the last var 
is set.  You could also do this by even having one function that it 
something like this:

I would prolly do something like this (maybe ;) depending on the situation...


where 0 is false (or don't get this var), and
1 is true (or get this var)

function get_somevars( getvar1 = 0, getvar2 = 0, getvar3 = 0) {

...

}

we don't get any by default, and the ones that we do want we pass the 
function 1 values like so...

get_somevers(1, 0, 1); // or get var1 and var3 but don't get var2

HTH,

Matt


At 04:42 PM 11/1/2002 -0500, you wrote:

Hi   every1

This is a theorical question about the best way to use classes.

I have a class named anything, and also theres a table named ahything ..
The class attributes are the same fields of the table like this

Class anything {
var $something1;
var $something2;
var $something3;
}

And the table 'anything' has 3 fields they are something1 , something2,
something3, my question:

I have a method in the class that retrieves the values for the 3
attributes from the table, there are many scripts that use this method
to get the data, but not all the scripts uses the 3 attributes, for
example a script calls the method just because only needs the attribute
something1. should i write one method to retrieve each attribute ? Or is
just fine that one method gets all data, and the scripts only uses what
it needs ?? Of course, the real class has more than 3 attributes it has
10 attributes


Thanks
Any help would be very useful.

Daniel.



--
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] Number of files in a dir

2002-11-01 Thread Shaun Thornburgh
How can i find out how many files exist in a dir?



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




Re: [PHP] Check box with same name

2002-11-01 Thread Philip Olson
Hello,

Use an array:

  input type=checkbox name=foo[] value=blah

Note:

  Only checked checkboxes are passed.

Access:

  print $_REQUEST['foo'][0];  // the first one
  print $_REQUEST['foo'][1];  // the second

You can use named indices too:

  input type=checkbox name=foo[bar] value=blah

  print $_REQUEST['foo']['bar'];

Mix and match, have fun.

Regards,
Philip


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




Re: [PHP] Check box with same name

2002-11-01 Thread John Nichel
Add square brackets to the end of the name of each check box, ie...

input type=checkbox name=searchStr[] value=Where

And on the page you submit the form too, you will be able to access this 
as an array...

$_POST['searchStr'] or $_GET['searchStr'], depending on the method the 
form was posted by.


ppf wrote:
Hi all:
I am having  a problem in accessing form data from
multiple check box
of same name with different values, like this

	input type=checkbox name=searchStr
value=Where
  Where/td
   			 td width=40%nbsp;nbsp; 
  input type=checkbox
name=searchStr value=would
  would/td
   			 td width=40%nbsp;nbsp; 
  input type=checkbox
name=searchStr value=Luluk,
  Luluk,/td
   /trtr			 td
width=40%nbsp;nbsp; 
  input type=checkbox
name=searchStr value=Indonesian
  Indonesian/td
   			 td width=40%nbsp;nbsp; 
  ons,/td
 How can i access these multiple selected value in
same name?
 I am trying to move my asp code to PHP, 
Thanks in advance
   Prad


__
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/




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




[PHP] getting HTML header from URL

2002-11-01 Thread Jule Slootbeek
hey

is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't know 
where to look.
if there's a function that pulls in an entire page that;s fine too i 
can work with that..
any help appreciated
TIA

Jule
Jule Slootbeek
[EMAIL PROTECTED]


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



Re: [PHP] search

2002-11-01 Thread rija
Perhaps the table name 'desc' is reserved word for 'order by' so MySQL
cannot use it as table name-
So why don't you print out the mysql_error() using for example die-
like this:
$inquiry = mysql_query(select id,link,heading,desc from links where heading
like '%$entry%' or desc like '%$entry%' or keyword like
'%$entry%',$connection)) or die (mysql_error()) ;

- Original Message -
From: samug [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 3:39 AM
Subject: [PHP] search


 There's no php.sql, so I'll put it here.

 I'm trying to do a search from mysql database like this:

 if (!$inquiry = mysql_query(select id,link,heading,desc from links where
 heading like '%$entry%' or desc like '%$entry%'
 or keyword like '%$entry%',$connection)){
 print LISearch was unsuccesful!;
 }
 else{
 while ($link = mysql_fetch_row($inquiry)){
 print LIA HREF=\ . $link[1];
 print \ . $link[2];
 print /A I . $link[3] . /I ;
 }

 }

 But everytime I get all the possible entries, even though I'm sure it
 doesn't match.

 Thanks for your answers.






 --
 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] Security - Maybe a silly question

2002-11-01 Thread rija
Yes,
Between user and server, everydata pass through DNS, routeur, etc...
So if you don't want someone (hackers or FBI of CIA) to decode your data,
use SSL server (https://) with certificate-

- Original Message -
From: SED [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 8:37 AM
Subject: [PHP] Security - Maybe a silly question


 When I use sessions in PHP or just plain login/password in $_POST, can
 3rd parties or hackers monitor the transmission, between me and user,
 and somehow decode the transmission and use the variables to login other
 time or overtake the current session?

 If so, how likely is for someone to manage it (get the
 username/password)?


 Regards,
 Sumarlidi E. Dadason

 SED - Graphic Design
 _
 Tel: +354-896-0376, +354-461-5501
 E-mail: [EMAIL PROTECTED]
 website: www.sed.is


 --
 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] getting HTML header from URL

2002-11-01 Thread John Nichel
Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey

is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't know 
where to look.
if there's a function that pulls in an entire page that;s fine too i can 
work with that..
any help appreciated
TIA

Jule
Jule Slootbeek
[EMAIL PROTECTED]





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




Re: [PHP] number_format question

2002-11-01 Thread Hugh Danaher
What you need to do with the input number is to do an ereg_replace() and
eliminate the commas from the string, then use the string variable where
needed.  Then, when you want to display the variable, use the
number_format() function.
Hope this helps,
Hugh

- Original Message -
From: [EMAIL PROTECTED]
To: Jay Blanchard [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, October 31, 2002 2:36 PM
Subject: RE: [PHP] number_format question



  Tried it. It works but crops everything after the first , in the number
 if you enter a number with commas. Works great if you don't enter any
 commas.

 What I need to be able to do:

 IN   OUT
 123456789  123,456,789
 123456789.00  123,456,789
 123,456,789.00  123,456,789

 Ed


 On Thu, 31 Oct 2002, Jay Blanchard wrote:

  [snip]
   If I try that I get a wrong parameter count error.
 
  [/snip]
 
  number_format ( float number [, int decimals [, string dec_point [,
string
  thousands_sep]]])
 
  number_format($number, 0, '', ',');
 
  Try that ...
 
  Jay
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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



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




Re: [PHP] getting HTML header from URL

2002-11-01 Thread Jule Slootbeek
i thought fopen() was only for local files, didn't even bother looking, 
but now i think about it..it makes perfect sence to open url's as well, 
thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't know 
where to look.
if there's a function that pulls in an entire page that;s fine too i 
can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] Number of files in a dir

2002-11-01 Thread rija
cope with readdir() or dir().
I always use one of these functions and I'm wondered if there are more
efficient solution to do it !

- Original Message -
From: Shaun Thornburgh [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 9:00 AM
Subject: [PHP] Number of files in a dir


 How can i find out how many files exist in a dir?



 --
 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] Security - Maybe a silly question

2002-11-01 Thread SED
Thank you for the reply, what do you mean by sniffing, do you mean
everbody can monitor our browsing?

-Original Message-
From: @ Edwin [mailto:copperwalls;hotmail.com] 
Sent: 1. nóvember 2002 21:47
To: SED
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Security - Maybe a silly question


Hello,

SED [EMAIL PROTECTED] wrote:
 When I use sessions in PHP or just plain login/password in $_POST, can

 3rd parties or hackers monitor the transmission, between me and user, 
 and somehow decode the transmission and use the variables to login 
 other time or overtake the current session?

Yes. (But, I'm not really sure what you meant by between me and
user...)

 If so, how likely is for someone to manage it (get the 
 username/password)?

By sniffing.

- E

-- 
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] regular expression question

2002-11-01 Thread John Meyer
I've got a regexp:

(EV[0-9]{2})!([0-9]{4}-[0-9]{2}-[0-9]{2})!(GR[0-9]{2}).txt


My question is, will it match this:


EV01!2002-11-09!VR01!GR01.txt



And anything formatted like this: (EV02, and so forth).

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




Re: [PHP] regular expression question

2002-11-01 Thread John Nichel
It might, you should test it to find out.

John Meyer wrote:

I've got a regexp:

(EV[0-9]{2})!([0-9]{4}-[0-9]{2}-[0-9]{2})!(GR[0-9]{2}).txt


My question is, will it match this:


EV01!2002-11-09!VR01!GR01.txt



And anything formatted like this: (EV02, and so forth).





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




RE: [PHP] Security - Maybe a silly question

2002-11-01 Thread SED
I'm not very familiar to this stuff, but if I wanna use https:// do
don't I need a key from Verisign (or similar) to make it work? If so,
who control who is what on the internet?


Regards,
Sumarlidi E. Dadason

SED - Graphic Design
_
Tel: 896-0376, 461-5501
E-mail: [EMAIL PROTECTED]
website: www.sed.is


-Original Message-
From: rija [mailto:rija;vatu.com] 
Sent: 1. nóvember 2002 22:33
To: php; SED
Subject: Re: [PHP] Security - Maybe a silly question


Yes,
Between user and server, everydata pass through DNS, routeur, etc... So
if you don't want someone (hackers or FBI of CIA) to decode your data,
use SSL server (https://) with certificate-

- Original Message -
From: SED [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 8:37 AM
Subject: [PHP] Security - Maybe a silly question


 When I use sessions in PHP or just plain login/password in $_POST, can

 3rd parties or hackers monitor the transmission, between me and user, 
 and somehow decode the transmission and use the variables to login 
 other time or overtake the current session?

 If so, how likely is for someone to manage it (get the 
 username/password)?


 Regards,
 Sumarlidi E. Dadason

 SED - Graphic Design
 _
 Tel: +354-896-0376, +354-461-5501
 E-mail: [EMAIL PROTECTED]
 website: www.sed.is


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





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


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




[PHP] Can't store info on a mysql database...

2002-11-01 Thread Mr. BuNgL3
Hi...
My problem is that i can't store info in a mysql database... ex:

I want to store this info in my database: login/passwd and i have the php
code...

?
$logintxt = $HTTP_POST_VARS['logintxt'];
$passwdtxt= $HTTP_POST_VARS['passwdtxt'];

if (!$logintxt || !$passwdtxt)
{
 include('registo.htm');
}
else
{
 $ligacao=mysql_connect(localhost,,);
 if (!$ligacao)
 {
  print(Problemas na ligação á base de dados!);
 }
 else
 {
  //Procurar se user já existente

  //$sql=INSERT into users SET login='$logintxt',
passwd=MD5('$passwdtxt');

  $sql=INSERT INTO users (login,passwd) VALUES ('$logintxt',
'passwd=MD5($passwdtxt))';
  mysql_db_query(mysite,$sql);
 }
 mysql_close();
}
?

what i'm doing wrong? : |

thanks...






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




Fw: [PHP] Can't store info on a mysql database...

2002-11-01 Thread Rick Emery
$md = MD5($passwdtxt);
$sql=INSERT INTO users (login,passwd) VALUES (\$logintxt\, \$md\);
mysql_query($sql) or die(mysql_error());

next time, show the error messages you got.

Also, ALWAYS USE mysql_error() when executing mysql_query()  --  see above
=
Mr. BuNgL3 [EMAIL PROTECTED] wrote in message
news:20021101233214.19457.qmail;pb1.pair.com...
 Hi...
 My problem is that i can't store info in a mysql database... ex:

 I want to store this info in my database: login/passwd and i have the php
 code...

 ?
 $logintxt = $HTTP_POST_VARS['logintxt'];
 $passwdtxt= $HTTP_POST_VARS['passwdtxt'];

 if (!$logintxt || !$passwdtxt)
 {
  include('registo.htm');
 }
 else
 {
  $ligacao=mysql_connect(localhost,,);
  if (!$ligacao)
  {
   print(Problemas na ligação á base de dados!);
  }
  else
  {
   //Procurar se user já existente

   //$sql=INSERT into users SET login='$logintxt',
 passwd=MD5('$passwdtxt');

   $sql=INSERT INTO users (login,passwd) VALUES ('$logintxt',
 'passwd=MD5($passwdtxt))';
   mysql_db_query(mysite,$sql);
  }
  mysql_close();
 }
 ?

 what i'm doing wrong? : |



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




[PHP] uping to plaese help

2002-11-01 Thread marcelo
Hi need some help please

What is wrong with my code?

it is supposed to upload 2 files but instead gives me this error







Warning: Unable to open 'Array' for reading





The code









html
head
titleO Leme upload/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body

?php



$PHP_SELF = $_SERVER['PHP_SELF'];
$page = $_REQUEST['page'];
$origem = $_FILES['origem'];
$origem2 = $_FILES['origem2'];



switch($page)
{
 case um:
um($origem ,$origem2);
 break;
 case dois:
  dois($origem, $origem2);
 break;

 default:
  um($origem ,$origem2);
 break;
}

function um($origem ,$origem2)


{

?



titleJornal O Leme/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body bgcolor=#006699
table width=100% border=0 cellpadding=0 cellspacing=0
  !--DWLayoutTable--
  tr
td width=100% height=70 valign=topimg src=test.jpg
width=600 height=120
/td
  /tr
  tr
td height=262 valign=toppnbsp;/p
  form method=post  action=?php $PHP_SELF ?
enctype=multipart/form-data
table width=75% border=0 align=center bgcolor=#FF
  tr
td width=23%div align=centerfont face=BankGothic Md
BT
/font/div/td
td width=77% bgcolor=#FFnbsp; /td
  /tr
  tr
tddiv align=center/div/td
td bgcolor=#FFnbsp; /td
  /tr
  tr
tddiv align=center/div/td
td bgcolor=#FFnbsp; /td
  /tr
  tr
tddiv align=leftstrongImagem pequena/strong/div/td
td bgcolor=#FF input type=hidden name=MAX_FILE_SIZE
value=102400
  input type=File name=origem /td
  /tr
  tr
tddiv align=leftstrongImagem grande/strong/div/td
td bgcolor=#FFinput type=hidden name=MAX_FILE_SIZE
value=102400
  input type=File name=origem2 /td
  /tr
  tr
tddiv align=center/div/td
td bgcolor=#FFnbsp; /td
  /tr
  tr
tdnbsp;/td
tdnbsp;/td
  /tr
/table
p align=center
  input name=submit type=submit value=Adicionar
input type=hidden name=page value=dois
  /form/p
  /td
  /tr
  tr
td height=81 valign=topdiv align=center
pnbsp;/p
p
  ?php

  include ('menu.php');

  ?
  nbsp;/p
  /div/td
  /tr
/table


?php



}




function dois($origem, $origem2)


{
set_time_limit(60);
$path=(dirname($PATH_TRANSLATED)).../primeirapagina/;
$origem_name=pppv2.jpg;
$dest= $path.$origem_name;

if (($origem  none)  ($origem  )){
   if (copy($origem,$dest)){;

 } else {
  echo directoria sem direitos de escrita br;
  }
unlink ($origem);
}

set_time_limit(60);
$path2=(dirname($PATH_TRANSLATED)).../primeirapagina/;
$origem2_name=ppv2.jpg;
$dest2= $path2.$origem2_name;

if (($origem2  none)  ($origem2  )){
   if (copy($origem2,$dest2)){;

} else {
  echo directoria sem direitos de escrita br;
  }
unlink ($origem2);
}




}





?
/body
/html




and yes i am new to php

tk





Marcelo Salvador

www.sinesdigital.pt





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




Re: [PHP] Can't store info on a mysql database...

2002-11-01 Thread rija
 $sql=INSERT INTO `users` (login,passwd) VALUES ('$logintxt',
'password($passwdtxt)') ;
 mysql_db_query(mysite,$sql);

- Original Message -
From: Mr. BuNgL3 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 10:32 AM
Subject: [PHP] Can't store info on a mysql database...


 Hi...
 My problem is that i can't store info in a mysql database... ex:

 I want to store this info in my database: login/passwd and i have the php
 code...

 ?
 $logintxt = $HTTP_POST_VARS['logintxt'];
 $passwdtxt= $HTTP_POST_VARS['passwdtxt'];

 if (!$logintxt || !$passwdtxt)
 {
  include('registo.htm');
 }
 else
 {
  $ligacao=mysql_connect(localhost,,);
  if (!$ligacao)
  {
   print(Problemas na ligação á base de dados!);
  }
  else
  {
   //Procurar se user já existente

   //$sql=INSERT into users SET login='$logintxt',
 passwd=MD5('$passwdtxt');

   $sql=INSERT INTO users (login,passwd) VALUES ('$logintxt',
 'passwd=MD5($passwdtxt))';
   mysql_db_query(mysite,$sql);
  }
  mysql_close();
 }
 ?

 what i'm doing wrong? : |

 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] uping to plaese help

2002-11-01 Thread rija
I bit you are doing something like this:
copy($file, file) ;



- Original Message -
From: marcelo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 11:19 AM
Subject: [PHP] uping to plaese help


 Hi need some help please

 What is wrong with my code?

 it is supposed to upload 2 files but instead gives me this error







 Warning: Unable to open 'Array' for reading





 The code









 html
 head
 titleO Leme upload/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head

 body

 ?php



 $PHP_SELF = $_SERVER['PHP_SELF'];
 $page = $_REQUEST['page'];
 $origem = $_FILES['origem'];
 $origem2 = $_FILES['origem2'];



 switch($page)
 {
  case um:
 um($origem ,$origem2);
  break;
  case dois:
   dois($origem, $origem2);
  break;

  default:
   um($origem ,$origem2);
  break;
 }

 function um($origem ,$origem2)


 {

 ?



 titleJornal O Leme/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head

 body bgcolor=#006699
 table width=100% border=0 cellpadding=0 cellspacing=0
   !--DWLayoutTable--
   tr
 td width=100% height=70 valign=topimg src=test.jpg
 width=600 height=120
 /td
   /tr
   tr
 td height=262 valign=toppnbsp;/p
   form method=post  action=?php $PHP_SELF ?
 enctype=multipart/form-data
 table width=75% border=0 align=center bgcolor=#FF
   tr
 td width=23%div align=centerfont face=BankGothic Md
 BT
 /font/div/td
 td width=77% bgcolor=#FFnbsp; /td
   /tr
   tr
 tddiv align=center/div/td
 td bgcolor=#FFnbsp; /td
   /tr
   tr
 tddiv align=center/div/td
 td bgcolor=#FFnbsp; /td
   /tr
   tr
 tddiv align=leftstrongImagem
pequena/strong/div/td
 td bgcolor=#FF input type=hidden name=MAX_FILE_SIZE
 value=102400
   input type=File name=origem /td
   /tr
   tr
 tddiv align=leftstrongImagem
grande/strong/div/td
 td bgcolor=#FFinput type=hidden name=MAX_FILE_SIZE
 value=102400
   input type=File name=origem2 /td
   /tr
   tr
 tddiv align=center/div/td
 td bgcolor=#FFnbsp; /td
   /tr
   tr
 tdnbsp;/td
 tdnbsp;/td
   /tr
 /table
 p align=center
   input name=submit type=submit value=Adicionar
 input type=hidden name=page value=dois
   /form/p
   /td
   /tr
   tr
 td height=81 valign=topdiv align=center
 pnbsp;/p
 p
   ?php

   include ('menu.php');

   ?
   nbsp;/p
   /div/td
   /tr
 /table


 ?php



 }




 function dois($origem, $origem2)


 {
 set_time_limit(60);
 $path=(dirname($PATH_TRANSLATED)).../primeirapagina/;
 $origem_name=pppv2.jpg;
 $dest= $path.$origem_name;

 if (($origem  none)  ($origem  )){
if (copy($origem,$dest)){;

  } else {
   echo directoria sem direitos de escrita br;
   }
 unlink ($origem);
 }

 set_time_limit(60);
 $path2=(dirname($PATH_TRANSLATED)).../primeirapagina/;
 $origem2_name=ppv2.jpg;
 $dest2= $path2.$origem2_name;

 if (($origem2  none)  ($origem2  )){
if (copy($origem2,$dest2)){;

 } else {
   echo directoria sem direitos de escrita br;
   }
 unlink ($origem2);
 }




 }





 ?
 /body
 /html




 and yes i am new to php

 tk





 Marcelo Salvador

 www.sinesdigital.pt





 --
 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] My 2cents on xml/php

2002-11-01 Thread Gerard Samuel
This is not meant to put down the php/xml combo.  Just putting down my 2 
cents from my experience
thus far, into the archive for anyone else looking for info.

I just started getting deep into parsing xml yesterday, and the dust has 
just begun to settle.
Im parsing rss files versions 0.91 - 2.0 just for content.
Before, I was using a class from phpheaven.net, phpsyndication, which 
basically is using regex to scan/grab content from an rss file.
On my PIII 450 dev box running FBSD 4.7, there is a noticeable hit using 
php's xml functions to parse the rss file.

Using siege, http://www.joedog.org/siege/index.shtml, I did some before 
and after tests.
Im experiencing on average a 9-14% drop in number of requests my script 
can handle.
And for some reason, the percentage drop is a bit larger when parsing 
rss 2.0 files.  (Maybe my code).

But I going to accept this, and Im going to keep my new code.
I have plans to use caching in my script at a later date, so its not 
going to be too bad.
So xml may have some advantages, but in my opinion, if you're going to 
use it extensively in your scripts,
consider caching its final destination, because, using php xml functions 
to parse xml is going to add overhead to your script.

Thats my 2 cents...


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



Re: [PHP] getting HTML header from URL

2002-11-01 Thread Jule Slootbeek
well, i got it to read a html file, but the problem is that it reads it 
after it loads it, so it doesn't read the tags, and i'm looking for the 
string in between title and /title
is there a way using fopen()  or something similar to read an html/php 
file before it's loaded?

Jule

On Friday, Nov 1, 2002, at 17:45 US/Eastern, Jule Slootbeek wrote:

i thought fopen() was only for local files, didn't even bother 
looking, but now i think about it..it makes perfect sence to open 
url's as well, thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't 
know where to look.
if there's a function that pulls in an entire page that;s fine too i 
can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] getting HTML header from URL [solved]

2002-11-01 Thread Jule Slootbeek
hmm, figured it out...all of a sudden it did work:
here's the code, it loads a URL and returns the title...
dunno what it would be used for, but it aught we some more about php..
i'll probbly implement it on a link page ir something

Jule

function getTitle($url)
{
	$file = @fopen($url, 'r');

	if(!$file) {
		$rline = Error, contact webmaster;
	} else {
		while (!feof ($file)) {
 			$line = fgets($file);
 			if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
return $rline;
fclose($file);
break;
			}
	}
	fclose($file);
}


On Friday, Nov 1, 2002, at 20:26 US/Eastern, Jule Slootbeek wrote:


well, i got it to read a html file, but the problem is that it reads 
it after it loads it, so it doesn't read the tags, and i'm looking for 
the string in between title and /title
is there a way using fopen()  or something similar to read an html/php 
file before it's loaded?

Jule

On Friday, Nov 1, 2002, at 17:45 US/Eastern, Jule Slootbeek wrote:

i thought fopen() was only for local files, didn't even bother 
looking, but now i think about it..it makes perfect sence to open 
url's as well, thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't 
know where to look.
if there's a function that pulls in an entire page that;s fine too 
i can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




RE: [PHP] getting HTML header from URL

2002-11-01 Thread Brendon G
Can't you just call the contents of the page into a variable and extract
what you need with regular expressions?

Php / Html  makes no difference its all text to fopen..

~
 is there a way using fopen()  or something similar to read an html/php
 file before it's loaded?
~~

I'm not sure what you mean here. How can you read anything with out opening
it first?.

Cheers

Brendon


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




Re: [PHP] getting HTML header from URL [solved]

2002-11-01 Thread Jule Slootbeek
oops didn't catch two little bugs

Jule

function getTitle($url)
{
	$file = @fopen($url, 'r');

	if(!$file) {
		$rline = Error, contact webmaster;
	} else {
		while (!feof ($file)) {
 			$line = fgets($file);
 			if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
//return $rline;
//fclose($file);
break;
			}
	}
	return $rline;
}
	fclose($file);
}

On Friday, Nov 1, 2002, at 20:35 US/Eastern, Jule Slootbeek wrote:


hmm, figured it out...all of a sudden it did work:
here's the code, it loads a URL and returns the title...
dunno what it would be used for, but it aught we some more about php..
i'll probbly implement it on a link page ir something

Jule

function getTitle($url)
{
	$file = @fopen($url, 'r');

	if(!$file) {
		$rline = Error, contact webmaster;
	} else {
		while (!feof ($file)) {
 			$line = fgets($file);
 			if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
return $rline;
fclose($file);
break;
			}
	}
	fclose($file);
}


On Friday, Nov 1, 2002, at 20:26 US/Eastern, Jule Slootbeek wrote:


well, i got it to read a html file, but the problem is that it reads 
it after it loads it, so it doesn't read the tags, and i'm looking 
for the string in between title and /title
is there a way using fopen()  or something similar to read an 
html/php file before it's loaded?

Jule

On Friday, Nov 1, 2002, at 17:45 US/Eastern, Jule Slootbeek wrote:

i thought fopen() was only for local files, didn't even bother 
looking, but now i think about it..it makes perfect sence to open 
url's as well, thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't 
know where to look.
if there's a function that pulls in an entire page that;s fine too 
i can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] Security - Maybe a silly question

2002-11-01 Thread @ Edwin
Hello SED,

SED [EMAIL PROTECTED] wrote:
 Thank you for the reply, what do you mean by sniffing, do you mean
 everbody can monitor our browsing?

I'm not really sure how I can answer your question but let me just put it
this way.

Everybody CAN monitor our browsing but:
1. That doesn't mean everybody WILL.
2. That doesn't mean they'll use sniffing.

Regarding sniffing, I think it'd be better if your research it yourself.

Google for it and use sniffing as your keyword--you'll be surprised with
the results. I'm sure you can find more info there than if I try to explain
it
here.

- E

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




Re: [PHP] Security - Maybe a silly question

2002-11-01 Thread @ Edwin

SED [EMAIL PROTECTED] wrote:
 I'm not very familiar to this stuff, but if I wanna use https:// do
 don't I need a key from Verisign (or similar) to make it work?

Yes and no. If you're going to use it on a production server, yes.
If it's on a test server but you still want to be somehow protected,
then, no--no you don't need a key from Verisign or others.

 If so, who control who is what on the internet?

That's a tricky question. Perhaps, you need to be more specific. But,
I'm afraid the question would be a bit OT...

- E

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




[PHP] Re: getting HTML header from URL [solved]

2002-11-01 Thread David U.
Jule Slootbeek wrote:
 oops didn't catch two little bugs

 Jule

 function getTitle($url)
 {
 $file = fopen($url, 'r');

 if(!$file) {
 $rline = Error, contact webmaster;
 } else {
 while (!feof ($file)) {
   $line = fgets($file);
   if (substr_count(strtoupper($line), TITLE) = 1) {
 $rline = strip_tags($line);
 //return $rline;
 //fclose($file);
 break;
 }
  }
  return $rline;
  }
 fclose($file);
 }

1) What if this line looks like:
htmlheadtitlefoo/title/headbodybar/body/html
Wont' $rline == foobar ?

2) Can't you use a socket and read until the first TITLEstart saving until
the /TITLE and close the socket?

-davidu





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




  1   2   >