Re: [PHP][PEAR] PEAR::DB_Common::nextId()

2004-01-15 Thread Rory McKinley
On 14 Jan 2004 at 18:12, Alessandro Vitale wrote:

 I would like to get the last insert id... anyone has some experience in
 using the PEAR::DB_Common::nextId() ?
 
 any suggestion would be very much appreciated.
 
 alessandro
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
Hi Alessandro

Will mysql_insert_id() not help?

Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
There are 10 kinds of people in this world, 
those who understand binary and those who don't (Unknown)

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



Re: [PHP] Variable PHP Includes - Is there such a thing?

2004-01-15 Thread Rory McKinley
On 14 Jan 2004 at 21:16, Freedomware wrote:

 Suppose you design a standard banner for the top of your web pages and 
 use an include to insert it into every page on your site, like this:
 
 ?php
 include (../../../../includes/header.php);
 ?
 
 But you later decide you'd like to change just one element on each page. 
 For example, you might design a standard image banner, followed by a 
 title and subtitle for each page, but you want to change the title to 
 Alaska, Nebraska or Wyoming on each page.
 
 Is there a way to do this with PHP? If it has a name, I can search for 
 information online, but I don't even know what to call it.
 
 I've played with something of this nature in Dreamweaver. You can design 
 a template that turns out carbon copies of a page, but single out 
 certain items by enclosing them with @@, which are somehow changed on 
 individual pages, or something like that. I can't remember what it's 
 called at the moment.
 
 Another strategy would be to use a PHP include to insert an element on 
 different pages, then modify each element with a unique style sheet on 
 each page.
 
 But I just wondered if PHP offers additional possibilities for similar 
 experiments.
 
 Thanks.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
Hi 

A possible option  could be something like  this 

{calling_template.php}

?php
/*State name does not have to be set statically, can be set from SQL query 
etc*/

$statename = 'Alaska';

include('/path/header.inc');

?

{header.inc}

?php

echo Welcome to the great state of .$statename.now go home!

?

That way you can put whatever you want as the statenameat the top of your pages, and 
the header willalways reflect it. You could also do something similar with objects 
e.g. 

?php

include('header.inc');

this_page_head = new header('Alaska')

?

if you are that way inclined.

Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
There are 10 kinds of people in this world, 
those who understand binary and those who don't (Unknown)

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



Re: [PHP] Variable PHP Includes - Is there such a thing?

2004-01-15 Thread Freedomware
(Oops - I replied by e-mail; guess I should have posted my response to 
the list.)

--- Rory McKinley [EMAIL PROTECTED] wrote:

 A possible option  could be something like  this

 {calling_template.php}

 ?php
/*State name does not have to be set statically,
 can be set from SQL query
 etc*/
I think I understand what you're saying. I'm just getting started with 
PHP and haven't touched MySQL yet, but I can see you're setting up a 
database, or query, and...

 That way you can put whatever you want as the
 statenameat the top of your pages, and
 the header willalways reflect it.
Then you'd put some sort of code in the head section of each page that 
would draw on the system you set up to translate the codes for each page.

I probably didn't work it right, but I think I get the general idea. 
I'll hang on to the code you gave me and play with it just as quick as I 
can learn more about this stuff.

One question, is the example you gave me a pure PHP function, or does it 
indeed involve MySQL, too?

Thanks!

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


[PHP] Very Simple one for u all :-)

2004-01-15 Thread Dave Carrera
Hi List,

My brain needs a kick start this morning and I ask you this basic question.

How do I do a if statement asking if 1st var = a value OR 2nd var = value

I have tried this

If(($var == val) || ($var2 == val2)){

Blah blah
}

I think this is a if var == val AND var2 == val2 then onwards but I need OR,
so one or the other.

Sorry this is so basic but not had enough coffee to sort this out yet, looks
like a bad day for me ahead :-)

Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

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



Re: [PHP] Very Simple one for u all :-)

2004-01-15 Thread Nitin Mehta
i dont c any shortcomings in the syntax, may b i'm sleepy myself
but isn't it working...


- Original Message - 
From: Dave Carrera [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 12:53 PM
Subject: [PHP] Very Simple one for u all :-)


 Hi List,

 My brain needs a kick start this morning and I ask you this basic
question.

 How do I do a if statement asking if 1st var = a value OR 2nd var = value

 I have tried this

 If(($var == val) || ($var2 == val2)){

 Blah blah
 }

 I think this is a if var == val AND var2 == val2 then onwards but I need
OR,
 so one or the other.

 Sorry this is so basic but not had enough coffee to sort this out yet,
looks
 like a bad day for me ahead :-)

 Thank you in advance for any help.

 Dave C

 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004


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


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



[PHP] RE: Very Simple one for u all :-)

2004-01-15 Thread Dave Carrera
I told you it was simple and I sort of answered it myself ;-)

If(($var == val) OR ($var2 == val2)){

Blah blah
}

Sorry for the time wasting:

Note to self:

Wake up before trying to change the world :-)

Dave C


-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED] 
Sent: 15 January 2004 07:23
To: '[EMAIL PROTECTED]'
Subject: Very Simple one for u all :-)


Hi List,

My brain needs a kick start this morning and I ask you this basic question.

How do I do a if statement asking if 1st var = a value OR 2nd var = value

I have tried this

If(($var == val) || ($var2 == val2)){

Blah blah
}

I think this is a if var == val AND var2 == val2 then onwards but I need OR,
so one or the other.

Sorry this is so basic but not had enough coffee to sort this out yet, looks
like a bad day for me ahead :-)

Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

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



Re: [PHP] Very Simple one for u all :-)

2004-01-15 Thread Louie Miranda
like this?

if ($value == $value_fetch) {
do something
} elseif ($value == $value_fetch {
do something on this matter
} else {
error
}



-- -
Louie Miranda
http://www.axishift.com


- Original Message -
From: Dave Carrera [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 3:23 PM
Subject: [PHP] Very Simple one for u all :-)


Hi List,

My brain needs a kick start this morning and I ask you this basic question.

How do I do a if statement asking if 1st var = a value OR 2nd var = value

I have tried this

If(($var == val) || ($var2 == val2)){

Blah blah
}

I think this is a if var == val AND var2 == val2 then onwards but I need OR,
so one or the other.

Sorry this is so basic but not had enough coffee to sort this out yet, looks
like a bad day for me ahead :-)

Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004


--
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] Very Simple one for u all :-)

2004-01-15 Thread Marek Kilimajer
http://sk2.php.net/manual/en/language.operators.logical.php

either one of OR or || would do

Dave Carrera wrote:
Hi List,

My brain needs a kick start this morning and I ask you this basic question.

How do I do a if statement asking if 1st var = a value OR 2nd var = value

I have tried this

If(($var == val) || ($var2 == val2)){

Blah blah
}
I think this is a if var == val AND var2 == val2 then onwards but I need OR,
so one or the other.
Sorry this is so basic but not had enough coffee to sort this out yet, looks
like a bad day for me ahead :-)
Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

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


Re: [PHP] Variable PHP Includes - Is there such a thing?

2004-01-15 Thread Rory McKinley
On 14 Jan 2004 at 23:16, David Blomstrom wrote:

 --- Rory McKinley [EMAIL PROTECTED] wrote:
 
  A possible option  could be something like  this 
  
  {calling_template.php}
  
  ?php
  /*State name does not have to be set statically,
  can be set from SQL query 
  etc*/
 
 I think I understand what you're saying. I'm just
 getting started with PHP and haven't touched MySQL
 yet, but I can see you're setting up a database, or
 query, and...
 
  That way you can put whatever you want as the
  statenameat the top of your pages, and 
  the header willalways reflect it.
 
 Then you'd put some sort of code in the head section
 of each page that would draw on the system you set up
 to translate the codes for each page.
 
 I probably didn't work it right, but I think I get the
 general idea. I'll hang on to the code you gave me and
 play with it just as quick as I can learn more about
 this stuff.
 
 One question, is the example you gave me a pure PHP
 function, or does it indeed involve MySQL, too?
 
 Thanks!
 
 __
 Do you Yahoo!?
 Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes
 http://hotjobs.sweepstakes.yahoo.com/signingbonus
 
Hi David

You do not need to use a query - if you had a database you could retrieve the state 
names from there and perhaps save on typing. The code that I gave you does not use a 
MySQL query at all, although I perhaps could have explained it better.

Basically, the situation is like this :

If you have two scripts - the main page and the header include file and you include 
the 
header script in the main page script, there are no issues of variable scope i.e. all 
variables within the included script are visible to the including script and vice 
versa. 

Therefore if you tell the header script to echo a variable and this variable is 
defined in 
the main page script instead of the header script, the header script will have access 
to 
this variable. From your part, all you have to be willing to do is set the variable on 
each 
main page.

I hope this has clarified matters somewhat and not made things worse.


Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
There are 10 kinds of people in this world, 
those who understand binary and those who don't (Unknown)

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



Re: [PHP] SOLVED= is ' or different in MS-Word then ascII?

2004-01-15 Thread Dagfinn Reiersøl
Roger Spears wrote:

Hello Everybody,

I have found a solution and/or the root of the problem.  I googled on 
the topic of MS-Word + smart quotes.

That lead me to this site:
http://www.rpgtimes.net/rpgtimes/guide.php?guide=1
It seems that the default for Word is to have smart quotes to on. 
When you have smart quotes on it replaces the ordinary straight 
quotes with a left specific and right specific quote.

To correct this:
Go into TOOLSAUTO-CORRECTAUTO-FORMATremove checkmark from replace 
straight quotes with smart quotes.  Also in TOOLSAUTO-CORRECT you 
must remove the line in AUTO-REPLACE about replacing ... with three 
dots that are closer together.

Once I did that, my problem was solved  Thanks to all who have 
helped today.  I appreaciate it!!
I'm happy for you :-), but didn't you say you were taking input from
visitors? Can you force them to turn smart quotes off?
To me it looks like you're pointing out a general problem that anyone
might run into: visitors may copy characters into a Web
form that are not entirely safe to display in an HTML page. That would
be anything except plain ASCII. That would include
smart quotes and a lot of accented letters that don't normally occur in
English. I haven't thought this through before, but I think
the safest thing to do would be to replace thos characters with their
HTML entity equivalents at some point before you display them.
For the smart quotes, the entities would be lsquo; rsqou; ldquo; and
rdquo;
Of course, you could replace them with dumb quotes instead, but the
smart quotes look better. That's why MS word and other word
processors do what they do.
BEFORE I changed these two Word settings, when writing to the 
database, the ord() (ordinate) value for the left quote was 147 and 
the right quote was 148.  When being retrieved from the database, the 
ord() (ordinate) value for the left quote was 17 and the right quote 
was 19.

Thanks again to everyone who offered help!

Roger

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


Re: [PHP][PEAR] PEAR::DB_Common::nextId()

2004-01-15 Thread Dagfinn Reiersøl
Alessandro Vitale wrote:

I would like to get the last insert id... anyone has some experience in
using the PEAR::DB_Common::nextId() ?
 

Yes. You have a PEAR DB object $db, and you do:

