Re: [PHP] Why does this happen?

2003-02-09 Thread Ernest E Vogelsinger
At 04:52 09.02.2003, CF High said:
[snip]
In this test form when I submit and insert into my db, only the last select
field get entered; i.e. in this case the day value of 25.

form name=form1 method=post action=

Year
select name=date onSelect=return check_submit()
option selected value=20022002/option
/select

Month
select name=date
option selected value=1212/option
/select

Day
select name=date
option selected value=2525/option
/select

input type=submit name=textfield

/form

Why does this happen?  In Cold Fusion I'm able to refer to the three selects
as #date# and it returns 20021225 as expected.
[snip] 

I don't know much about CF, but in plain HTML as you show here you have 3
different form input (select) fields sharing the same name. Thus the
browser will transmit only one of the three input (select) fields upon
submit (it is undefined which field will be sent, but most browsers will
transmit the last value).

Maybe CF fiddles around with the element names, PHP doesn't. You could e.g.
format the 3 elements to transmit an array, something like this:

form name=form1 method=post action=
Year 
select name=date[Y] onSelect=return check_submit() 
option selected value=20022002/option 
/select
Month 
select name=date[M] 
option selected value=1212/option 
/select
Day 
select name=date[D] 
option selected value=2525/option 
/select
input type=submit name=textfield
/form

In your receiving script you would have an associative array named date
in the $_REQUEST structure:

$date_received = $_REQUEST['date'];
$year = $date_received['Y'];
$month = $date_received['M'];
$day = $date_received['D'];

HTH,


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



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




Re: [PHP] Data Structures

2003-02-09 Thread Ernest E Vogelsinger
At 04:43 09.02.2003, Laborda said:
[snip]
Does anyone know where can I find information about data structures
implemented in PHP. I need to find something about Linked Lists, implemented
in PHP.. If anyone has any info, I'd appreciate it. I've tried to google it
out but I can't find anything. Thanks.
[snip] 

As another poster already pointed out associative arrays may be one way to
go /although there are multiple solutions to linked lists, as in many
languages).

However there is one caveat you absolutely need to observe: in PHP there
are NO POINTERS. Normally assigning variables of any type will create a
copy of the variable. like this:

$a1 = array(1,2,3);
$a2 = $a1;

Here, $a2 is a COPY of $a1:
$a2[3] = 4;
echo join(',',$a1), ' - ', join(',',$a2);

will produce
1,2,3 - 1,2,3,4

OTOH, you may use REFERENCES:
$a2 = $a1;
$a2[3] = 4;
echo join(',',$a1), ' - ', join(',',$a2);
will now produce
1,2,3,4 - 1,2,3,4

This said, using array entries for linked lists, you must absolutely make
sure to always use references, not simple assignments.

Assuming a structure built as PHP array (unfortunately there's no such
thing as a typedef):

