RE: [PHP] Tryng To Prevent Caching on IE 5-6.0

2003-03-08 Thread Kurst


 -Original Message-
 From: Bryan Lipscy [mailto:[EMAIL PROTECTED]
 Sent: Saturday, March 08, 2003 1:38 AM
 To: 'Kurst'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Tryng To Prevent Caching on IE 5-6.0
 
 Try: header(Cache-control: private);

It's a very good suggestion and I thank you for it but IE is still caching
the data :(.

For those people who are wondering - 
I used almost ever variation of that cache control in the header 
That includes:
The cache-control as the only command, added to my huge cache-control
statement, and put on it's own line.

Anybody else have any suggestions or different ways?

Thanks for the advice :)
I appreciate it!


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



Re: [PHP] Displaying few words from record in mySQL

2003-03-08 Thread Nik Makepeace
On Sat, 2003-03-08 at 05:21, Rahul.Brenda wrote:
 Kevin,
 
 Your program certainly makes very good sense to me. 

I have written an extension of the idea available at

http://nikmakepeace.com/goodies/abbreviate.phps

It takes 5 arguments: 
string to be abbreviated, 
length in characters to abbreviate to 
(-ve values mean reduce string by this many chars)
place you want to abbreviate at (end, start or middle), 
string used to abbreviate (included in the total length)
(default is ... html entity)
whether to enclose the abbreviation in the abbr element
(title includes the whole string for mouseover)

I hope you or anyone else likes it. Maybe some day I'll actually do some
proper work instead of writing silly utilities.

Nik




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



Re: [PHP] Re: Difference between

2003-03-08 Thread Jome
James Taylor wrote:
 Where can I read more about this?  I'm not sure that I understand why
 4  4 == 4.

http://se.php.net/manual/en/language.operators.bitwise.php

  Jome



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



Re: [PHP] $PHPSESSID

2003-03-08 Thread Ernest E Vogelsinger
At 05:45 08.03.2003, Liam Gibbs said:
[snip]
Here's the newest brain teaser: I have cookies disabled (well, I have IE set 
to the highest security mode, where it disables cookies). I understand that 
with cookies enabled, $PHPSESSID will return nothing when it works. However, 
it will return a value when cookies are disabled and the page is refreshed 
after a cookie is attempted. I'm still getting nothing either way. Anybody 
know why?
[snip] 

You mean the SID constant I assume. This constant is only defined if the
client didn't send the right cookie.

There's no global variable holding the session identifier - you can use
session_id() to retrieve (and set!) the current session identifier, and
session_name() to retrieve (and set!) the name of the session (which
usually is PHPSESSIONID).

For further information check out http://www.php.net/manual/en/ref.session.php.


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



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



Re: [Fwd: Re: [PHP] error while reading google-search-results]

2003-03-08 Thread Jens Lehmann
James Holden wrote:


Welcome to a mine field of problems :-)

1. The url you have entered is invalid.  Thats a good first check to 
make usually.  Try /search?q=test to get that bit sorted.
Ok, this was just a typo. :)

2. Google prevents known useragents from accessing it's content as it 
believes you are acting as a spider or a search engine stealing thier 
content.  To counter this you need to use a new url capturing method and 
specifically set the name of the useragent.  Use 'MSIE'.  You can use 
curl, lwp etc to do this kind of thing.
Curl is excellent, fast, highly configurable and execellent with secure 
connections. 
I heard about curl, but not about lwp. I can't find documentation for 
lwp on php.net. I must check out if I can use one of these.

3. I suggest you don't do this - they prevent it for a reason.
It's part of a larger project and not especially related to google. The 
script should be able to read in any website and do some processing. One 
of its functions should (later) be to determine search engine positions. 
Is there a simple way to do this without reading in the search results 
of google (or other search engines)?

Jens



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


[PHP] repost: cookie problem

2003-03-08 Thread H. Miersch
i've posted this before to the newsgroup, and i don't think it got 
through to the mailinglist, so i'll try again.

hello.
i'm new to this NG, so i don't know if this is the right mailinglist 
/ newsgroup for my problem. if not, please let me know which one to 
post it to. anyway, here goes:

i'm designing a new website with several php scripts. for that 
purpose i've configuerd my server (apache under MacOSX 10.2.4) to 
process php. the scripts get executed as they should be. so far so 
hoopy. the problem is the cookie. i have a login.php which checks 
user input and depending on the results either sets a cookie, 
displays a message and proceeds to the next page or returns to the 
login page. the problem is, it doesn't work, the browser (netscape, 
safari,...) never gets the cookie. the next page checks the cookie 
and if it isn't set, it returns to the login page. since the cookie 
isn't set, this keeps happening even when it should proceed to the 
order forms.
now the strange thing: before i had to reinstall OSX, it worked nicely.

what can i do about this? any suggestions?

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


Re: [PHP] Configure with register_globals on

2003-03-08 Thread Frank Keessen
Hi Mike,

I've googled something for you!

http://www.entropy.ch/software/macosx/php/#install

Everything about PHP and running it on the MAC OS X..

Regards,

Frank
- Original Message - 
From: Mike Tuller [EMAIL PROTECTED]
To: php mailing list list [EMAIL PROTECTED]
Sent: Friday, March 07, 2003 5:49 PM
Subject: [PHP] Configure with register_globals on


 I am running OS X 10.2 and am trying to work with PHP and Adobe GoLive. 
 GoLive tells me that I don't have PHP running, which I do, and on 
 Adobe's site someone said that register_globals needs to be on. I know 
 that this is not something that should be done, but I want to see if 
 this is the problem with GoLive saying PHP is not installed. I don't 
 have a php.ini file to change the values for register_globals to be on, 
 so what do I need to add when I run configure to have register_globals 
 turned on?
 
 Thanks,
 Mike
 
 
 -- 
 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] Tryng To Prevent Caching on IE 5-6.0

2003-03-08 Thread Andre Dubuc
Hi Kurst,

I don't know whether what I'm about to pass on will be of any help, or close 
to solving your problem, but perhaps the idea might lead you somewhere.

I was faced with a problem: As my index page loaded, I had to test to see 
whether 'cookies' were enabled, without resorting to javascript. The reason I 
had to check: without cookies, sessions wouldn't work properly. The user 
would not be aware of anything amiss, until he accessed something from the db 
-- then all forms were messed up. 