$id = $db-nextID('Documents');
$db-query(INSERT INTO Documents (id,title,text) VALUES
($id,'Title','Text'));
The confusing thing about this is the fact that Documents in the two
lines don't necessarily have anything to do
with each other. The first is the name of a sequence, the other is the
name of a table. They're just both called
'Documents'. What happens, and I believe this isn't described in the
documentation, is that PEAR DB stores
the current ID of the Documents sequence in a separate table called
Documents_seq:
mysql select * from Documents_seq;
+-+
| id  |
+-+
| 200 |
+-+
So it's a completely different mechanism than using mysql_insert_id().

In fact, it might be a better idea to have just one sequence and
generate IDs for all tables from that:
$id = $db-nextID('Sequence');
$db-query(INSERT INTO Documents (id,title,text) VALUES
($id,'Title','Text'));
$id = $db-nextID('Sequence');
$db-query(INSERT INTO Users (id,username...) VALUES ($id,$username...));
any suggestion would be very much appreciated.

alessandro

 

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


Re: [PHP] Variable PHP Includes - Is there such a thing?

2004-01-15 Thread Freedomware
Rory McKinley wrote:
I hope this has clarified matters somewhat and not made things worse.

Absolutely; the only thing that has made matters worse so far is the 
book Teach Yourself PHP, MySQL and Apache, which had me thinking 
making PHP includes was going to be a minor wrestling match. In fact, 
they were so simple even I can understand them, and the information you 
just gave me is more or less the vision I had in my mind some time ago, 
before I even heard of PHP.

Thanks for the tips!

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


[PHP] R: [PHP][PEAR] PEAR::DB_Common::nextId()

2004-01-15 Thread Alessandro Vitale
hi,

thanks to Rory for his suggestion.
sure mysql_insert_id() could help. but I was looking for some trick for
accessing the result of that function without having to deal to
mysql_connect() again.
and i found it: PEAR::DB::getOnce(SELECT LAST_INSERT_ID());
doesn't work perfectly but is ok.

cheers

alessandro

-Messaggio originale-
Da: Rory McKinley [mailto:[EMAIL PROTECTED]
Inviato: giovedi 15 gennaio 2004 8.06
A: Alessandro Vitale; [EMAIL PROTECTED]
Oggetto: Re: [PHP][PEAR] PEAR::DB_Common::nextId()


On 14 Jan 2004 at 18:12, Alessandro Vitale wrote:

 I would like to get the last insert id... anyone has some experience in
 using the PEAR::DB_Common::nextId() ?

 any suggestion would be very much appreciated.

 alessandro

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


Hi Alessandro

Will mysql_insert_id() not help?

Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
There are 10 kinds of people in this world,
those who understand binary and those who don't (Unknown)

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



[PHP] PHP Collaboration

2004-01-15 Thread Cesar Aracena
Hi all,

Does anyone knows of any nice PHP/MySQL program (free of course) that could
help me do a more efficient collaboration between me and my programming
partners? I've tried like 8 of them but the nice ones are pricely. I need to
upload/download files, keep track of proyects and users and leave messages
for all to see.

Thanks in advanced,

Cesar Aracena

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



RE: [PHP] PHP Collaboration

2004-01-15 Thread Humberto Silva
Tried Phpcollab ?  http://www.php-collab.com/

 
Humberto Silva
World Editing
Portugal
 


-Original Message-
From: Cesar Aracena [mailto:[EMAIL PROTECTED] 
Sent: quinta-feira, 15 de Janeiro de 2004 10:19
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Collaboration


Hi all,

Does anyone knows of any nice PHP/MySQL program (free of course) that
could help me do a more efficient collaboration between me and my
programming partners? I've tried like 8 of them but the nice ones are
pricely. I need to upload/download files, keep track of proyects and
users and leave messages for all to see.

Thanks in advanced,

Cesar Aracena

-- 
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] Variable PHP Includes - Is there such a thing?

2004-01-15 Thread Rory McKinley
On 15 Jan 2004 at 0:21, Freedomware wrote:

 Rory McKinley wrote:
  
  I hope this has clarified matters somewhat and not made things worse.
  
 
 Absolutely; the only thing that has made matters worse so far is the 
 book Teach Yourself PHP, MySQL and Apache, which had me thinking 
 making PHP includes was going to be a minor wrestling match. In fact, 
 they were so simple even I can understand them, and the information you 
 just gave me is more or less the vision I had in my mind some time ago, 
 before I even heard of PHP.
 
 Thanks for the tips!
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
Glad to have helped.

I taught myself from a book called PHP and MySQL Web Development by Welling  
Thompson (I got it about 18 months ago) I found it quite understandable andthey 
probably have a new version out by now - perhaps that book will serve you better!



Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
There are 10 kinds of people in this world, 
those who understand binary and those who don't (Unknown)

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



Re: [PHP] PHP Includes versus sloppy Dreamweaver code and split elements

2004-01-15 Thread Marek Kilimajer
Freedomware wrote:

My first question is really trivial, but I noticed that Dreamweaver 
likes to display my PHP includes code like this...

   ?php
include (../../../../includes/state/themes.php);
?
When I do a search and replace function, it often jumps onto another 
element's line, like this:

/table   ?php
include (../../../../includes/state/themes.php);
?
I changed the code to this:

?php include (../../../../includes/state/themes.php); ?

and it seems to work just fine. But I just wondered if there's some 
potential problem or convention that I should be aware of.

No, white space is ignored in both html and php.

* * * * * * * * * *

I also wondered if it's OK to include just a portion of another element, 
like a table or layer, in a PHP include, like this:

body
div id=main
table
  tr
tdFirst Row/td
  /tr
?php include (../../../../includes/bottom.php); ?
/body
(The include would include the remainder of the table and div main's 
closing tag, /div)

Again, I tried it, and it seems to work just fine. I just wondered if 
there's something I should be warned about.
Sure you can, but I would not open a tag in one file, and close the tag 
in another. This makes code very unreadable, the errors are hard to find 
and also the code is not reusable.


Thanks!

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


[PHP] create_function() and anonymous methods

2004-01-15 Thread Marco
Hi all,

Is it possible to use create_function() to define anonymous methods
(like in Java) ?
I mean something like:

class Listener {
  function listen () { return 'I am an abstract method'; }
}
$listener = new Listener();
$listener-listen = create_function ( '',
  'return I am an anonymous method;'
);
echo $listener-listen();

The above code doesn't work, abstract method is printed. I've read I
could define a private variable that stores a function and use it inside
 a method. But it's not what I want: I want dynamically overload the
methods of several already defined functions. Is there some way to do it?
Thanks in advance for an answer.

Marco.

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


[PHP] UTF-8 and HTTP headers

2004-01-15 Thread Ji Nmec
Hello,

I have problem with encoding UTF-8 and PHP scripts. Scripts send
information about encoding and this disallow send HTTP headers. Is
possibility to solve this problem?

Jiri Nemec

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



[PHP] newbie: hmtl form to select items from mysql db

2004-01-15 Thread Danny Anderson
Hola, PHP folk!

I am slowly getting a handle on what php/mysql can do.  I have a mysql 
database that I can display in a web browswer with php.  That part is 
working just fine, but it was the easiest part, of course.

My goal is to create an order form sort of thing were a certain quantity 
of each item is specified, and the final step is creating the invoice 
with the grand total is tabulated, etc, etc.  I know this is standard 
stuff, my immediate question is more specific.

I need some direction in creating the html form where the items are 
selected.  As it stands now, I have six digit ID numbers that identify 
each item.  The first digit represents the general class of items and 
the second digit represents a sub-class.  The remaining four are arbitrary.

What I would like is for the user to
1)pick the class, see the available sub-classes
2)pick the subclass, see the items available
3)pick the item
4)pick quantity
If anybody can point me to a tutorial or examples, I would be most 
appreciative.

Danny

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


[PHP] Printing on remote windows printers

2004-01-15 Thread A . Garelli
Can i print on remote windows systems using php printing functions?
How can i do ?

Thank you

Ing. Alberto Garelli - Sales Executive  System Design
Cosmic S.p.A. - Filiale Nord-Ovest (WEB site: www.cosmic.it)
Via Vittorio Amedeo II n. 11 - 10121 - Torino
Corso Venezia n. 16 - 20121 - Milano
Tel. 011 / 561.35.67 r.a. - Fax 011 / 563.74.78 - Mobile 335 / 533.85.28
e-mail: [EMAIL PROTECTED]



Re: [PHP] Printing on remote windows printers

2004-01-15 Thread CPT John W. Holmes
From: [EMAIL PROTECTED]



 Can i print on remote windows systems using php printing functions?
 How can i do ?

No. Use a client side solution.

---John Holmes...

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



[PHP] Installing PHP on IIS6 Windows 2003

2004-01-15 Thread Tareq Yaghmour
Hi,

 

I'm suffering from installing PHP on IIS 6.0, Windows 2003 Web Edition
Server.

Any how-to ? or anyone how can write the instructions how to do it exactly ?

Your help is much much appreciated.

 

Best Regards,

Tareq Yaghmour

 



[PHP] Re: Installing PHP on IIS6 Windows 2003

2004-01-15 Thread Ben Ramsey
 I'm suffering from installing PHP on IIS 6.0,
 Windows 2003 Web Edition Server.
 Any how-to ? or anyone how can write the
 instructions how to do it exactly ?
I found a helpful guide to installing PHP on IIS 6.0 (Win2003).  Browse 
to http://www.php.net/manual/en/installation.php .  Look in the User 
Contributed Notes portion at the bottom of the page, and find the note 
that begins with Installing PHP 4.2.2 on Microsoft Windows .NET Server 
  The installation tips provided will work for every version of PHP 
that I know of.  I used the tips to install PHP 5.0b3 on a Win2003 
server and it worked just fine.  You'll need to download the zip package 
on the downloads page to follow these steps -- 
http://www.php.net/downloads.php

-Ben

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


[PHP] PHP Calendar.

2004-01-15 Thread Carles Xavier Munyoz Bald
Hi,
Is there any PHP function or set of PHP files that allows me to print the 
current month in calendar format ?

Greetings.
---
Carles Xavier Munyoz Baldó
[EMAIL PROTECTED]
http://www.unlimitedmail.net/
---

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



[PHP] Re: create_function() and anonymous methods

2004-01-15 Thread Ben Ramsey
 Is it possible to use create_function() to define
 anonymous methods (like in Java) ?
I'm not exactly sure what an anonymous method is, but I do know that PHP 
5.0 Beta 3 offers a new object model that includes abstract classes and 
methods, which may be something you will want to take a look at.  You 
may read up on this at http://www.php.net/zend-engine-2.php

-Ben

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


Re: [PHP] PHP Calendar.

2004-01-15 Thread Nathan Taylor
No, but HotScripts.com and PHPClasses.org () will have classes to do them.  I'm a 
fan of BosDates (can be found on HotScripts.com), but I think it might cost something 
to get it.

Cheers,
Nathan Taylor
  - Original Message - 
  From: Carles Xavier Munyoz Baldó 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, January 15, 2004 9:27 AM
  Subject: [PHP] PHP Calendar.


  Hi,
  Is there any PHP function or set of PHP files that allows me to print the 
  current month in calendar format ?

  Greetings.
  ---
  Carles Xavier Munyoz Baldó
  [EMAIL PROTECTED]
  http://www.unlimitedmail.net/
  ---

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



Re: [PHP] nested tags

2004-01-15 Thread David T-G
Gregor --

...and then Gregor Jaksa said...
% 
% HTML tags.

Yes, you can nest HTML tags.  The example below needs tr and td
elements to contain the second table, but in general it's fine.