$start = array('prev' = null, 'next' = null, 'data' = 'First entry');
$elem  = array('prev' = $start, 'next' = null, 'data' = 'Second
entry');
$start['next'] = $elem;

You get the picture, I believe. Just make sure the pointers are actually
references to the list elements, or everything will break up.

HTH,


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



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




[PHP] Re: Class Interfaces

2003-02-09 Thread rush
Laborda [EMAIL PROTECTED] wrote in message
005201c2cfe9$47c704b0$ad629c40@galaxy">news:005201c2cfe9$47c704b0$ad629c40@galaxy...

 Hello,

 I have a question.. Does PHP have support for Class Interfaces
declaration?
 What in Java would be:

 ? If not, how can I do this?.. Thanks a lot.

Well, interfaces are needed in Java since it is a statically typed language.
For dynamically typed language like php there is no need for it. If you
would like to do it just for the documentation sake, than write abstract
class like:

class pehro_interface {
function a1() {}
function a2() {}
function a3() {}
}


rush
--
http://www.templatetamer.com/




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




php-general Digest 9 Feb 2003 15:07:01 -0000 Issue 1873

2003-02-09 Thread php-general-digest-help

php-general Digest 9 Feb 2003 15:07:01 - Issue 1873

Topics (messages 134933 through 134947):

Class Interfaces
134933 by: Laborda
134940 by: Justin Garrett
134947 by: rush

Re: How to uncompress PHP
134934 by: David T-G

Data Structures
134935 by: Laborda
134938 by: Justin Garrett
134946 by: Ernest E Vogelsinger

Re: Why does this happen?
134936 by: Jason k Larson
134945 by: Ernest E Vogelsinger

how to move database from one server to another
134937 by: Sunfire
134939 by: Kevin Waterson

incromenting $counter in a whloop
134941 by: Sunfire
134942 by: Jason Wong
134943 by: John W. Holmes

multiple file upload, yet again
134944 by: David T-G

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

Hello,

I have a question.. Does PHP have support for Class Interfaces declaration?
What in Java would be:

public interface MyInterface {
final String aString = Str;
final String oString = String;
void aFunction(String inter, double face);
}

? If not, how can I do this?.. Thanks a lot.

Laborda.-


---End Message---
---BeginMessage---
Nope.  You're stuck with straight single inheritance for now.

Justin Garrett

Laborda [EMAIL PROTECTED] wrote in message
005201c2cfe9$47c704b0$ad629c40@galaxy">news:005201c2cfe9$47c704b0$ad629c40@galaxy...

 Hello,

 I have a question.. Does PHP have support for Class Interfaces
declaration?
 What in Java would be:

 public interface MyInterface {
 final String aString = Str;
 final String oString = String;
 void aFunction(String inter, double face);
 }

 ? If not, how can I do this?.. Thanks a lot.

 Laborda.-




---End Message---
---BeginMessage---
Laborda [EMAIL PROTECTED] wrote in message
005201c2cfe9$47c704b0$ad629c40@galaxy">news:005201c2cfe9$47c704b0$ad629c40@galaxy...

 Hello,

 I have a question.. Does PHP have support for Class Interfaces
declaration?
 What in Java would be:

 ? If not, how can I do this?.. Thanks a lot.

Well, interfaces are needed in Java since it is a statically typed language.
For dynamically typed language like php there is no need for it. If you
would like to do it just for the documentation sake, than write abstract
class like:

class pehro_interface {
function a1() {}
function a2() {}
function a3() {}
}


rush
--
http://www.templatetamer.com/




---End Message---
---BeginMessage---
Lin --

...and then ?$BNS?(B ?$B7C72?(B said...
% 
% Hi, I am Lin.

Hello!


% 
% When I execute a command
% 
% gzip -d php-4_3_0_tar.gz
% 
% on the linux. The system show the following error.
% 
% gzip: php-4_3_0_tar.gz: not in gzip format
% 
% How can I uncompress this file.

Sounds like it isn't compressed, no matter what the extension says.  What
does

  file php-4_3_0_tar.gz

tell you?  And what if you just run tar on it, without any z flag?


HTH  HAND

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




msg96295/pgp0.pgp
Description: PGP signature
---End Message---
---BeginMessage---
Hello,

Does anyone know where can I find information about data structures
implemented in PHP. I need to find something about Linked Lists, implemented
in PHP.. If anyone has any info, I'd appreciate it. I've tried to google it
out but I can't find anything. Thanks.

Laborda.-


---End Message---
---BeginMessage---
You'd create a linked list in PHP just like you would in most languages,
however IMHO it's best just to stick with PHP arrays.  They grow dynamically
and are so easy to work with.

There is an ADT extension scheduled for PHP5
http://www.php.net/~sterling/adt/

Justin Garrett

Laborda [EMAIL PROTECTED] wrote in message
007501c2cfed$777f1090$ad629c40@galaxy">news:007501c2cfed$777f1090$ad629c40@galaxy...
 Hello,

 Does anyone know where can I find information about data structures
 implemented in PHP. I need to find something about Linked Lists,
implemented
 in PHP.. If anyone has any info, I'd appreciate it. I've tried to google
it
 out but I can't find anything. Thanks.

 Laborda.-




---End Message---
---BeginMessage---
At 04:43 09.02.2003, Laborda said:
[snip]
Does anyone know where can I find information about data structures
implemented in PHP. I need to find something about Linked Lists, implemented
in PHP.. If anyone has any info, I'd appreciate it. I've tried to google it
out but I can't find anything. Thanks.
[snip] 

As another poster already pointed out 

[PHP] Re: any windows php developers out here?

2003-02-09 Thread rush
It works reliably. I have used Abria Merlin form abria soft to install
apache, php, mysql, and various utils on my machine. It is single install
that installs without problems. The php version inside is a bit dated, but
you can later on easily replace it once everything is connected and working
properly.

rush
--
http://www.templatetamer.com/




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




[PHP] Re: Alternating Row Colors in PHP........

2003-02-09 Thread rush
Cf High [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I'm coming from Cold Fusion to PHP; in CF I could alternate rows with the

Here is an example how to do it with TemplateTamer:

http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=3538

same code can also be used for more sofisticated effects, and finer
formatting.

rush
--
http://www.templatetamer.com/




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




Re: Re: [PHP] incromenting $counter in a whloop

2003-02-09 Thread Sunfire
i got it tnx...
while(whatever){
//record code here
//and echo $counter

$counter++}


- Original Message -
From: Beauford.2002 [EMAIL PROTECTED]
To: Sunfire [EMAIL PROTECTED]
Sent: Sunday, February 09, 2003 2:14 AM
Subject: Spam: Re: [PHP] incromenting $counter in a whloop


 This is one way, or you could use a for loop.

 $counter = 1;

 While (whatever) {

 record code goes here
 echo $counter;
 $counter = $counter + 1;
 }
 - Original Message -
 From: Sunfire [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, February 09, 2003 12:37 AM
 Subject: [PHP] incromenting $counter in a whloop


  hi..
 
  was wondering how you would incroment $counter in a while loop.. i want
to
  print it out next to each record for a record counter on a web page...
 
 
 
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




[PHP] MySQL Username and Passwords

2003-02-09 Thread Stephen Craton
It's me again, trying to get some more help.

My boss is hosting sites now for games and I need some help with setting up
phpMyAdmin privelages for certain MySQL users and such. Right now, my
problem is setting up a new MySQL username and password.

I add a new user in phpMyAdmin, I type in the details, everything is fine.
When I go to test the connection with those connection details, I get this
error: (I copied and pasted the username and password so they are the same
for both the script and when I entered them into phpMyAdmin.)

   Access denied for user: 'd2sector@localhost' (Using password: YES)

My code is as follows:

?php
if(@mysql_connect('localhost', 'd2sector', '**Edited Out**')) {
 header(Location: index.php);
} else {
 echo 'font color=redUnable to connect to database. Error as
follows:/fontbr'.mysql_error();
}
?

Does anyone have a clue as to why this happens and how to fix it? I'll need
to know how to fix this for future users as well. Thanks in advanced.


Thanks,
Stephen Craton
http://www.melchior.us



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




Re: [PHP] MySQL Username and Passwords

2003-02-09 Thread John Nichel
Did you reload MySQL after you added the new user?

Stephen Craton wrote:

It's me again, trying to get some more help.

My boss is hosting sites now for games and I need some help with setting up
phpMyAdmin privelages for certain MySQL users and such. Right now, my
problem is setting up a new MySQL username and password.

I add a new user in phpMyAdmin, I type in the details, everything is fine.
When I go to test the connection with those connection details, I get this
error: (I copied and pasted the username and password so they are the same
for both the script and when I entered them into phpMyAdmin.)

   Access denied for user: 'd2sector@localhost' (Using password: YES)

My code is as follows:

?php
if(@mysql_connect('localhost', 'd2sector', '**Edited Out**')) {
 header(Location: index.php);
} else {
 echo 'font color=redUnable to connect to database. Error as
follows:/fontbr'.mysql_error();
}
?

Does anyone have a clue as to why this happens and how to fix it? I'll need
to know how to fix this for future users as well. Thanks in advanced.


Thanks,
Stephen Craton
http://www.melchior.us






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




Re: [PHP] MySQL Username and Passwords

2003-02-09 Thread Stephen Craton
I'm not sure how except through shell which isn't enabled. Even if I didn't
reload it, why would the username work but the password not?


- Original Message -
From: John Nichel [EMAIL PROTECTED]
To: Stephen Craton [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Sunday, February 09, 2003 12:29 PM
Subject: Re: [PHP] MySQL Username and Passwords


 Did you reload MySQL after you added the new user?

 Stephen Craton wrote:
  It's me again, trying to get some more help.
 
  My boss is hosting sites now for games and I need some help with setting
up
  phpMyAdmin privelages for certain MySQL users and such. Right now, my
  problem is setting up a new MySQL username and password.
 
  I add a new user in phpMyAdmin, I type in the details, everything is
fine.
  When I go to test the connection with those connection details, I get
this
  error: (I copied and pasted the username and password so they are the
same
  for both the script and when I entered them into phpMyAdmin.)
 
 Access denied for user: 'd2sector@localhost' (Using password: YES)
 
  My code is as follows:
 
  ?php
  if(@mysql_connect('localhost', 'd2sector', '**Edited Out**')) {
   header(Location: index.php);
  } else {
   echo 'font color=redUnable to connect to database. Error as
  follows:/fontbr'.mysql_error();
  }
  ?
 
  Does anyone have a clue as to why this happens and how to fix it? I'll
need
  to know how to fix this for future users as well. Thanks in advanced.
 
 
  Thanks,
  Stephen Craton
  http://www.melchior.us
 
 
 


 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com






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




[PHP] Re: jumping between php and html or using echo for printing html-tags.

2003-02-09 Thread Askengren
I do not know why so many developers use the -character (double quote)
instead of ' (single quote) in php/html-scripts.

Much easier is:
function admin_menu() {
   echo B Meny /BBR;
   echo A HREF=' . $_SERVER['PHP_SELF'] . ?action= . MANAGE_MEMBERS
.'Medlemmar/ABR;
.
You do then not have to worry about all backslashes.
And single quote is w3c html-standard just as double quote.
And it?s faster - you do not have to switch between html and php so often.

/Håkan



Anders Thoresson [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Which is more efficient:

 function admin_menu() {
   echo B Meny /BBR;
   echo A HREF=\ . $_SERVER['PHP_SELF'] . ?action= . MANAGE_MEMBERS .
 \Medlemmar/ABR;
   echo A HREF=\ . $_SERVER['PHP_SELF'] . ?action= . MANAGE_ALBUMS .
 \Album/ABR;
   echo A HREF=\ . $_SERVER['PHP_SELF'] . ?action= . INITIAL_PAGE .
 \Huvudmeny/ABR;
   echo A HREF=\ . $_SERVER['PHP_SELF'] . ?action= . LOG_OUT .
 \Logga ut/ABR;
 }

 or

 function admin_menu() {
   ?
   B Meny /BBR
   A HREF=?=$_SERVER['PHP_SELF']??action=?php echo(MANAGE_MEMBERS)
 ;?Medlemmar/ABR
   A HREF=?=$_SERVER['PHP_SELF']??action=?php echo(MANAGE_ALBUMS)
 ;?Album/ABR
   A HREF=?=$_SERVER['PHP_SELF']??action=?php echo(INITIAL_PAGE)
 ;?Huvudmeny/ABR
   A HREF=?=$_SERVER['PHP_SELF']??action=?php echo(LOG_OUT);?Logga
 ut/ABR
   ?php
 }

 Any reasons other than speed to choose either?

 --
 anders thoresson



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




Re: [PHP] Why does this happen?

2003-02-09 Thread CF High
Alright, alright, everyone, I could get away with this in Cold Fusion, but
not in PHP.

The simple example I gave is part of a more complex problem, however.

Here's the deal:

Let's say I have a form that requests the season schedule of a baseball
team, and the team in question has twenty scheduled games all on different
days.

Each form row will have three select elements for the date; i.e. date(x) for
the year, date(x+1) for the month, and date(x+2) for the day, or however
I'll need to make each date select element unique.

Then, in the insert page, I'll need to loop through each date element by
groups of three and create an array for each date set.

Similar to what I had to do in CF, but I could get away with naming each row
of select elements as date(x) for year, date(x) for month, date(x) for day,
etc.


My ideas might be a little primitive here, so feel free to chime in if
you've got a tighter solution

Thanks,

--Noah





John W. Holmes [EMAIL PROTECTED] wrote in message
000a01c2cfdd$5f9c5c40$7c02a8c0@coconut">news:000a01c2cfdd$5f9c5c40$7c02a8c0@coconut...
  Got a problem with I'm sure a simple solution::
 
  In this test form when I submit and insert into my db, only the last
  select
  field get entered; i.e. in this case the day value of 25.
 
  form name=form1 method=post action=
 
  Year
  select name=date onSelect=return check_submit()
  option selected value=20022002/option
  /select
 
  Month
  select name=date
  option selected value=1212/option
  /select
 
  Day
  select name=date
  option selected value=2525/option
  /select
 
  input type=submit name=textfield
 
  /form

 All of your form elements have the same name! What do you expect to
 happen?

 If you have this in PHP:

 $date = 1;
 $date = 2;
 $date = 3;

 What value do you think $date has now??

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/





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




Re: [PHP] Output yyyymmdd formatted date || 20030131 to FridayJanuary 31, 2003

2003-02-09 Thread CF High
Very nice John.

I'm quickly learning the utility of MySql Date and Time objects.

I used to have to write a ten line script to format the date; now, I can use
this:

SELECT DATE_FORMAT(mydate, '%a %M %d, %Y') and I'm done.

Thanks a bunch for your help, John.

I might even write an effiicient application in this lifetime.

--Noah


John W. Holmes [EMAIL PROTECTED] wrote in message
000201c2cfd8$dcc2e180$7c02a8c0@coconut">news:000201c2cfd8$dcc2e180$7c02a8c0@coconut...
 SELECT * FROM table WHERE date BETWEEN 20030201 AND 20030201 + INTERVAL
 7 DAY

 I assume '20030201' will come from PHP eventually, right, or the current
 date?

 For any record between now and 7 days from now:
 SELECT * FROM table WHERE date BETWEEN CURDATE() AND CURDATE() +
 INTERVAL 7 DAY

 For a date from PHP,

 $date = '20030201';

 SELECT * FROM table WHERE date BETWEEN $date AND $date + INTERVAL 7 DAY

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/

  -Original Message-
  From: Noah [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, February 08, 2003 10:20 PM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Output mmdd formatted date || 20030131 to
  FridayJanuary 31, 2003
 
  Right.
 
  I've switched the date column from type INT to type DATE in our MySql
 db.
 
  The problem I've had with retrieving records in a certain date range
 with:
 
  SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207
 
  is getting the latter part of the expression; i.e. in this case
 20030207
  to
  be seven days older than the first part.
 
  This is where I need to use MySql's DATE_ADD, and other date
 manipulation
  functions..
 
  Lots to learn; little time to do it.
 
  Thanks for feedback, John.
 
 
  --Noah
 
 
  - Original Message -
  From: John W. Holmes [EMAIL PROTECTED]
  To: 'Noah' [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Saturday, February 08, 2003 3:31 PM
  Subject: RE: [PHP] Output mmdd formatted date || 20030131 to
  FridayJanuary 31, 2003
 
 
The dates are stored in a MySql db.
   
I checked out the MySql DATE_FORMAT function -- pretty cool.
   
However, pardon my ignorance here, how can I do date comparisons?
   
For example, if I want to retrieve records from the db where the
 date
   is
between say, 2003-02-01 and 2003-02-07, will MySql be able to
 compare
   the
strings?
   
I stored my dates as integer fields to do such a comparison, but
 it
   looks
like I need to graduate to MySql date time functions..
  
   If you've done it correctly and stored your dates in a MySQL DATE,
   DATETIME, or TIMESTAMP column, then you can do something like this:
  
   SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207
  
   If you're storing them in an INT column, then change it over to one
 of
   the above.
  
   Go back to the manual and read about date_sub() and date_add() in
 MySQL
   for further date manipulation...
  
   ---John W. Holmes...
  
   PHP Architect - A monthly magazine for PHP Professionals. Get your
 copy
   today. http://www.phparch.com/
  
  






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




[PHP] Beginners question

2003-02-09 Thread Martin Purdy
Hi everybody

I am totally new to PHP, and I have a problem with the Print statement.
When I send a newline using \n nothing happens.

I cannot get any linebreaks into my code.

The following line is copied from the PHP Manual, and is sopposed to give me
the text split into 3 lines, but they come out as one line.

echo This spans\nmultiple lines. The newlines will be\noutput as
well.;

Can someone please tell me what I am doing wrong?

Martin Purdy



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




Re: [PHP] Beginners question

2003-02-09 Thread Leif K-Brooks
My guess is that the new lines are there, but since you're (most likely)
outputting HTML, you don't see them.  Take at look at the br HTML tag.

Martin Purdy wrote:

Hi everybody

I am totally new to PHP, and I have a problem with the Print statement.
When I send a newline using \n nothing happens.

I cannot get any linebreaks into my code.

The following line is copied from the PHP Manual, and is sopposed to 
give me
the text split into 3 lines, but they come out as one line.

echo This spans\nmultiple lines. The newlines will be\noutput as
well.;

Can someone please tell me what I am doing wrong?

Martin Purdy






--
The above message is encrypted with double rot13 encoding.  Any 
unauthorized attempt to decrypt it will be prosecuted to the full extent 
of the law.





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



[PHP] Files upload

2003-02-09 Thread Max 'AMiGo' Gashkov
Is there any difference between using

   move_uploaded_file(...

or

  if(is_uploaded_file...
  ...
  copy(

(security hazards etc.)?


WBR, Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
Distributed.net participant [408228][RC5-72]


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




RE: [PHP] any windows php developers out here?

2003-02-09 Thread Victor
Kk, I got it to work in apache 2.X on redhat 8.0 all I had to do is
start apache from the directory it resides in and then it work sfine,
but I will try your notes also and get it working on windows too.
Thanks, I'll see if I have more problems...

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 8:58 PM
To: 'Victor'; [EMAIL PROTECTED]
Subject: RE: [PHP] any windows php developers out here?

 So I guess I al looking to finding out what I need to configure IIS to
 to get the ISAPI module to work, etc.

1. Unzip the php .zip file to C:\php\

2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll

3. Ensure the user IIS runs as, generally IUSR_computer_name, has read
permissions to C:\php\ and all subdirectories.

4. Follow directions as in the manual

5. Shut down IIS (net stop iisadmin)

6. Open up IIS control panel

7. Add ISAPI filter pointing to c:\php\php4isapi.dll

8. Add application mapping pointing to c:\php\php4isapi.dll

9. Start up IIS (net start w3svc)

That's it...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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

__ 
Post your free ad now! http://personals.yahoo.ca

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




Re: [PHP] Files upload

2003-02-09 Thread Andrew Brampton
I beleive move_uploaded_file is prefered since copy won't work in Safe Mode.

Andrew
- Original Message - 
From: Max 'AMiGo' Gashkov [EMAIL PROTECTED]
To: PHP General list [EMAIL PROTECTED]
Sent: Sunday, February 09, 2003 6:09 PM
Subject: [PHP] Files upload


 Is there any difference between using
 
move_uploaded_file(...
 
 or
 
   if(is_uploaded_file...
   ...
   copy(
 
 (security hazards etc.)?
 
 
 WBR, Max 'AMiGo' Gashkov
 [EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
 Distributed.net participant [408228][RC5-72]
 
 
 -- 
 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] Object In a class

2003-02-09 Thread Justin Mazzi
Can anyone tell me how to use an object within an object. Example


class blah {
var $test;
var $test2;

function test() {
$this-do();
}

}


then you want to use that class in a new one.


class blah2 {
var $test;
var $test2;

function do() {
$blah = new blah();
}

}

What I want to do is run some mysql queries(mysql class) in a class I
made.



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




[PHP] encoding problems

2003-02-09 Thread adam muller
Hello everybody. I need some help. Please, look at www.vba.sk, you can see a
little encoding problems. It is because the server/php is working in win1250
charset and mysql database in 8859-2. Is there any possibility, how to
convert php to 8859-2 or mysql to win1250. thanx.



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




Re: [PHP] Beginners question

2003-02-09 Thread Martin Purdy
How do you use the output on a webpage then?

Martin




Leif K-Brooks [EMAIL PROTECTED] skrev i en meddelelse
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 My guess is that the new lines are there, but since you're (most likely)
 outputting HTML, you don't see them.  Take at look at the br HTML tag.

 Martin Purdy wrote:

  Hi everybody
  
  I am totally new to PHP, and I have a problem with the Print statement.
  When I send a newline using \n nothing happens.
  
  I cannot get any linebreaks into my code.
  
  The following line is copied from the PHP Manual, and is sopposed to
 give me
  the text split into 3 lines, but they come out as one line.
  
  echo This spans\nmultiple lines. The newlines will be\noutput as
  well.;
  
  Can someone please tell me what I am doing wrong?
  
  Martin Purdy
  
  
  
  
  

 --
 The above message is encrypted with double rot13 encoding.  Any
 unauthorized attempt to decrypt it will be prosecuted to the full extent
 of the law.







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




Re: [PHP] Beginners question

2003-02-09 Thread Paul Roberts
use html br instead of \n 

or 

echo nl2br(This spans\nmultiple lines. The newlines will be\noutput as
well.);

Best Wishes

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: Martin Purdy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 09, 2003 8:16 PM
Subject: Re: [PHP] Beginners question


How do you use the output on a webpage then?

Martin




Leif K-Brooks [EMAIL PROTECTED] skrev i en meddelelse
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 My guess is that the new lines are there, but since you're (most likely)
 outputting HTML, you don't see them.  Take at look at the br HTML tag.

 Martin Purdy wrote:

  Hi everybody
  
  I am totally new to PHP, and I have a problem with the Print statement.
  When I send a newline using \n nothing happens.
  
  I cannot get any linebreaks into my code.
  
  The following line is copied from the PHP Manual, and is sopposed to
 give me
  the text split into 3 lines, but they come out as one line.
  
  echo This spans\nmultiple lines. The newlines will be\noutput as
  well.;
  
  Can someone please tell me what I am doing wrong?
  
  Martin Purdy
  
  
  
  
  

 --
 The above message is encrypted with double rot13 encoding.  Any
 unauthorized attempt to decrypt it will be prosecuted to the full extent
 of the law.







-- 
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: SV: [PHP] Beginners question

2003-02-09 Thread Leif K-Brooks
No, you can output the BR / directly.

echo This spansbr /multiple lines. The newlines will bebr /output as well.;


Martin Purdy wrote:


Thanks for your prompt answer.

I think that sounds very likely, but do I have to break out of PHP, and
send a BR every time I need to send a linefeed?

Martin Purdy

-Oprindelig meddelelse-
Fra: Leif K-Brooks [mailto:[EMAIL PROTECTED]] 
Sendt: 9. februar 2003 19:18
Til: Martin Purdy
Cc: [EMAIL PROTECTED]
Emne: Re: [PHP] Beginners question


My guess is that the new lines are there, but since you're (most likely)
outputting HTML, you don't see them.  Take at look at the br HTML tag.

Martin Purdy wrote:

Hi everybody

I am totally new to PHP, and I have a problem with the Print
statement.  When I send a newline using \n nothing happens.I
cannot get any linebreaks into my code.The following line is
copied from the PHP Manual, and is sopposed to 
give me
the text split into 3 lines, but they come out as one line.

echo This spans\nmultiple lines. The newlines will be\noutput as
well.;

Can someone please tell me what I am doing wrong?

Martin Purdy






 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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




[PHP] PHP and Serach Engines...

2003-02-09 Thread Steven Kallstrom
Hello,

How do search engines react to PHP pages?  If every page of a
site has a .php extension will search engines not react well to that?
If it does, is there a possible way to handle tracking sessions with
php, without being punished by the search engines?

Steve



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




Re: [PHP] PHP and Serach Engines...

2003-02-09 Thread Chris Hayes
At 22:00 9-2-2003, you wrote:

Hello,

How do search engines react to PHP pages?  If every page of a
site has a .php extension will search engines not react well to that?
If it does, is there a possible way to handle tracking sessions with
php, without being punished by the search engines?



it's not that they ignore .php pages, more that they do not see a 
difference between
  domain.org/index.php?page=1
  domain.org/index.php?page=123
  domain.org/index.php?page=129909
  domain.org/index.php?module=boardID=445
so only the 1st page will be indexed.

A common workaround involves the use of Apaches' mod_rewrite,  or an 
error_document trick so the links are:
 domain.org/page/1
and
  domain.org/page/129909

search engines have no problem to see these as different.




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



Re: [PHP] Object In a class

2003-02-09 Thread John Wells
Justin Mazzi said:
 Can anyone tell me how to use an object within an object. Example


 class blah {
   var $test;
   var $test2;

   function test() {
   $this-do();
   }

 }


 then you want to use that class in a new one.


 class blah2 {
   var $test;
   var $test2;

   function do() {
   $blah = new blah();
   }

 }


Well, you could use the blah object you created exclusively in function
do(), or you could create it as a attribute of your class and use it in
your instantiated objects, as:

class blah2 {
var $test;
var $test2;
var $myBlah;

function blah2()
{
$this-myBlah = new blah();
}

function do() {
$this-myBlah-test();
}

}

$myobj = new blah2();

$myobj-do();





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




RE: [PHP] any windows php developers out here?

2003-02-09 Thread Victor
 So I guess I al looking to finding out what I need to configure IIS to
 to get the ISAPI module to work, etc.

1. Unzip the php .zip file to C:\php\

2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll

3. Ensure the user IIS runs as, generally IUSR_computer_name, has read
permissions to C:\php\ and all subdirectories.

4. Follow directions as in the manual

5. Shut down IIS (net stop iisadmin)

6. Open up IIS control panel

7. Add ISAPI filter pointing to c:\php\php4isapi.dll

8. Add application mapping pointing to c:\php\php4isapi.dll

9. Start up IIS (net start w3svc)

That's it...

---John W. Holmes...

You are the best!

Thanks, BTW who is in charge of the PHP installation documentation, I
would like to slap them in the face with these instructions. I know that
IIS setup is not their domain but they are responsible for helping users
use PHP and facilitating that is made by clear documentation, this
documentation here is not perfect, but it's much more in depth and
clearer to the one who doesn't want to go to get a MSCSE degree so that
they know how to get PHP running on IIS...

- Vic

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] Static functions

2003-02-09 Thread Leo Spalteholz
Hi, I'm a bit of a newbie to PHP, I've done some stuff in Java/VB/C++ 
but I'm having a few problems finding info on this issue.

Does PHP support something like static functions in Java?

for example in Java I can write:

public class someClass {
public static void someMethod() {}
}

and then in another file:

import someClass;

public class anotherClass {
someClass.someMethod()
}

Is there some way to access methods of a class without creating an 
object in PHP?
Right now I just include the file (not using a class) and then call 
the function but I would like to have it more seperate.

Thanks,
Leo

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




[PHP] Shopping Cart

2003-02-09 Thread Chris Cook
Hello everybody,

I am interested in designing a site with a shopping cart. I have several 
years of programming experience in php and perl, but I have never made a 
shopping cart.

I was looking into some of the already made shopping carts and was wondering 
what peoples' experiences have been with already made shopping carts. 
Ultimately, I am wondering whether I should code it from scratch or not.

Thanks in advance for any help,
Chris


_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] File upload problem

2003-02-09 Thread Gurhan Ozen
Hi, 
You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
form.. 
See: http://www.php.net/manual/en/features.file-upload.php

Gurhan

On Mon, 2003-06-30 at 15:05, John M wrote:
 Hello,
 
 I have the code below. It's a simple file upload. But it doesn't work.
 Before the line if(isset( $Submit )) is an echo which can I read. But after
 choosing a file and press a submit nothing happens. Why is if(isset(
 $Submit )) always false? Maybe my apache or php config is wrong?
 
 I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
 is c:\tmp\ and upload_max_filesize is 2M in PHP config file.
 
 Thanks!
 
 
 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head
 body
 
 form name=form1 method=post action= enctype=multipart/form-data
 input type=file name=imagefile
 input type=submit name=Submit value=Submit
 
 ?
 echo Before submit br\n;
 if(isset( $Submit ))
 {
 echo After submit br\n;
 
 if ($_FILES['imagefile']['type'] == image/gif){
 copy ($_FILES['imagefile']['tmp_name'],
 files/.$_FILES['imagefile']['name'])
 or die (Could not copy);
 echo Name: .$_FILES['imagefile']['name'].;
}
  else {
 echo ;
 echo Could Not Copy, Wrong Filetype
 (.$_FILES['imagefile']['name'].);
 }
 }
 ?
 /form
 
 /body
 /html
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 




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




Re: [PHP] Static functions

2003-02-09 Thread Chris Hayes
At 22:18 9-2-2003, you wrote:

Hi, I'm a bit of a newbie to PHP, I've done some stuff in Java/VB/C++
but I'm having a few problems finding info on this issue.

Does PHP support something like static functions in Java?

afaik the answer is no, but please do not rely on my pitiful opinion. I 
only use my classes with one single object, just to keep the code cleaner.

See one of the articles on objects, in no particular order:

PHP makers on OOP   http://www.php.net/oop
Lotsotalk   http://www.liquidpulse.net/articles/125
knowledgebase   http://www.faqts.com/knowledge_base/view.phtml/aid/7569
ZEND Using objects to create an application 1 
http://www.zend.com/zend/tut/tutorial-johnson.php
ZEND An Introduction to Classes http://www.zend.com/zend/tut/class-intro.php
ZEND Overusing 
OO   http://www.zend.com/zend/art/mistake1.php#Heading13
Devarticles http://www.devarticles.com/art/1/241 
http://www.devarticles.com/art/1/245
http://www.devarticles.com/art/1/262 
http://www.devarticles.com/art/1/285
Devshed Accessing Databases with Class 
http://www.devshed.com/Server_Side/PHP/Class/
Back to Class 
http://www.devshed.com/Server_Side/PHP/BackToClass
PHPBuilder  Classes and PHP 
http://www.phpbuilder.com/columns/rod19990601.php3
Vamsi: Object Oriented Programming in PHP http://php.vamsi.net/article/3/1
OOP Talk : A slide presentation http://www.sdphp.net/talks/talks/sdphp_class



for example in Java I can write:

public class someClass {
public static void someMethod() {}

 PHP has no public or private methods


import someClass;


public class anotherClass {
someClass.someMethod()
}

Is there some way to access methods of a class without creating an
object in PHP?

afaik you do need to create an object.
You can override a function with class y extends (class) x, see the 
articles for examples


Right now I just include the file (not using a class) and then call
the function but I would like to have it more seperate.





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




[PHP] Re: Static functions

2003-02-09 Thread David Eisenhart
yes, you can call a static method on a class by specifying the class name,
then 2 colons and finally the function name:

classname :: functionname([arg,.])

(of course properties can not be accessed by such methods)

David Eisenhart



Leo Spalteholz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I'm a bit of a newbie to PHP, I've done some stuff in Java/VB/C++
 but I'm having a few problems finding info on this issue.

 Does PHP support something like static functions in Java?

 for example in Java I can write:

 public class someClass {
 public static void someMethod() {}
 }

 and then in another file:

 import someClass;

 public class anotherClass {
 someClass.someMethod()
 }

 Is there some way to access methods of a class without creating an
 object in PHP?
 Right now I just include the file (not using a class) and then call
 the function but I would like to have it more seperate.

 Thanks,
 Leo











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




Re: [PHP] Why does this happen?

2003-02-09 Thread Noah
Hey Ernest.

This looks like the solution I'll need to make my CF interface work in PHP.

I'll check it out.

Thanks!

--Noah


- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: CF High [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, February 09, 2003 6:39 AM
Subject: Re: [PHP] Why does this happen?


 At 04:52 09.02.2003, CF High said:
 [snip]
 In this test form when I submit and insert into my db, only the last
select
 field get entered; i.e. in this case the day value of 25.
 
 form name=form1 method=post action=
 
 Year
 select name=date onSelect=return check_submit()
 option selected value=20022002/option
 /select
 
 Month
 select name=date
 option selected value=1212/option
 /select
 
 Day
 select name=date
 option selected value=2525/option
 /select
 
 input type=submit name=textfield
 
 /form
 
 Why does this happen?  In Cold Fusion I'm able to refer to the three
selects
 as #date# and it returns 20021225 as expected.
 [snip]

 I don't know much about CF, but in plain HTML as you show here you have 3
 different form input (select) fields sharing the same name. Thus the
 browser will transmit only one of the three input (select) fields upon
 submit (it is undefined which field will be sent, but most browsers will
 transmit the last value).

 Maybe CF fiddles around with the element names, PHP doesn't. You could
e.g.
 format the 3 elements to transmit an array, something like this:

 form name=form1 method=post action=
 Year
 select name=date[Y] onSelect=return check_submit()
 option selected value=20022002/option
 /select
 Month
 select name=date[M]
 option selected value=1212/option
 /select
 Day
 select name=date[D]
 option selected value=2525/option
 /select
 input type=submit name=textfield
 /form

 In your receiving script you would have an associative array named date
 in the $_REQUEST structure:

 $date_received = $_REQUEST['date'];
 $year = $date_received['Y'];
 $month = $date_received['M'];
 $day = $date_received['D'];

 HTH,


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




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




Re: [PHP] Re: Static functions

2003-02-09 Thread Chris Hayes
At 22:49 9-2-2003, you wrote:

yes, you can call a static method on a class by specifying the class name,
then 2 colons and finally the function name:

classname :: functionname([arg,.])

(of course properties can not be accessed by such methods)

ah ok, cool


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




Re: [PHP] encoding problems

2003-02-09 Thread Gurhan Ozen
Hi Adam, 
I am not sure if my solution will work for you, because i don't know
anything about your language, so i couldn't be sure of the results of
the test:)
You can get around that program by encoding the html page..
Add this lines between your head tags on the html pages:

meta http-equiv=content-type
content=text/html;charset=windows-1250
meta http-equiv=content-type content=text/html;charset=ISO-8859-2
meta http-equiv=content-language content=SK

And see if it will solve your problem?
Hope this helps...
Gurhan


On Sun, 2003-02-09 at 09:50, adam muller wrote:
 Hello everybody. I need some help. Please, look at www.vba.sk, you can see a
 little encoding problems. It is because the server/php is working in win1250
 charset and mysql database in 8859-2. Is there any possibility, how to
 convert php to 8859-2 or mysql to win1250. thanx.
 
 
 
 -- 
 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] Printing

2003-02-09 Thread Chris Kay

If anyone has got PHP to print to a remote printer please
Could you direct me to some examples or anything that would help me
understand this a bit more .

Thanks in advance

- 
Chris Kay 
Techex Communications 
Website: www.techex.com.au Email: [EMAIL PROTECTED] 
Telephone: 1300 88 111 2 - Fax: 1300 882 221 
-  


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




Re: [PHP] multiple file upload, yet again

2003-02-09 Thread Gurhan Ozen
Hi David, 
I know that there is an php application doing multiple file uploading at
once which is open source..
The application is san franscisco indymedia's news publishing system.
You might wanna download it at: http://tech.sfimc.net/download.php and
scrutinize the source code.. I am very sure their coders will help you
in anyway as well.
I hope this helps..
Gurhan

On Sun, 2003-02-09 at 01:18, David T-G wrote:
 Hi, all --
 
 I realize that this has probably been beaten to death, and I've watched
 with some excitement the recent crop of discussions of multiple file
 uploads, but only to be disappointed.
 
 I've read in detail the archives and seen countless statements that one
 cannot upload multiple files in one selection, requiring instead that you
 have multiple input boxes and then a single submit button if you want.
 I've also see, however, a few mentions of a script or a class that *do*
 allow you to select multiple files in the browse window and make
 reference to hotmail multiple attachment uploads.
 
 Does anyone know how to do this?  I would like for my users to be able to
 select their files in one swell foop, perhaps even all in the directory,
 rather than having to click repeatedly for each file to upload.
 
 I even tried making myself a hotmail account so I could send myself mail
 and try to upload multiple files and then look at the HTML source :-) but
 the server had some problem or other and I couldn't get set up.  Well, I
 didn't really want an account anyway.
 
 
 TIA  HAND
 
 :-D
 -- 
 David T-G  * There is too much animal courage in 
 (play) [EMAIL PROTECTED] * society and not sufficient moral courage.
 (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
 http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
 




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




[PHP] Re: Static functions

2003-02-09 Thread David Eisenhart
you may find the following link interesting
http://www.tek271.com/articles/JavaOrPhp.html

David Eisenhart











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




[PHP] appending file with new line first

2003-02-09 Thread Guru Geek
Hello,

Yep, me again, with yet another php question.
Maybe I'm too tired to see the easy solution...

I open a file and write to it:
   $handle = fopen ($temp_file, 'a');
   fwrite($handle, $original_info);
   fclose ($handle);

Later I want to add to the above file:
   $handle = fopen ($temp_file, 'a');
   fwrite($handle, $new_info);
   fclose ($handle);

Here's what the file now looks like:
original info
original info
original info
original info
new infonew info

I'm trying to achieve:
original info
original info
original info
original info
new info
new info

It writes the very first piece of new info on a new line.  That is
good.  The second piece of new info gets written right at the exact end
of the file.  I've tried fwrite($handle, $new_info\n) but that creates
an error.  So does  fwrite($handle, $new_info\r);

How can I get the new info to go on its own line in the file?

Thanks,
Roger



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




Re: [PHP] File upload problem

2003-02-09 Thread David Rice
Hi John:
Well actually I believe that you don't have to set MAX_FILE_SIZE...(I 
don't)
but you might want make sure that you are not trying to send a file 
larger than the post_max_size directives in php.ini and ensure that 
file_uploads is set to allow http uploads.

On Sunday, February 9, 2003, at 04:56 PM, Gurhan Ozen wrote:

Hi,
You need to specifye the MAX_FILE_SIZE value as a hidden argument to 
the
form..
See: http://www.php.net/manual/en/features.file-upload.php

Gurhan

On Mon, 2003-06-30 at 15:05, John M wrote:
Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But 
after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , 
upload_tmp_dir
is c:\tmp\ and upload_max_filesize is 2M in PHP config file.

Thanks!


html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; 
charset=iso-8859-1
/head
body

form name=form1 method=post action= 
enctype=multipart/form-data
input type=file name=imagefile
input type=submit name=Submit value=Submit

?
echo Before submit br\n;
if(isset( $Submit ))
{
echo After submit br\n;

if ($_FILES['imagefile']['type'] == image/gif){
copy ($_FILES['imagefile']['tmp_name'],
files/.$_FILES['imagefile']['name'])
or die (Could not copy);
echo Name: .$_FILES['imagefile']['name'].;
   }
 else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}
?
/form

/body
/html



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





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




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




RE: [PHP] appending file with new line first

2003-02-09 Thread Chris Kay

fwrite($handle, $new_info\r);

as quoted above would indicate $new_info\n as been a variable..

try

$new_info .= \n;
fwrite($handle, $new_info);

this will add \n to the end of the string before you write it...

hope this helps

- 
Chris Kay 
Techex Communications 
Website: www.techex.com.au Email: [EMAIL PROTECTED] 
Telephone: 1300 88 111 2 - Fax: 1300 882 221 
-  

-Original Message-
From: Guru Geek [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 10 February 2003 9:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] appending file with new line first

Hello,

Yep, me again, with yet another php question.
Maybe I'm too tired to see the easy solution...

I open a file and write to it:
   $handle = fopen ($temp_file, 'a');
   fwrite($handle, $original_info);
   fclose ($handle);

Later I want to add to the above file:
   $handle = fopen ($temp_file, 'a');
   fwrite($handle, $new_info);
   fclose ($handle);

Here's what the file now looks like:
original info
original info
original info
original info
new infonew info

I'm trying to achieve:
original info
original info
original info
original info
new info
new info

It writes the very first piece of new info on a new line.  That is
good.  The second piece of new info gets written right at the exact end
of the file.  I've tried fwrite($handle, $new_info\n) but that creates
an error.  So does  fwrite($handle, $new_info\r);

How can I get the new info to go on its own line in the file?

Thanks,
Roger



-- 
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] Returning to a Previous Page

2003-02-09 Thread Nelson Goforth
In my application I'd like the user to be able to return to a page that 
they have had to leave in order to register or log-in to the 
application. (It's a sort of shopping cart)

The URL contains a couple of items of data in the query string.

I figure there are two options (and let me know about others) - 1. pass 
the URL back in hidden fields, and 2. every time the user visits a 
'product' page, set that page in a session variable - then when they 
are done registering I collect the URL and return to that page (so that 
they don't have to start their search all over again).

Is there an advantage to either solution.  What problems would I have 
in resetting the session variable for each page visited?

==

Additional question on the same topic: No single ENV variable that I 
can find gives me the full URL.  And REQUEST_URI gives me too much 
for use.

i.e.: Let's say the URL is 
http://www.mydomain.com/about/this/thatfile.php?key=42name=zaphod

It seems that to return to this page I need either the full URL or just 
thatfile.php?key=...etc, but REQUEST_URI gives me 
/about/this/thatfile?key=etc

So, I can concatenate HOST and URI variables to get what I want, but am 
I missing something here?

I am running sessions in this application.

Thank you for any assistance,
Nelson


Nelson Goforth   
http://www.goforthstudio.com
 Computer Database Programming: Perl, PHP, SQL, VBA


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



Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Chris Hayes
At 23:09 9-2-2003, you wrote:

you may find the following link interesting
http://www.tek271.com/articles/JavaOrPhp.html

David Eisenhart

I cannot suppress the feeling that someone out there has a slight prejudice 
in favour of Java!




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



Re: [PHP] MySQL Username and Passwords

2003-02-09 Thread Thomas Seifert
phpMyAdmin has an option to reload mysql too.
It won't work until that is done.

Where did you get the idea, that the username worked?
It just tells, that access has been denied ... the same message
would be sent if the user didn't exist at all!


Thomas


On Sun, 9 Feb 2003 12:40:12 -0500 [EMAIL PROTECTED] (Stephen Craton) wrote:

 I'm not sure how except through shell which isn't enabled. Even if I didn't
 reload it, why would the username work but the password not?
 
 
 - Original Message -
 From: John Nichel [EMAIL PROTECTED]
 To: Stephen Craton [EMAIL PROTECTED]
 Cc: PHP List [EMAIL PROTECTED]
 Sent: Sunday, February 09, 2003 12:29 PM
 Subject: Re: [PHP] MySQL Username and Passwords
 
 
  Did you reload MySQL after you added the new user?
 
  Stephen Craton wrote:
   It's me again, trying to get some more help.
  
   My boss is hosting sites now for games and I need some help with setting
 up
   phpMyAdmin privelages for certain MySQL users and such. Right now, my
   problem is setting up a new MySQL username and password.
  
   I add a new user in phpMyAdmin, I type in the details, everything is
 fine.
   When I go to test the connection with those connection details, I get
 this
   error: (I copied and pasted the username and password so they are the
 same
   for both the script and when I entered them into phpMyAdmin.)
  
  Access denied for user: 'd2sector@localhost' (Using password: YES)
  
   My code is as follows:
  
   ?php
   if(@mysql_connect('localhost', 'd2sector', '**Edited Out**')) {
header(Location: index.php);
   } else {
echo 'font color=redUnable to connect to database. Error as
   follows:/fontbr'.mysql_error();
   }
   ?
  
   Does anyone have a clue as to why this happens and how to fix it? I'll
 need
   to know how to fix this for future users as well. Thanks in advanced.
  
  
   Thanks,
   Stephen Craton
   http://www.melchior.us
  
  
  
 
 
  --
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com
 
 
 
 
 


-- 
Thomas Seifert

mailto:[EMAIL PROTECTED]
http://www.MyPhorum.de 

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




[PHP] Re: any windows php developers out here?

2003-02-09 Thread Lee W

Victor [EMAIL PROTECTED] wrote in message
01c2cfc7$b6ecd0d0$237b7018@JUMPY">news:01c2cfc7$b6ecd0d0$237b7018@JUMPY...
 Hello, I am wondering if any of you got a reliable php and MySQL
 installation (MySQL is easy) I am mostly wondering if there is a point
 in tying to use windows as a development platform for PHP. I have a nice
 and working red hat 8.0 installation, but I did an upgrade from 7.3 and
 now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X
 and all I want is to erase the old apache and use the new one or erase
 the new one and use the old one, whichever works. But anyway... I also
 do design and I have people submit me illustrator and Photoshop files
 and word docs, so for now I might have to stick to windows for work. BUT
 what do u suggest? I it futile to try to get php to work in windows?
 With IIS preferably so that I can play with ASP and Cold Fusion once in
 a while. Please help if you are using windows with php and send me some
 instructions if you feel like it, much appreciated.

 - Vic

 __
 Post your free ad now! http://personals.yahoo.ca

Vic,

I currently have PHP working both on IIS  Apache with Windows 2000.

My personal recommendation to you would be to install Apache on Windows with
the relevent PHP download, remember that certain features of PHP won't work
though a CGI executable with I believe is still the only stable way of
running PHP though IIS.

I normally have IIS running on a port other than 80 which allows me0 to have
both the IIS and Apache available simultaniously.

Hope some of this helps.

Regards

Lee



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




[PHP] Re: html tags

2003-02-09 Thread Lee W

Erich C. Beyrent [EMAIL PROTECTED] wrote in message
008d01c2cfa3$fc752630$0a64a8c0@wolf">news:008d01c2cfa3$fc752630$0a64a8c0@wolf...
 Hi everyone,

 A quick question about html tags and PHP.  I have a text area where users
 can submit text, and I need them to able to have links in the text if they
 so choose.

 The contents get written to an ini style flat file database.


Is there any particular reason why you are using ini-style files.  IMHO they
are not very good for storing information that could potentially store
multi-line content.  I don't recall any programs using multi-line content
back in the win-3.1 days.

You wish to try using some other form of delimiter (or if available a
database).  For example.

Using ** to seperate records and -- to indicate that start and end of
the text data, e.g.

month:day:year:time:bands:venue
--
Event description, line 1

Event description, line 2
--
**
month:day:year:time:bands:venue
--
Event description, line 1

Event description, line 2
--
**
month:day:year:time:bands:venue
--
Event description, line 1

Event description, line 2
--

This is only a simple example, but may solve your problem.  The only issues
with doing this that I can see is that it would require a lot more work of
the programmer but should not be to difficult to implement.

Regards

Lee



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




Re: [PHP] MySQL Username and Passwords

2003-02-09 Thread Stephen Craton
You see, I ran a sample script. I typed in the username and passwords to
connect. It fails if I have a password entered. If I leave it blank, it
works...


- Original Message -
From: Thomas Seifert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 09, 2003 5:24 PM
Subject: Re: [PHP] MySQL Username and Passwords


 phpMyAdmin has an option to reload mysql too.
 It won't work until that is done.

 Where did you get the idea, that the username worked?
 It just tells, that access has been denied ... the same message
 would be sent if the user didn't exist at all!


 Thomas


 On Sun, 9 Feb 2003 12:40:12 -0500 [EMAIL PROTECTED] (Stephen Craton)
wrote:

  I'm not sure how except through shell which isn't enabled. Even if I
didn't
  reload it, why would the username work but the password not?
 
 
  - Original Message -
  From: John Nichel [EMAIL PROTECTED]
  To: Stephen Craton [EMAIL PROTECTED]
  Cc: PHP List [EMAIL PROTECTED]
  Sent: Sunday, February 09, 2003 12:29 PM
  Subject: Re: [PHP] MySQL Username and Passwords
 
 
   Did you reload MySQL after you added the new user?
  
   Stephen Craton wrote:
It's me again, trying to get some more help.
   
My boss is hosting sites now for games and I need some help with
setting
  up
phpMyAdmin privelages for certain MySQL users and such. Right now,
my
problem is setting up a new MySQL username and password.
   
I add a new user in phpMyAdmin, I type in the details, everything is
  fine.
When I go to test the connection with those connection details, I
get
  this
error: (I copied and pasted the username and password so they are
the
  same
for both the script and when I entered them into phpMyAdmin.)
   
   Access denied for user: 'd2sector@localhost' (Using password:
YES)
   
My code is as follows:
   
?php
if(@mysql_connect('localhost', 'd2sector', '**Edited Out**')) {
 header(Location: index.php);
} else {
 echo 'font color=redUnable to connect to database. Error as
follows:/fontbr'.mysql_error();
}
?
   
Does anyone have a clue as to why this happens and how to fix it?
I'll
  need
to know how to fix this for future users as well. Thanks in
advanced.
   
   
Thanks,
Stephen Craton
http://www.melchior.us
   
   
   
  
  
   --
   By-Tor.com
   It's all about the Rush
   http://www.by-tor.com
  
  
  
 
 


 --
 Thomas Seifert

 mailto:[EMAIL PROTECTED]
 http://www.MyPhorum.de

 --
 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: Static functions

2003-02-09 Thread Leo Spalteholz
ah!  thank you very much.  Thats exactly what I was looking for.

Leo

On February 9, 2003 01:49 pm, David Eisenhart wrote:
 yes, you can call a static method on a class by specifying the
 class name, then 2 colons and finally the function name:

 classname :: functionname([arg,.])

 (of course properties can not be accessed by such methods)

 David Eisenhart



 Leo Spalteholz [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  Hi, I'm a bit of a newbie to PHP, I've done some stuff in
  Java/VB/C++ but I'm having a few problems finding info on this
  issue.
 
  Does PHP support something like static functions in Java?
 
  for example in Java I can write:
 
  public class someClass {
  public static void someMethod() {}
  }
 
  and then in another file:
 
  import someClass;
 
  public class anotherClass {
  someClass.someMethod()
  }
 
  Is there some way to access methods of a class without creating
  an object in PHP?
  Right now I just include the file (not using a class) and then
  call the function but I would like to have it more seperate.
 
  Thanks,
  Leo


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




[PHP] imap_open

2003-02-09 Thread Bartosz Matosiuk
hi

i'm using imap_open for opennig mailbox on the server where the script
is and everything is ok. I want also to open my mailbox on the other server
but script is behaving in a strange way. I looks like it's unable to open
that account but it is not giving me any error message.

I not sure but maybe this funcction can't be used in opening mailbox
which is on the other server than script and if so that what should I do to
open that account?

Have anyone got any suggestions???

thanks
bartek matosiuk



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




[PHP] Drop in replacement for session_decode() ?

2003-02-09 Thread Uchendu Nwachukwu
I was wondering if anyone knew of a drop-in replacement function for
session_decode(). I am having problems with the session_decode() function
populating the $_SESSION array with bogus or corrupt entries. I'm using PHP
4.3.0.

Thanks in advance.

Uchendu Nwachukwu
www.unnndunn.com



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




Re: [PHP] Re: Static functions

2003-02-09 Thread Leo Spalteholz
very interesting link.  While some of the cases where he takes java to 
be the winner are simply personal preference, I do agree with most of 
his conclusions.
Best points are the one about declaring variables(3), declaring 
constants(6), using libraries(7), class member scope(17), and 
exception handling(20).  Ok thats my (very unrealistic) wishlist for 
PHP :)

leo

On February 9, 2003 02:09 pm, David Eisenhart wrote:
 you may find the following link interesting
 http://www.tek271.com/articles/JavaOrPhp.html

 David Eisenhart


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Joshua Moore-Oliva
The only thing I do wish is that there was a way to force php into a typecast 
mode...  and possibly a setting to reqiure a definition for a variable.

Josh.

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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread David Eisenhart
yeh, I'd agree with this; on your second issue of variable definitions I do
find that being able set the error reporting level to show non critical
errors (such as undefined variables) to be a reasonable, although non ideal,
compromise; php's still a great language to work with most respects though
...

David Eisenhart

Joshua Moore-Oliva [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The only thing I do wish is that there was a way to force php into a
typecast
 mode...  and possibly a setting to reqiure a definition for a variable.

 Josh.



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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread David Eisenhart

Chris Hayes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 23:09 9-2-2003, you wrote:
 you may find the following link interesting
 http://www.tek271.com/articles/JavaOrPhp.html
 
 David Eisenhart
 I cannot suppress the feeling that someone out there has a slight
prejudice
 in favour of Java!


'horses for courses' as they say; php is in my case the best fit for my
particular set of needs and circumstances (one big, big advantage being its
MySQL functions and also the ready accessibility of great template libraries
like Smarty)

david











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




Re: [PHP] Re: Static functions

2003-02-09 Thread David Eisenhart
pleasure Leo, happy php'ing !!


Leo Spalteholz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ah!  thank you very much.  Thats exactly what I was looking for.

 Leo

 On February 9, 2003 01:49 pm, David Eisenhart wrote:
  yes, you can call a static method on a class by specifying the
  class name, then 2 colons and finally the function name:
 
  classname :: functionname([arg,.])
 
  (of course properties can not be accessed by such methods)
 
  David Eisenhart
 
 
 
  Leo Spalteholz [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
   Hi, I'm a bit of a newbie to PHP, I've done some stuff in
   Java/VB/C++ but I'm having a few problems finding info on this
   issue.
  
   Does PHP support something like static functions in Java?
  
   for example in Java I can write:
  
   public class someClass {
   public static void someMethod() {}
   }
  
   and then in another file:
  
   import someClass;
  
   public class anotherClass {
   someClass.someMethod()
   }
  
   Is there some way to access methods of a class without creating
   an object in PHP?
   Right now I just include the file (not using a class) and then
   call the function but I would like to have it more seperate.
  
   Thanks,
   Leo




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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Robert Cummings
Chris Hayes wrote:
 
 At 23:09 9-2-2003, you wrote:
 you may find the following link interesting
 http://www.tek271.com/articles/JavaOrPhp.html
 
 David Eisenhart
 I cannot suppress the feeling that someone out there has a slight prejudice
 in favour of Java!

God yes, the guy seems to think that OOP is the do all end all style of coding...
personally I like to hybrid OOP and prcoedural concepts which you can't do in
Java. Also lots of other issues that he doesn't take into consideration such
as the task at hand and the appropriateness of one solution over another for
that task.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




Re: [PHP] multiple file upload, yet again

2003-02-09 Thread David T-G
Gurhan, et al --

...and then Gurhan Ozen said...
% 
% Hi David, 

Hi!


% I know that there is an php application doing multiple file uploading at
% once which is open source..

Cool!


% The application is san franscisco indymedia's news publishing system.
% You might wanna download it at: http://tech.sfimc.net/download.php and

Hmmm...  I haven't yet been able to download it, but I was pointed to a
live page (tech.indymedia.org/publish.php3) only to find that it has
multiple boxes for multiple files, which I can already do.  Nothing that
allows multiple files with shift-clicking or the like...

If only hotmail would let me sign up!  grr...  Then i could see if it
really does it and how...


% scrutinize the source code.. I am very sure their coders will help you
% in anyway as well.

Heh.  I haven't found any yet, though the #tech channel has been very
nice about being unhelpful.


% I hope this helps..
% Gurhan


Thanks anyway  HAND

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




msg96348/pgp0.pgp
Description: PGP signature


Re: [PHP] File upload problem

2003-02-09 Thread Jason Wong
On Monday 10 February 2003 05:56, Gurhan Ozen wrote:

 You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
 form..
 See: http://www.php.net/manual/en/features.file-upload.php

You don't. 

If you can show otherwise please post details to the list.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
To keep your friends treat them kindly; to kill them, treat them often.
*/


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Joshua Moore-Oliva
How would I go about setting the error reporting level?

Josh.

On February 9, 2003 06:38 pm, David Eisenhart wrote:
 yeh, I'd agree with this; on your second issue of variable definitions I do
 find that being able set the error reporting level to show non critical
 errors (such as undefined variables) to be a reasonable, although non
 ideal, compromise; php's still a great language to work with most respects
 though ...

 David Eisenhart

 Joshua Moore-Oliva [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  The only thing I do wish is that there was a way to force php into a

 typecast

  mode...  and possibly a setting to reqiure a definition for a variable.
 
  Josh.


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




Re: [PHP] multiple file upload, yet again

2003-02-09 Thread Jason Wong
On Monday 10 February 2003 08:36, David T-G wrote:

 Hmmm...  I haven't yet been able to download it, but I was pointed to a
 live page (tech.indymedia.org/publish.php3) only to find that it has
 multiple boxes for multiple files, which I can already do.  Nothing that
 allows multiple files with shift-clicking or the like...

 If only hotmail would let me sign up!  grr...  Then i could see if it
 really does it and how...


 % scrutinize the source code.. I am very sure their coders will help you
 % in anyway as well.

You probably already know this -- HTML does not allow for the type of multiple 
uploads that you seek. Any solutions out there will be based on 
'non-standard' technology -- javascript, java or some activex control.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I'm pretending I'm pulling in a TROUT!  Am I doing it correctly??
*/


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Jason Wong
On Monday 10 February 2003 08:45, Joshua Moore-Oliva wrote:
 How would I go about setting the error reporting level?

google  'php error reporting level'

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Extreme feminine beauty is always disturbing.
-- Spock, The Cloud Minders, stardate 5818.4
*/


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




[PHP] Testing..

2003-02-09 Thread Troy May
Just a quick test.  I just re-signed up for this list after a 3 week
vacation and I haven't seen even one message yet.  So, reply if you get it
please so I know this is working.

Thanks,
Troy


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




Re: [PHP] Testing..

2003-02-09 Thread Paul Marinas
working :)

On Sun, 9 Feb 2003, Troy May wrote:

 Just a quick test.  I just re-signed up for this list after a 3 week
 vacation and I haven't seen even one message yet.  So, reply if you get it
 please so I know this is working.

 Thanks,
 Troy


 --
 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] Mysql Select

2003-02-09 Thread andraskende
Hello,

Can anyone help me with this simple query:

I want to limit to 1 the same names returned from the query like:



FROM:

SELECT gallery.design FROM gallery

buffet
buffet
buffet
buffet
barstools
barstools
barstools
barstools
barstools
barstools
barstools
barstools
tables
tables
tables



TO:

SELECT gallery.design FROM gallery ??

buffet
barstools
tables


THANKS !!

Andras Kende
[EMAIL PROTECTED]




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




[PHP] Re: Mysql Select

2003-02-09 Thread andraskende
 Hello,

 Can anyone help me with this simple query:

 I want to limit to 1 the same names returned from the query like:

 

 FROM:

 SELECT gallery.design FROM gallery

 buffet
 buffet
 buffet
 buffet
 barstools
 barstools
 barstools
 barstools
 barstools
 barstools
 barstools
 barstools
 tables
 tables
 tables

 

 TO:

 SELECT gallery.design FROM gallery ??

 buffet
 barstools
 tables


 THANKS !!

 Andras Kende
 [EMAIL PROTECTED]




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




Re: [PHP] Mysql Select

2003-02-09 Thread Nicola Delbono

SELECT DISTINCT(gallery.design)  FROM gallery 

:

I want to limit to 1 the same names returned from the query like:
[CUT]



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




[PHP] Trouble with resizing image!!

2003-02-09 Thread Geckodeep
I am having trouble in resizing the image. What I am trying to do is letting
people upload images of any dimension, and with the aid of my script after
having uploaded, it renames the file, from this new file I'll get the size
and resize it to predefined format 360x240 or 240x360 and this is the normal
presentation image (image1_big). From this image I am getting a thumb nail
format of 104x70 or 70x104 ( image1_thumb ).

When I run the script the whole page is filled with characters, I know the
first part of the script upload is working as I can see the file on the
server. The script resizing apparently is not functioning.

I ve checked the Php config at my service provider with the aid of Phpinfo()
and I can see the GD version 2.0 or higher enabled, so that question is
cleared.

I am pretty sure the error is from my sloppy code.



I'd appreciate if some one could look into my code and see where the bug is.



?php // image_pro.php

$uploaddir='../images/repor_images/'; // Uploaded images directory on the
server

$n_image1 = $_FILES['image1']['name'];// New file before renaming it.



if // Image1

(move_uploaded_file($_FILES['image1']['tmp_name'],
$uploaddir.$n_image1)) {

rename($uploaddir .$n_image1, $uploaddir.time().$n_image1); //
Renames the file in the server.

 $size = GetImageSize($uploaddir.time().$n_image1);

 $width = $size[0];

 $height = $size[1];

 if ($heigth$width){

 $newwidth = '360';

 $newheight = '240';

 header (Content-type: image/jpeg);

 $src = imagecreatefromjpeg($uploaddir.time().$n_image1);

 $image1_big = imagecreate($newwidth,$newheight);


imagecopyresized($image1_big,$src,0,0,0,0,$newwidth,$newheight,$width,$heigh
t);

 imagejpeg($image1_big); // New normal sized image

 imagedestroy($src);// deletes the initial image

 $size_big = GetImageSize($uploaddir.$image1_big);

 $width_big = $size[0];

 $height_big = $size[1];

 $newwidth_thumb = '104';

 $newheight_thumb = '70';

 $src_thumb = imagecreatefromjpeg($uploaddir.$image1_big);

 $image1_thumb = imagecreate($newwidth_thumb,$newheight_thumb);


imagecopyresized($image1_thumb,$src_thumb,0,0,0,0,$newwidth_thumb,$newheight
_thumb,$width_big,$heigh
t_big);

 imagejpeg(tn_.$image1_thumb); // New thumbnail

 }

 elseif ($heigth$width){

 $newwidth = '360';

 $newheight = '240';

 header (Content-type: image/jpeg);

 $src = imagecreatefromjpeg($uploaddir.time().$n_image1);

 $image1_big = imagecreate($newwidth,$newheight);


imagecopyresized($image1_big,$src,0,0,0,0,$newwidth,$newheight,$width,$heigh
t);

 imagejpeg($image1_big); // New normal sized image

 imagedestroy($src);// deletes the initial image

 $size_big = GetImageSize($uploaddir.$image1_big);

 $width_big = $size[0];

 $height_big = $size[1];

 $newwidth_thumb = '70';

 $newheight_thumb = '104';

 $src_thumb = imagecreatefromjpeg($uploaddir.$image1_big);

 $image1_thumb = imagecreate($newwidth_thumb,$newheight_thumb);


imagecopyresized($image1_thumb,$src_thumb,0,0,0,0,$newwidth_thumb,$newheight
_thumb,$width_big,$heigh
t_big);

 imagejpeg(tn_.$image1_thumb); // New thumbnail

 }

print $image1_big. File transfered. br\n;

print $image1_thumb. File transfered. br\n;

$image1_big_url = time().$image1_big;// Sets the name of the
file to be Copied into the database.

$image1_thumb_url = time().tn_.$image1_thumb;// Sets the name
of the file to be Copied into the database.

}

else {

print File failed to transfer!\n;

$image1_url = ;

exit();

}

?


Thanks in advance for the time and humble helping hand.



GD



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




[PHP] Controlling browser windows with php?

2003-02-09 Thread Geoff Lists
Hi,
I'm relatively new to php and neither of the books I am using for 
reference mention anything about controlling a child window.

What is the correct syntax to:
open window( width, height, menu, scrollbars)  and position it on the 
screen?

Any help would be gratefully and humbly accepted I need to know how to 
do this now!
OR
How to call an existing javascript to do it for me.

Thank you.
Heff.


--
Geoff Hill
Information Technology Training  Solutions
A.B.N. 28 712 665 728

P.O. Box 7156
Lismore Heights, NSW, 2480.

Ph:  02 6688 6381


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



php-general Digest 10 Feb 2003 06:30:22 -0000 Issue 1874

2003-02-09 Thread php-general-digest-help

php-general Digest 10 Feb 2003 06:30:22 - Issue 1874

Topics (messages 134948 through 135013):

Re: any windows php developers out here?
134948 by: rush
134960 by: Victor
134972 by: Victor
134990 by: Lee W

Re: Alternating Row Colors in PHP
134949 by: rush

Re: incromenting $counter in a whloop
134950 by: Sunfire

MySQL Username and Passwords
134951 by: Stephen Craton
134952 by: John Nichel
134953 by: Stephen Craton
134989 by: Thomas Seifert
134992 by: Stephen Craton

Re: jumping between php and html or using echo for printing html-tags.
134954 by: Askengren

Re: Why does this happen?
134955 by: CF High
134978 by: CF High

Re: Output mmdd formatted date || 20030131 to FridayJanuary 31, 2003
134956 by: CF High

Beginners question
134957 by: Martin Purdy
134958 by: Leif K-Brooks
134966 by: Martin Purdy
134967 by: Paul Roberts
134968 by: Leif K-Brooks

Files upload
134959 by: Max 'AMiGo' Gashkov
134962 by: Andrew Brampton

Confirmation e-mail
134961 by: Davy Obdam

Object In a class
134963 by: Justin Mazzi
134971 by: John Wells

encoding problems
134964 by: adam muller
134980 by: Gurhan Ozen

Re: [PHP-DB] Confirmation e-mail
134965 by: Ruprecht Helms

PHP and Serach Engines...
134969 by: Steven Kallstrom
134970 by: Chris Hayes

Static functions
134973 by: Leo Spalteholz
134976 by: Chris Hayes
134977 by: David Eisenhart
134979 by: Chris Hayes
134983 by: David Eisenhart
134993 by: Leo Spalteholz
134996 by: Leo Spalteholz
135000 by: David Eisenhart

Shopping Cart
134974 by: Chris Cook

Re: File upload problem
134975 by: Gurhan Ozen
134985 by: David Rice
135003 by: Jason Wong

Printing
134981 by: Chris Kay

Re: multiple file upload, yet again
134982 by: Gurhan Ozen
135002 by: David T-G
135005 by: Jason Wong

appending file with new line first
134984 by: Guru Geek
134986 by: Chris Kay

Returning to a Previous Page
134987 by: Nelson Goforth

Re: Static functions (java/php)
134988 by: Chris Hayes
134997 by: Joshua Moore-Oliva
134998 by: David Eisenhart
134999 by: David Eisenhart
135001 by: Robert Cummings
135004 by: Joshua Moore-Oliva
135006 by: Jason Wong

Re: html tags
134991 by: Lee W

imap_open
134994 by: Bartosz Matosiuk

Drop in replacement for session_decode() ?
134995 by: Uchendu Nwachukwu

Testing..
135007 by: Troy May
135008 by: Paul Marinas

Mysql Select
135009 by: andraskende.kende.com
135010 by: andraskende.kende.com
135011 by: Nicola Delbono

Trouble with resizing image!!
135012 by: Geckodeep

Controlling browser windows with php?
135013 by: Geoff Lists

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---
It works reliably. I have used Abria Merlin form abria soft to install
apache, php, mysql, and various utils on my machine. It is single install
that installs without problems. The php version inside is a bit dated, but
you can later on easily replace it once everything is connected and working
properly.

rush
--
http://www.templatetamer.com/




---End Message---
---BeginMessage---
Kk, I got it to work in apache 2.X on redhat 8.0 all I had to do is
start apache from the directory it resides in and then it work sfine,
but I will try your notes also and get it working on windows too.
Thanks, I'll see if I have more problems...

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 8:58 PM
To: 'Victor'; [EMAIL PROTECTED]
Subject: RE: [PHP] any windows php developers out here?

 So I guess I al looking to finding out what I need to configure IIS to
 to get the ISAPI module to work, etc.

1. Unzip the php .zip file to C:\php\

2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll

3. Ensure the user IIS runs as, generally IUSR_computer_name, has read
permissions to C:\php\ and all subdirectories.

4. Follow directions as in the manual

5. Shut down IIS (net stop iisadmin)

6. Open up IIS control panel

7. Add ISAPI filter pointing to c:\php\php4isapi.dll

8. Add application mapping pointing to c:\php\php4isapi.dll

9. Start up IIS (net start w3svc)

That's it...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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

RE: [PHP] Controlling browser windows with php?

2003-02-09 Thread Warren Vail
Since PHP executes server side and not in the browser, you may want to
resort to something that runs in the browser, like Javascript, which PHP can
output as part of the html it feeds to the browser.

check out http://www.hotscripts.com/ for lots of handy examples of how
Javascript opens an additional window on the browser, note that the URL for
the new window can point to another PHP (server side) script to fill it with
information.

You might want to check out the PHP section as well, there are lots of
useful routines there.

Warren Vail
[EMAIL PROTECTED]


-Original Message-
From: Geoff Lists [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 09, 2003 10:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Controlling browser windows with php?


Hi,
I'm relatively new to php and neither of the books I am using for
reference mention anything about controlling a child window.

What is the correct syntax to:
open window( width, height, menu, scrollbars)  and position it on the
screen?

Any help would be gratefully and humbly accepted I need to know how to
do this now!
OR
How to call an existing javascript to do it for me.

Thank you.
Heff.


--
Geoff Hill
Information Technology Training  Solutions
A.B.N. 28 712 665 728

P.O. Box 7156
Lismore Heights, NSW, 2480.

Ph:  02 6688 6381


--
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] Controlling browser windows with php?

2003-02-09 Thread Davy Obdam
Hi Geoff,

You cant do this with php... you will have to use JavaScript for opening 
a new window. You could write the function in the html of your page.. or 
use echo script type=\text/javascript\ language=\javascript\!-- 
your code //--/script and call this function in your links, in your 
php script.

Best regards,

Davy Obdam

Geoff Lists wrote:

Hi,
I'm relatively new to php and neither of the books I am using for 
reference mention anything about controlling a child window.

What is the correct syntax to:
open window( width, height, menu, scrollbars)  and position it on the 
screen?

Any help would be gratefully and humbly accepted I need to know how to 
do this now!
OR
How to call an existing javascript to do it for me.

Thank you.
Heff.


--
Geoff Hill
Information Technology Training  Solutions
A.B.N. 28 712 665 728

P.O. Box 7156
Lismore Heights, NSW, 2480.

Ph:  02 6688 6381



--

Davy Obdam - Obdam webdesign©
mailto:[EMAIL PROTECTED]   web: www.davyobdam.com





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




[PHP] text on image

2003-02-09 Thread Ilya Nemihin
I try to place text on image, but have color problems.

code:
$im = imagecreatefromjpeg( 'test.jpg' );
$white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 0, 20, $white, './fonts/times.ttf', 'text text
text' );
ImageJpeg( $im, 'test_out.jpg' );

i.e. I want to have 'white' text, but text absolutely not rgb(255,255,255),
image truecolor.

I must use imagecreatetruecolor? but how...?

Ilya



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




[PHP] Confirmation e-mail

2003-02-09 Thread Davy Obdam
Hello people.,

I am developing a website with a user login system, i would like to send 
an confirmation e-mail to the user when he/she registers for the site, 
asking for confirmation...for instance click on a link to activate thier 
account.
My question is what would be the best approach to achieve this? How is 
this usualy done? Any thoughts and help is appreciated.

Best regards,

Davy Obdam

--

Davy Obdam - Obdam webdesign©
mailto:[EMAIL PROTECTED]   web: www.davyobdam.com





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



[PHP] RE: [PHP-DB] Confirmation e-mail

2003-02-09 Thread Ruprecht Helms
Hi  Davy Obdam,

[...]
 My question is what would be the best approach to achieve this? How is 
 this usualy done? 

Storing the password in encrypted form in a database. The confirmationmail
you can write with the normal mailcommand using addslashes. The securest way
if the password was randomly generated is to presend the resultpage via a
ssl-connection and without sending a mail or the mail must be protected.
So a hacker can't sniff the password.

Regards,
Ruprecht

--
Ruprecht Helms IT-Service und Softwareentwicklung

Tel/Fax.:  +49[0]7621 16 99 16
Homepage:  http://www.rheyn.de
email:  [EMAIL PROTECTED]
--

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