The solution I hit upon was to create a test schema that relied on two 
additional 'pages' been called. On the 'index' page, the main one I wanted 
displayed, (and the one called for by url), has a simple script at the 
beginning. I have found that the 'index' page is not cached since it must be 
processed through this two-page filter on every encounter with the url -- 
else it is re-directed. Maybe it will work for you, or you could adapt it to 
your needs?? (I'm only a one-year 'php-veteran from the trenches' :)

Code follows:

Index page:

?php session_start();  ob_start(); ?
?php
 if ($_SESSION['test'] == ) {
$_SESSION['test'] = 1;
header(location: index-load.php);
}
?


Index-load page:

?php session_start();  ob_start(); ?
?php
if ($_SESSION['test'] == 1) {
$_SESSION['test'] = 1;
session_write_close();
header(location: index.php);
}
else {
header(location: index-message.php);
}
?


Index-message page:

?php session_start();  ob_start(); ?
?php
switch ($_SESSION['test']):
case 1:
header(location: index.php)
break;
case 
$_SESSION['test'] = 1;
/* you can put whatever message, commands in here */
break;
endswitch;
?


Hth,
Andre



On Saturday 08 March 2003 03:03 am, you wrote:
  -Original Message-
  From: Bryan Lipscy [mailto:[EMAIL PROTECTED]
  Sent: Saturday, March 08, 2003 1:38 AM
  To: 'Kurst'; [EMAIL PROTECTED]
  Subject: RE: [PHP] Tryng To Prevent Caching on IE 5-6.0
 
  Try: header(Cache-control: private);

 It's a very good suggestion and I thank you for it but IE is still caching
 the data :(.

 For those people who are wondering -
 I used almost ever variation of that cache control in the header
 That includes:
 The cache-control as the only command, added to my huge cache-control
 statement, and put on it's own line.

 Anybody else have any suggestions or different ways?

 Thanks for the advice :)
 I appreciate it!

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



[PHP] Video clip

2003-03-08 Thread Anthony Rodriguez
Hi!

In PHP, does anyone know how I would display a video clip (.avi?) on a 
specific spot on a Web page?

Thanks!

Tony



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


RE: [PHP] Video clip

2003-03-08 Thread daniel
definbately OT dude , use the windows media player object embed code
= Original Message From Anthony Rodriguez [EMAIL PROTECTED] =
Hi!

In PHP, does anyone know how I would display a video clip (.avi?) on a
specific spot on a Web page?

Thanks!

Tony



--
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 +Xml?

2003-03-08 Thread James
There is nothing to install.

By default php usually comes with XML parser methods - however if you want
to invest time in running XSLT/XPATH styles against XML you need to install
server side software such as Sablotron or Saxon.  We run Sablotron and it's
very good.  We've also invested in Stylus Studio which is a good xml/xslt
development tool.

I'm not really sure what you want to do so it's difficult to help you
further.If you give a small idea of what it is you want to achieve then
it might be easier to help you on your way.

Jim.


Dhaval Desai [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello people,

 I want to start using Xml with php. How do I install xml on Apache with
Php?
 I am running redhat 7.2,Apache 1.3.12 and php latest version.

 How do I install xml? I am totally new to Xmland want to start
 somewhere...

 -Dhaval





 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
 http://join.msn.com/?page=features/virus




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



Re: [PHP] require_once adds a 1

2003-03-08 Thread James
?
if ([EMAIL PROTECTED](topten.php)){
echo Loading of top ten failed on line .__LINE__;
}
?


Gary [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks for your response James!
 but still I must be doing something wrong the 1 is a persistent little
 bugger. Have you any tips on how to rewrite:

 ?php
 echo @ require_once(topten.php);
  ?
 using the ob_methods?
 Again thanx for your response
 Gary

 James Holden wrote:
  The '1' is received simply because your requirement clause echoed the
  result to the page.
 
  include, require and include_once all return boolean results of 1 or 0
  which indicates a successful loading of said include.   If you want to
  suppress the output of an include use ob_ methods which prevent output
  the stdout.
 
  Simply putting 'include_once(anyfile.php)' will output whatever
  processes occur within that include.
  Putting the echo statement will additionally output the status of the
  include operation.
 
  Regards,
  Jim
  londontown.com
 
 
  Ernest E Vogelsinger wrote:
 
  At 17:28 07.03.2003, Gary spoke out and said:
  [snip]
 
 
  Hi
  I've included the following in a php document:
  ?php
  echo @ require_once(anyfile.php)
 
 
  and it works exactly as I expect except at the end of the included
  document theres a single 1 displayed. I've noticed also that if I
  include a document in the included document the end result will be
  the document I want exactly as I want it with the addition of two
  ones 11s can anyone tell me how to get rid of the ones?
  (if I run anyfile.php by itself there are no 1s)
 
 
  [snip]
 
  This happens if the included file returns some value, in your case
  it seems to return true. Remove the return something statement
  (you may simply return; if necessary) and the 1 will be history.





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



Re: [Fwd: Re: [PHP] error while reading google-search-results]

2003-03-08 Thread James
LWP is a perl thing.  Curl is probably the best thing to use.
Have you tried using googles php api which they provide free?
http://www.google.com/apis/

Jens Lehmann [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 James Holden wrote:
 
 
  Welcome to a mine field of problems :-)
 
  1. The url you have entered is invalid.  Thats a good first check to
  make usually.  Try /search?q=test to get that bit sorted.

 Ok, this was just a typo. :)

  2. Google prevents known useragents from accessing it's content as it
  believes you are acting as a spider or a search engine stealing thier
  content.  To counter this you need to use a new url capturing method and
  specifically set the name of the useragent.  Use 'MSIE'.  You can use
  curl, lwp etc to do this kind of thing.
  Curl is excellent, fast, highly configurable and execellent with secure
  connections.

 I heard about curl, but not about lwp. I can't find documentation for
 lwp on php.net. I must check out if I can use one of these.

  3. I suggest you don't do this - they prevent it for a reason.

 It's part of a larger project and not especially related to google. The
 script should be able to read in any website and do some processing. One
 of its functions should (later) be to determine search engine positions.
 Is there a simple way to do this without reading in the search results
 of google (or other search engines)?

 Jens






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



RE: [PHP] Re: Php +Xml?

2003-03-08 Thread daniel
wot exactly does the xml parse do over sablot ? and what benfit do u get 
xml'ing an entire site , where some processes which come easy to do in php are 
insanely tedious to replicate in xsl :|

= Original Message From James [EMAIL PROTECTED] =
There is nothing to install.

By default php usually comes with XML parser methods - however if you want
to invest time in running XSLT/XPATH styles against XML you need to install
server side software such as Sablotron or Saxon.  We run Sablotron and it's
very good.  We've also invested in Stylus Studio which is a good xml/xslt
development tool.

I'm not really sure what you want to do so it's difficult to help you
further.If you give a small idea of what it is you want to achieve then
it might be easier to help you on your way.

Jim.


Dhaval Desai [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello people,

 I want to start using Xml with php. How do I install xml on Apache with
Php?
 I am running redhat 7.2,Apache 1.3.12 and php latest version.

 How do I install xml? I am totally new to Xmland want to start
 somewhere...

 -Dhaval





 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
 http://join.msn.com/?page=features/virus




--
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] repost: cookie problem

2003-03-08 Thread Marek Kilimajer
First find out if the cookie is send as it should be - use a php script 
to simulate sending the login form and look at the response you will 
recieve. Curl is great for this.

H. Miersch wrote:

i've posted this before to the newsgroup, and i don't think it got 
through to the mailinglist, so i'll try again.

hello.
i'm new to this NG, so i don't know if this is the right mailinglist / 
newsgroup for my problem. if not, please let me know which one to post 
it to. anyway, here goes:

i'm designing a new website with several php scripts. for that purpose 
i've configuerd my server (apache under MacOSX 10.2.4) to process php. 
the scripts get executed as they should be. so far so hoopy. the 
problem is the cookie. i have a login.php which checks user input and 
depending on the results either sets a cookie, displays a message and 
proceeds to the next page or returns to the login page. the problem 
is, it doesn't work, the browser (netscape, safari,...) never gets the 
cookie. the next page checks the cookie and if it isn't set, it 
returns to the login page. since the cookie isn't set, this keeps 
happening even when it should proceed to the order forms.
now the strange thing: before i had to reinstall OSX, it worked nicely.

what can i do about this? any suggestions?



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


Re: [PHP] Executing PHP code in a database

2003-03-08 Thread Ernest E Vogelsinger
At 06:15 08.03.2003, Leo Spalteholz said:
[snip]
I have a table that stores all the boxes that my website will 
display on the sides.  So far the content is simply stored in a text 
field and then substituted for the box body.  However this way I 
can't have any php code in the boxes...  What I thought I could do is 
have another field that will contain any php code that I want for 
that box and then execute that after I read it from the database.

So I have two questions basically.
1. How would I go about executing php code in a string?
Say I have $code = md5('blah');  how would I execute the code in 
the string?

To execute any code contained within a string you need to eval() it.
Assuming you have this piece of code
$uname = 'Leo';
$text = bHello there, ?php echo \$uname; ?/b;
eval(?$text?php ;);

Note that you first escape from PHP in order to correctly execute plain text.

2. If I instead include a file would it have access tio the local 
variables?

Ie.  In a class I have this:
$strContent = blah, this is the content I got from the database;
include(includefilefromdatabase.php);

Is the $strContent variable then available from the include file?

Yes. See http://www.vogelsinger.at/test.php for an example (will be
available for 1-2 days).


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



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



Re: [PHP] Is this possible? Group related results from mysql to one field

2003-03-08 Thread Marek Kilimajer
The only way that comes to my mind is using a SET column type - in 
related table you would not wave toid relating to categories, but 
instead it would be of type SET(demonstrations,people). This column 
can be set to
 -empty, no category
demonstrations
people
demonstrations,people

But SET column is limited to 64 different members, still you can use 
more columns.

Victor Spng Arthursson wrote:

Hi!

Perhaps this is a little bit of topic, but if it's not possible to fix 
directly when the result is returning from mysql I need some tips on 
an intelligent solution...

This is the problem: I'm searching the database for files and i get 
some results. In the sql I have a LIMIT to split the result up. Every 
file can have none, one or several categories associated with it. This 
is done by having an extra table between the table with the references 
to the files and the table with the categories. What I want to do is 
to get all categories associated with an file concatenated and 
returned in _one_ field together with the other data. Look below for 
visualisation.

I'm having this main table with references to files in it:

files
+-+-+
 |  id  |   filename   |
+-+-+
 |168 |v008-12.jpg|
+-+-+
Then I have this table to relate one file to one or several categories:

relatedtable
+-++--+
 |id   |   fromid   |   toid   |
+-++--+
 |4|   1   | 2 |
 |  257  |   2   | 2 |
+-++--+
Which lies in this table for categories:

categories
++--+
 |  id   |   categoryname   | stickword
++--+
 |   5   |   demonstrations |
 |   6   |people   |
++--+
The following sql:

SELECT DISTINCT
files.id, files.filename, categories.categoryname
FROM
files
LEFT JOIN
relatedtable
ON
files.id = relateratabell.fromid
LEFT JOIN
kategorier
ON
relatedtable.toid = categories.id
WHERE
(relatedtable.fromid IS NULL OR relatedtable.fromid IS NOT NULL)
AND
   files.stickword LIKE '%basta%' //for example
ORDER BY
filename;
Gives the following result:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations  |
 | 166| v007-86.jpg | people   |
 | 167| v008-03.jpg | demonstrations  |
 | 167| v008-03.jpg | people  |
+---+---+--+
This is what I expected it to, but I'ld rather get a result as this one:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations, people|
 | 167| v008-03.jpg | demonstrations, people|
+---+---+--+
Where the categories have been collected together into the same field, 
so that I don't get multiple rows for the same file Is this possible 
to achieve?

Many many thanks to the one who can give me some input!

Sincerely

Victor




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


[PHP] TextImage

2003-03-08 Thread Christopher Smith
Greetings,

  I've recently searched newsgroup archives on how to convert text into an
image. However, I cannot seem to find a clear example on how to create the
image dimensions based on the size of a textfile and then once I create the
initial image how to paint the text on the image based on how it appears in
the textfile.  Any help with this would be helpful. Thank-you for your time!



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



Re: [PHP] TextImage

2003-03-08 Thread David Rice
On Saturday, March 8, 2003, at 08:49 AM, Christopher Smith wrote:

Greetings,

  I've recently searched newsgroup archives on how to convert text 
into an
image.
Another good place to get start-up information, assuming that GD is 
available on your setup, is the manual:

http://www.php.net/manual/en/ref.image.php

However, I cannot seem to find a clear example on how to create the
image dimensions based on the size of a textfile
What do you mean based on the size of a text file? Number of bytes? 
Lines?

and then once I create the
initial image how to paint the text on the image based on how it 
appears in
the textfile.
Again, it is unclear to me what you mean by based on how it appears in 
the textfile?
Is your text file broken into lines, and you want to create your image 
with the same line breaks? If so, there are a couple of examples in the 
comments for the imagettfbbox() and
 imagettftext() functions. I know the last comment contains an example 
that can do multiple lines (Brian at PrintsMadeEasy dot com) There's a 
link to the code and a working demo. When I modified the code to 
anti-alias the text it looked rather good. YMMV

Any help with this would be helpful. Thank-you for your time!
HTH.

David

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


Re: [PHP] test for rtf

2003-03-08 Thread bill
Just a note, testing for those characters is trickier than it sounds.  The
backslash throws off the test.  Here's what I did on a POST form.  Note the
-two- backslashes.


$chkstring=substr($thisfile,0,5);
if ($chkstring != {\\rtf) {
// fail
}

This seems to work, but I'm wondering if there's a better way.


Brady Hegberg wrote:

 You could always open it and see if the first few characters are
 {\rtf1.

 Brady

  Is there any way to test a file to confirm it is an RTF file?
 
  I'm thinking along the lines of how we can test for an image with
  getimagesize().
 
  kind regards,
 
  bill
 


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



[PHP] PHP removing data...

2003-03-08 Thread Doug Coning
Hi all,

I'm trying to save a text file from my server to a client machine through
PHP and am using the following headers:

header(Content-type: application/text);
header(Content-Disposition: attachment; filename=variables.txt);

The header does save a text file from the server to my desktop alright, but
it strips everything in the text file.  I have a file named variables.txt
with nothing in it.  I have uploaded a text file that does have test data in
it.  Furthermore, I set all the user rights in Unix to Read / Write/Execute
but everytime PHP opens or saves it, it does so without any of the variables
I've entered.

Does anyone have a suggestion as to what I'm doing wrong?

Thanks

Doug Coning




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



Re: [PHP] Displaying few words from record in mySQL

2003-03-08 Thread chris
On Fri, 7 Mar 2003 10:22:01 -0800 (PST), Rahul.Brenda 
[EMAIL PROTECTED] wrote:

Glory  Supreme Power

What i'm looking to do is.. i want to display only the
first few words of the record in my mySQL database..
For example.. i have a table with a field title..
and let's say my last record has the value in title
field as
This is going to be really cool

What i want to display is

this is going...

Basically this is for News Headlines. I have a page
which displays news but on the first page of the site
i have to give the first few words of the last 4
articles in the news table..
How can i do this? I have seen this in a lot of places
but i dont know how to do this.
Thanks,
Rahul S. Johari
__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Make mysql do the work for you.

select substring_index(title, ' ', 20), author from news order by date desc 
limit 4
// this particular string selects everything before the first 20 spaces of 
your title.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Functions internal to a class implementation

2003-03-08 Thread trlists
I have a class for elements of an HTML form and a bunch of subclasses 
for text box, radio, etc.

I need some utility functions which will be called by some of the 
subclass implementations.  These are utilities used within the class 
only, they are not methods.

Is there a best way to implement this given that there are no private 
functions in PHP?  The options seem to be to define the utilities 
globally, or define them as methods in the superclass and call them 
with superclass::func(); in either case I would never call them 
externally.

Thanks for any tips,

 --
 Tom Rawson




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



Re: [PHP] $PHPSESSID

2003-03-08 Thread Jim Lucas
I think it might have something to do with --enable-trans-sid

read up on that

Jim
- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Friday, March 07, 2003 8:45 PM
Subject: [PHP] $PHPSESSID


First of all, thanks all who helped with the min and max functions (that
works) and the dollar sign bit (which also works). Kudos. Couldn't have done
it without y'all!

Here's the newest brain teaser: I have cookies disabled (well, I have IE set
to the highest security mode, where it disables cookies). I understand that
with cookies enabled, $PHPSESSID will return nothing when it works. However,
it will return a value when cookies are disabled and the page is refreshed
after a cookie is attempted. I'm still getting nothing either way. Anybody
know why?




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



Re: [PHP] Difference between

2003-03-08 Thread Ernest E Vogelsinger
At 05:54 08.03.2003, James Taylor said:
[snip]
Ok, this may have already been posted to the list already, but the
archives don't seem to like the  and  characters.

I'm running into some code that looks like this:

snip
Define('INPUT', 2);
snip
if($search-level  INPUT) $tmp.= $search-input();


Ok, what's the  mean? 

As far as I could tell from the very little documentation I was able to
scrape up on google,  is a bit-by-bit operator.  Thus, if either INPUT
or $search-level, we get TRUE... If that's the case, what's the point
of using it instead of || ?
[snip] 

These are two totally different operators:
  - bitwise AND
 - logical AND

So: 5  2 yields true
5  2 yields 0

In your example we would need to know the value of INPUT - it is most
certainly one of 1, 2, 4, 8, etc, denoting a single bit. So the expression
$search-level  INPUT
would yield nonzero (a.k.a. true) if the bit denoted by INPUT was set in
$search-level.


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



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



RE: [PHP] Re: Difference between

2003-03-08 Thread Ernest E Vogelsinger
At 08:04 08.03.2003, James Taylor said:
[snip]
Where can I read more about this?  I'm not sure that I understand why 4
 4 == 4.
[snip] 

Bitwise comparison means just that, i.e. comparing two numbers bit by bit.

Any number is represented by a bit combination (this has technical reasons
- if a single wire has some electric potential set it's 1, if not it's
0 (or is it the other way round? Can't remember...). A single Byte is
comprised of 8 such lines, each line representig a Bit with increasing value.

To read this correctly you need to have a monospaced font:

line number 7   6   5   4   3   2   1   0
|   |   |   |   |   |   |   |
|   |   |   |   |   |   |   |
line value   7   6   5   4   3   2   1   0
as power of 2:  2   2   2   2   2   2   2   2

dec. value:   128  64  32  16   8   4   2   1

Taking this, the decimal number 4 would look
 0100
written in binary notation.

Ok, now let's bitwise AND 4 and 4, walking bits left to right. If both bits
are set the resulting bit is also set (for an AND operation), if one or
both bits are not set this yields a zero bit:

   0  0 = 0
   0  0 = 0
   0  0 = 0
   0  0 = 0
   0  0 = 0
   1  1 = 1
   0  0 = 0
   0  0 = 0

I hope it seems logical that the result of bitwise ANDing a number to
itself always will result in the same number...

There are a couple of bitwise operators:
   (AND): the result contains bits set in both operands
  | (OR):  the result contains bits set in either operand
  ^ (XOR): the result contains bits set in either one or the other operand,
   but not in both (0 ^ 1 = 1, 1 ^ 0 = 1, 1 ^ 1 = 0, 0 ^ 0 = 0)

Unary operands:
  ~ (NOT)  reverses all bits of the single operand, e.g.;
   ~4 = 251 (~ 0100 =  1011)

Bit-Shift operators move the bits of a number to the left or right:
left shift ($a  $b means shift bits of $a $b-times to the left)
  e.g. 4  1 = 8 ( 0100  1 =  1000)
right shift ($a  $b means shift bits of $a $b-times to the right)
  e.g. 4  1 = 2 ( 0100  1 =  0010)

HTH,

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



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



[PHP] Re: Php +Xml?

2003-03-08 Thread Alexandru COSTIN
Hello,

 Hello people,

 I want to start using Xml with php. How do I install xml on Apache with
Php?
 I am running redhat 7.2,Apache 1.3.12 and php latest version.
If you want to use SAX, you should already have it installed if you have
compiled PHP with '--with-xml'. (BTW, have you compiled PHP yourself? - do
you know how to compile PHP?).

First of all you should upgrade to a newer apache, as as far as I know
Apache 1.3.12 had some problem when ran with Sablotron (this would be needed
if you will want to use XML with XSL transformations)

Then you should use the domxml extension (add '--with-dom'
'--with-dom-xslt' '--with-dom-exslt' to your configure patch when you are
compiling PHP). After you compile PHP, you should have support for SAX, DOM
and XSL transformations.

And if you want a bootstrap to start using XMLs for content publishing,
you should also look at Krysalis at
http://www.interakt.ro/products/Krysalis/

Alexandru


 How do I install xml? I am totally new to Xmland want to start
 somewhere...

 -Dhaval





 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
 http://join.msn.com/?page=features/virus





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



Re: [PHP] PHP removing data...

2003-03-08 Thread Ernest E Vogelsinger
At 17:12 08.03.2003, Doug Coning said:
[snip]
Hi all,

I'm trying to save a text file from my server to a client machine through
PHP and am using the following headers:

header(Content-type: application/text);
header(Content-Disposition: attachment; filename=variables.txt);

The header does save a text file from the server to my desktop alright, but
it strips everything in the text file.  I have a file named variables.txt
with nothing in it.  I have uploaded a text file that does have test data in
it.  Furthermore, I set all the user rights in Unix to Read / Write/Execute
but everytime PHP opens or saves it, it does so without any of the variables
I've entered.
[snip] 

Try to add the Content-length header and see if this resolves your problem:
header(Content-type: application/text);
header('Content-Disposition: attachment; filename=variables.txt');
header('Content-Length: ' . strlen($contents));

I made a habit to send the filename part in double quotes - some user
agents seem to require this although it's not required by RFC (RFC822,
RFC2183). Since doing this it always works for me :)


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



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



Re: [PHP] Mining a file for data

2003-03-08 Thread Ernest E Vogelsinger
Dear Hugh,

please don't use background colors. Black text on darkblue background is
definetely hard to decipher.


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



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



[PHP] RE: Calculate UTC Time from GPS device

2003-03-08 Thread YC Nyon
Hi,

I got time data from a GPS unit  like 054544 which is rollback to 1970s or
something.
Has anyone got script to convert it into current time?


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003


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



Re: [PHP] Displaying few words from record in mySQL [WORKS]

2003-03-08 Thread Rahul.Brenda
Chris.. 

2 words for you.. WOW and WOW. 
This works real well.. thanks. I didn't know it was
possible through an SQL statement. 

Nik  Kevin, thanks a lot .. but this SQL Query works
too efficiently and fast. 

Thanks again.. 
Rahul S. Johari

 Make mysql do the work for you.
 
 select substring_index(title, ' ', 20), author from
 news order by date desc 
 limit 4
 // this particular string selects everything before
 the first 20 spaces of 
 your title.



__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



[PHP] Deleting Files

2003-03-08 Thread Vernon
I need to have files that exist within a folder on my server based on the a
MySQL record that contains it's name. What command would I be looking for in
the php functions list? Anyone?

Thanks



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



Re: [PHP] Deleting Files

2003-03-08 Thread Ernest E Vogelsinger
At 19:14 08.03.2003, Vernon said:
[snip]
I need to have files that exist within a folder on my server based on the a
MySQL record that contains it's name. What command would I be looking for in
the php functions list? Anyone?
[snip] 

file_exists($filename);


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



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



Re: [PHP] Deleting Files

2003-03-08 Thread Ernest E Vogelsinger
At 19:14 08.03.2003, Vernon said:
[snip]
I need to have files that exist within a folder on my server based on the a
MySQL record that contains it's name. What command would I be looking for in
the php functions list? Anyone?
[snip] 

Sorry, just saw you wanted to DELETE the files...

It's unlink($filename);

Note you need to have write access to the directory (not only the file) to
delete it.


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



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



php-general Digest 8 Mar 2003 18:31:42 -0000 Issue 1926

2003-03-08 Thread php-general-digest-help

php-general Digest 8 Mar 2003 18:31:42 - Issue 1926

Topics (messages 138725 through 138769):

Re: Access
138725 by: Uttam

Session hanling  session disabled
138726 by: Jacques Jocelyn

mysql connect to database problem
138727 by: Karl James

Re: Difference between  
138728 by: James Taylor
138729 by: Leif K-Brooks
138733 by: Leif K-Brooks
138736 by: Jome
138758 by: Ernest E Vogelsinger
138759 by: Ernest E Vogelsinger

Tryng To Prevent Caching on IE 5-6.0
138730 by: Kurst
138731 by: Bryan Lipscy
138734 by: Kurst
138741 by: Andre Dubuc

Re: Mining a file for data
138732 by: Hugh Danaher
138762 by: Ernest E Vogelsinger

Re: Displaying few words from record in mySQL
138735 by: Nik Makepeace
138755 by: chris

Re: $PHPSESSID
138737 by: Ernest E Vogelsinger
138757 by: Jim Lucas

Re: error while reading google-search-results]
138738 by: Jens Lehmann
138746 by: James

repost: cookie problem
138739 by: H. Miersch
138748 by: Marek Kilimajer

Re: Configure with register_globals on
138740 by: Frank Keessen

Video clip
138742 by: Anthony Rodriguez
138743 by: daniel

Re: Php +Xml?
138744 by: James
138747 by: daniel
138760 by: Alexandru COSTIN

Re: require_once adds a 1
138745 by: James

Re: Executing PHP code in a database
138749 by: Ernest E Vogelsinger

Re: Is this possible? Group related results from mysql to one field…
138750 by: Marek Kilimajer

TextImage
138751 by: Christopher Smith
138752 by: David Rice

Re: test for rtf
138753 by: bill

PHP removing data...
138754 by: Doug Coning
138761 by: Ernest E Vogelsinger

Functions internal to a class implementation
138756 by: trlists.clayst.com

Really simple question - /php directory above /web tree .htaccess contents
138763 by: news.php.net
138765 by: Ernest E Vogelsinger

Re: Calculate UTC Time from GPS device
138764 by: YC Nyon

Re: Displaying few words from record in mySQL [WORKS]
138766 by: Rahul.Brenda

Deleting Files
138767 by: Vernon
138768 by: Ernest E Vogelsinger
138769 by: Ernest E Vogelsinger

Administrivia:

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

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

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


--
---BeginMessage---
Not yet.

And if there ever will it can not be odbc_connect(), may be something like
access_open()?

regds,

-Original Message-
From: Kiswa [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 01:03
To: [EMAIL PROTECTED]
Subject: Access


Hi.
Is their anyway to connect to a Access Db using only the filesystem like

$connect = odbc_connect(\Db\Webdb.mdb, nobody, nobody);

thus pointing directly to the file not using drivers???



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

Hi all,
Since the upgrade to php 4.3 I have several issue with my session handling
and my URL. First of all I currently use the following code :
?
$chaine = nav.php;
$url_array = explode(/, $_SERVER['REQUEST_URI']) ;

$url = array() ; $stop = true ;
while (list($key, $val) = each($url_array)){
if ($val == $chaine) $stop = false ;
if (! $stop) $url[] = $val ;
}

$i = 0 ;
while (list($key, $val) = each($url)){
$nom = $url[$i++] ;
$$nom = $url[$i++] ;
}

//Then I call my session lib
if (!$SID){
@session_destroy();
@session_start();
$SID=session_id();
}else{
session_start();
# . my customized code
}
 ?

this allows me to have my URL in this format :
http://domain.tld/nav.php/page1/SID/abc123
instead of http://domain.tld/nav.php?page=page1SID=abc123
Thus,  all my link are in this format : a
href=/nav.php/page/SID/?=SID?

Since the upgrade to version 4.3, all my URL and link are in this format :
http://domain.tld/nav.php/page1/SID/abc123?PHPSID=abc123
As a result the Session ID becomes : abc123?PHPSID=abc123. the server cannot
find variables.related to the current session

I would like NOT to use cookies at all, but at soon as I start a session, a
cookies is sent to the browser.
I tried to change several ini variables (with no result), such as :
@ini_set(session.use_trans_sid,0);
@ini_set(session.use_cookies,0);
@ini_set(session.auto_start,0);
@ini_set(session.name,SID);
@ini_set(session.save_handler,files);

Do you have any idea how to force php to write the session information into
the session folder ?
the only way for me to keep my URL clean is to activate cookies. but if
cookies are refused by the visitor, the website will be unusable (member
section etc)
I will appreciate any help from you.
Thanks,

Jacques



---End Message---
---BeginMessage---
Is there anyone 

Re: [PHP] Re: Php +Xml?

2003-03-08 Thread James
There are distinct differences to parsing XML into your program and
producing XML from your program.

We use the following method's which are enabling us to create scalable
systems with independent design from code.
One of the clear reasons for using XML/XSLT is the seperation of data and
design.  If you imagine that your ecommerce application is working very well
and doesnt need changing but you have a new client who wants the system in
thier design.  Usually, there will come a point where you have to change
hardcoded design elements within your ecommerce application - and if the
design is radically different you will need to do conditional statements to
determine which design to use - a real pain.  More importantly your playing
with your engine (code) when in fact all you really wanted to do was put  on
some new alloys! :-)  It's boring, time consuming and often results in *
up code.

If you take the XML and XSLT path you instantly change your method.  Your
ecommerce application only EVER spews out XML.  That's it's purpose in
life - it has it's business rules and it's resulting output and design is
never a factor.  The XSLT style sheets are used to implement the XML into a
valid document usable by humans.  In essence you can now have a 1000
independent designs which never require a single code change in your main
commerce app.  Taking it further you can employ your xsl sheets to spew out
WML, CSV, XML etc etc.  Simply, your have reached a true data and design
independence.

Added to this you can offer third parties an industry standard form of data
exchange.  You can use multiple languages and know with confidence that none
of them have to understand each other.  We are using this method very
shortly to create a win32 application using the XML feed from our commerce
engine.  Eventually it will be used by our customer service team.

php are
 insanely tedious to replicate in xsl :|


I totally disagree.  Take the following:

for ($i=0;$i=10;$i++){
echo trtdHello/td/tr;
}


Take the following in XSLT:

xsl:for-each select=node/to/match
trtdxsl:value-of select=. //td/tr
/xsl:for-each

They may be about the same in number of lines but the php app must be
modified to create a different table type.  It is true however that unless
you need to something on a large scale these methods may be to much.


James.







Daniel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 wot exactly does the xml parse do over sablot ? and what benfit do u get
 xml'ing an entire site , where some processes which come easy to do in php
are
 insanely tedious to replicate in xsl :|

 = Original Message From James [EMAIL PROTECTED] =
 There is nothing to install.
 
 By default php usually comes with XML parser methods - however if you
want
 to invest time in running XSLT/XPATH styles against XML you need to
install
 server side software such as Sablotron or Saxon.  We run Sablotron and
it's
 very good.  We've also invested in Stylus Studio which is a good xml/xslt
 development tool.
 
 I'm not really sure what you want to do so it's difficult to help you
 further.If you give a small idea of what it is you want to achieve
then
 it might be easier to help you on your way.
 
 Jim.
 
 
 Dhaval Desai [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hello people,
 
  I want to start using Xml with php. How do I install xml on Apache with
 Php?
  I am running redhat 7.2,Apache 1.3.12 and php latest version.
 
  How do I install xml? I am totally new to Xmland want to start
  somewhere...
 
  -Dhaval
 
 
 
 
 
  _
  MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
  http://join.msn.com/?page=features/virus
 
 
 
 
 --
 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] Mining a file for data

2003-03-08 Thread John Wulff
I've toyed with this for a few hours now with no luck.  I think the best way
to go about extracting the data is to look for the field names and seperate
the fields by them.  Any more hints on how to do this?  The file structure
is as shown below.

Card Name: Akroma, Angel of Wrath
Card Color: W
Mana Cost: 5WWW
Type  Class: Creature - Angel Legend
Pow/Tou: 6/6
Card Text: Flying, first strike, trample, haste, protection from black,
  protection from red. Attacking doesn't cause Akroma, Angel
  of Wrath to tap.
Flavor Text: No rest.  No mercy.  No matter what.
Artist:  Ron Spears
Rarity:  R
Card #:  1/145

Card Name: Akroma's Devoted
Card Color: W
Mana Cost: 3W
Type  Class: Creature - Cleric
Pow/Tou: 2/4
Card Text: Attacking doesn't cause Clerics to tap.
Flavor Text: Akroma asked for only one thing from her troops: unwavering,
  unconditional loyalty.
Artist:  Dave Dorman
Rarity:  U
Card #:  2/145

etc.. etc..


Hugh Danaher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 depending on how the text file is organized, this can be an easy task or
 impossible.  But, here goes:

 If a line in the text file contains all the info about the card and is
 organized routinely and separated by a special character (, , ; or tab,
 then you should be able to do something like the following:

 html
 body bgcolor=navy
 ?php
 $db= ;
 $table= ;
 $user= ;
 $pass= ;
 $link=mysql_connect(localhost,$user,$pass);
 if (! $link) die(Can't log in at this time);
 mysql_select_db($db,$link) or die (Can't log in at this time);

 print table align=center cellpadding=7 cellspacing=0 border=1
 bgcolor=silver;

 $fp=fopen(persons.txt,r) or die (Couldn't open file!);

 while (!feof ($fp))
  {
  $persons=fgets($fp,100); // looks for \n (carrage return) or 100
characters
 before moving on

  list($image,$title,$first,$date,)= split (\t, $persons, 6);  /// splits
 on tab
  print tr
td$firstnbsp;/td
td$titlenbsp;/td
td$imagenbsp;/td
td$datenbsp;/td
   /tr;
  $query=insert into $table (first, title, date, directory, image)
   values ('.addslashes($first).',
 '.addslashes($title).',
 '.addslashes($date).',
 '.addslashes($directory).',
 '.addslashes($image).' );
   $result=mysql_query($query);
   if (!$result) die (couldn't update $table.mysql_error());
  }
 fclose($fp);
 mysql_close($link);
 print /table;
 ?
 /body
 /html


 - Original Message -
 From: John Wulff [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, March 07, 2003 5:25 PM
 Subject: [PHP] Mining a file for data


  I'm just learning PHP so please excuse my ignorance.  I'm trying to
 extract
  the data from a simply formatted text file via a simple PHP script.  The
  goal of this project is to take Magic the Gathering spoiler lists and
dump
  them into a MySQL database.  I've got plenty of experience with MySQL
but
  not file parsing.  How do I about parsing this data?  What sort of
pattern
  recognition do I use (if that's the right term).
  Thanks for the help.  The format of the file is below.
  -John
 
  Card Name: Akroma, Angel of Wrath
  Card Color: W
  Mana Cost: 5WWW
  Type  Class: Creature - Angel Legend
  Pow/Tou: 6/6
  Card Text: Flying, first strike, trample, haste, protection from black,
protection from red. Attacking doesn't cause Akroma, Angel
of Wrath to tap.
  Flavor Text: No rest.  No mercy.  No matter what.
  Artist:  Ron Spears
  Rarity:  R
  Card #:  1/145
 
  Card Name: Akroma's Devoted
  Card Color: W
  Mana Cost: 3W
  Type  Class: Creature - Cleric
  Pow/Tou: 2/4
  Card Text: Attacking doesn't cause Clerics to tap.
  Flavor Text: Akroma asked for only one thing from her troops:
unwavering,
unconditional loyalty.
  Artist:  Dave Dorman
  Rarity:  U
  Card #:  2/145
 
  etc.. etc...
 
 
 
  --
  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] global find and replace

2003-03-08 Thread Didier McGillis
I have to remove all semi-colons from user input fields that will be sent 
down to our backend system, semi-colons are the delimiter in the messages 
that flow from ur website to our backend system.  How I need this to work is 
not client side but server-side in our pages, I need to do this in the least 
system taxing and easiest to implement.  There are many many files and 
fields that find their way into the system.  I dont necessarly want a PHP 
function.  I am looking for a best pratice for doing a global removal.

Here are the three approaches that I have thought of, although there is 
another one but that is outside my scope as it requires me touching out C++ 
componets.

1.  Down and dirty make a function that will strip each field when it is 
going through its normal validation.  Time consuming and taxing of the 
system.

2.  Strip the semi colons on their way in to the functions that interact 
with the C++ components.

3.  Strip them in the JSI component, which is the layer between JS and C++.

4.  I had thought of stripping the semi-colons in the C++ components myself, 
I thought that would be the best, doing a strip, but I dont know C++ very 
well and I dont know the best way or any way to do that.

Okay you have seen my four obviously briliant ideas, do you have one or do 
you have a way of doing this task easly and quickly.

Please help

_
Tired of spam? Get advanced junk mail protection with MSN 8.  
http://join.msn.com/?page=features/junkmail

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


[PHP] Re: global find and replace

2003-03-08 Thread James
Add an append file to the php.ini file, this script will act the default
loader before any other php action.

parse $HTTP_POST_VARS and $HTTP_GET_VARS and $HTTP_FILES or whatever you
want
Parsing the POST_VARS and GET_VARS will mean you will not have to worry
about variable names

dont use eregi_* use preg.

var = preg_replace(/;/i,, $var);

jim.




Didier McGillis [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have to remove all semi-colons from user input fields that will be sent
 down to our backend system, semi-colons are the delimiter in the messages
 that flow from ur website to our backend system.  How I need this to work
is
 not client side but server-side in our pages, I need to do this in the
least
 system taxing and easiest to implement.  There are many many files and
 fields that find their way into the system.  I dont necessarly want a PHP
 function.  I am looking for a best pratice for doing a global removal.

 Here are the three approaches that I have thought of, although there is
 another one but that is outside my scope as it requires me touching out
C++
 componets.

 1.  Down and dirty make a function that will strip each field when it is
 going through its normal validation.  Time consuming and taxing of the
 system.

 2.  Strip the semi colons on their way in to the functions that interact
 with the C++ components.

 3.  Strip them in the JSI component, which is the layer between JS and
C++.

 4.  I had thought of stripping the semi-colons in the C++ components
myself,
 I thought that would be the best, doing a strip, but I dont know C++ very
 well and I dont know the best way or any way to do that.

 Okay you have seen my four obviously briliant ideas, do you have one or do
 you have a way of doing this task easly and quickly.

 Please help

 _
 Tired of spam? Get advanced junk mail protection with MSN 8.
 http://join.msn.com/?page=features/junkmail




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



[PHP] Re: global find and replace

2003-03-08 Thread Mark Heintz PHP Mailing Lists
Actually, in this case str_replace() would be preferred over preg_replace,
as it would be faster.

foreach($_REQUEST AS $key = $val)
{
  $_REQUEST[$key] = str_replace(';', '', $val);
}


mh.

On Sat, 8 Mar 2003, James wrote:

 Add an append file to the php.ini file, this script will act the default
 loader before any other php action.

 parse $HTTP_POST_VARS and $HTTP_GET_VARS and $HTTP_FILES or whatever you
 want
 Parsing the POST_VARS and GET_VARS will mean you will not have to worry
 about variable names

 dont use eregi_* use preg.

 var = preg_replace(/;/i,, $var);

 jim.




 Didier McGillis [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I have to remove all semi-colons from user input fields that will be sent
  down to our backend system, semi-colons are the delimiter in the messages
  that flow from ur website to our backend system.  How I need this to work
 is
  not client side but server-side in our pages, I need to do this in the
 least
  system taxing and easiest to implement.  There are many many files and
  fields that find their way into the system.  I dont necessarly want a PHP
  function.  I am looking for a best pratice for doing a global removal.
 
  Here are the three approaches that I have thought of, although there is
  another one but that is outside my scope as it requires me touching out
 C++
  componets.
 
  1.  Down and dirty make a function that will strip each field when it is
  going through its normal validation.  Time consuming and taxing of the
  system.
 
  2.  Strip the semi colons on their way in to the functions that interact
  with the C++ components.
 
  3.  Strip them in the JSI component, which is the layer between JS and
 C++.
 
  4.  I had thought of stripping the semi-colons in the C++ components
 myself,
  I thought that would be the best, doing a strip, but I dont know C++ very
  well and I dont know the best way or any way to do that.
 
  Okay you have seen my four obviously briliant ideas, do you have one or do
  you have a way of doing this task easly and quickly.
 
  Please help



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



[PHP] Resizing Images Uploaded to Web Page

2003-03-08 Thread Vernon
I have users uploading images to a server and need to have those files
resized on upload. I looked under filesystem, but found nothing like that.
Anyone?

Thanks



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



Re: [PHP] Resizing Images Uploaded to Web Page

2003-03-08 Thread Liam Gibbs
 I have users uploading images to a server and need to have those files
 resized on upload. I looked under filesystem, but found nothing like that.
 Anyone?

Check the GD extension. You'll need that installed, and the images can't be
GIFs (must be JPEGs or TIFs, something like that). Anyway, there should be a
function in there called imagecopyresized() you'll want to check out.


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



Re: [PHP] Resizing Images Uploaded to Web Page

2003-03-08 Thread Weston Houghton
You'll need to either use the gd functions, or my recommendation, get  
the imagick module and use it. Both should do an excellent job. iMagick  
is in PEAR.

Wes

On Saturday, March 8, 2003, at 03:15  PM, Vernon wrote:

I have users uploading images to a server and need to have those files
resized on upload. I looked under filesystem, but found nothing like  
that.
Anyone?

Thanks



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



 
---
The selection and placement of letters on this page was
determined automatically by a computer program. Any
resemblance to actual words, sentences, or paragraphs is
pure coincidence, and no liability will be assumed for
such coincidences.
 
---

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


Fw: [PHP] Resizing Images Uploaded to Web Page

2003-03-08 Thread Liam Gibbs
 You'll need to either use the gd functions, or my recommendation, get
 the imagick module and use it. Both should do an excellent job. iMagick
 is in PEAR.

How is PEAR making out? What makes it better than using the GD extension? I
will need to do image manipulation (much like the original question, I'll
have to make thumbnails of images on upload) and I want to know which is the
better option, in what circumstances, etc.


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



Re: Fw: [PHP] Resizing Images Uploaded to Web Page

2003-03-08 Thread Weston Houghton
iMagick offers all of the functionality of imageMagick, which is a  
substantially different subset than GD. iMagick is primarily geared  
toward modifying existing images. Resizing, converting formats, apply  
effects to, etc. It also works with a far larger set of base image  
formats.

Check out imagemagick itself, and then for access to that functionality  
in php, head out and grab iMagick.

Wes

On Saturday, March 8, 2003, at 03:34  PM, Liam Gibbs wrote:

You'll need to either use the gd functions, or my recommendation, get
the imagick module and use it. Both should do an excellent job.  
iMagick
is in PEAR.
How is PEAR making out? What makes it better than using the GD  
extension? I
will need to do image manipulation (much like the original question,  
I'll
have to make thumbnails of images on upload) and I want to know which  
is the
better option, in what circumstances, etc.

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



 
---
The selection and placement of letters on this page was
determined automatically by a computer program. Any
resemblance to actual words, sentences, or paragraphs is
pure coincidence, and no liability will be assumed for
such coincidences.
 
---

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


Re: [PHP] Re: global find and replace

2003-03-08 Thread James
yup.

Mark Heintz Php Mailing Lists [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
 Actually, in this case str_replace() would be preferred over preg_replace,
 as it would be faster.

 foreach($_REQUEST AS $key = $val)
 {
   $_REQUEST[$key] = str_replace(';', '', $val);
 }


 mh.

 On Sat, 8 Mar 2003, James wrote:

  Add an append file to the php.ini file, this script will act the default
  loader before any other php action.
 
  parse $HTTP_POST_VARS and $HTTP_GET_VARS and $HTTP_FILES or whatever you
  want
  Parsing the POST_VARS and GET_VARS will mean you will not have to worry
  about variable names
 
  dont use eregi_* use preg.
 
  var = preg_replace(/;/i,, $var);
 
  jim.
 
 
 
 
  Didier McGillis [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   I have to remove all semi-colons from user input fields that will be
sent
   down to our backend system, semi-colons are the delimiter in the
messages
   that flow from ur website to our backend system.  How I need this to
work
  is
   not client side but server-side in our pages, I need to do this in the
  least
   system taxing and easiest to implement.  There are many many files and
   fields that find their way into the system.  I dont necessarly want a
PHP
   function.  I am looking for a best pratice for doing a global removal.
  
   Here are the three approaches that I have thought of, although there
is
   another one but that is outside my scope as it requires me touching
out
  C++
   componets.
  
   1.  Down and dirty make a function that will strip each field when it
is
   going through its normal validation.  Time consuming and taxing of the
   system.
  
   2.  Strip the semi colons on their way in to the functions that
interact
   with the C++ components.
  
   3.  Strip them in the JSI component, which is the layer between JS and
  C++.
  
   4.  I had thought of stripping the semi-colons in the C++ components
  myself,
   I thought that would be the best, doing a strip, but I dont know C++
very
   well and I dont know the best way or any way to do that.
  
   Okay you have seen my four obviously briliant ideas, do you have one
or do
   you have a way of doing this task easly and quickly.
  
   Please help





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



[PHP] file_exists() question

2003-03-08 Thread Charles Kline
Can anyone tell me why this code does not return true when the file in 
the directory cherpdocs/ with the file (which I see as being there) 
does exist?

if(file_exists('cherpdocs/$annrow[id].doc')){
echo br /a href=\cherpdocs/$annrow[id].doc\Funding 
details paper/a;
 }

This is a path relative to the file calling it, should it be otherwise?

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


[PHP] Re: [PHP-DB] explode string variable

2003-03-08 Thread Leif K-Brooks
Try the limit parameter of the explode function, www.php.net/explode.

André Sannerholt wrote:

Hi everyone!

Does anybody know how to stop an explosion of a string: Let me explain:

$variable_aray=explode('-', $variable);

I want the variable to be devided in only two other ones! If for example:

$variable=Willy-Brandt-Platz-5

I want to have an array that looks like this:

$variable_array[0] should be Willy
$variable_array[1] should be Brandt-Platz
Regards

André



 

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


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


Re: [PHP] file_exists() question

2003-03-08 Thread Jim Lucas
what does $annrow[id] return?

I HAVE found that I have to refer to a file when using file_exists() from /

so
file_exists(/path/to/me/cherpdocs/filename.doc)

for it to work right.

Jim
- Original Message - 
From: Charles Kline [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 1:10 PM
Subject: [PHP] file_exists() question


 Can anyone tell me why this code does not return true when the file in 
 the directory cherpdocs/ with the file (which I see as being there) 
 does exist?
 
 if(file_exists('cherpdocs/$annrow[id].doc')){
  echo br /a href=\cherpdocs/$annrow[id].doc\Funding 
 details paper/a;
   }
 
 This is a path relative to the file calling it, should it be otherwise?
 
 Thanks
 Charles
 
 
 -- 
 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] file_exists() question

2003-03-08 Thread Khalid El-Kary
because you can't directly use the $annrow[id] within single quotes, you 
should use double quotes to do so.

file_exists(cherpdocs/$annrow[id].doc)

or

file_exists('cherpdocs/'.$annrow[id].'.doc')

or

file_exists(cherpdocs/.$annrow[id]..doc)

Note: i heared it's prefered to always use the . when including variables 
within strings.

Regards,
Khalid Al-Kary
http://creaturesx.ma.cx/kxparse/



Can anyone tell me why this code does not return true when the file in the 
directory cherpdocs/ with the file (which I see as being there) does exist?

if(file_exists('cherpdocs/$annrow[id].doc')){
echo br /a href=\cherpdocs/$annrow[id].doc\Funding details 
paper/a;
 }

This is a path relative to the file calling it, should it be otherwise?

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


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

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


[PHP] no phun intended!!!

2003-03-08 Thread Chris Knipe
http://www.fingers.co.za/arb/mod_perl.jpg

If this starts a flame war, I'm going to be rather disappointed at people
that's not able to take a joke :P

I think it's hilarious though...

--
me


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



Re: [PHP] Resizing Images Uploaded to Web Page

2003-03-08 Thread Hugh Danaher
Actually you can input .GIF files but you can't output in that format on
most php-gd installs.  The following script shows most of the steps you're
going to need to get an image resized.  This script resizes files already
stored online but it can be changed to deal with a temp file.
Hope this helps.
Hugh

// resize routine, you may want something different
if (!isset($max)) $max=150;  // maximum dimension
if ($resize==2) $max=200;


if ($height$width)
 {
 $nheight=$max;
 $nwidth=$width/($height/$max);
 }
else
 {
 $nwidth=$max;
 $nheight=$height/($width/$max);
 }

//header(content-type: image/jpeg);
$image=imagecreatefromjpeg($picture); //could be imagecreatefromgif()
$image1=imagecreate($nwidth,$nheight);
imagecopyresized( $image1, $image,0,0, 0,0, $nwidth,
$nheight,$width,$height);
//imagecopyresampled( $image1, $image,0,0, 0,0, $nwidth,
$nheight,$width,$height);  // available on newer php versions but, alas, not
mine.
header(content-type: image/jpeg); // needed if you're going to use the
result as an image on another page
imagejpeg($image1); // changing this to imagejpeg($image1,$new_image,80)
creates an image called $new_image with a quality of 80


ImageDestroy($image);
ImageDestroy($image1);
?

- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 12:32 PM
Subject: Re: [PHP] Resizing Images Uploaded to Web Page


  I have users uploading images to a server and need to have those files
  resized on upload. I looked under filesystem, but found nothing like
that.
  Anyone?

 Check the GD extension. You'll need that installed, and the images can't
be
 GIFs (must be JPEGs or TIFs, something like that). Anyway, there should be
a
 function in there called imagecopyresized() you'll want to check out.


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

- Original Message -
From: Vernon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 12:15 PM
Subject: [PHP] Resizing Images Uploaded to Web Page


 I have users uploading images to a server and need to have those files
 resized on upload. I looked under filesystem, but found nothing like that.
 Anyone?

 Thanks



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



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



Re: [PHP] no phun intended!!!

2003-03-08 Thread Khalid El-Kary
sorry, but if PHP (a great piece of knowledge) worths a wet girl for you, so 
you don't know how to appreciate knowledge.

Both PHP and mod_perl are knowledge, science that's more honourful than a 
wet girl

Regards,
Khalid Al-Kary
http://creaturesx.ma.cx/kxparse/
http://www.fingers.co.za/arb/mod_perl.jpg

If this starts a flame war, I'm going to be rather disappointed at people
that's not able to take a joke :P
I think it's hilarious though...

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


_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

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


[PHP] Re: TextImage

2003-03-08 Thread Christopher Smith
I understand how to place the text on the image etc. Just not exactly sure
how to make the image based on how big the text file I put into an array


Christopher Smith [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greetings,

   I've recently searched newsgroup archives on how to convert text into an
 image. However, I cannot seem to find a clear example on how to create the
 image dimensions based on the size of a textfile and then once I create
the
 initial image how to paint the text on the image based on how it appears
in
 the textfile.  Any help with this would be helpful. Thank-you for your
time!





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



RE: [PHP] Re: Php +Xml?

2003-03-08 Thread daniel
what is domxml ? is it similar to sablot ?
= Original Message From Alexandru COSTIN [EMAIL PROTECTED] =
Hello,

 Hello people,

 I want to start using Xml with php. How do I install xml on Apache with
Php?
 I am running redhat 7.2,Apache 1.3.12 and php latest version.
If you want to use SAX, you should already have it installed if you have
compiled PHP with '--with-xml'. (BTW, have you compiled PHP yourself? - do
you know how to compile PHP?).

First of all you should upgrade to a newer apache, as as far as I know
Apache 1.3.12 had some problem when ran with Sablotron (this would be needed
if you will want to use XML with XSL transformations)

Then you should use the domxml extension (add '--with-dom'
'--with-dom-xslt' '--with-dom-exslt' to your configure patch when you are
compiling PHP). After you compile PHP, you should have support for SAX, DOM
and XSL transformations.

And if you want a bootstrap to start using XMLs for content publishing,
you should also look at Krysalis at
http://www.interakt.ro/products/Krysalis/

Alexandru


 How do I install xml? I am totally new to Xmland want to start
 somewhere...

 -Dhaval





 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
 http://join.msn.com/?page=features/virus





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



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



RE: [PHP] Re: Php +Xml?

2003-03-08 Thread Khalid El-Kary
try this parser, it would be useful.

http://creaturesx.ma.cx/kxparse/

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

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


[PHP] save to file

2003-03-08 Thread Ryan Holowaychuk
I am trying to save to a text file.  And I have managed to do that part
now, but what happens is when I save to the file, all the lines get put
into one big line in the file.
 
I am creating a roster input that I adding to our website:  No, name
grade .
 
The roster will contain 15 players
 
So right now the implode puts everything on one line in the text file!!!
 
So I am no sure if anybody can shed some light on this one.
 
Thanks again
Ryan
 
?
//create a new file
   $fp = fopen(/place/on/server/ . $HTTP_POST_VARS['team'] , w);
 
   $file_data = implode(\t\, $_POST);
//this would return values spit by tabs
//write to the open file handle
 fwrite($fp, $file_data . \r\n);
//close the file
 fclose($fp); 
  
?
 
 
 



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



Re: [PHP] file_exists() question

2003-03-08 Thread Jason Sheets
You will probably need to use

file_exists(cherpdocs/{$annrow['id']}.doc) you could also use
file_exists('cherpdocs/' . $annrow['id'] . '.doc')

You should use single quotes to identify your element in an array,
otherwise PHP will try to use it as a constant first.

Jason
On Sat, 2003-03-08 at 14:40, Khalid El-Kary wrote:
 because you can't directly use the $annrow[id] within single quotes, you 
 should use double quotes to do so.
 
 file_exists(cherpdocs/$annrow[id].doc)
 
 or
 
 file_exists('cherpdocs/'.$annrow[id].'.doc')
 
 or
 
 file_exists(cherpdocs/.$annrow[id]..doc)
 
 Note: i heared it's prefered to always use the . when including variables 
 within strings.
 
 Regards,
 Khalid Al-Kary
 http://creaturesx.ma.cx/kxparse/
 
 
 
 
 Can anyone tell me why this code does not return true when the file in the 
 directory cherpdocs/ with the file (which I see as being there) does exist?
 
 if(file_exists('cherpdocs/$annrow[id].doc')){
  echo br /a href=\cherpdocs/$annrow[id].doc\Funding details 
 paper/a;
   }
 
 This is a path relative to the file calling it, should it be otherwise?
 
 Thanks
 Charles
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
 http://join.msn.com/?page=features/featuredemail
-- 
Jason Sheets [EMAIL PROTECTED]

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



Re: [PHP] Re: TextImage

2003-03-08 Thread Jason Sheets
Hi Christopher,

You have to get the width of the font you are using in the image then
multiply that by the length of your string.

There is a gd/image function that returns the width of a font, you can
look at http://www.php.net/manual

Jason
On Sat, 2003-03-08 at 15:30, Christopher Smith wrote:
 I understand how to place the text on the image etc. Just not exactly sure
 how to make the image based on how big the text file I put into an array
 
 
 Christopher Smith [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Greetings,
 
I've recently searched newsgroup archives on how to convert text into an
  image. However, I cannot seem to find a clear example on how to create the
  image dimensions based on the size of a textfile and then once I create
 the
  initial image how to paint the text on the image based on how it appears
 in
  the textfile.  Any help with this would be helpful. Thank-you for your
 time!
 
 
-- 
Jason Sheets [EMAIL PROTECTED]

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



Re: [PHP] file_exists() question

2003-03-08 Thread Ernest E Vogelsinger
At 22:40 08.03.2003, Khalid El-Kary said:
[snip]
because you can't directly use the $annrow[id] within single quotes, you 
should use double quotes to do so.

file_exists(cherpdocs/$annrow[id].doc)

or

file_exists('cherpdocs/'.$annrow[id].'.doc')

or

file_exists(cherpdocs/.$annrow[id]..doc)

Note: i heared it's prefered to always use the . when including variables 
within strings.
[snip] 

Hmm - that's a bit different.

1) You can't use variables in singlequoted strings - these don't get parsed
by PHP.
2) You can absolutely use variables in doublequoted strings as these do get
parsed.
3) Array indices and object references must be enclosed in curly brackets
when used within double quotes to tell PHP what the variable and what the
string text is.
Example:
cherpdocs/$annrow[id].doc  == doesn't work correctly
cherpdocs/{$annrow['id']}.doc == will work
cherpdocs/$object-docname.doc == will not work
cherpdocs/{$object-docname}.doc == will work

Note that you should quote non-numeric array indices to allow PHP to
recognize it's not a defined value. Omitting quotes for index data would
trigger a warning (something like 'using unknown identifier id, assuming
id').


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



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



[PHP] wont display anything but a white page!!!

2003-03-08 Thread Karl James
http://66.12.3.67/webdb/webdb13/assignment_1.phps

Can anyone tell me why I only get a white page
And no text to be on the browser?

Thanks karl.

ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



Re: [PHP] save to file

2003-03-08 Thread Ernest E Vogelsinger
At 00:30 09.03.2003, Ryan Holowaychuk said:
[snip]
So right now the implode puts everything on one line in the text file!!!
 
So I am no sure if anybody can shed some light on this one.
 
Thanks again
Ryan
 
?
//create a new file
   $fp = fopen(/place/on/server/ . $HTTP_POST_VARS['team'] , w);
 
   $file_data = implode(\t\, $_POST);
//this would return values spit by tabs
//write to the open file handle
 fwrite($fp, $file_data . \r\n);
//close the file
 fclose($fp); 
[snip] 

The implode statement will indeed create a single line, that's what you
tell it to do... if you want a line per value, you need to specify the
newline separator, such as
implode(\n, $_POST);
Or am I off topic?


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



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



[PHP] Part PHP part MySQL question

2003-03-08 Thread Beauford.2002
Hi,

I have a hockey database with players names in it and I want to be able to
update their stats one after the other. To be more clear - when the page is
first entered I want the first players name to automatically appear showing
his current stats (this will be in a form). Then you can update the record
and write it back to the database, then the next player will show up with
his stats showing, and the process continues until all the players have been
done. Setting up the database and forms is no problem, but I'm not sure how
I would keep count of what player has been done so the next one
automatically appears (and if there should be a power failure orWindows
crashes, or whatever else - I want the process to start at the last player
being updated - I don't want to have to start again from player one).  I'm
not sure if this is more a PHP or MySQL question - or both - so I have sent
it to both lists.

Thanks

Beauford




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



[PHP] Re: Part PHP part MySQL question

2003-03-08 Thread bill
I'd add a timestamp to the database to automatically track when a record was
last modified.  Then poll the database for the oldest one every time you call
the form, loading it with his stats.

Every time you update a player's data, his timestamp will become the newest, the
form then gets the next oldest.

Lather, rinse, repeat.

kind regards,

bill

Beauford.2002 wrote:

 Hi,

 I have a hockey database with players names in it and I want to be able to
 update their stats one after the other. To be more clear - when the page is
 first entered I want the first players name to automatically appear showing
 his current stats (this will be in a form). Then you can update the record
 and write it back to the database, then the next player will show up with
 his stats showing, and the process continues until all the players have been
 done. Setting up the database and forms is no problem, but I'm not sure how
 I would keep count of what player has been done so the next one
 automatically appears (and if there should be a power failure orWindows
 crashes, or whatever else - I want the process to start at the last player
 being updated - I don't want to have to start again from player one).  I'm
 not sure if this is more a PHP or MySQL question - or both - so I have sent
 it to both lists.

 Thanks

 Beauford


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



[PHP] phorm (PHPMail) script setup problem...

2003-03-08 Thread Dan Sabo
Hi,

I'm New to PHP, I'm running 4.1.2

I'm switching over from perl, trying to get a basic mail form going, trying
to get some freeware running in the meantime while I'm learning PHP and can
write my own.  I'm setting up a freeware script called Phorm, it was
previously called PHPMail.  I got it from http://www.phorm.com/  Anyone
here have experience with this script?

For some reason I'm getting errors when trying to send a test e-mail, and
I've followed the setup instructions for phorm to the letter, the readme
claims there are only a couple of settings to make in the config file and in
the html form itself - I thought this one would be a no brainer.  I did run
the test.php script when I installed and tested PHP on my server - it's
fine, and I also installed MySQL and have phpbb (Forum) running fine now
with MySQL, so I think php is set up correctly.

Do I need to set a path to the PHP library like I do for perl scripts or
anything like that?  I have pasted the code for my html form and the php
config script below, these are the only two files readme tells me I need to
setup for phorm to work correctly.  Can anyone think of what I might be
doing wrong or am missing?

I've had several different errors in the past, but the latest batch are -

 090 - There has been an error, and your information has not been sent.
Alerts:
105 - Mail function failed on user email for template ./lib/generic.txt.
111 - Mail function failed on sending alerts.

Thanks.

HTML form...

HTML
HEAD
TITLEPhorm Test: No Configuration File/TITLE
/HEAD

BODY BGCOLOR=WHITE TEXT=MAROON
FORM METHOD=POST ACTION=phorm.php

BName:/B INPUT TYPE=TEXT NAME=Name nbsp;nbsp;
BEmail:/B INPUT TYPE=TEXT NAME=PHORM_FROM
BRBR

BComment:/B
TEXTAREA NAME=Comment COLS=50 ROWS=3/TEXTAREA
BRBR

INPUT TYPE=SUBMIT VALUE=   Submit   
/FORM

/BODY
/HTML

phormconfig.php ...

?php
# This is the global configuration file. It's read every time Phorm runs.
# If the form calling Phorm has a local (form-specific) configuration file,
# settings in it will override settings here.

# This variable indicates that a local config file is NOT required.
  $PHORM_RCONFIG = N;

  $PHORM_ALERTTO = [EMAIL PROTECTED]; // Change to your email address

  $PHORM_TO  = [EMAIL PROTECTED]; // Change to your email address
  $PHORM_SUBJECT = Form Data;  // The subject of the email message

  $PHORM_TMPL= ph_GENERIC;   // A generic email template
  $PHORM_ACK = ph_GENERIC;   // A generic ack template
?



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



[PHP] Variable Undefined, even when global?

2003-03-08 Thread Ron Biggs
I'm getting a Variable Undefined error, even tho phpinfo() shows me that
globals are set to ON.  I've done massive searches on the web to find a
solution, but I'm totally missing it.  Help?  (I've bolded where the
Variable Undefined is occuring --- where $whatglass =
$lkColor[$i]-glass; is written.)

Here's the code:

==code start=
? $whatx = $HTTP_GET_VARS['x'];
 if ($whatx != null ) {
  $whatx = $whatx;
   }else{
 $whatx = 0;
   }

error_reporting (E_ALL ^ E_WARNING); //Turn on all error reporting EXCEPT
warnings.

class dbColors
{
// var $code;
// var $name;
// var $glass;

 function dbColors($code,$name,$glass)
 {
  $numargs = func_num_args();
  //Array constructor function
  //Create a reference inside the global array $globalref
global $globalref;
$globalref[] = $this;

  $this-code = $code;
  $this-name = $name;
  $this-glass = $glass;
 }
}

// $lkColor = array(dbColors($code,$name,$glass));
 $lkColor[0] = new dbColors;
 $lkColor[0]-dbColors(Z651,Red,9);

 $lkColor[1] = new dbColors;
 $lkColor[1]-dbColors(R3,Cranberry,8,9);
//rest are clipped

 define(test, count($lkColor));
// global test =  count($lkColor);

function ColorCollection($lkID){

 $whatX = $lkID + 1; // Adding 1 turns makes the index correspond to the
template number.

// $aColLen = count($lkColor); //.length
 $aColLen = test; //sizeof($lkColor); //.length

 echo option value=\\ selectedxxx/option\n; //first option is blank

// KeepGoing: //PHP does not have a line-label statement.  Set up a trigger
 for($i=0;$i$aColLen;$i++){
  $trigger = false;
  $whatglass = $lkColor[$i]-glass; //shouldn't $lkColor[any-number] be
global??? 
  // collect/build the option

  //if $lkID = egg or ornament (template numbers 8 or 9)
  if($whatX == 8 || $whatX == 9){ // if yes to either
   if($whatX == 8){
$pos = strpos($whatglass,8);
if($pos === true){
 echo option
value=\{$lkColor[$i]-code}\{$lkColor[$i]-name}/option\n;
 //continue KeepGoing;
 $trigger=true;
 continue;
}
}
   if($whatX == 9){
$pos = strpos($whatglass,9);
if($pos === true){
 echo option value=\ . $lkColor[$i]-code . \ .
$lkColor[$i]-name . /option\n;
 //continue KeepGoing;
 $trigger=true;
 continue;
}
   }
  }else{
   if($trigger == false){
echo option value=\ . $lkColor[$i]-code . \ .
$lkColor[$i]-name . /option\n;
continue;
   }
} //EndIf either 8 or 9
  } // FOR colors loop
} // end function
?

==code end==

I'm calling the function this way:

select name=Main_color id=Main_color size=1
onChange=ChangeColor(this.id) style=width:80pt;
   ?  ColorCollection($whatx); ?
/select


How can $lkColor[$i]-glass not be global?

-ron
[EMAIL PROTECTED]



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



Re: [PHP] Variable Undefined, even when global?

2003-03-08 Thread Ernest E Vogelsinger
At 01:28 09.03.2003, Ron Biggs said:
[snip]
function ColorCollection($lkID){

 $whatX = $lkID + 1; // Adding 1 turns makes the index correspond to the
template number.

// $aColLen = count($lkColor); //.length
 $aColLen = test; //sizeof($lkColor); //.length

 echo option value=\\ selectedxxx/option\n; //first option is blank

// KeepGoing: //PHP does not have a line-label statement.  Set up a trigger
 for($i=0;$i$aColLen;$i++){
  $trigger = false;
  $whatglass = $lkColor[$i]-glass; //shouldn't $lkColor[any-number] be
global??? 
[snip] 

Yes it _is_ global, but within the function you need to declare if global
to have access to it, if you miss this you're referencing a local variable,
which is not defined...

function ColorCollection($lkID){

 global $lkColor; // 

 $whatX = $lkID + 1; // Adding 1 turns makes the index correspond to the
template number.
// $aColLen = count($lkColor); //.length
 $aColLen = test; //sizeof($lkColor); //.length
 echo option value=\\ selectedxxx/option\n; //first option is blank
// KeepGoing: //PHP does not have a line-label statement.  Set up a trigger
 for($i=0;$i$aColLen;$i++){
 $trigger = false;
 $whatglass = $lkColor[$i]-glass; //shouldn't $lkColor[any-number] be
global???



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



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



[PHP] PHP5 + PHP4

2003-03-08 Thread daniel
i forgot who asked but just to show u

PHP4.3.1 :
http://electroteque.dyndns.org:1023/phpinfo.php

PHP5:
http://electroteque.dyndns.org:1025/phpinfo.php



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



Re: [PHP] file_exists() question

2003-03-08 Thread Justin French
on 09/03/03 8:10 AM, Charles Kline ([EMAIL PROTECTED]) wrote:

 if(file_exists('cherpdocs/$annrow[id].doc')){
 echo br /a href=\cherpdocs/$annrow[id].doc\Funding
 details paper/a;
 }

This is a pretty simple debugging type query, so:

First things first, make sure that $annrow[id] is what you expect, by
echoing it to the screen.

?
echo $annrow[id] . br /;
?


Then your file_exists() line has to use double quotes, because you're using
a variable:

file_exists(cherpdocs/$annrow[id].doc)

Or better still, clarify exactly what you want by using {braces} or .'s
file_exists(cherpdocs/{$annrow[id]}.doc)

Or:
file_exists(cherpdocs/ . $annrow[id] . .doc)


Same applies to your echo line.



Summary, I think you can save yourself a little grief by making the
following changes to your code.  Personally, I prefer wrapping all vars in
{braces} if inside a string.  It also includes some minor debugging code, so
that you can hunt down the issue.

?
$file = cherpdocs/{$annrow[id]}.doc

if(file_exists($file)) {
echo br /a href=\{$file}\Funding details paper/a;
} else {
echo The file {$file} did not exist;
}
?


Justin


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



[PHP] Array - Newbie question

2003-03-08 Thread John Taylor-Johnston
New at this, somewhat:

?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name, Option 
Selected,
AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
TI = Title, EricTI, SelTI, BT, BT «Book Title»
);

echo $EricCodesArray=TI[2]; //should display SelTi

?

I want to display SelTi. How to code for it? I know I should know this.
EricCodesArray where TI = [2]

? :)
John


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



RE: [PHP] Array - Newbie question

2003-03-08 Thread daniel
would this work ?

$EricCodesArray[2][2] ?
= Original Message From [EMAIL PROTECTED] =
New at this, somewhat:

?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name,
Option Selected,
AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
TI = Title, EricTI, SelTI, BT, BT «Book Title»
);

echo $EricCodesArray=TI[2]; //should display SelTi

?

I want to display SelTi. How to code for it? I know I should know this.
EricCodesArray where TI = [2]

? :)
John


--
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] repost: cookie problem

2003-03-08 Thread Justin French
1. Perhaps the browsers aren't accepting the cookies, or there are some
other security settings set too high?  Have you LOOKED in each browser to
see if the cookie is set?

2. Is it the EXACT same version of PHP that you have before/after the
reinstall?

3. It *may* be something to do with register globals being off in your
php.ini file...


Justin


on 08/03/03 9:34 PM, H. Miersch ([EMAIL PROTECTED]) wrote:

 i've posted this before to the newsgroup, and i don't think it got
 through to the mailinglist, so i'll try again.
 
 hello.
 i'm new to this NG, so i don't know if this is the right mailinglist
 / newsgroup for my problem. if not, please let me know which one to
 post it to. anyway, here goes:
 
 i'm designing a new website with several php scripts. for that
 purpose i've configuerd my server (apache under MacOSX 10.2.4) to
 process php. the scripts get executed as they should be. so far so
 hoopy. the problem is the cookie. i have a login.php which checks
 user input and depending on the results either sets a cookie,
 displays a message and proceeds to the next page or returns to the
 login page. the problem is, it doesn't work, the browser (netscape,
 safari,...) never gets the cookie. the next page checks the cookie
 and if it isn't set, it returns to the login page. since the cookie
 isn't set, this keeps happening even when it should proceed to the
 order forms.
 now the strange thing: before i had to reinstall OSX, it worked nicely.
 
 what can i do about this? any suggestions?


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



Re: [PHP] Array - Newbie question

2003-03-08 Thread John Taylor-Johnston
echo $EricCodesArray[2][2];

No.


 would this work ?
 $EricCodesArray[2][2] ?
 ?php
 #http://www.php.net/manual/en/ref.array.php
 $EricCodesArray = array (
 CO = Description, Input Name, Select Name, Option Name,
 Option Selected,
 AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
 TI = Title, EricTI, SelTI, BT, BT «Book Title»
 );

 echo $EricCodesArray=TI[2]; //should display SelTi

 ?

 I want to display SelTi. How to code for it? I know I should know this.
 EricCodesArray where TI = [2]


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



Re: [PHP] Variable Undefined, even when global?

2003-03-08 Thread Ron Biggs
You are a god among men, Ernest. THANK YOU!

-ron

Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 At 01:28 09.03.2003, Ron Biggs said:
 [snip]
 function ColorCollection($lkID){
 
  $whatX = $lkID + 1; // Adding 1 turns makes the index correspond to the
 template number.
 
 // $aColLen = count($lkColor); //.length
  $aColLen = test; //sizeof($lkColor); //.length
 
  echo option value=\\ selectedxxx/option\n; //first option is
blank
 
 // KeepGoing: //PHP does not have a line-label statement.  Set up a
trigger
  for($i=0;$i$aColLen;$i++){
   $trigger = false;
   $whatglass = $lkColor[$i]-glass; //shouldn't $lkColor[any-number]
be
 global??? 
 [snip]

 Yes it _is_ global, but within the function you need to declare if global
 to have access to it, if you miss this you're referencing a local
variable,
 which is not defined...

 function ColorCollection($lkID){

  global $lkColor; //


  $whatX = $lkID + 1; // Adding 1 turns makes the index correspond to the
 template number.
 // $aColLen = count($lkColor); //.length
  $aColLen = test; //sizeof($lkColor); //.length
  echo option value=\\ selectedxxx/option\n; //first option is
blank
 // KeepGoing: //PHP does not have a line-label statement.  Set up a
trigger
  for($i=0;$i$aColLen;$i++){
  $trigger = false;
  $whatglass = $lkColor[$i]-glass; //shouldn't $lkColor[any-number] be
 global???



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





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



[PHP] Array - Newbie question

2003-03-08 Thread John Taylor-Johnston
echo $EricCodesArray[2][2];
No. Sorry. Empty set.

I would also like to express it something like:

select EricCodesArray where TI displays [2]

I want to pass TI into a function and build some html for that record.

Pseudo code:
echo (PTI[0] input name=TI[1] select name=TI[2]option 
name=TI[3]/select);

$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name, Option Selected,
AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
TI = Title, EricTI, SelTI, BT, BT «Book Title»
);


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



RE: [PHP] phorm (PHPMail) script setup problem...

2003-03-08 Thread Dan Sabo
Hi Ernest,

Not exactly sure but here's everything on $PHORM_RCONFIG from the readme...

Requiring a Form-Specific Config File
The normal way to run Phorm is to have it named in the ACTION attribute of
your FORM tag on an HTML form, as described above. However, if a visitor
should happen to bookmark your acknowledgement page, thinking he or she
could come back to it later, what they would really be bookmarking would be
Phorm itself. When they return to the bookmark, Phorm would execute, but if
you are using PHORM_CONFIG in a field on your form to name a form-specific
configuration file, this would be bypassed, and Phorm needs to know what to
do in this case. If Phorm starts up and discovers that $PHORM_CONFIG is not
defined, the default action is to display the following message:

   I'm sorry, this page only processes the contents of a form. You cannot
access it directly.

and then terminate. However, if you would rather have Phorm re-direct to a
different URL in such a case, you can set $PHORM_URL. If you choose not to
use form-specific configuration files, and instead have everything in
phormconfig.php3, you can tell Phorm not to require $PHORM_CONFIG to be set,
by setting the variable $PHORM_RCONFIG to N. This setting is very strict:
it must be an upper-case N. This is the only setting of $PHORM_RCONFIG.
Setting it to Y or anything else is meaningless: if $PHORM_RCONFIG is not
explicitly set to N, Phorm will not execute without a local config file.

Note: the operation of $PHORM_RCONFIG is now the opposite of what it was
before version 2.5.1. Before that, it was necessary to set $PHORM_RCONFIG to
Y


And -

$ph_RedirectA URL to re-direct to, set either to $PHORM_URL by the
$PHORM_RCONFIG code, or to$PHORM_RDIRECT or $HTTP_REFERER if there was no
ack template.

And -

$PHORM_RCONFIG: If this is set to Y, Phorm will not run if $PHORM_CONFIG
is not set. You can use this to prevent people from going directly to the
URL for Phorm and bypassing your form (which generates an alert to you!)

And -

$PHORM_URL: A URL to attempt to redirect to if $PHORM_RCONFIG is set and
$PHORM_CONFIG is not - presumably the URL of your form.

Dan

-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 7:48 PM
To: Dan Sabo
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] phorm (PHPMail) script setup problem...


At 01:17 09.03.2003, Dan Sabo said:
[snip]
# This variable indicates that a local config file is NOT required.
  $PHORM_RCONFIG = N;
[snip]

Not that I'd know _anything_ of Phorm, but in my first sight of your post I
thought RCONFIG would mean remote config, and if set to no this would
mean to use a local config?

Just an idea of an absolute outsider...


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




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



[PHP] Changes in PHP 5.0? Important? What?

2003-03-08 Thread Sascha Ende \[GetContent\]
Hello @ all freaks,

what will be the most important changes in PHP 5.0? I only ask, because I
heard, that there will be big changes so that older software will not work
anymore...

Some announces...?

--
MFG
Sascha Ende



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



Re: [PHP] Array - Newbie question

2003-03-08 Thread Jim Lucas
You need to have this

$EricCodesArray = array (
 CO = array(Description,
   Input Name,
   Select Name,
   Option Name,
   Option Selected),
 AN = array(ERIC Number,
   EricAN,
   SelAN,
   AN,
   AN «Annotation»),
 TI = array(Title,
   EricTI,
   SelTI,
   BT,
   BT «Book Title»)
 );

you must place the 5 elements in a sub array

Jim

- Original Message -
From: John Taylor-Johnston [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 4:47 PM
Subject: [PHP] Array - Newbie question


 New at this, somewhat:

 ?php
 #http://www.php.net/manual/en/ref.array.php
 $EricCodesArray = array (
 CO = Description, Input Name, Select Name, Option Name,
Option Selected,
 AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
 TI = Title, EricTI, SelTI, BT, BT «Book Title»
 );

 echo $EricCodesArray=TI[2]; //should display SelTi

 ?

 I want to display SelTi. How to code for it? I know I should know this.
 EricCodesArray where TI = [2]

 ? :)
 John


 --
 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] Array - Newbie question

2003-03-08 Thread John W. Holmes
 You need to have this
 
 $EricCodesArray = array (
  CO = array(Description,
Input Name,
Select Name,
Option Name,
Option Selected),
  AN = array(ERIC Number,
EricAN,
SelAN,
AN,
AN Annotation),
  TI = array(Title,
EricTI,
SelTI,
BT,
BT Book Title)
  );
 
 you must place the 5 elements in a sub array

and then use

echo $EricCodesArray['TI'][2];

to get SelTI

---John Holmes...



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



RE: [PHP] Part PHP part MySQL question

2003-03-08 Thread John W. Holmes
 I have a hockey database with players names in it and I want to be
able to
 update their stats one after the other. To be more clear - when the
page
 is
 first entered I want the first players name to automatically appear
 showing
 his current stats (this will be in a form). Then you can update the
record
 and write it back to the database, then the next player will show up
with
 his stats showing, and the process continues until all the players
have
 been
 done. Setting up the database and forms is no problem, but I'm not
sure
 how
 I would keep count of what player has been done so the next one
 automatically appears (and if there should be a power failure
orWindows
 crashes, or whatever else - I want the process to start at the last
player
 being updated - I don't want to have to start again from player one).
I'm
 not sure if this is more a PHP or MySQL question - or both - so I have
 sent
 it to both lists.

Each player has a unique number, right? Probably an auto_increment
column? Use that to your advantage. 

SELECT * FROM your_table WHERE id  {$_COOKIE['id']} ORDER BY id ASC
LIMIT 1

When you load the first player, $_COOKIE['id'] isn't set, so you'll get
the player with the lowest ID number. Now you submit the form, process
the data, and save the ID of the player you just edited into a cookie
named 'id'. Now when you run the above query, you'll get the next
highest ID number based on the last ID number you saved in a cookie.  

Keep track of the ID number in a cookie so that you'll always get the
next ID whenever you come to the site. Have a method where you can
reset the ID if you need to, also. Once the above query returns no
rows then there is no one left to edit and you'll want to reset it also.


---John W. Holmes...

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



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



RE: [PHP] wont display anything but a white page!!!

2003-03-08 Thread John W. Holmes
 http://66.12.3.67/webdb/webdb13/assignment_1.phps
 
 Can anyone tell me why I only get a white page
 And no text to be on the browser?

Is display errors turned on in php.ini? Usually you get a page like then
when there was an error, but displaying it is not activated in php.ini.

---John W. Holmes...

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



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



Re: [PHP] no phun intended!!!

2003-03-08 Thread Ernest E Vogelsinger
At 23:11 08.03.2003, Chris Knipe said:
[snip]
http://www.fingers.co.za/arb/mod_perl.jpg

If this starts a flame war, I'm going to be rather disappointed at people
that's not able to take a joke :P

I think it's hilarious though...
[snip] 

Hmm. Quite nice girls I'd say.
But I'm sure they have better things in mind than to fuck just mod_perl...

Would like to have them round my office anyway (esp. the dark one in the
background).
*sigh*


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



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



Re: [PHP] phorm (PHPMail) script setup problem...

2003-03-08 Thread Ernest E Vogelsinger
At 01:17 09.03.2003, Dan Sabo said:
[snip] 
# This variable indicates that a local config file is NOT required.
  $PHORM_RCONFIG = N;
[snip] 

Not that I'd know _anything_ of Phorm, but in my first sight of your post I
thought RCONFIG would mean remote config, and if set to no this would
mean to use a local config?

Just an idea of an absolute outsider...


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



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



Re: [PHP] Array - Newbie question

2003-03-08 Thread Ernest E Vogelsinger
At 01:47 09.03.2003, John Taylor-Johnston said:
[snip]
New at this, somewhat:

?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name, 
Option Selected,
AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
TI = Title, EricTI, SelTI, BT, BT «Book Title»
);

This won't run I believe...

Code it like this:
$EricCodesArray = array (
   CO = array(Description, Input Name, Select Name, Option Name, 
Option Selected,),
   AN = array(ERIC Number, EricAN, SelAN, AN, AN «Annotation»,),
   TI = array(Title, EricTI, SelTI, BT, BT «Book Title»,),
);

Then you may reference an element within a subarray:

echo $EricCodesArray['TI'][2]; //should display SelTi

Note that non-numeric array indices (a.k.a. associative arrays)
a) should always be quoted, and
b) are case sensitive.


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



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



[PHP] PEAR AUTH :: Need some advice

2003-03-08 Thread Alex Piaz
Hi Folks!

I am working with pear auth package in order to authenticate some users on 
a project.

Well, I have a mysql table with the following columns:

uid
username
password
name
I can authenticate the user against his username/password without problems, 
but I need also to include the uid, name and age on the session generated 
by Auth. The only data I get is:

Array
(
[auth] = Array
(
[registered] = 1
[username] = geddylee
[timestamp] = 1047172433
[idle] = 1047172433
)
)

The desired results should be:

Array
(
[auth] = Array
(
[registered] = 1
[username] = geddylee
  [uid] = 2112
  [name] = Gary Lee Weinrib
[timestamp] = 1047172433
[idle] = 1047172433
)
)

I read the docs and the mailing list archives, but find nothing about it.

Any tips?

Thanks in advance.

Alex



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


Re: [PHP] Variable Undefined, even when global?

2003-03-08 Thread Ernest E Vogelsinger
At 01:53 09.03.2003, Ron Biggs said:
[snip]
You are a god among men, Ernest. THANK YOU!
[snip] 

Bless you :)

Nope. You're welcome,


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



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



RE: [PHP] wont display anything but a white page!!!

2003-03-08 Thread Daevid Vincent
I have the same problem, and I've found that if you set
error_reporting(E_ALL); at the top of the page you're working on, you
will at least get some info.

You may also set that in the /etc/php.ini file

I also suggest you make a phpinfo.php page wich contains simply:

?php 
phpinfo();
?

And browse that to see all the PHP settings you have. Maybe you have a
local vs. master conflict.

Daevid.

 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, March 08, 2003 5:49 PM
 To: 'Karl James'; [EMAIL PROTECTED]
 Subject: RE: [PHP] wont display anything but a white page!!!
 
 
  http://66.12.3.67/webdb/webdb13/assignment_1.phps
  
  Can anyone tell me why I only get a white page
  And no text to be on the browser?
 
 Is display errors turned on in php.ini? Usually you get a 
 page like then
 when there was an error, but displaying it is not activated 
 in php.ini.
 
 ---John W. Holmes...
 
 PHP Architect - A monthly magazine for PHP Professionals. Get 
 your copy
 today. http://www.phparch.com/
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



[PHP] variable string names

2003-03-08 Thread julian haffegee
Hi all,

I have something thats been driving me mad for days

I have:

if ($where1 != '')
{
$whereArray = array_push($whereArray, $where1);
}

and I want to repeat for $where1 up to $where8

but rather than write it out 8 times, I'd rather use a loop

for ($i=1; $i=8 i++)
{
if ($where1 != '')
{
$whereArray = array_push($whereArray, $where1);
}
}

but how can I change $where1 to $where2, $where3 etc using $i. 
nothing I try seems to work. Do I use eval? 
Thanks for any help given

Jules


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



Re: [PHP] variable string names

2003-03-08 Thread Leif K-Brooks
for ($i=1; $i=8 i++)
{
   if (${'where'.$i} != '')
   {
   $whereArray = array_push($whereArray, ${'where'.$i});
   }
}


julian haffegee wrote:

Hi all,

I have something thats been driving me mad for days

I have:

   if ($where1 != '')
   {
   $whereArray = array_push($whereArray, $where1);
   }
and I want to repeat for $where1 up to $where8

but rather than write it out 8 times, I'd rather use a loop

for ($i=1; $i=8 i++)
{
   if ($where1 != '')
   {
   $whereArray = array_push($whereArray, $where1);
   }
}
but how can I change $where1 to $where2, $where3 etc using $i. 
nothing I try seems to work. Do I use eval? 
Thanks for any help given

Jules

 

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


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


Re: [PHP] variable string names

2003-03-08 Thread Liam Gibbs
You could probably do this. Set up a $$where variable, which would contain
where . $i, $i being the iterator of your loop.


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



[PHP] php trouble

2003-03-08 Thread Benny Pedersen
how do i get var from a url like this one

http://localhost/index.php?sort=namevar2=login

thanks, i have googled, and have found alot of trees but no answer :/

-- 
  5:06am  up 4 days,  1:51,  4 users,  load average: 0.25, 0.25, 0.26


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



[PHP] More array syntax

2003-03-08 Thread John Taylor-Johnston
I have an array $var (see structure below), which contains AN, AU, TI, PY ... etc. (28 
in total - no teasing.) How can access these keys so I can do this:

foreach key in $var until $var.length
{
if(!$something){$something = filter_strings(something: ,$line);}
}

So I can avoid doing this 28 times:

 if(!$AN){$AN = filter_strings(AN: ,$line);}
 if(!$AU){$AU = filter_strings(AU: ,$line);}
 if(!$TI){$TI = filter_strings(TI: ,$line);}
 if(!$PY){$PY = filter_strings(PY: ,$line);}
...

and this 28 times.

if($AN) {DisplayLine('AN',$AN);}
if($AU) {DisplayLine('AU',$AU);}
if($TI) {DisplayLine('TI',$TI);}
if($PY) {DisplayLine('PY',$PY);}
...


$var = array (
 'AN' = array (
 'Description' = 'ERIC_NO: (AN)',
 'Input'   = 'EricAN',
 'Select'  = 'SelAN',
 'Option'  = 'AN',
 'Selected'= 'AN «Annotation»'
 ),
 'AU' = array (
 'Description' = 'AUTHOR: (AU)',
 'Input'   = 'EricAU',
 'Select'  = 'SelAU',
 'Option'  = 'AU',
 'Selected'= 'AU «Author»'
 ),
 'TI' = array (
 'Description' = 'TITLE: (TI)',
 'Input'   = 'EricTI',
 'Select'  = 'SelTI',
 'Option'  = 'TI',
 'Selected'= 'TI «Title»'
 ),
 'PY' = array (
 'Description' = 'PUBLICATION_DATE: (PY)',
 'Input'   = 'EricPY',
 'Select'  = 'SelPY',
 'Option'  = 'YR',
 'Selected'= 'YR «Year of Publication»'
 ),
24 more to go.
)



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



Re: [PHP] php trouble

2003-03-08 Thread Ashley M. Kirchner
Benny Pedersen wrote:

how do i get var from a url like this one

http://localhost/index.php?sort=namevar2=login
 

   In index.php:

   echo $sort;
   echo $var2;
--
M | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



smime.p7s
Description: S/MIME Cryptographic Signature


RE: [PHP] php trouble

2003-03-08 Thread John W. Holmes
 Benny Pedersen wrote:
 
 how do i get var from a url like this one
 
 http://localhost/index.php?sort=namevar2=login
 
 
 
 In index.php:
 
 echo $sort;
 echo $var2;

And if you're wondering why that doesn't work (if it doesn't), then try

echo $_GET['sort'];
echo $_GET['var2'];

and read up on the register_globals setting in your php.ini file.

---John W. Holmes...

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



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



Re: [PHP] php trouble

2003-03-08 Thread Greg Beaver
If register_globals is off

echo $_GET['sort'];
echo $_GET['var2'];
Greg
--
phpDocumentor
http://www.phpdoc.org
Ashley M. Kirchner wrote:
Benny Pedersen wrote:

how do i get var from a url like this one

http://localhost/index.php?sort=namevar2=login
 

   In index.php:

   echo $sort;
   echo $var2;


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


Re: [PHP] More array syntax

2003-03-08 Thread Greg Beaver
Hi John,

foreach ($var as $key = $value)
{
if (!$key) {
 $$key = filter_string($key.': ',$line);
}
}
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
John Taylor-Johnston wrote:
I have an array $var (see structure below), which contains AN, AU, TI, PY ... etc. (28 in total - no teasing.) How can access these keys so I can do this:

foreach key in $var until $var.length
{
if(!$something){$something = filter_strings(something: ,$line);}
}
So I can avoid doing this 28 times:

 if(!$AN){$AN = filter_strings(AN: ,$line);}
 if(!$AU){$AU = filter_strings(AU: ,$line);}
 if(!$TI){$TI = filter_strings(TI: ,$line);}
 if(!$PY){$PY = filter_strings(PY: ,$line);}
...
and this 28 times.

if($AN) {DisplayLine('AN',$AN);}
if($AU) {DisplayLine('AU',$AU);}
if($TI) {DisplayLine('TI',$TI);}
if($PY) {DisplayLine('PY',$PY);}
...
$var = array (
 'AN' = array (
 'Description' = 'ERIC_NO: (AN)',
 'Input'   = 'EricAN',
 'Select'  = 'SelAN',
 'Option'  = 'AN',
 'Selected'= 'AN «Annotation»'
 ),
 'AU' = array (
 'Description' = 'AUTHOR: (AU)',
 'Input'   = 'EricAU',
 'Select'  = 'SelAU',
 'Option'  = 'AU',
 'Selected'= 'AU «Author»'
 ),
 'TI' = array (
 'Description' = 'TITLE: (TI)',
 'Input'   = 'EricTI',
 'Select'  = 'SelTI',
 'Option'  = 'TI',
 'Selected'= 'TI «Title»'
 ),
 'PY' = array (
 'Description' = 'PUBLICATION_DATE: (PY)',
 'Input'   = 'EricPY',
 'Select'  = 'SelPY',
 'Option'  = 'YR',
 'Selected'= 'YR «Year of Publication»'
 ),
24 more to go.
)



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


RE: [PHP] variable string names

2003-03-08 Thread John W. Holmes
 I have:
 
 if ($where1 != '')
 {
 $whereArray = array_push($whereArray, $where1);
 }
 
 and I want to repeat for $where1 up to $where8
 
 but rather than write it out 8 times, I'd rather use a loop
 
 for ($i=1; $i=8 i++)
 {
 if ($where1 != '')
 {
 $whereArray = array_push($whereArray, $where1);
 }
 }
 
 but how can I change $where1 to $where2, $where3 etc using $i.
 nothing I try seems to work. Do I use eval?

Yes, you can use variable variables, like others have suggested, but why
not just use an array? Almost every implementation of variable-variables
seems to be a work around that's used instead of arrays. 

Where are all of your $where variables coming from? If they are from a
form, just name them as where[], then simply loop through them using
foreach($_POST['where']) and check them all. This makes your code more
dynamic as you can add/subtract where[] elements and your processing
code doesn't change. With a variable-variable solution, you have to
change the number of loops you run each time to change the number of
where elements you have.

---John Holmes...



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



RE: [PHP] Array - Newbie question

2003-03-08 Thread daniel
sorry yeh its not a numbered key as like the next posts $EricCodesArray[TI][2]
= Original Message From [EMAIL PROTECTED] =
echo $EricCodesArray[2][2];

No.


 would this work ?
 $EricCodesArray[2][2] ?
 ?php
 #http://www.php.net/manual/en/ref.array.php
 $EricCodesArray = array (
 CO = Description, Input Name, Select Name, Option Name,
 Option Selected,
 AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
 TI = Title, EricTI, SelTI, BT, BT «Book Title»
 );

 echo $EricCodesArray=TI[2]; //should display SelTi

 ?

 I want to display SelTi. How to code for it? I know I should know this.
 EricCodesArray where TI = [2]


--
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] More array syntax

2003-03-08 Thread daniel
here is a tricky question , as i've probably said work is still using php3 and 
mysql 3.22 which has no random select function , and the only way i can 
randomise results is place them into an array and use shuffle , although 
shuffle will not randomise on a two dimensional array , how can i get this to 
work in php3 i have to call the microtime seed function first before shuffle 
it works for one dimensional arrays?



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



RE: [PHP] More array syntax

2003-03-08 Thread John W. Holmes
 here is a tricky question , as i've probably said work is still using
php3
 and
 mysql 3.22 which has no random select function , and the only way i
can
 randomise results is place them into an array and use shuffle ,
although
 shuffle will not randomise on a two dimensional array , how can i get
this
 to
 work in php3 i have to call the microtime seed function first before
 shuffle
 it works for one dimensional arrays?

Can't you just count the array and then choose a random number below the
count?

Won't 

SELECT *, RAND() r FROM your_table ORDER BY r;

work for you?

---John W. Holmes...

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



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



  1   2   >