% I can have something like
% table
%   first
%   table
% second table
%   /table
%   table
% /table
% 
% and i need to convert each table/table tags into something more user
% friendly.

Aside from John's suggestion :-) I don't see how much more friendly
you'll get.  Of course, I don't know where you're going, either.  Do
you mean, perhaps, that you want your user to be able to write

  first_table
first
second_table
  second table
/second_table
table
  /first_table

or the like?  Can you give us any more detail at all?


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!



pgp0.pgp
Description: PGP signature


[PHP] regexp with mysql

2004-01-15 Thread tony
i hope someone can help it should be easy but i still don't get it.

i have a field which has numbers seperated via a comma
for example 1,2,3,12,14,23,51

now if i was to do a search for a the rows that has '2' in it i do
SELECT * FROM table WHERE ids REGEXP 2

will it show fields that has 12 22 23 etc...?? or just 2

thank you

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



[PHP] Re: PHP Calendar.

2004-01-15 Thread nabil
catch the out put of Linux

exec('cal');
and for the year
exec('cal 2004');

regards


Carles Xavier Munyoz Baldó [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
Is there any PHP function or set of PHP files that allows me to print the
current month in calendar format ?

Greetings.
---
Carles Xavier Munyoz Baldó
[EMAIL PROTECTED]
http://www.unlimitedmail.net/
---

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



[PHP] New List Memegber Question

2004-01-15 Thread Alex Hogan
Hi All,

 

I am on a 2K Server with SQL Server 2K and will have a lot of questions on
PHP during development.

 

Is this the right list?

 

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] New List Memegber Question

2004-01-15 Thread Richard Davey
Hello Alex,

Thursday, January 15, 2004, 3:00:37 PM, you wrote:

AH I am on a 2K Server with SQL Server 2K and will have a lot of questions on
AH PHP during development.

AH Is this the right list?

Yes if they are PHP related, SQL specific ones probably ought to go to
the PHP-DB list instead, otherwise... welcome :)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] R: [PHP][PEAR] PEAR::DB_Common::nextId()

2004-01-15 Thread David T-G
Alessandro --

...and then Alessandro Vitale said...
% 
% hi,

Hi!


% 
% thanks to Rory for his suggestion.
% sure mysql_insert_id() could help. but I was looking for some trick for
% accessing the result of that function without having to deal to
% mysql_connect() again.

But how will you query the DB then?


% and i found it: PEAR::DB::getOnce(SELECT LAST_INSERT_ID());

Believe me, this has to be connected or it's doing the connect for you.


% doesn't work perfectly but is ok.

If that's good enough for you, then that's fine :-)


% 
% cheers
% 
% alessandro


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!



pgp0.pgp
Description: PGP signature


[PHP] Re: PHP Calendar.

2004-01-15 Thread nabil
?php
passthru('/usr/bin/cal') or die('error');
?



Carles Xavier Munyoz Baldó [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
Is there any PHP function or set of PHP files that allows me to print the
current month in calendar format ?

Greetings.
---
Carles Xavier Munyoz Baldó
[EMAIL PROTECTED]
http://www.unlimitedmail.net/
---

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



[PHP] Junk Mail from this List?

2004-01-15 Thread Ben Ramsey
I'm using Mozilla Thunderbird 0.7 to view and post to this news group, 
so I don't know if that has anything to do with this, but, after just 
posting a few messages to the list, I've received a bunch of what I 
consider spam to my e-mail address.  The spam doesn't consist of 
advertisements but of acknowledgements of receiving my inquiries or 
support requests.  The addresses responding to me (or to undisclosed 
recipients) include:

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
I have not sent any other messages from this e-mail address or used it 
to sign up for anything else (I just created the address, actually). 
So, I assume that these messages are some sort of bouncebacks from my posts.

Has anyone else experienced a similar problem, and is there a way to 
stop this other than marking these as spam in Thunderbird?

-Ben

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


RE: [PHP] New List Memegber Question

2004-01-15 Thread Alex Hogan
Hi Richard,

Thanks for the welcome.

They will be PHP related I assure you.  I'm a newbe


alex

 -Original Message-
 From: Richard Davey [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 15, 2004 9:03 AM
 To: Alex Hogan
 Cc: PHP General list
 Subject: Re: [PHP] New List Memegber Question
 
 Hello Alex,
 
 Thursday, January 15, 2004, 3:00:37 PM, you wrote:
 
 AH I am on a 2K Server with SQL Server 2K and will have a lot of
 questions on
 AH PHP during development.
 
 AH Is this the right list?
 
 Yes if they are PHP related, SQL specific ones probably ought to go to
 the PHP-DB list instead, otherwise... welcome :)
 
 --
 Best regards,
  Richardmailto:[EMAIL PROTECTED]



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] Junk Mail from this List?

2004-01-15 Thread Richard Davey
Hello Ben,

Thursday, January 15, 2004, 3:06:38 PM, you wrote:

BR Has anyone else experienced a similar problem, and is there a way to
BR stop this other than marking these as spam in Thunderbird?

Welcome to the list!

You'll get alsorts like this.. often I get those highly annoying
Please verify you wish to send this person an email mails, along
with mailloop errors, out of office replies, etc etc etc.

Just the price to pay for posting I'm afraid (he says as he hits send
and gets another load back).

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] Dynamic Forms

2004-01-15 Thread Robert Temple
Can anyone suggest a PHP solution to creating a form that gets built 
after a client enters a variable? For example: an automobile 
insurance form that first asks how many cars you have, and then 
creates a form with fields for car 1, car 2, etc.

I have found JavaScript code that will do this, but I would rather 
use a server side language like PHP for more consistency and browser 
compatibility.

Any help would be appreciated!

- Robert

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


Re: [PHP] Junk Mail from this List?

2004-01-15 Thread CPT John W. Holmes
From: Ben Ramsey [EMAIL PROTECTED]


 I'm using Mozilla Thunderbird 0.7 to view and post to this news group,
 so I don't know if that has anything to do with this, but, after just
 posting a few messages to the list, I've received a bunch of what I
 consider spam to my e-mail address.

Common problem. The mailing list basically sends the message on your behalf,
so it's still coming from you. So any error messages, undeliverables,
confirm messages, etc, come to your address. It's the same as if you just
pasted everyones address in the To: line and sent the message. That's just
the way this mailing list is set up.

Either way, start training your Junk Mail filter to catch them and soon you
won't even see them. Been there, done that. :)

---John Holmes...

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



Re: [PHP] Dynamic Forms

2004-01-15 Thread Matt Matijevich
[snip]
Can anyone suggest a PHP solution to creating a form that gets built 
after a client enters a variable?
[/snip]

php runs on your server so to build the forms based on a user entered
form field, the form has to be submitted, so you would have to use
javascript to automatically submit the form or have the user push a
submit button to susbmit the form so php can do its thing.

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



Re: [PHP] regexp with mysql

2004-01-15 Thread Lowell Allen
 i hope someone can help it should be easy but i still don't get it.
 
 i have a field which has numbers seperated via a comma
 for example 1,2,3,12,14,23,51
 
 now if i was to do a search for a the rows that has '2' in it i do
 SELECT * FROM table WHERE ids REGEXP 2
 
 will it show fields that has 12 22 23 etc...?? or just 2

Yes. I think you need something like:

$sql = SELECT * FROM table WHERE .
   ids REGEXP '2' AND ids NOT REGEXP '([1-9]2)|(2[0-9])';

But I don't profess to much knowledge of regular expressions. Check the
MySQL documentation. I saw something about REGEXP there recently. Also,
there's a MySQL discussion list at http://lists.mysql.com/.

HTH

--
Lowell Allen

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



Re: [PHP] PHP Calendar.

2004-01-15 Thread Lowell Allen
 Hi,
 Is there any PHP function or set of PHP files that allows me to print the
 current month in calendar format ?
 

You should write one. Here's mine, which I'm sure could be improved:

HTH

--
Lowell Allen


function display_calendar($mon, $year) {
// find current date and day of the month for comparison
$today = getdate();
$current_mon = $today['mon'];
$current_mday = $today['mday'];
$current_year = $today['year'];

// if no arguments provided with function call
if ((!isset($mon)) || ($mon == )) {
$mon = $today['mon'];
}
if ((!isset($year)) || ($year == )) {
$year = $today['year'];
}

// establish timestamp values from arguments provided
$cal_date = getdate(mktime(0, 0, 0, $mon, 1, $year));
$month = $cal_date['month'];
$weekday = $cal_date['weekday'];

// find position of first day of month, 0 thru 6 for Sun. thru Sat.
$firstdayposition = $cal_date['wday'];

// find day of year of first day of month
$firstday_yearday = $cal_date['yday'];

$lastday = getdate(mktime(0, 0, 0, $mon + 1, 0, $year));

// find position of last day of month
$lastdayposition = $lastday['wday'];

// find day of year of last day of month
$lastday_yearday = $lastday['yday'];

// find number of days in current month
$numdays = $lastday_yearday - $firstday_yearday + 1;

// find last day date of previous month
$prevmonlastday = getdate(mktime(0, 0, 0, $mon, 0));
$prevmonlastdaydate = $prevmonlastday['mday'];

// html layout for month

if ($firstdayposition != 0) {
$caldate = $prevmonlastdaydate - $firstdayposition + 1;
$color = #666;
} else {
$caldate = 1;
$color = #333;
}
?
h4?=$month? ?=$year?/h4
table cellpadding=4 cellspacing= 0 style=border: solid 1px
#cc;
tr
td class=dayslabel width=14%S/td
td class=dayslabel width=14%M/td
td class=dayslabel width=14%T/td
td class=dayslabel width=14%W/td
td class=dayslabel width=14%T/td
td class=dayslabel width=14%F/td
td class=dayslabel width=14%S/td
/tr
tr
?
$i = 1;

while ($i = ($numdays + $firstdayposition + 6 - $lastdayposition)) {
if (($i % 7 == 0)  ($i != ($numdays + $firstdayposition + 6 -
$lastdayposition))) {
if (($caldate == $current_mday)  ($mon == $current_mon) 
($year == $current_year)  ($color == #333)) {
echo(td class=\calendar\ style=\color:
#600;\strong . $caldate . /strong/td\n/tr\ntr\n);
} else {
echo(td class=\calendar\ style=\color:  . $color .
;\ . $caldate . /td\n/tr\ntr\n);
}
} else {
if (($caldate == $current_mday)  ($mon == $current_mon) 
($year == $current_year)  ($color == #333)) {
echo(td class=\calendar\ style=\color:
#600;\strong . $caldate . /strong/td\n);
} else {
echo(td class=\calendar\ style=\color:  . $color .
;\ . $caldate . /td\n);
}
}
$i = $i + 1;
if ($i - 1 == $firstdayposition) {
$caldate = 1;
$color = #333;
} elseif (($i - 1) == ($numdays + $firstdayposition)) {
$caldate = 1;
$color = #666;
} else {
$caldate = $caldate + 1;
}
}
?
/tr
/table
?
}

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



Re: [PHP] PHP Calendar.

2004-01-15 Thread Brian V Bonini
On Thu, 2004-01-15 at 09:27, Carles Xavier Munyoz Baldó wrote:
 Hi,
 Is there any PHP function or set of PHP files that allows me to print the 
 current month in calendar format ?
 

I've seen many classes floating around that do this. Google should turn
up something.

-- 
BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
  Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Dynamic Forms

2004-01-15 Thread Jas
Matt Matijevich wrote:
[snip]
Can anyone suggest a PHP solution to creating a form that gets built 
after a client enters a variable?
[/snip]

php runs on your server so to build the forms based on a user entered
form field, the form has to be submitted, so you would have to use
javascript to automatically submit the form or have the user push a
submit button to susbmit the form so php can do its thing.
I don't have a solution or tutorial per se'... Google might.  Here is a 
small example of a self processing form, if it helps.

?php
if((empty($_POST['var01'])) || (empty($_POST['var02']))) {
  $form = form method=\post\ action=\$_SERVER[PHP_SELF]\
   input name=\var01\
   input name=\var02\
   input type=\submit\ value=\Save\
   input type=\reset\ value=\Reset\
   /form;
} elseif((!empty($_POST['var01'])) || (!empty($_POST['var02']))) {
  $form = form method=\post\ action=\$_SERVER[PHP_SELF]\
   input name=\var01\ value=\$_POST[var01]\
   input name=\var02\ value=\$_POST[var02]\
   input type=\submit\ value=\Save\
   input type=\reset\ value=\Reset\
   /form;
} else {
  $form = $_POST[var01]
   $_POST[var02]; }
echo $form;
?
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Multiple Queries

2004-01-15 Thread Arthur Pelkey
I am new this.

I have a page that has multiple queries on it, I want to do doing the
following:

Query a mysql db multiple times in the same page, but i must be missing
something, I keep getting these AFTER the first queryis successful:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /path/php_file.php on line line_number

Can someone point in the right direction on how to do multiple queries,
some are not querying the same db btw.

-Art

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



Re: [PHP] regexp with mysql

2004-01-15 Thread Toby Irmer
i guess

SELECT * FROM `table` WHERE ids REGEXP ',2,|^2,|,2$'

should do it...

hth

toby


- Original Message - 
From: Lowell Allen [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 4:39 PM
Subject: Re: [PHP] regexp with mysql


  i hope someone can help it should be easy but i still don't get it.
  
  i have a field which has numbers seperated via a comma
  for example 1,2,3,12,14,23,51
  
  now if i was to do a search for a the rows that has '2' in it i do
  SELECT * FROM table WHERE ids REGEXP 2
  
  will it show fields that has 12 22 23 etc...?? or just 2
 
 Yes. I think you need something like:
 
 $sql = SELECT * FROM table WHERE .
ids REGEXP '2' AND ids NOT REGEXP '([1-9]2)|(2[0-9])';
 
 But I don't profess to much knowledge of regular expressions. Check the
 MySQL documentation. I saw something about REGEXP there recently. Also,
 there's a MySQL discussion list at http://lists.mysql.com/.
 
 HTH
 
 --
 Lowell Allen
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] PHP Calendar.

2004-01-15 Thread Carles Xavier Munyoz Bald
El Jueves, 15 de Enero de 2004 16:42, Brian V Bonini escribió:
 On Thu, 2004-01-15 at 09:27, Carles Xavier Munyoz Baldó wrote:
  Hi,
  Is there any PHP function or set of PHP files that allows me to print the
  current month in calendar format ?

 I've seen many classes floating around that do this. Google should turn
 up something.

Yes, but Google can not return me the users experience whith this classes for 
this reason I ask here ;-)

Greetings.
---
Carles Xavier Munyoz Baldó
[EMAIL PROTECTED]
http://www.unlimitedmail.net/
---

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



RE: [PHP] Multiple Queries

2004-01-15 Thread Arthur Pelkey
$result = mysql_query(SELECT * FROM classes3 WHERE c_d_sun='1' AND
c_s_sun_1_hr='5'); 
while($row = @ mysql_fetch_array($result)) {
if($row[c_s_sun_1_hr] != 5) {
echo n/a;
} else {
echo
$row[c_s_sun_1_hr]:$row[c_s_sun_1_min]$row[c_s_sun_1_dn]br;
echo a title=\$row[c_desc]\$row[c_title]/a;
}
}

I have multiple segments of this, the query and the formatting are
different, is there another way to go about this?


-Original Message-
From: Humberto Silva [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 15, 2004 10:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Multiple Queries 

Can you paste the code please...

 
Humberto Silva
World Editing
Portugal
 


-Original Message-
From: Arthur Pelkey [mailto:[EMAIL PROTECTED] 
Sent: quinta-feira, 15 de Janeiro de 2004 15:46
To: [EMAIL PROTECTED]
Subject: [PHP] Multiple Queries 


I am new this.

I have a page that has multiple queries on it, I want to do doing the
following:

Query a mysql db multiple times in the same page, but i must be missing
something, I keep getting these AFTER the first queryis successful:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /path/php_file.php on line line_number

Can someone point in the right direction on how to do multiple queries,
some are not querying the same db btw.

-Art

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




RE: Re[4]: [PHP] Re: jpeg Uploader issue

2004-01-15 Thread Mike R

Since the link goes directly to the picture, how do I apply the header
first?  Should I apply it in the html page the link is on?

:)

Thanks!

-Mike




 Hello Mike,

 Tuesday, January 13, 2004, 5:31:47 PM, you wrote:

 MR That's what I kind of thought, but this is a case where the browser is
 MR opening the image directly - there is no html code or
 placement in an html
 MR page.

 It doesn't matter, it's still being served via HTTP and that's what
 you're trying to emulate. Here is a typical (real live) image request
 as seen from a browser:

 HTTP/1.1 200 OK
 Date: Tue, 13 Jan 2004 17:54:28 GMT
 Server: Apache/1.3.26 (Unix)
 Last-Modified: Mon, 31 Mar 2003 23:40:00 GMT
 ETag: 64060d-18b4-3e88d1d0
 Accept-Ranges: bytes
 Content-Type: image/gif

 The image in question was actually:
 http://tucows.easynet.net/images/logo.gif

 Just happened to be on that page at the time :)

 --
 Best regards,
  Richardmailto:[EMAIL PROTECTED]

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



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



Re: Re[4]: [PHP] Re: jpeg Uploader issue

2004-01-15 Thread Toby Irmer
file: show.php

?
header(Content-type: image/jpeg); 
readfile(/path/to/file/.$_GET[filename]);
?


in your files:

img src=show.php?filename=myfile.jpg ...


or something like that ;)

hth

toby

- Original Message - 
From: Mike R [EMAIL PROTECTED]
To: Richard Davey [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 5:03 PM
Subject: RE: Re[4]: [PHP] Re: jpeg Uploader issue


 
 Since the link goes directly to the picture, how do I apply the header
 first?  Should I apply it in the html page the link is on?

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



Re: [PHP] Multiple Queries

2004-01-15 Thread CPT John W. Holmes
From: Arthur Pelkey [EMAIL PROTECTED]

 I have a page that has multiple queries on it, I want to do doing the
 following:

 Query a mysql db multiple times in the same page, but i must be missing
 something, I keep getting these AFTER the first queryis successful:

 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
 result resource in /path/php_file.php on line line_number

 Can someone point in the right direction on how to do multiple queries,
 some are not querying the same db btw.

There's no real trick to it. You can have as many mysql_query() calls as you
want. You probably just need to check that you're assigning the result of it
to a unique variable each time and not overwriting results or rows from
previous queries.

Post your code if you want, but your error means your query is failing or
you're using the wrong variable in one of the mysql_fetch_*() functions.
Using mysql_error() will help here.

---John Holmes...

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



Re: [PHP] regexp with mysql

2004-01-15 Thread CPT John W. Holmes
How about:

SELECT * FROM table WHERE FIND_IN_SET(2,column);

where column is  your table column containing the comma separated list. 

---John Holmes...

- Original Message - 
From: Toby Irmer [EMAIL PROTECTED]
To: Lowell Allen [EMAIL PROTECTED]; PHP [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 10:48 AM
Subject: Re: [PHP] regexp with mysql


 i guess
 
 SELECT * FROM `table` WHERE ids REGEXP ',2,|^2,|,2$'
 
 should do it...
 
 hth
 
 toby
 
 
 - Original Message - 
 From: Lowell Allen [EMAIL PROTECTED]
 To: PHP [EMAIL PROTECTED]
 Sent: Thursday, January 15, 2004 4:39 PM
 Subject: Re: [PHP] regexp with mysql
 
 
   i hope someone can help it should be easy but i still don't get it.
   
   i have a field which has numbers seperated via a comma
   for example 1,2,3,12,14,23,51
   
   now if i was to do a search for a the rows that has '2' in it i do
   SELECT * FROM table WHERE ids REGEXP 2
   
   will it show fields that has 12 22 23 etc...?? or just 2
  
  Yes. I think you need something like:
  
  $sql = SELECT * FROM table WHERE .
 ids REGEXP '2' AND ids NOT REGEXP '([1-9]2)|(2[0-9])';
  
  But I don't profess to much knowledge of regular expressions. Check the
  MySQL documentation. I saw something about REGEXP there recently. Also,
  there's a MySQL discussion list at http://lists.mysql.com/.
  
  HTH
  
  --
  Lowell Allen
  
  -- 
  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: Re[4]: [PHP] Re: jpeg Uploader issue

2004-01-15 Thread CPT John W. Holmes
From: Toby Irmer [EMAIL PROTECTED]

 file: show.php

 ?
 header(Content-type: image/jpeg);
 readfile(/path/to/file/.$_GET[filename]);
 ?


 in your files:

 img src=show.php?filename=myfile.jpg ...

 or something like that ;)

Are you trying to get him to compromise his server? I'm sure that's just a
simple suggestion, but it's horrible. This will allow a user to request the
contents of any file PHP has access to read...

---John Holmes...

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



Re: Re[4]: [PHP] Re: jpeg Uploader issue

2004-01-15 Thread Toby Irmer
that was explaining the prinicple.

of course you wouldn't do it like this, but pass an id to identify. you
could also send an encryption key...

- Original Message -
From: CPT John W. Holmes [EMAIL PROTECTED]
To: Toby Irmer [EMAIL PROTECTED]; Mike R [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 5:15 PM
Subject: Re: Re[4]: [PHP] Re: jpeg Uploader issue


 From: Toby Irmer [EMAIL PROTECTED]

  file: show.php
 
  ?
  header(Content-type: image/jpeg);
  readfile(/path/to/file/.$_GET[filename]);
  ?
 
 
  in your files:
 
  img src=show.php?filename=myfile.jpg ...
 
  or something like that ;)

 Are you trying to get him to compromise his server? I'm sure that's just a
 simple suggestion, but it's horrible. This will allow a user to request
the
 contents of any file PHP has access to read...

 ---John Holmes...

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


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



Re: [PHP] PHP Calendar.

2004-01-15 Thread Jason Wong
On Thursday 15 January 2004 23:49, Carles Xavier Munyoz Baldó wrote:

  I've seen many classes floating around that do this. Google should turn
  up something.

 Yes, but Google can not return me the users experience whith this classes
 for this reason I ask here ;-)

The only user experience that really counts is *yours*. Try them and find one 
that *you* like.

-- 
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
--
/*
Life is like a buffet; it's not good but there's plenty of it.
*/

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



Re: [PHP] Dynamic Forms

2004-01-15 Thread Justin French
On Friday, January 16, 2004, at 02:15  AM, Robert Temple wrote:

Can anyone suggest a PHP solution to creating a form that gets built 
after a client enters a variable? For example: an automobile insurance 
form that first asks how many cars you have, and then creates a form 
with fields for car 1, car 2, etc.

I have found JavaScript code that will do this, but I would rather use 
a server side language like PHP for more consistency and browser 
compatibility.
step1.php
---
form action='step2.php' method='post'
How many cars do you own?
input type='text' size='2' name='numberOfCars'
input type='submit'
/form
---
step2.php
---
form action='step3.php' method='post'
?
$i=0;
while($i  $_POST['numberOfCars'])
  {
  $i++;
  echo h2car number {$i}/h2;
  echo Make input type='text' size='50' 
name='car[{$i}][\make\]'br;
  echo Model input type='text' size='50' 
name='car[{$i}][\model\]'br;
  echo hr;
  }
?
input type='submit' /
/form
---

This will produce an array of cars ($car[1] to $car[n]), each of which 
is an array of two elements make and model.  Haven't done any work with 
arrays?  Now is a good time :)

step3.php
---
pre? print_r($_POST) ?/pre
---
This code is there just to show you the array structure... you'd change 
it to ad items to a database, etc.

Example output:

---
Array
(
[car] = Array
(
[1] = Array
(
[make] = datsun
[model] = 1600
)
[2] = Array
(
[make] = toyota
[model] = corolla
)
[3] = Array
(
[make] = honda
[model] = civic
)
)

)
---
Good luck :)

Justin

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


Re: [PHP] UTF-8 and HTTP headers

2004-01-15 Thread Jason Wong
On Thursday 15 January 2004 19:52, Ji Nmec wrote:

 I have problem with encoding UTF-8 and PHP scripts. Scripts send
 information about encoding and this disallow send HTTP headers. Is
 possibility to solve this problem?

If I understand your problem correctly, the solution is to arrange your code 
so that all the headers are sent before any other output.

If I don't understand your problem, then please re-phrase your question and 
include actual code and error messages as necessary.

-- 
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
--
/*
Life is like a tin of sardines.  We're, all of us, looking for the key.
-- Beyond the Fringe
*/

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



Re: [PHP] UTF-8 and HTTP headers

2004-01-15 Thread memoimyself
Hello Jiri,

I'm not sure I understand your problem (I had some trouble with your English), but 
have 
you tried PHP's utf8_encode() and utf8_decode() functions? Check out the PHP manual 
in your native language for more information on these functions.

Cheers,

Erik


On 15 Jan 2004 at 12:52, Ji ¡ N mec wrote:

 Hello,
 
 I have problem with encoding UTF-8 and PHP scripts. Scripts send
 information about encoding and this disallow send HTTP headers. Is
 possibility to solve this problem?
 
 Jiri Nemec
 
 -- 
 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] Multiple drop downs

2004-01-15 Thread Alex Hogan
Hi All,

 

I am converting a page from asp that is using several drop down lists.  Each
list contains part of the product list based on the product type.  At the
moment it is making a connection to the db and populating a list using the
product type, closing the connection, then re-opening for another list.

 

I can see that populating those drop downs like this is going to cause me
tremendous problems in the future.

 

I know there is an easier way to do this.  I wish I could think of it right
now. any assistance would be appreciated.

 

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] dynamic list/menu in php

2004-01-15 Thread E. Ricardo Santos
I have a php page to update records of a table.



There are two fields that are used to relate to other tables reason why they
are like list/menu.



The problem is that these select must show the list to me of elements of
the table that contains the data but the selected value must update the
table for which I am created the update form. Example:



Persons (id_person, id_country, id_city, name, last_name)



Country (id_country, country)



City (id_city, City)



Therefore in the update page they are to the fields of the Persons table:



 input type=text name = id_person  value=?php I throw $$row_ persons
[ ' id_person ' ];   

 input type=text name = name value=?php I throw $$row_ persons [ '
name ' ];   



Etc.



Now the instruction select must be declared of the following form:



select name=id_country

?php

do {

?

option value=?= $row_ country ['id_ country ']? ?php if
(!(strcmp($row_ country ['id_ country '], $row_persons['id_ country '])))
{echo SELECTED;} ??= $row_ country [' country ']?/option

?php

} while ($row_ country = mysql_fetch_assoc($country));

?

/select



this works perfectly. Where:



?php if (!(strcmp($row_ country ['id_ country '], $row_persons['id_
country ']))) {echo SELECTED;} ?



it is the sentence that verifies if the Persons  table has an equal value to
the registry of select. The same select for the case of the field would
happen to create another one id_city. Then; when I create select dynamic
for the field id_city, the servant shows an error to me where he says:
(the servant cannot use another behavior of servant. already there is a
behavior of used servant) and the page in target remains.



If exempt the sentence: ?php if (!(strcmp($row_ country ['id_ country '],
$row_persons['id_ country ']))) {echo SELECTED;} ?  From select, one
becomes to show page, but clear that then it does not show the value to me
that has the Persons  table  in those specific fields, but that are the list
simply.



Somebody knows because it does not allow me to have but of a dynamic
list/menu in a page?



I hope to me to have explained more clearly possible so that they can give
some aid me





Greetings



Sorry, my English is poor, very.

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



[PHP] Re: dynamic list/menu in php

2004-01-15 Thread Justin Patrin
I didn't really understand most of what you said (your English is really 
confusing), but you might want to check out DB_DataObject_FormBuilder. 
It will create forms for editing of DB records with select boxes for 
foreign keys. There are also lots of new options in the newest CVS 
version which isn't realeased yet.

http://pear.php.net/DB_DataObject_FormBuilder
--
Question Everything, Reject Nothing
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php dinamic list/menu

2004-01-15 Thread E. Ricardo Santos
I have a php page to update records of a table.



There are two fields that are used to relate to other tables reason why they
are like list/menu.



The problem is that these select must show the list to me of elements of
the table that contains the data but the selected value must update the
table for which I am created the update form. Example:



Persons (id_person, id_country, id_city, name, last_name)



Country (id_country, country)



City (id_city, City)



Therefore in the update page they are to the fields of the Persons table:



 input type=text name = id_person  value=?php I throw $$row_ persons
[ ' id_person ' ];   

 input type=text name = name value=?php I throw $$row_ persons [ '
name ' ];   



Etc.



Now the instruction select must be declared of the following form:



select name=id_country

?php

do {

?

option value=?= $row_ country ['id_ country ']? ?php if
(!(strcmp($row_ country ['id_ country '], $row_persons['id_ country '])))
{echo SELECTED;} ??= $row_ country [' country ']?/option

?php

} while ($row_ country = mysql_fetch_assoc($country));

?

/select



this works perfectly. Where:



?php if (!(strcmp($row_ country ['id_ country '], $row_persons['id_
country ']))) {echo SELECTED;} ?



it is the sentence that verifies if the Persons  table has an equal value to
the registry of select. The same select for the case of the field would
happen to create another one id_city. Then; when I create select dynamic
for the field id_city, the server shows an error to me where he says: (the
server cannot use another behavior of server. already there is a behavior of
used servant) and the page in target remains.



If exempt the sentence: ?php if (!(strcmp($row_ country ['id_ country '],
$row_persons['id_ country ']))) {echo SELECTED;} ?  From select, one
becomes to show page, but clear that then it does not show the value to me
that has the Persons  table  in those specific fields, but that are the list
simply.



Somebody knows because it does not allow me to have but of a dynamic
list/menu in a page?



I hope to me to have explained more clearly possible so that they can give
some aid me





Greetings



Sorry, my English is poor, very.

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



[PHP] Re: dynamic list/menu in php

2004-01-15 Thread E. Ricardo Santos
thanks you very much

-- 


-
Are you still wasting your time with spam?...
There is a solution!

Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com


Justin Patrin [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 I didn't really understand most of what you said (your English is really
 confusing), but you might want to check out DB_DataObject_FormBuilder.
 It will create forms for editing of DB records with select boxes for
 foreign keys. There are also lots of new options in the newest CVS
 version which isn't realeased yet.

 http://pear.php.net/DB_DataObject_FormBuilder
 --
 Question Everything, Reject Nothing

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



[PHP] i can't show two dinamic lit/menu

2004-01-15 Thread E. Ricardo Santos
i can't show two dinamic list/menu per page. the server say: too many server
behaviors

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



[PHP] MySQL Question

2004-01-15 Thread John Taylor-Johnston
Sorry, don't want to be off-topic, but have found something curious about MySQL 
4.0.16-standard.

It does not seem to prioritise properly. Searching for 'English Canada'
(as opposed to +English +Canada)
gives me all instances of both words but does not prioritize the display order for
'English Canada' first and then 'English' then 'Canada'.

SELECT * FROM ccl_main WHERE MATCH
(YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,KW,AUS,GEO,AN,RB,CO) AGAINST ('English
Canada' IN BOOLEAN MODE)
ORDER BY id asc;

versus

SELECT * FROM ccl_main WHERE MATCH
(YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,KW,AUS,GEO,AN,RB,CO) AGAINST ('English
Canada' IN BOOLEAN MODE);

gives the same order.

Anyone know of an article that might help me control the priority.

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



[PHP] best paractice example page creation php / mysql

2004-01-15 Thread Jon Bennett
Hi,

One of the sections in the site I'm developing is a training section. 
Within this section there are sub sections which each need the option 
of having multiple examples added. Each example will be made up of 2 
sections a UL list and a 2 column table with a title and intro as well.

The way I was thinking of doing this was to have 3 tables:

training_subsections
training_list_items
training_table_items
Then once a training sub section has been added into the system they 
can then add example pages. With this current setup I was thinking I'd 
ask the user how many list items and how many table items they want for 
this item (I will add the option to add more at a later date if 
nessecary) and then build the form on the fly from these 2 figures.

My problem is, is it a 'reccomended' way of doing things to query the 
db multiple times for each new list_item and table_item in one go ??? I 
could just have an examples table with say 10 list_item columns and 10 
x 2 table columns but that seems like a short cut really and leaves no 
room for scaleability.

Any thoughts ??

Thanks,

Jon

jon bennett  |  [EMAIL PROTECTED]
new media creative
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
J   b   e   n   .   n   e   t

91 Gloucester Rd,  Trowbridge,  Wilts,  BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] addslashes

2004-01-15 Thread João Cândido de Souza Neto
Hello to all.

I'm using str_replace(\r\n,\\r\\n,addslashes($campo)) to add \ in
mysql data to send to javascript variable.

Running in my machine with win xp + iis it's all ok, but in server with
linux + apache, the javascript variable no have \ causing error in my
script.

Anybody know how do i do ?

Thanks.

João Cândido de Souza Neto
webdeveloper
icq: 1996331
msn: [EMAIL PROTECTED]
www.saladamix.com.br

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



Re: [PHP] best paractice example page creation php / mysql

2004-01-15 Thread Richard Davey
Hello Jon,

Thursday, January 15, 2004, 6:23:51 PM, you wrote:

JB The way I was thinking of doing this was to have 3 tables:

JB training_subsections
JB training_list_items
JB training_table_items

JB My problem is, is it a 'reccomended' way of doing things to query the
JB db multiple times for each new list_item and table_item in one go ??? I

There is no reason why you can't, but I'm quite convinced that with a
little more fore-thought you could come up with a table structure that
meant you didn't have to do this.

For example (if I've understood your post correctly) why not have a
training_examples table and then use an ExampleID for the subsections,
list items and table items.

That way you know which example you're dealing with and can bring back
all of the sub sections accordingly, linking in the list and table
items.

If this isn't possible, post a few more details about what you want to
achieve and perhaps your table schema.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: Re[4]: [PHP] Re: jpeg Uploader issue

2004-01-15 Thread CPT John W. Holmes
From: Toby Irmer [EMAIL PROTECTED]

 that was explaining the prinicple.

 of course you wouldn't do it like this, but pass an id to identify. you
 could also send an encryption key...

Ok. I'm sure the original poster is grateful. Hopefully, if anyone actually
searches those things called the archives, they'll now realize the intent of
your code snippet, also. :)

---John Holmes...

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



Re: [PHP] MySQL Question

2004-01-15 Thread CPT John W. Holmes
From: John Taylor-Johnston [EMAIL PROTECTED]

 Sorry, don't want to be off-topic, but have found something curious about
MySQL 4.0.16-standard.

 It does not seem to prioritise properly. Searching for 'English Canada'
 (as opposed to +English +Canada)
 gives me all instances of both words but does not prioritize the display
order for
 'English Canada' first and then 'English' then 'Canada'.

And how would you know that?

 SELECT * FROM ccl_main WHERE MATCH
 (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,KW,AUS,GEO,AN,RB,CO) AGAINST ('English
 Canada' IN BOOLEAN MODE)
 ORDER BY id asc;

 versus

 SELECT * FROM ccl_main WHERE MATCH
 (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,KW,AUS,GEO,AN,RB,CO) AGAINST ('English
 Canada' IN BOOLEAN MODE);

 gives the same order.

Given these queries, you're not ordering by the relevance MySQL determines,
so you really don't know. You need to also use your MATCH ... AGAINST
condition in the SELECT columns and then order by that.

SELECT *, MATCH
(YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,KW,AUS,GEO,AN,RB,CO) AGAINST ('English
Canada' IN BOOLEAN MODE) AS relevancy FROM ccl_main WHERE MATCH
(YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,KW,AUS,GEO,AN,RB,CO) AGAINST ('English
Canada' IN BOOLEAN MODE) ORDER BY relevancy DESC;

Now I can't honestly say that MySQL determines English Canada is more
relevant than the two words found by themselves, but this will show you
whether it does or not.

---John Holmes...

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



[PHP] addslashes

2004-01-15 Thread João Cândido de Souza Neto
Hello to all.

I'm using str_replace(\r\n,\\r\\n,addslashes($campo)) to add \ in
mysql data to send to javascript variable.

Running in my machine with win xp + iis it's all ok, but in server with
linux + apache, the javascript variable no have \ causing error in my
script.

Anybody know how do i do ?

Thanks.

João Cândido de Souza Neto
webdeveloper
icq: 1996331
msn: [EMAIL PROTECTED]
www.saladamix.com.br

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



Re: [PHP] UTF-8 and HTTP headers

2004-01-15 Thread Chris Shiflett
--- Jiøí Nìmec [EMAIL PROTECTED] wrote:
 I have problem with encoding UTF-8 and PHP scripts. Scripts send
 information about encoding and this disallow send HTTP headers. Is
 possibility to solve this problem?

I don't understand your question, but maybe this will help.

HTTP is encoded with ISO-8859-1, and this is not something you can change.
The content can be encoded however you want.

You will have to explain what exactly is preventing you from sending HTTP
headers.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



Re: [PHP] addslashes

2004-01-15 Thread Marek Kilimajer
Send us the resulting javascript code.

João Cândido de Souza Neto wrote:
Hello to all.

I'm using str_replace(\r\n,\\r\\n,addslashes($campo)) to add \ in
mysql data to send to javascript variable.
Running in my machine with win xp + iis it's all ok, but in server with
linux + apache, the javascript variable no have \ causing error in my
script.
Anybody know how do i do ?

Thanks.

João Cândido de Souza Neto
webdeveloper
icq: 1996331
msn: [EMAIL PROTECTED]
www.saladamix.com.br
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: addslashes

2004-01-15 Thread Justin Patrin
JoãO CâNdido De Souza Neto wrote:

Hello to all.

I'm using str_replace(\r\n,\\r\\n,addslashes($campo)) to add \ in
mysql data to send to javascript variable.
Running in my machine with win xp + iis it's all ok, but in server with
linux + apache, the javascript variable no have \ causing error in my
script.
This could easily be a difference between magic_quotes settings on the 
machines. Check your php.ini file son btoh machines and see if 
magic_quotes_gpc or magic_quotes_runtime is on. If the settings differ 
between machines, this is probably your problem.

--
paperCrane Justin Patrin
--
Question Everything, Reject Nothing
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] best paractice example page creation php / mysql

2004-01-15 Thread Jon Bennett
Ahh, i was originally thinking of having a examples table, but when 
writing the post I decided it might not be nessecary :-)

ok, that bit I understand fine, it's getting the data into the DB first 
that's bugging me, would something like this be ok ?

function addNews($aArgs, $aListItems, $aTableItems) {

// create example record
$sql = INSERT INTO _training_examples (
training_id,
status,
created_dt,
modified_dt
) values (
.$this-$_iTrainingId.,
1,
NOW(),
NOW()
);
if (DB::isError($rsTmp = $this-_oConn-query($sql))) {

catchExc($rsTmp-getMessage());
return false;
} else {

/ Use MySQL's LAST_INSERT_ID() method to query for the 
insert id
$sql = SELECT LAST_INSERT_ID();

// Check for DB class exceptions
if (DB::isError($iExampleId = $this-_oConn-getOne($sql))) 
{

// Report exceptions if present
catchExc($iExampleId-getMessage());
// Unset the product id
unset($iExampleId);
}
$i = 0;

while (count($aListItems)){
// add multiple records to db for list_items
$sql = INSERT INTO _training_list_items (
training_id,
example_id,
listitem,
status,
created_dt,
modified_dt
) values (
.$this-$_iTrainingId.,
.$iExampleId.,
.$aListItems[$i]['List Item Text'].,
1,
NOW(),
NOW()
);
$i++
}

And then repeat the 2 while loop for the table_items table.

Is it ok to have INSERT statements enclosed in a while loop ???

Cheers,

Jon

jon bennett  |  [EMAIL PROTECTED]
new media creative
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
J   b   e   n   .   n   e   t

91 Gloucester Rd,  Trowbridge,  Wilts,  BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/
On 15 Jan 2004, at 18:45, Richard Davey wrote:

Hello Jon,

Thursday, January 15, 2004, 6:23:51 PM, you wrote:

JB The way I was thinking of doing this was to have 3 tables:

JB training_subsections
JB training_list_items
JB training_table_items
JB My problem is, is it a 'reccomended' way of doing things to query 
the
JB db multiple times for each new list_item and table_item in one go 
??? I

There is no reason why you can't, but I'm quite convinced that with a
little more fore-thought you could come up with a table structure that
meant you didn't have to do this.
For example (if I've understood your post correctly) why not have a
training_examples table and then use an ExampleID for the subsections,
list items and table items.
That way you know which example you're dealing with and can bring back
all of the sub sections accordingly, linking in the list and table
items.
If this isn't possible, post a few more details about what you want to
achieve and perhaps your table schema.
--
Best regards,
 Richardmailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Random(?) blank pages when using sessions

2004-01-15 Thread Matt Grimm
I'm using non-cookie-based sessions for authentication on a page.  The
session is set like so, which works (these values, along with the SID, are
always retrievable):

$_SESSION['user'] = $_POST['UserName'];
$_SESSION['time'] = time();

My problem is when I get to the protected site area, in which a header
script calls session_start() at the top (first line).  Seemingly randomly,
while navigating links within this area, I get blank white pages.  If I
comment out the session_start() line, it doesn't happen.  If I spit out the
session variables in the resulting page, they are echoed, but that's it -- 
it's a blank white page otherwise.

The apache error log is silent, and the access log is normal.  No php errors
are displayed or written to the log.  Here's the real kicker -- if I refresh
the page, it loads correctly.  What is going on?

Thank you,
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

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



[PHP] Where is the mistace? Warning: ftp_put(): 'STOR ' not understood.

2004-01-15 Thread Harry.de
Does anybody now,
what this error message mean?
I can see no mistace in my code:

$mode = FTP_BINARY;
$picuploadname = $picupload[$i];
$piclocalname = ../pictures/.$piclocal[$i];
ftp_put($conn_ftp,$picuploadname ,$piclocalname ,$mode);

The connection is correct and the files are putted but there always appears
this message.
Anyone any idea?

Harry

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



RE: [PHP] Where is the mistace? Warning: ftp_put(): 'STOR ' not understood.

2004-01-15 Thread Jay Blanchard
[snip]
$mode = FTP_BINARY;
$picuploadname = $picupload[$i];
$piclocalname = ../pictures/.$piclocal[$i];
ftp_put($conn_ftp,$picuploadname ,$piclocalname ,$mode);
[/snip]

You cannot put FTP_BINARY into a variable, it then becomes a string
instead of a function directive.
Cahnge to this and see if it works;

ftp_put($conn_ftp,$picuploadname ,$piclocalname , FTP_BINARY);

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



[PHP] Locking and unlocking records

2004-01-15 Thread Lowell Allen
I need to implement database record locking and unlocking. I want to prevent
multiple users of a content management system from editing the same record
simultaneously, which can result in one user's edits being overwritten. I
can use PHP to lock a record when it's opened, and unlock it when it's
updated or if the user goes anywhere else within the content management
system (or logs out), but I need to account for a user leaving the CMS
directly from the edit screen. I'm not aware of any way to do that other
than using a Javascript onunload event to open a new window, run a PHP
script, and close the new window onload -- very nasty and unreliable with
pop-up blocking so popular. Can anyone suggest an all-PHP way?

TIA

--
Lowell Allen

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



Re: [PHP] Where is the mistace? Warning: ftp_put(): 'STOR ' not understood.

2004-01-15 Thread Luke
That shouldnt matter, because FTP_BINARY is a constant, and therfore has a
numeric, or string value. The only way FTP_BINARY would become a physical
string is if there was quotes around it.

As for the problem, are you sure you have the right connection open, because
the error (STOR not understood) sounds like you mat not have connected to a
valid FTP server? possibly or permissions?

-- 
Luke
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
$mode = FTP_BINARY;
$picuploadname = $picupload[$i];
$piclocalname = ../pictures/.$piclocal[$i];
ftp_put($conn_ftp,$picuploadname ,$piclocalname ,$mode);
[/snip]

You cannot put FTP_BINARY into a variable, it then becomes a string
instead of a function directive.
Cahnge to this and see if it works;

ftp_put($conn_ftp,$picuploadname ,$piclocalname , FTP_BINARY);

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



[PHP] PHP Includes and Echoes in Head Sections and Search Engines

2004-01-15 Thread Freedomware
I'm having a blast with PHP includes and echo functions; I never dreamed 
they could be so simple and effective. But I have a couple questions 
relating to head sections and search engines.

Consider the following html code:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
?php include (../../../../includes/state/head.php); ?
meta name=mssmarttagspreventparsing content=true /
?php include (../../../../includes/javascript.php); ?
?php include (../../../../includes/stylesheets.php); ?
?php
$statename = 'Alaska';
$postcode = 'ak';
$linkcode = 'world/na/us/ak';
?
/head
body

Welcome to ?php echo $statename ?!

* * * * * * * * * *

And here's the html code from the include named head.php:

?php
$todayDate = date(m-d-Y);
?
titleFreedomware gt; ?php echo $statename ?/title
meta name=description content=?php echo $statename ? versus 
Microsoft /
meta name=keywords content=Alaska, Microsoft, Microshaft, Linux, 
Bill Gates, corporate corruption /

* * * * * * * * * *

I discovered that includes will apparently work just about anywhere, but 
echo functions apparently don't work with the title tag and meta tags; 
at least, I can't see the word Alaska in those locations when I click 
View Source in my browser.

So I wondered if there IS a way to make echo functions work in meta tags.

Also, do you know if text derived from includes causes any problems with 
search engines? My guess is no, because I can see the included words 
just fine when I click View Source.

Along similar lines, I wondered if there might be potential pitfalls if 
you import links to style sheets and javascripts as includes. Everything 
seems to work just fine so far.

Thanks.

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


[PHP] Building Graphs

2004-01-15 Thread Williams, Olwen - SAL
I was looking into using a graphing object to make graphs from some intranet
data, but the libraries I'm looking at are all filled with plain colours and
I'd like to use a pattern.  I can't find a way to use a pattern fill in the
image functions.  can anyone tell me if there is a way to use a pattern?  We
want our users to use BW lasers for their printing.

Olwen Williams
[EMAIL PROTECTED]


CAUTION - This message may contain privileged and confidential 
information intended only for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby 
notified that any use, dissemination, distribution or reproduction 
of this message is prohibited. If you have received this message in 
error please notify Safe Air Ltd immediately. Any views expressed 
in this message are those of the individual sender and may not 
necessarily reflect the views of Safe Air.
_
For more information on the Safe Air Group, visit us online
at http://www.safeair.co.nz/ 
_

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



[PHP] Re: Multiple drop downs

2004-01-15 Thread Luke
Well could you do something like this:

Connect to the database

retreive the entire table into an array,

run through the array for each product category (while $i  $category count)
and put a nested loop inside to create each dropdown list (or select (in
htm))

this then removes the need to connect to the database several times,
allthought you will have to loop through a multidimensional array, but that
would work

-- 
Luke
Alex Hogan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi All,



 I am converting a page from asp that is using several drop down lists.
Each
 list contains part of the product list based on the product type.  At the
 moment it is making a connection to the db and populating a list using the
 product type, closing the connection, then re-opening for another list.



 I can see that populating those drop downs like this is going to cause me
 tremendous problems in the future.



 I know there is an easier way to do this.  I wish I could think of it
right
 now. any assistance would be appreciated.







 alex hogan





 **
 The contents of this e-mail and any files transmitted with it are
 confidential and intended solely for the use of the individual or
 entity to whom it is addressed.  The views stated herein do not
 necessarily represent the view of the company.  If you are not the
 intended recipient of this e-mail you may not copy, forward,
 disclose, or otherwise use it or any part of it in any form
 whatsoever.  If you have received this e-mail in error please
 e-mail the sender.
 **




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



Re: [PHP] PHP Includes and Echoes in Head Sections and Search Engines

2004-01-15 Thread CPT John W. Holmes
From: Freedomware [EMAIL PROTECTED]

 I discovered that includes will apparently work just about anywhere, but
 echo functions apparently don't work with the title tag and meta tags;
 at least, I can't see the word Alaska in those locations when I click
 View Source in my browser.

Look back over your code and you'll realize you set $statename _AFTER_ you
include your file. So when the include file is run, $statename doesn't
have a value. :)

 Also, do you know if text derived from includes causes any problems with
 search engines? My guess is no, because I can see the included words
 just fine when I click View Source.

No, they won't. Search engines, just like browsers, only see the RESULT of
your PHP code. So as long as the result is properly formatted HTML and META
tags, you're fine.

---John Holmes...

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



RE: [PHP] Where is the mistace? Warning: ftp_put(): 'STOR ' not understood.

2004-01-15 Thread Jay Blanchard
[snip]
That shouldnt matter, because FTP_BINARY is a constant, and therfore has
a
numeric, or string value. The only way FTP_BINARY would become a
physical
string is if there was quotes around it.

As for the problem, are you sure you have the right connection open,
because
the error (STOR not understood) sounds like you mat not have connected
to a
valid FTP server? possibly or permissions?
[/snip]

If you put quotes around FTP_BINARY in the function like this 

ftp_put($conn_ftp,$picuploadname ,$piclocalname , FTP_BINARY);

...it will fail. The expected behaviour is that ftp_put will silently
default to ASCII mode. The same happens if you put FTP_BINARY in a
variable. I have confirmed this in 4.3.n

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



[PHP] Converting a TIFF image to PDF

2004-01-15 Thread Todd Cary
I am looking for an example of converting a TIFF image file to a PDF 
file that can be viewed by the user.  It would be helpful if ths can be 
done on the fly using the PdfLib functions.  Does anyone have some 
sample code for doing this in PHP?

Todd

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


RE: [PHP] PHP Includes and Echoes in Head Sections and Search Engines

2004-01-15 Thread Arthur Pelkey
You are defining the vars after the header/title has already been
processed, put it before the head.php, and it should work

-Original Message-
From: Freedomware [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 15, 2004 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Includes and Echoes in Head Sections and Search
Engines

I'm having a blast with PHP includes and echo functions; I never dreamed

they could be so simple and effective. But I have a couple questions 
relating to head sections and search engines.

Consider the following html code:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
?php include (../../../../includes/state/head.php); ?
meta name=mssmarttagspreventparsing content=true /
?php include (../../../../includes/javascript.php); ?
?php include (../../../../includes/stylesheets.php); ?
?php
$statename = 'Alaska';
$postcode = 'ak';
$linkcode = 'world/na/us/ak';
?
/head
body

Welcome to ?php echo $statename ?!

* * * * * * * * * *

And here's the html code from the include named head.php:

?php
$todayDate = date(m-d-Y);
?
titleFreedomware gt; ?php echo $statename ?/title
meta name=description content=?php echo $statename ? versus 
Microsoft /
meta name=keywords content=Alaska, Microsoft, Microshaft, Linux, 
Bill Gates, corporate corruption /

* * * * * * * * * *

I discovered that includes will apparently work just about anywhere, but

echo functions apparently don't work with the title tag and meta tags;

at least, I can't see the word Alaska in those locations when I click 
View Source in my browser.

So I wondered if there IS a way to make echo functions work in meta
tags.

Also, do you know if text derived from includes causes any problems with

search engines? My guess is no, because I can see the included words 
just fine when I click View Source.

Along similar lines, I wondered if there might be potential pitfalls if 
you import links to style sheets and javascripts as includes. Everything

seems to work just fine so far.

Thanks.

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

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



[PHP] Re: PHP Includes and Echoes in Head Sections and Search Engines

2004-01-15 Thread Luke
hi

Very simple problems, good to see ur getting the hang of it :)
the first is, you have defined your variables after you include the page, so
that the echo is outputting a blank variable...

so instead of:

?php include (../../../../includes/state/head.php); ?
meta name=mssmarttagspreventparsing content=true /
?php include (../../../../includes/javascript.php); ?
?php include (../../../../includes/stylesheets.php); ?
?php
$statename = 'Alaska';
$postcode = 'ak';
$linkcode = 'world/na/us/ak';
?

make it

?php
$statename = 'Alaska';
$postcode = 'ak';
$linkcode = 'world/na/us/ak';
php include (../../../../includes/state/head.php);
echo 'meta name=mssmarttagspreventparsing content=true /';
include (../../../../includes/javascript.php);
include (../../../../includes/stylesheets.php);
\?

i just changed the opening and closing tags a little (you didnt need so
many) but the main change is, now the variables come before the included
file, so that the include file can access those variables too.

echo's will work anywhere inside a ?php tag so, it will always output
something to the screen

no problems with search engines, if you use the meta tags and stuff u
usually use, itll work fine

javascript, stylesheets and stuff... the only thing to remember is all the
stylesheet files, and javascript files are relative to the final page
location, not to the include file location, but other than that its the same
as normal

hope that clears it up a bit :)

-- 
Luke
Freedomware [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm having a blast with PHP includes and echo functions; I never dreamed
 they could be so simple and effective. But I have a couple questions
 relating to head sections and search engines.

 Consider the following html code:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 head
 ?php include (../../../../includes/state/head.php); ?
 meta name=mssmarttagspreventparsing content=true /
 ?php include (../../../../includes/javascript.php); ?
 ?php include (../../../../includes/stylesheets.php); ?
 ?php
 $statename = 'Alaska';
 $postcode = 'ak';
 $linkcode = 'world/na/us/ak';
 ?
 /head
 body

 Welcome to ?php echo $statename ?!

 * * * * * * * * * *

 And here's the html code from the include named head.php:

 ?php
 $todayDate = date(m-d-Y);
 ?
 titleFreedomware gt; ?php echo $statename ?/title
 meta name=description content=?php echo $statename ? versus
 Microsoft /
 meta name=keywords content=Alaska, Microsoft, Microshaft, Linux,
 Bill Gates, corporate corruption /

 * * * * * * * * * *

 I discovered that includes will apparently work just about anywhere, but
 echo functions apparently don't work with the title tag and meta tags;
 at least, I can't see the word Alaska in those locations when I click
 View Source in my browser.

 So I wondered if there IS a way to make echo functions work in meta tags.

 Also, do you know if text derived from includes causes any problems with
 search engines? My guess is no, because I can see the included words
 just fine when I click View Source.

 Along similar lines, I wondered if there might be potential pitfalls if
 you import links to style sheets and javascripts as includes. Everything
 seems to work just fine so far.

 Thanks.

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



Re: [PHP] Where is the mistace? Warning: ftp_put(): 'STOR ' not understood.

2004-01-15 Thread Luke
hmm, well that sure is strange. cuz here http://au3.php.net/ftp_put someone
got it working...ahh i see, they used FTP_ASCII, so its the default
anyways...hmmm might be a bug, because FTP_BINARY is just a constant, so it
has a numerical value, (eg 2003 (i dont think thats it)) but in theory

ftp_put($conn_ftp,$picuploadname ,$piclocalname , FTP_BINARY);

should be the same as

ftp_put($conn_ftp,$picuploadname ,$piclocalname , 2003);

so i duno :/

-- 
Luke
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
That shouldnt matter, because FTP_BINARY is a constant, and therfore has
a
numeric, or string value. The only way FTP_BINARY would become a
physical
string is if there was quotes around it.

As for the problem, are you sure you have the right connection open,
because
the error (STOR not understood) sounds like you mat not have connected
to a
valid FTP server? possibly or permissions?
[/snip]

If you put quotes around FTP_BINARY in the function like this 

ftp_put($conn_ftp,$picuploadname ,$piclocalname , FTP_BINARY);

...it will fail. The expected behaviour is that ftp_put will silently
default to ASCII mode. The same happens if you put FTP_BINARY in a
variable. I have confirmed this in 4.3.n

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



[PHP] PDFlib error 2516

2004-01-15 Thread Mark Wouters
Hello!

Tried out this simple script from a tutorial on creating PDF with PHP:

?php

 $pdf = PDF_new();
 PDF_open_file($pdf, testpdf.pdf);

  PDF_set_info($pdf, Author, Someone);
  PDF_set_info($pdf, Title, PDF creation with PHP);
  PDF_set_info($pdf, Creator, Someone);
  PDF_set_info($pdf, Subject, Creating PDFs);

  PDF_begin_page($pdf, 595, 842);

   $arial = PDF_findfont($pdf, Arial, host, 1);
   PDF_setfont($pdf, $arial, 14);

   PDF_show_xy($pdf, Pricelist, 40, 780);

  PDF_end_page($pdf);

 PDF_close($pdf);

?

However got this error:

Fatal error: PDFlib error: [2516] PDF_findfont: Metrics data for font
'Arial' not found in
/usr/local/psa/home/vhosts/resilion.be/httpdocs/test/createpdf.php on line
23

Does anyone have an idea what the problem could be? What does the host
mean in the example above ($arial = PDF_findfont($pdf, Arial, host,
1); )?

Thanks for any help

Mark.

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



Re: [PHP] Converting a TIFF image to PDF

2004-01-15 Thread Jason Wong
On Friday 16 January 2004 05:06, Todd Cary wrote:
 I am looking for an example of converting a TIFF image file to a PDF
 file that can be viewed by the user. It would be helpful if ths can be
 done on the fly using the PdfLib functions.  Does anyone have some
 sample code for doing this in PHP?

There are tools that will convert TIFF into PDF.

Or you can embed TIFF images into a PDF file. Have a look for pc4p on 
sourceforge.

-- 
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
--
/*
The best portion of a good man's life, his little, nameless, unremembered acts
of kindness and love.
-- Wordsworth
*/

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



[PHP] Imap function problems

2004-01-15 Thread Daryl Meese
Hello All,

I am having some strange problems -- code I tested a while back has broken
and I'm not sure why.

I am receiving an email with an attachment (testing.doc).  when I get the
message I call imap_fetchstructure then check the length of the parts array,
which is one.  It used to always be (at least) two if their were attachments
and zero otherwise.

Now it is one and the file information (name, etc) is no where to be found.
There is a new entry in the message structures parameters array named
BOUNDARY, with the boundary value.

If I call imap_fetchbody with a body part number of two then I get the body
of the attachment but, can't get the name, etc.  Any ideas?

Running PHP 4.3.x

Calling print_r on the message structure returns

stdClass Object (
   [type] = 1
   [encoding] = 0
   [ifsubtype] = 1
   [subtype] = MIXED
   [ifdescription] = 0
   [ifid] = 0
   [bytes] = 27074
   [ifdisposition] = 0
   [ifdparameters] = 0
   [ifparameters] = 1
   [parameters] = Array (
  [0] = stdClass Object (
 [attribute] = BOUNDARY [value]
= =_NextPart_000_000D_01C3DB7A.5BC1DAB0
)
   )
   [parts] = Array (
  [0] = stdClass Object (
 [type] = 0
 [encoding] = 0
 [ifsubtype] = 1
 [subtype] = PLAIN
 [ifdescription] = 0
 [ifid] = 0
 [bytes] = 16
 [ifdisposition] = 0
 [ifdparameters] = 0
 [ifparameters] = 1
 [parameters] = Array (
[0] = stdClass Object (
   [attribute] = CHARSET [value] = iso-8859-1
)
 )
   )
)
)

TIA,  Daryl

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



Re: [PHP] best paractice example page creation php / mysql

2004-01-15 Thread Luke
Yeah, its fine, as long as your while loop ends

just after a quick glance, it looks like an infinite loop,

you might try
instead of
while (count($aListItems)){
try
while (isset($aListItems[$i])){
or
while ($i  count($aListItems)){

-- 
Luke
Jon Bennett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Ahh, i was originally thinking of having a examples table, but when
 writing the post I decided it might not be nessecary :-)

 ok, that bit I understand fine, it's getting the data into the DB first
 that's bugging me, would something like this be ok ?

 function addNews($aArgs, $aListItems, $aTableItems) {

  // create example record
  $sql = INSERT INTO _training_examples (
  training_id,
  status,
  created_dt,
  modified_dt
  ) values (
  .$this-$_iTrainingId.,
  1,
  NOW(),
  NOW()
  );

  if (DB::isError($rsTmp = $this-_oConn-query($sql))) {

  catchExc($rsTmp-getMessage());
  return false;

  } else {

  / Use MySQL's LAST_INSERT_ID() method to query for the
 insert id
  $sql = SELECT LAST_INSERT_ID();

  // Check for DB class exceptions
  if (DB::isError($iExampleId = $this-_oConn-getOne($sql)))
 {

  // Report exceptions if present
  catchExc($iExampleId-getMessage());

  // Unset the product id
  unset($iExampleId);
  }

  $i = 0;

  while (count($aListItems)){
  // add multiple records to db for list_items
  $sql = INSERT INTO _training_list_items (
  training_id,
  example_id,
  listitem,
  status,
  created_dt,
  modified_dt
  ) values (
  .$this-$_iTrainingId.,
  .$iExampleId.,
  .$aListItems[$i]['List Item Text'].,
  1,
  NOW(),
  NOW()
  );
  $i++

  }

 And then repeat the 2 while loop for the table_items table.

 Is it ok to have INSERT statements enclosed in a while loop ???

 Cheers,

 Jon


 jon bennett  |  [EMAIL PROTECTED]
 new media creative
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

 J   b   e   n   .   n   e   t

 91 Gloucester Rd,  Trowbridge,  Wilts,  BA14 0AD
 t: +44 (0) 1225 341039 w: http://www.jben.net/


 On 15 Jan 2004, at 18:45, Richard Davey wrote:

  Hello Jon,
 
  Thursday, January 15, 2004, 6:23:51 PM, you wrote:
 
  JB The way I was thinking of doing this was to have 3 tables:
 
  JB training_subsections
  JB training_list_items
  JB training_table_items
 
  JB My problem is, is it a 'reccomended' way of doing things to query
  the
  JB db multiple times for each new list_item and table_item in one go
  ??? I
 
  There is no reason why you can't, but I'm quite convinced that with a
  little more fore-thought you could come up with a table structure that
  meant you didn't have to do this.
 
  For example (if I've understood your post correctly) why not have a
  training_examples table and then use an ExampleID for the subsections,
  list items and table items.
 
  That way you know which example you're dealing with and can bring back
  all of the sub sections accordingly, linking in the list and table
  items.
 
  If this isn't possible, post a few more details about what you want to
  achieve and perhaps your table schema.
 
  -- 
  Best regards,
   Richardmailto:[EMAIL PROTECTED]
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] Imap function problems

2004-01-15 Thread Jason Wong
On Friday 16 January 2004 05:19, Daryl Meese wrote:

 I am having some strange problems -- code I tested a while back has broken
 and I'm not sure why.

 I am receiving an email with an attachment (testing.doc).  when I get the
 message I call imap_fetchstructure then check the length of the parts
 array, which is one.  It used to always be (at least) two if their were
 attachments and zero otherwise.

Are you sure that your message is a properly formatted one? Not one that is 
designed to exploit flaws in Outlook (and siblings)?

-- 
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
--
/*
There is hopeful symbolism in the fact that flags do not wave in a vacuum.
--Arthur C. Clarke
*/

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



[PHP] Variables

2004-01-15 Thread Alex Hogan
How do you insert a php variable into a javascript function?

 

For instance;

 

function redirect(?php $MyVar ?) { location = ?php $MyVar ?; }

 

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] MMCache.....zend or PHP extention?

2004-01-15 Thread Ryan A
Hi all,

I have just kind of installed MMCachenow as what do i add it in my
php.ini file? as a zend extention or a PHP one? which one is
better...couldnt find any details on the websitewhats the diff anyway?

If anyone here is active on the MMCache project...think about adding a FAQ
on the site page PLEASE.

Advise or links appreciated...

Cheers,
-Ryan

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



RE: [PHP] Imap function problems

2004-01-15 Thread Daryl Meese
The contents of the mail file are located below

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 3:42 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Imap function problems


On Friday 16 January 2004 05:19, Daryl Meese wrote:

 I am having some strange problems -- code I tested a while back has broken
 and I'm not sure why.

 I am receiving an email with an attachment (testing.doc).  when I get the
 message I call imap_fetchstructure then check the length of the parts
 array, which is one.  It used to always be (at least) two if their were
 attachments and zero otherwise.

Are you sure that your message is a properly formatted one? Not one that is
designed to exploit flaws in Outlook (and siblings)?

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

From [EMAIL PROTECTED] Thu Jan 15 14:21:01 2004
Received: from desktop (commons10k1.mo24.107.117.24.charter-stl.com
[24.107.117.24]) by magia1.tempdomainname.com (8.12.10) id i0FLKx8O088767
for [EMAIL PROTECTED]; Thu, 15 Jan 2004 14:21:00 -0700 (MST)
From: Daryl Meese [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: testing again
Date: Thu, 15 Jan 2004 15:21:46 -0600
Message-ID: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary==_NextPart_000_0013_01C3DB7B.4A12C3F0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal

This is a multi-part message in MIME format.

--=_NextPart_000_0013_01C3DB7B.4A12C3F0
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: 7bit

testing email body

--=_NextPart_000_0013_01C3DB7B.4A12C3F0
Content-Type: application/msword;
name=testing.doc
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=testing.doc

0M8R4KGxGuEAPgADAP7/CQAGAAABIQAA
EAAAIwEAAAD+ACD/

// chopped out for brevity


AA==

--=_NextPart_000_0013_01C3DB7B.4A12C3F0--

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



[PHP] How can I read 8 bytes from a binary file and cast it as a double?

2004-01-15 Thread SVERRE WISLØFF
How can I read 8 bytes from a binary file and cast it as a double?

sw

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



Re: [PHP] How can I read 8 bytes from a binary file and cast it as a double?

2004-01-15 Thread Marek Kilimajer
http://www.php.net/unpack

SVERRE WISLØFF wrote:
How can I read 8 bytes from a binary file and cast it as a double?

sw

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


[PHP] Re: PHP Includes and Echoes in Head Sections and Search Engines

2004-01-15 Thread Freedomware
i just changed the opening and closing tags a little (you didnt need so
many) but the main change is, now the variables come before the included
file, so that the include file can access those variables too.
Holy cow, this gets simpler all the time. Pretty soon, there'll be 
nothing left on my page but PHP includes and echo functions!

Does this cut down on a website's file size? In other words, are the php 
includes effectively inactive when no one's viewing your main pages, 
leaving them empty of the included pages?

Here's another question. I'm replacing the ../ URL prefixes with the 
echo name $periods, so I can use these includes in pages on several 
levels, such as geobop/one and geobop/one/two, simply replacing $periods 
with ../../ or ../../../.

Below is some code from my include page:

link href=?php echo $periods ?css/a1.css rel=stylesheet 
type=text/css /
link href=?php echo $periods ?css/MIDDLE.css rel=stylesheet 
type=text/css /
link href=?php echo $periods ?css/na/rockies.css rel=stylesheet 
 type=text/css /

But suppose there's a certain page where I don't want the style sheet in 
the middle - the one I named MIDDLE. Is there a way to mark it in the 
include page, then instruct the main page to either not import it or 
replace it with nothing ()?

Thanks.

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


  1   2   >