Re: [PHP] authentication

2004-12-28 Thread Zareef Ahmed
Hi  Ali,
 Visit 

http://zareef.users.phpclasses.org/browse/class/21.html

You will find a lot of code.

zareef ahmed 


On Tue, 28 Dec 2004 13:12:14 +1030, Ali <[EMAIL PROTECTED]> wrote:
> Hi everyone...
> can anyone lead me to a good tutorial on authentication...it wud be good if
> i can get a one in connection with a database..
> thnks
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Making includes and requires safe.

2004-12-28 Thread Zareef Ahmed
I agree with John Holmes that  it is targeted at PHP. It is really
wonderfull thing to know that google, yahoo can detect my php code on
my site. These news item written by total uninformed (or Illinformed )
persons.

zareef ahmed 



-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] $HTTP_POST array

2004-12-28 Thread Zareef Ahmed
Hi Kalinga,

it is not recomended to use $HTTP_POST_VAR array. Use $_POST and 
it have global scope. In PHP5, we have a special directive by which we
can disable $HTTP_*_VAR. currently it defaults to enabled. But who
says in future versions of PHP it default set to disabled. then your
code will not run. So Use $_POST, $_GET etc. instead of using old long
$HTTP_*_* style.


zareef ahmed 


On Mon, 27 Dec 2004 18:31:21 +0300, Burhan Khalid <[EMAIL PROTECTED]> wrote:
> kalinga wrote:
> > Dear all,
> > Is it possible to pass the entire $HTTP_POST array to a function of a class
> > as a variable?
> 
> Use $_POST -- its automatically in scope of every function (you don't
> need to pass it).
> 
> You can pass any array to a function.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Environment and Modules

2004-12-28 Thread Zareef Ahmed
HI,
Install instruction file contains all information you need to enable
some of the exetension.
HINT ::  dlls folder

zareef ahmed 

On Tue, 28 Dec 2004 18:26:52 +0100, Steven Spierenburg
<[EMAIL PROTECTED]> wrote:
> Hi There,
> 
> I recently installed PHP and have two things going on that I can't seem to
> rectify or solve.
> If I may use the collective knowledge of PHP users/developers on these
> groups I would be grateful.
> 
> First some info on my setup:
> OS : Windows 2000 Server
> Webserver :IIS6
> PHP : 4.3.10 (extracted zip version from php.net into folder "c:\php4")
> phpinfo() page : www.jikade.com/test.php
> 
> The problems:
> 
> 1) I want PHP to look for my php.ini file in the php folder (c:\php4) but it
> refuses to do so. Setting PHPRC doesn't help and this setting actualy won't
> show in the summary of phpinfo() in the environment section. I changed the
> PATH environment variable to include "c:\php4" but that doesn't help either.
> Putting the php.ini in the "c:\winnt" folder does work and then I configure
> PHP through this file. Otherwise it won't load *any* php.ini file and use
> defaults, or so it seems.
> What I want to accomplish is that PHP finds and uses the php.ini file that
> resides in the "c:\php4" folder
> 
> 2) Some modules won't load, php_mcrypt.dll for one. I tried setting the
> "extension_dir" (extension_dir = "c:\php4\extensions") but that doesn't
> help. Copying the dll to the "c:\winnt\system32" folder doesn't work either.
> Some modules do load however (php_df.dll loads fine from the same location),
> it's just some modules that don't/won't. Examples are: php_mcrypt.dll,
> php_mhash.dll and php_xmlrpc.dll.
> What I want to accomplish here is that modules can load (obviously) :-)
> Any help on these matters will be appreciated immensly!
> 
> ps: I used a MailExpire temporary email address to be able to post on this
> newsgroup. Don't know if that's a faux-pas around here but I tend to be
> realy carefull with my real email addresses on newsgroups due to spam
> problems. If people say it's ok to use my real email address then I'll use
> that one in future posts. Sorry for any inconvenience caused.
> 
> --
> 
> Greetings,
> Steven Spierenburg
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



[PHP] Arrays

2004-12-28 Thread GH
Would it be possible in a form fields name to make it an array? 

This way it would be i.e. att[$part_id] 

Now is there a way to iterate through the array when I submit the form
to process it, being that the ID numbers are not going to be
sequential and that there will be some numbers not included?

I.E. the id's would be 1, 5, 6, 7, 20, 43

and how would I refence it? would it be $_POST['att']['[partIDhere}'] ?

Thanks
G

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



Re: [PHP] CMS

2004-12-28 Thread Zareef Ahmed
HI Javier,

  You may try (!) pathos which is now available under a new name EXPONENT.
It is based on Smarty template. It is very good at adding   new
exetensions. One of the problem I faced in this CMS is its file
structure. IMO it is best .

visit

http://sourceforge.net/projects/exponent/


zareef ahmed 


On Tue, 28 Dec 2004 16:41:57 +0600, kalinga <[EMAIL PROTECTED]> wrote:
> typo3, it's a good one..
> 
> try it ;-)
> 
> vk.
> 
> On Tue, 28 Dec 2004 11:00:32 +0100, Javier Leyba
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi
> >
> > I'm looking for a good CMS recommendation.
> >
> > I've seen comments in opencms and tested a few (Xaraya was good when I read
> > features but so slow at testing time) but I can't test all and may be other
> > user experience could reduce my test universe.
> >
> > I want a CMS with html code separated from PHP code, fully customizable,
> > easy to implement and fast...
> >
> > Any clue ?
> >
> > Thanks in advance
> >
> > Javier
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> --
> vk.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



[PHP] How to enable TTF extension

2004-12-28 Thread Viet Hung
Hi all,

I'm testing an PHP application, this application
requires TTF extension.
Please help me a way to configure PHP enabling TTF
extension.
I have to download & install which application/module
to configure 
successfully.
I'm using Linux OS (FC3).
Any help will be appreciated highly!
Thanks in advance.

Hung Le



__ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

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



Re: [PHP] PEAR DB vs ADODB

2004-12-28 Thread daniel
> Haven't done much with either of them, besides reading docs, but I'd
> lean towards ADODB for its exception handling(with php5), if you need
> error handling.
>
> Having that said, I haven't really a clue what I'm talking about in
> this regard, so I'll be listening in with interest.
>

I'm assuming PEAR error handling will come out with exception handling ?
Besides , i am using thepear syntax in adodb , i wonder if it will still work 
with the components
ie DataGrid andDB_DataObjects. These tools will be highly useful, I cant see 
much pear
stuff compatible withADODB

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



Re: [PHP] PEAR DB vs ADODB

2004-12-28 Thread Rory Browne
Haven't done much with either of them, besides reading docs, but I'd
lean towards ADODB for its exception handling(with php5), if you need
error handling.

Having that said, I haven't really a clue what I'm talking about in
this regard, so I'll be listening in with interest.


On Wed, 29 Dec 2004 12:25:23 +1100 (EST), [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi there I am in a bit of a dilemma, I have been leaning towards ADODB for
> its speed, but I amliking to use some pear components that only handle pear 
> db etc .. Honest
> opinions, I am doingweb applications and building a little framework for it, 
> will I notice any
> performance differences if Iuse DB ? I have used DB alot in the past, but for 
> this current job had to
> build a custom DBabstraction class with error handling. Let me know
> 
> --
> 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] PEAR DB vs ADODB

2004-12-28 Thread daniel
Hi there I am in a bit of a dilemma, I have been leaning towards ADODB for
its speed, but I amliking to use some pear components that only handle pear db 
etc .. Honest
opinions, I am doingweb applications and building a little framework for it, 
will I notice any
performance differences if Iuse DB ? I have used DB alot in the past, but for 
this current job had to
build a custom DBabstraction class with error handling. Let me know

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



Re: [PHP] cURL and line breaks

2004-12-28 Thread Andrew Kreps
Are you talking about the variable you're POSTing?  Does it make a
difference if you urlencode the form var?  Have you tried debugging
from the server end to see what cURL is passing over?  I use cURL
quite a bit, although I've never tried passing muti-line form data.


On Tue, 28 Dec 2004 15:04:36 -0500, Mike Johnson <[EMAIL PROTECTED]> wrote:
> Just thought I'd throw this one out there to test the waters...
> 
> This past weekend, I was fiddling with cURL to create a "bot" that could
> auto-post to my phpBB message board on-demand. All was working well with
> getting it to login to the board and post, but the strange part came
> when I discovered that it would shear form vars at a \n character.
> 
> I never did pinpoint it to whether it was cURL or phpBB doing it, but I
> suspected cURL. I also didn't do much testing outside of my application
> outside of messing with every CURLOPT_* setting I could lay my hands on.
> 
> Has anyone ever run into something like this, though? I Googled to no
> avail...
> 
> --
> Mike Johnson Smarter Living, Inc.
> Web Developerwww.smarterliving.com
> [EMAIL PROTECTED]   (617) 886-5539
> 
> --
> 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] A serious bug? "or" operator gives out diffferent results depending on order of operands

2004-12-28 Thread Rory Browne
> $a = $b ^^  $c

You sure? It didn't work for me, and it isn't listed in the PHP manual.

I used:


to test it and got a syntax error. 

I suppose you could use the bitwise one as a bit of a hack, so long as
you 'boolean-ised' both arguments first.
eg $a = (!!$b) ^ (!!$c);   // or even $a = !$b ^ !$c; since xor
depends exclusively on both sides being different to each other.


> > Generally however there is no need to parentisize everything to the
> > right of the assignment operator(=), since besides 'and', 'or', 'xor',
> > and the comma operator. The only time I see the need to parentisize
> > everything to the right is when using the xor operator, since there is
> > no equivlent above the = operator.
> 
> $a = $b ^^ $c;
> 
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
> 
> http://www.smempire.org
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



[PHP] MySQL Database type

2004-12-28 Thread The Disguised Jedi
Which type of engine would y'all recommend for a user/customer and
session data storage database?  I'm currently using MyISAM, but I just
was curious to see if you guys could tell me if you know of a better
one, or tell me what you use.

TIA,

-- 
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free

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



Re: [PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread GH
Ok... Here we go 

> On Tuesday 28 December 2004 23:43, GH wrote:
> 
> 
> > During the code... it gets to the following point...
> >
> > [snip]
> > #
> > # Check if report report is present or not  #
> > #
> > if(!mysql_num_rows($dba['results']['attendance_report'])){
> >  #report is not present
> >  return 0;
> > }
> > else {
> >  #report is present
> >  return 1;
> >  #gets here
> > }
> > [/snip]
> >
> > it gets to the return 1 section
> 
> Just to be sure, how are you determining that your code does indeed goes to
> the 'else' branch and return 1? Because if it does indeed return 1 then:
> 
>   echo isAttendanceReport(1); // should display 1
> 
> For debugging something like this I would put in echo statements (or
> trigger_error()) all over the place to indicate which part of the code is
> being executed.
> 
> > however the calling statement just does not seem to work
> 
> If isAttendanceReport() did indeed return 1 then the if-clause in
> displayMenu() would be obviously be true and would obviously execute (unless
> you have uncovered a bug in PHP). So the most likely explanation is that
> isAttendanceReport() is NOT returning 1.
> 
> > using SID = 1, mysql_num_rows($dba['results']['attendance_report'])
> > evaluates to 8
> >
> > Dunno if that helps
> 
> How does $dba['results']['attendance_report'] get assigned? What variables
> does it rely on? What variables are present/not present in the case that
> succeeds/fails?

$dba['query']['attendance_report'] = "Select A.AttID, P.Part_ID,
P.LastName, P.FirstName, A.Present FROM Attendance A, Participants P,
Sessions S Where P.Part_ID = A.Participant  AND  S.SessionID =
A.Session AND A.Session = ".$sd . ' ORDER BY P.LastName ASC';

# attendance_report --> Query is written above.
$dba['results']['attendance_report'] =
mysql_query($dba['query']['attendance_report']) or
die('$dba[\'query\'][\'attendance_report\']: '.mysql_error());

> 
> > > Isolate the problem, just run isAttendanceReport() on its own and plugin
> > > various values to see what comes back.
> >
> > How can I do that... I have tried but how do you see what the output
> > is? I have tried just echo  ing it, print_r, var_dump ...
> 
> By not running unnecessary code. In this case you seemed to have determined
> that isAttendanceReport() is not returning what you think it should be
> returning. Hence running displayMenu() to test for the return value of
> isAttendanceReport() is unnecessary, particularly when the execution of
> displayMenu() is itself subject to a switch construct. So cut through the
> crap and just run isAttendanceReport() direct as in:
> 
>   echo isAttendanceReport(SOME_VALUE_FOR_SID);
> 
> If you still don't get any joy then dig deeper. What isAttendanceReport()
> returns is solely dependent on:
> 
>   mysql_num_rows($dba['results']['attendance_report'])

This return 8 for some the SID value of 1


> 
> As I have hinted above you have to find out what code is setting
> $dba['results']['attendance_report'], what factors (variables) will affect
> that code, and even try running that bit of code direct instead of going
> through isAttendanceReport() (which itself is adding another layer of
> unnecessary complexity).

Most of isAttendanceReport() comes directly from the code of
AttendanceReport() --> the function that fulls the report... the only
thing that it does does diffrently is is check to see if the data is
there instead of displaying the data.

When I was doing the DEBUGGING I had put " echo 'got here(line
number)'; " statements during the code and it displayed going through
out the isAttendanceReport().

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



Re: [PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread Matthew Weier O'Phinney
* Mike Johnson <[EMAIL PROTECTED]>:
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > I am making a gallery for my Homepage. Now, I want to make 
> > little tumbnails of my work and make a table out of them. 
> > So, to not put them all in a row, what whould make the site 
> > unreadable, i have to put them in a little table, an i think 
> > 4 in each row would be ok.
> > 
> > I like to read out the pic's name etc. out of a mysql table. 
> > But how do make the script to write a  after it read 
> > out 4 entries of a mysql table?
> > 
> > Thanks in advance :)
>
> What I generally do is use the mod (%) operator to keep track of where
> it is. 

> The only problem is that at the end of the while() loop, if you want to
> have perfectly-formatted HTML, you need to figure out if it left off in
> the middle of a row and fill with N empty  tags.
>
> Also, if there's a better way to do this, I'm all ears. This is the way
> I've done it for years, but it /is/ a pain to do.

CSS and floats are your friend:






caption here...


 

The beauty of this method is:
* As the browser window expands, more images are allowed per row
* No need to muck about with closing rows
* Separation of content from layout

The cons:
* If you have some images landscape, some portrait, you may get some
  uneven spacing amongst rows. This can be solved by adding a height
  attribute to the style, but if your captions are of variable length,
  this could cause some strange display issues on longer captions.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



[PHP] PHP5 and File Locking

2004-12-28 Thread Gerard Samuel
I started to put together a few classes that reads/writes files,
using the fopen() function, injunction with flock() to
lock files while reading/writing.
And I also was wrapping fopen()/flock() around copy()/unlink()/rename()
with the thinking that they needed file locking *features* while
modifying the filesystem.
I initially chose to use flock() to cut down possibilities of *race
conditions*.
Now Im beginning to question even using the fopen()/flock() way of
reading/writing
files, and instead go to file_[get|put]_contents().
As I understand it, race conditions *can* occur during the php steps
of reading/writing files using the fopen() method ->
fopen(...);
// read or write to file with fread()/fwrite()
fclose(...);
Now my thinking is that if I were to start using file_[get|put]_contents(),
and do away with fopen()/flock(), there would be no need for file locking,
since file_[get|put]_contents() is just one php operation.
I may be wrong with this assumption.
Im looking to see what others may think about file locking using php
functions,
file_[get|put]_contents()/copy()/unlink()/rename() to read/write/modify
the filesystem.
Is it even neccessary in php5?
Thanks for any insight that you can provide...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] $_FILE[user][error] = 6 ?

2004-12-28 Thread Al
I keyed "$_FILE[user][error]" from memory, and it's wrong.  It really is 
"userfile";
Weird problem, eh!
Sebastian wrote:
not sure if its a typo but the array shows "userfile" and your variable
array shows "user"
it looks like the file isn't being passed at all, double check if you have
any typos..  type is blank which should at least show the mime type..
- Original Message - 
From: "Al" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, December 28, 2004 2:51 PM
Subject: Re: [PHP] $_FILE[user][error] = 6 ?


Doesn't work on any file type.
I've checked the usual suspects. e.g.
 URL is
my
php file.
On Wednesday 29 December 2004 01:40, Al wrote:
What is a $_FILE[user][error]=> 6
I can't find Error level 6 in the manual or on Google.
Here is my files array:
[userfile] => Array
   (
[name] => Readme.txt
[type] =>
[tmp_name] =>
[error] => 6
[size] => 0
)
Doesn't make sense.  Readme.txt is simply a small text file on my local
HD.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] cURL and line breaks

2004-12-28 Thread Mike Johnson
Just thought I'd throw this one out there to test the waters...

This past weekend, I was fiddling with cURL to create a "bot" that could
auto-post to my phpBB message board on-demand. All was working well with
getting it to login to the board and post, but the strange part came
when I discovered that it would shear form vars at a \n character.

I never did pinpoint it to whether it was cURL or phpBB doing it, but I
suspected cURL. I also didn't do much testing outside of my application
outside of messing with every CURLOPT_* setting I could lay my hands on.

Has anyone ever run into something like this, though? I Googled to no
avail...


-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smarterliving.com
[EMAIL PROTECTED]   (617) 886-5539

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



Re: [PHP] $_FILE[user][error] = 6 ?

2004-12-28 Thread Matt M.
is 
what comes out in the html or is it ?

can you upload any files at all?

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



Re: [PHP] $_FILE[user][error] = 6 ?

2004-12-28 Thread Sebastian
not sure if its a typo but the array shows "userfile" and your variable
array shows "user"
it looks like the file isn't being passed at all, double check if you have
any typos..  type is blank which should at least show the mime type..

- Original Message - 
From: "Al" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, December 28, 2004 2:51 PM
Subject: Re: [PHP] $_FILE[user][error] = 6 ?


> Doesn't work on any file type.
>
> I've checked the usual suspects. e.g.
>  URL is
my
> php file.
>
> On Wednesday 29 December 2004 01:40, Al wrote:
>
> What is a $_FILE[user][error]=> 6
>
>I can't find Error level 6 in the manual or on Google.
>
>Here is my files array:
>
>[userfile] => Array
> (
>  [name] => Readme.txt
>  [type] =>
>  [tmp_name] =>
>  [error] => 6
>  [size] => 0
>  )
>
> Doesn't make sense.  Readme.txt is simply a small text file on my local
HD.

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



Re: [PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread Chris
Mike Johnson wrote:
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 

 

Hi all
I am making a gallery for my Homepage. Now, I want to make 
little tumbnails of my work and make a table out of them. 
So, to not put them all in a row, what whould make the site 
unreadable, i have to put them in a little table, an i think 
4 in each row would be ok.

I like to read out the pic's name etc. out of a mysql table. 
But how do make the script to write a  after it read 
out 4 entries of a mysql table?

Thanks in advance :)
   

What I generally do is use the mod (%) operator to keep track of where
it is. It returns the remainder of the divisional operator, as such: 

0 % 4 == 0
1 % 4 == 1
2 % 4 == 2
3 % 4 == 3
4 % 4 == 0
5 % 4 == 1
6 % 4 == 2
etc...  
That way, you have a guaranteed 4-member looping variable.
Try something like this:

$result = mysql_query("SELECT * FROM foo ORDER BY bar");
$count = 0;
while ($row = mysql_fetch_assoc($result)) {
$loopcount = $count % 4;
if ($loopcount == 0) {
echo "\n";
}
echo "{$row['baz']}\n";
if ($loopcount == 3) {
echo "\n";
}
}
?>
The only problem is that at the end of the while() loop, if you want to
have perfectly-formatted HTML, you need to figure out if it left off in
the middle of a row and fill with N empty  tags.
Also, if there's a better way to do this, I'm all ears. This is the way
I've done it for years, but it /is/ a pain to do.
Anyway, HTH!
 

Heh, that looks better than what I usually do, but to put a clean finish 
on it, you could do something like:

$loopcount = $count % 4;
if($loopcount > 0)
{
   for(;$loopcount < 4;++$loopcount) echo "empty cell\n";
   echo "\n";
}
That should work, and could be cleaned up a bit better I imagine...
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] $_FILE[user][error] = 6 ?

2004-12-28 Thread Al
Doesn't work on any file type.
I've checked the usual suspects. e.g.
 URL is my 
php file.

Jason Wong wrote:
On Wednesday 29 December 2004 01:40, Al wrote:
What is a $_FILE[user][error]=> 6
I can't find Error level 6 in the manual or on Google.
Here is my files array:
[userfile] => Array
(
[name] => Readme.txt
[type] =>
[tmp_name] =>
[error] => 6
[size] => 0
)
Doesn't make sense.  Readme.txt is simply a small text file on my local HD.
Note, type doesn't register either.

Does upload work at all, or does it only fail for that particular file? 

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


[PHP] help with PEAR and SOAP

2004-12-28 Thread Jones, Douglas 1
Hello,

I have the SOAP PEAR package set up correctly to the point where I can send a 
request and get a response.  However, my web service is designed to return XML 
back to the caller.  When I do this, all of the tags have their "<" and ">" 
converted to < and >.  I have spent much time searching the web for an 
answer to this, but have come up empty handed.  If anyone knows how to solve 
this that would be great.  Also, if anyone has experience writing a web service 
in PHP that returns XML I am open to suggestions of approaches other than using 
the PEAR SOAP package.


Thanks,




-
Doug Jones
Co-Op Web Developer

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



Re: [PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread John Nichel
Robby Russell wrote:
I'd reply, but I don't think it would go anywhere: 

[EMAIL PROTECTED] wrote:
So that's who has 'domain.invalid'.  Damn, I wanted to register that. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread Mike Johnson
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 

> Hi all
> 
> I am making a gallery for my Homepage. Now, I want to make 
> little tumbnails of my work and make a table out of them. 
> So, to not put them all in a row, what whould make the site 
> unreadable, i have to put them in a little table, an i think 
> 4 in each row would be ok.
> 
> I like to read out the pic's name etc. out of a mysql table. 
> But how do make the script to write a  after it read 
> out 4 entries of a mysql table?
> 
> Thanks in advance :)

What I generally do is use the mod (%) operator to keep track of where
it is. It returns the remainder of the divisional operator, as such: 

0 % 4 == 0
1 % 4 == 1
2 % 4 == 2
3 % 4 == 3
4 % 4 == 0
5 % 4 == 1
6 % 4 == 2
etc...  

That way, you have a guaranteed 4-member looping variable.

Try something like this:

\n";
}

echo "{$row['baz']}\n";

if ($loopcount == 3) {
echo "\n";
}

}

?>

The only problem is that at the end of the while() loop, if you want to
have perfectly-formatted HTML, you need to figure out if it left off in
the middle of a row and fill with N empty  tags.

Also, if there's a better way to do this, I'm all ears. This is the way
I've done it for years, but it /is/ a pain to do.

Anyway, HTH!


-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smarterliving.com
[EMAIL PROTECTED]   (617) 886-5539

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



Re: [PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread Robby Russell
On Tue, 2004-12-28 at 19:47 +0100, [EMAIL PROTECTED] wrote:
> Hi all
> 
> I am making a gallery for my Homepage. Now, I want to make little 
> tumbnails of my work and make a table out of them. So, to not put them 
> all in a row, what whould make the site unreadable, i have to put them 
> in a little table, an i think 4 in each row would be ok.
> 
> I like to read out the pic's name etc. out of a mysql table. But how do 
> make the script to write a  after it read out 4 entries of a mysql 
> table?
> 
> Thanks in advance :)

I'd reply, but I don't think it would go anywhere: 
> [EMAIL PROTECTED] wrote:

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/

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



Re: [PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 23:43, GH wrote:



> During the code... it gets to the following point...
>
> [snip]
> #
> # Check if report report is present or not  #
> #
> if(!mysql_num_rows($dba['results']['attendance_report'])){
>  #report is not present
>  return 0;
> }
> else {
>  #report is present
>  return 1;
>  #gets here
> }
> [/snip]
>
> it gets to the return 1 section

Just to be sure, how are you determining that your code does indeed goes to 
the 'else' branch and return 1? Because if it does indeed return 1 then:

  echo isAttendanceReport(1); // should display 1

For debugging something like this I would put in echo statements (or 
trigger_error()) all over the place to indicate which part of the code is 
being executed.

> however the calling statement just does not seem to work

If isAttendanceReport() did indeed return 1 then the if-clause in 
displayMenu() would be obviously be true and would obviously execute (unless 
you have uncovered a bug in PHP). So the most likely explanation is that 
isAttendanceReport() is NOT returning 1.

> using SID = 1, mysql_num_rows($dba['results']['attendance_report'])
> evaluates to 8
>
> Dunno if that helps

How does $dba['results']['attendance_report'] get assigned? What variables 
does it rely on? What variables are present/not present in the case that 
succeeds/fails?

> > Isolate the problem, just run isAttendanceReport() on its own and plugin
> > various values to see what comes back.
>
> How can I do that... I have tried but how do you see what the output
> is? I have tried just echo  ing it, print_r, var_dump ...

By not running unnecessary code. In this case you seemed to have determined 
that isAttendanceReport() is not returning what you think it should be 
returning. Hence running displayMenu() to test for the return value of 
isAttendanceReport() is unnecessary, particularly when the execution of 
displayMenu() is itself subject to a switch construct. So cut through the 
crap and just run isAttendanceReport() direct as in:

  echo isAttendanceReport(SOME_VALUE_FOR_SID);

If you still don't get any joy then dig deeper. What isAttendanceReport() 
returns is solely dependent on:

  mysql_num_rows($dba['results']['attendance_report'])

As I have hinted above you have to find out what code is setting 
$dba['results']['attendance_report'], what factors (variables) will affect 
that code, and even try running that bit of code direct instead of going 
through isAttendanceReport() (which itself is adding another layer of 
unnecessary complexity).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You are wise, witty, and wonderful, but you spend too much time reading
this sort of trash.
*/

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



[PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread user
Hi all
I am making a gallery for my Homepage. Now, I want to make little 
tumbnails of my work and make a table out of them. So, to not put them 
all in a row, what whould make the site unreadable, i have to put them 
in a little table, an i think 4 in each row would be ok.

I like to read out the pic's name etc. out of a mysql table. But how do 
make the script to write a  after it read out 4 entries of a mysql 
table?

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


Re: [PHP] Function Default Values

2004-12-28 Thread Jason Wong
On Wednesday 29 December 2004 01:46, The Disguised Jedi wrote:
> Can you not default to variables in a function? 

No.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If you don't know what game you're playing, don't ask what the score is.
*/

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



Re: [PHP] $_FILE[user][error] = 6 ?

2004-12-28 Thread Jason Wong
On Wednesday 29 December 2004 01:40, Al wrote:
> What is a $_FILE[user][error]=> 6
>
> I can't find Error level 6 in the manual or on Google.
>
> Here is my files array:
>
> [userfile] => Array
>  (
>  [name] => Readme.txt
>  [type] =>
>  [tmp_name] =>
>  [error] => 6
>  [size] => 0
>  )
>
> Doesn't make sense.  Readme.txt is simply a small text file on my local HD.
>
> Note, type doesn't register either.

Does upload work at all, or does it only fail for that particular file? 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Sometime in 1993 NANCY SINATRA will lead a BLOODLESS COUP on GUAM!!
*/

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



Re: [PHP] Test, please ignore

2004-12-28 Thread Jason Wong
On Wednesday 29 December 2004 01:09, Steven Spierenburg wrote:
> to see if i can post...

If you have something to post why not just post it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Fifty flippant frogs
Walked by on flippered feet
And with their slime they made the time
Unnaturally fleet.
*/

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



[PHP] Function Default Values

2004-12-28 Thread The Disguised Jedi
I have written a function to generate and store a salt data for a
session cookie.  I haven't written the MySQL code, so that is absent. 
Basically what I am trying to do is make it so that if there is no
value submitted for an argument, I want it to fall back to the
defaults set up in my config.ini file.  This file is successfully
parsed into the array "$_SETTINGS".  I have no problems doing this.  I
get an "Unexpected T_VARIABLE" in the line with the function
definition.  I know this means that I've got a variable call in the
wrong place, but I don't know why it thinks it is wrong.

Can you not default to variables in a function?  Or am I just writing
it incorrectly?  Please enlighten me on this, I'm pretty much stuck.

--CODE SNIPPET--
function create_salt_data($destination =
$_SETTINGS['session.salt_var'], $prefix =
$_SETTINGS['session.salt_prefix'], $crypt_method =
$_SETTINGS['session.salt_crypt']) {
$crypt_command = '$salt_data = ' . $crypt_method . '(uniqid("' .
$prefix . '"));';
//Did compiling the salt together fail?  If so, return failure.
if (!eval($crypt_command)) {
return false;
}
//  $salt_data = $crypted_salt;

if ($destination != 'return') {
$_SESSION[$destination] = $salt_data;
return true;
}
else {
return $salt_data;
}
}

I have worked around it by making the defaults null, and then testing
and replacing them inside the function.  It takes more code than I
would like it to, I'm trying to condense my files.

Thanks in advance!

-- 
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free

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



Re: [PHP] Test, please ignore

2004-12-28 Thread Robby Russell
On Tue, 2004-12-28 at 18:09 +0100, Steven Spierenburg wrote:
> to see if i can post...
> 

no, you can't.

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/

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



[PHP] $_FILE[user][error] = 6 ?

2004-12-28 Thread Al
What is a $_FILE[user][error]=> 6
I can't find Error level 6 in the manual or on Google.
Here is my files array:
[userfile] => Array
(
[name] => Readme.txt
[type] =>
[tmp_name] =>
[error] => 6
[size] => 0
)
Doesn't make sense.  Readme.txt is simply a small text file on my local HD.
Note, type doesn't register either.
Weird.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Environment and Modules

2004-12-28 Thread Steven Spierenburg
Hi There,

I recently installed PHP and have two things going on that I can't seem to
rectify or solve.
If I may use the collective knowledge of PHP users/developers on these
groups I would be grateful.

First some info on my setup:
OS : Windows 2000 Server
Webserver :IIS6
PHP : 4.3.10 (extracted zip version from php.net into folder "c:\php4")
phpinfo() page : www.jikade.com/test.php

The problems:

1) I want PHP to look for my php.ini file in the php folder (c:\php4) but it
refuses to do so. Setting PHPRC doesn't help and this setting actualy won't
show in the summary of phpinfo() in the environment section. I changed the
PATH environment variable to include "c:\php4" but that doesn't help either.
Putting the php.ini in the "c:\winnt" folder does work and then I configure
PHP through this file. Otherwise it won't load *any* php.ini file and use
defaults, or so it seems.
What I want to accomplish is that PHP finds and uses the php.ini file that
resides in the "c:\php4" folder

2) Some modules won't load, php_mcrypt.dll for one. I tried setting the
"extension_dir" (extension_dir = "c:\php4\extensions") but that doesn't
help. Copying the dll to the "c:\winnt\system32" folder doesn't work either.
Some modules do load however (php_df.dll loads fine from the same location),
it's just some modules that don't/won't. Examples are: php_mcrypt.dll,
php_mhash.dll and php_xmlrpc.dll.
What I want to accomplish here is that modules can load (obviously) :-)
Any help on these matters will be appreciated immensly!

ps: I used a MailExpire temporary email address to be able to post on this
newsgroup. Don't know if that's a faux-pas around here but I tend to be
realy carefull with my real email addresses on newsgroups due to spam
problems. If people say it's ok to use my real email address then I'll use
that one in future posts. Sorry for any inconvenience caused.

-- 

Greetings,
Steven Spierenburg

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



[PHP] Test, please ignore

2004-12-28 Thread Steven Spierenburg
to see if i can post...

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



[PHP] [SOLVED] Re: [PHP] Strange results from file_get_contents using an url as filename

2004-12-28 Thread Ewout de Boer
> I'm getting unexpected data from my file_get_contents function using an
url
> as filename.
>
> The function does not return false, i do get data from it. Problem is that
> is is not the data is requested.

The ISP made a mistake in the server config :-( ... it works again



regards,
Ewout

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



Re: [PHP] Strange results from file_get_contents using an url as filename

2004-12-28 Thread John Hicks
Ewout de Boer wrote:
I'm getting unexpected data from my file_get_contents function using an url
as filename.
The function does not return false, i do get data from it. Problem is that
is is not the data is requested.
 $data =
file_get_contents("http://somehost.com/xmlonl.asp?custid=00&prodid=0
");
 if ($data)
 {
   ...
the string this function returns is the webpage from the default website of
the server where this php code is running at and not the data from the
remote site (which is not on the same server).
i tried the url from my shell on the server using telnet and it gets the
data i expected.
I can't figure out why php is getting the wrong results while telnet on the
same host gets the correct data. Is this a (known) error with php or is it a
apache/php/server configuration problem ?
regards,
Ewout
*Check your PHP runtime config to see if  'allow_url_fopen' is enabled. 
(You can view your configuration using 'phpinfo'. You can change it in 
your php.ini file.)

(See the first tip in the fine manual: 
http://us4.php.net/manual/en/function.file-get-contents.php )
**
-John
*

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


Re: [PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread GH
Ok here is what I get... 

> >The isAttendanceReport() fails... so in the displayMenu() function I get
> >
> > Print Attendance Sheet
> > No Attendance Report Available1
> 
> OK, so why does isAttendanceReport() return 0?
> 
> When debugging it's always a good idea to plugin absolute values where
> possible, ie instead of using isAttendanceReport($SID), use
> isAttendanceReport(1).

When using 1 in the fuction... no change 

During the code... it gets to the following point... 

[snip]
#
# Check if report report is present or not  #
#
if(!mysql_num_rows($dba['results']['attendance_report'])){
#report is not present
return 0;
}
else {
#report is present
return 1;
#gets here
}
[/snip]

it gets to the return 1 section
however the calling statement just does not seem to work

using SID = 1, mysql_num_rows($dba['results']['attendance_report'])
evaluates to 8

Dunno if that helps

> Isolate the problem, just run isAttendanceReport() on its own and plugin
> various values to see what comes back.

How can I do that... I have tried but how do you see what the output
is? I have tried just echo  ing it, print_r, var_dump ...

> 
> > > Note that it is good practice to use { } around your statement(s).
> >
> > I am under the opression that it is only for when you have
> > multistatement groups and not just a one statement after a condition?
> > Please correct me if I am wrong.
> 
> You're not wrong, like I said it's _good practice_. Say you revise your code
> to add more statements, it is all too easy to forget to put in the braces as
> well thus resulting in faulty logic in your code and you pulling your hair
> out trying to figure what the problem is. PHP's flexibility also means that
> there is more than one way to shoot yourself in the foot (TIMTOWTSYITF (TM)).
> 
> BTW PHP is not an oppressive language at all :)
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The wind doth taste so bitter sweet,
>  Like Jaspar wine and sugar,
> It must have blown through someone's feet,
>  Like those of Caspar Weinberger.
>   -- P. Opus
> */
> 
> --
> 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] Strange results from file_get_contents using an url as filename

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 20:03, Ewout de Boer wrote:

>   $data =
> file_get_contents("http://somehost.com/xmlonl.asp?custid=00&prodid=
>0 ");
>
>   if ($data)
>   {
> ...
>
>
> the string this function returns is the webpage from the default website of
> the server where this php code is running at and not the data from the
> remote site (which is not on the same server).

Have you tried other URLs? With and without a query string? Could you give a 
_real life_ example of a URL that doesn't work?

> i tried the url from my shell on the server using telnet and it gets the
> data i expected.
>
> I can't figure out why php is getting the wrong results while telnet on the
> same host gets the correct data. Is this a (known) error with php or is it
> a apache/php/server configuration problem ?

One possible explanation as to why it doesn't work within PHP but works with 
something else is that the target site looks at the user-agent in the request 
header and if it finds something it doesn't like (eg PHP) then it redirects 
the request to http://localhost/ or something. That way the target site hopes 
to prevent bots from harvesting its data. 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I didn't want a hokey second wedding like those ones on TV!  This one's
for real!

  -- Homer Simpson
 A Milhouse Divided
*/

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



Re: [PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 22:29, GH wrote:

Please do not top post.

> The isAttendanceReport() fails... so in the displayMenu() function I get
>
> Print Attendance Sheet
> No Attendance Report Available1

OK, so why does isAttendanceReport() return 0?

When debugging it's always a good idea to plugin absolute values where 
possible, ie instead of using isAttendanceReport($SID), use 
isAttendanceReport(1).

Isolate the problem, just run isAttendanceReport() on its own and plugin 
various values to see what comes back.

> > Note that it is good practice to use { } around your statement(s).
>
> I am under the opression that it is only for when you have
> multistatement groups and not just a one statement after a condition?
> Please correct me if I am wrong.

You're not wrong, like I said it's _good practice_. Say you revise your code 
to add more statements, it is all too easy to forget to put in the braces as 
well thus resulting in faulty logic in your code and you pulling your hair 
out trying to figure what the problem is. PHP's flexibility also means that 
there is more than one way to shoot yourself in the foot (TIMTOWTSYITF (TM)).

BTW PHP is not an oppressive language at all :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The wind doth taste so bitter sweet,
 Like Jaspar wine and sugar,
It must have blown through someone's feet,
 Like those of Caspar Weinberger.
  -- P. Opus
*/

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



Re: [PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread GH
The isAttendanceReport() fails... so in the displayMenu() function I get

Print Attendance Sheet
No Attendance Report Available1

> Note that it is good practice to use { } around your statement(s).

I am under the opression that it is only for when you have
multistatement groups and not just a one statement after a condition?
Please correct me if I am wrong.

Thanks

Gary

On Tue, 28 Dec 2004 19:24:28 +0800, Jason Wong <[EMAIL PROTECTED]> wrote:
> On Tuesday 28 December 2004 13:00, GH wrote:
> 
> > I am having a problem with some php that I have written...  In an
> > attempt to clearly state the problem and how it is supposed to work
> > the following may be lengthy, to which I appologize for.
> 
> It's better to have a lengthy explanation of what your problem is rather than
> havong to trade posts back and forth trying to determine what your problem
> is, so no need to apologize. NB it is good to have a lengthy explanation but
> not good to post lengthy code.
> 
> > I am not getting the results that I am expecting.  I am using the
> > following url  to access my page.
> >
> > http://localhost/AHRC_PL/ahrc_programleader/ahrc_programleader.php?SID=1&ge
> >t_switch=0
> 
> So what *do* you get?
> 
> > In the displayMenu() function it is  (1) supposed to print out a link
> > to get an Attendance Sheet for the SID and  (2) check if an attendance
> > report exists using the isAttendance Report() function... if there is
> > it prints out a link to it (ahrc_programleader.php with SID=$SID and
> > get_switch = 1. Otherwise it prints out "No Attendance Report
> > Available".  the function isAttendanceReport() is supposed to return
> > either a 0 if no report or invalid session id or 1 for is a report.
> >
> > function displayMenu($SID){
> > echo "Print
> > Attendance Sheet \n";
> > if(isAttendanceReport($SID))
> >  echo " > "&get_switch=1\"> Print Attendance Report  \n";
> > else
> 
> Note that it is good practice to use { } around your statement(s).
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Make me look like LINDA RONSTADT again!!
> */
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



Re: [PHP] PHP based Apache admin tool?

2004-12-28 Thread John Nichel
Brian Dunning wrote:
Is there any such thing as a PHP based GUI tool for administering 
Apache? I've searched high & low and found nothing.

- Brian
I don't know of any php based ones, but there's webmin; Perl based.
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Strange results from file_get_contents using an url as filename

2004-12-28 Thread Ewout de Boer
I'm getting unexpected data from my file_get_contents function using an url
as filename.

The function does not return false, i do get data from it. Problem is that
is is not the data is requested.


  $data =
file_get_contents("http://somehost.com/xmlonl.asp?custid=00&prodid=0
");

  if ($data)
  {
...


the string this function returns is the webpage from the default website of
the server where this php code is running at and not the data from the
remote site (which is not on the same server).

i tried the url from my shell on the server using telnet and it gets the
data i expected.

I can't figure out why php is getting the wrong results while telnet on the
same host gets the correct data. Is this a (known) error with php or is it a
apache/php/server configuration problem ?


regards,
Ewout

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



Re: [PHP] Re: negative numbers

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 01:13, Ford, Mike wrote:

> > abs():
> >
> > $doo = -20;
> > for ($i = 1; $i < 1000; $i++) {
> > $dah = abs($doo);
> > }
>
> That's not a valid benchmark, since only on the first pass through the loop
> is $doo negative.  

I'm not sure what you mean by that, could you please elaborate. $doo is not 
reassigned inside the loop, so AFAICS it will be negative for all passes of 
the loop.

> Personally, I'd want to test it with equal numbers of 
> positive and negative values, 

Yes, that might affect the results ...

> and I'd want to know the contribution of the 
> loop and value-setup overhead, so I'd write it like this:

... but this ought to be irrelevant because for practical purposes if you need 
a loop you use a loop along with whatever overhead it brings, it's not as if 
there are alternatives to the loop. As we're only interested in the relative 
speeds of the 2 methods, and as the loop structure is the same for both then 
effectively the loop overhead is inconsequential.


[original code snipped]

Having fixed the subtle bugs(!) running this:

Overhead = ", $oh, "sec\n";
echo "Ternary = ", $tern,
 " sec; less overhead = ", $tern-$oh,
 " sec\n";
echo "Abs() = ", $abs,
 " sec; less overhead = ", $abs-$oh,
 " sec\n";
?>


Results in:

Overhead = 12.942795991898sec
Ternary = 22.343024015427 sec; less overhead = 9.4002280235291 sec
Abs() = 21.590991973877 sec; less overhead = 8.6481959819794 sec

> I don't have access to a php system right now, or I'd run it (just out of
> curiosity!).  Anyone who wants to grab the above and test it is welcome...

And for the even more curious amongst you, using a straight "$doo = -20" and 
"$doo = 20" results in:

$doo = -20
Overhead = 9.3479979038239sec
Ternary = 19.242904186249 sec; less overhead = 9.8949062824249 sec
Abs() = 18.279228925705 sec; less overhead = 8.9312310218811 sec

$doo = 20
Overhead = 7.9141719341278sec
Ternary = 16.776551008224 sec; less overhead = 8.8623790740967 sec
Abs() = 17.280977964401 sec; less overhead = 9.3668060302734 sec


Conclusion if you know that all your values will be positive then using the 
ternary method will be faster (but then why the heck would you need to use 
any method at all if you already knew your values were positive!), otherwise 
abs() is faster and clearer.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
QOTD:
 "She's about as smart as bait."
*/

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



Re: [PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 13:00, GH wrote:

> I am having a problem with some php that I have written...  In an
> attempt to clearly state the problem and how it is supposed to work
> the following may be lengthy, to which I appologize for.

It's better to have a lengthy explanation of what your problem is rather than 
havong to trade posts back and forth trying to determine what your problem 
is, so no need to apologize. NB it is good to have a lengthy explanation but 
not good to post lengthy code.

> I am not getting the results that I am expecting.  I am using the
> following url  to access my page.
>
> http://localhost/AHRC_PL/ahrc_programleader/ahrc_programleader.php?SID=1&ge
>t_switch=0

So what *do* you get?

> In the displayMenu() function it is  (1) supposed to print out a link
> to get an Attendance Sheet for the SID and  (2) check if an attendance
> report exists using the isAttendance Report() function... if there is
> it prints out a link to it (ahrc_programleader.php with SID=$SID and
> get_switch = 1. Otherwise it prints out "No Attendance Report
> Available".  the function isAttendanceReport() is supposed to return
> either a 0 if no report or invalid session id or 1 for is a report.
>
> function displayMenu($SID){
> echo "Print
> Attendance Sheet \n";
> if(isAttendanceReport($SID))
>  echo " "&get_switch=1\"> Print Attendance Report  \n";
> else

Note that it is good practice to use { } around your statement(s).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Make me look like LINDA RONSTADT again!!
*/

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



[PHP] PHP variables on SSL and IE5.x

2004-12-28 Thread Merlin
Hi there,
I am having trouble with posting a form to a php script through SSL on IE prior 
5.5 sp1. It works like a charm on all other browsers. In IE it works without 
SSL, but when SSL is enabled, the browser pops up with a message that he is 
switching to an unsecure site and then all then displays a 404 error with the 
correct php file url inside the Adressbar. I guess the browser is somehow 
loosing all variables submited via post.

Has anybody an idea how to solve that? I cant unfortunatelly provide a link, 
since I had to disable SSL on the productio server due to that error.

Thank you for any help on that,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] CMS

2004-12-28 Thread kalinga
typo3, it's a good one..

try it ;-)

vk.


On Tue, 28 Dec 2004 11:00:32 +0100, Javier Leyba
<[EMAIL PROTECTED]> wrote:
> 
> Hi
> 
> I'm looking for a good CMS recommendation.
> 
> I've seen comments in opencms and tested a few (Xaraya was good when I read
> features but so slow at testing time) but I can't test all and may be other
> user experience could reduce my test universe.
> 
> I want a CMS with html code separated from PHP code, fully customizable,
> easy to implement and fast...
> 
> Any clue ?
> 
> Thanks in advance
> 
> Javier
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
vk.

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



Re: Fwd: Re: [PHP] How to delete text with replies for archive pages

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 18:09, Will McCullough wrote:
> That will result in the same problem, some lines after
> replies, then would be:
>
> <<
>
> And finding out how to delete that with the < in front
> is my problem

That's where the good luck comes in. Sorry if you misunderstood, I wasn't 
offering a solution (other than pointing out that you should make use of the 
standard signature separator), I was just pointing out how it is bad not to 
follow standards :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
BOFH Excuse #193:

Did you pay the new Support Fee?
*/

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



Fwd: Re: [PHP] How to delete text with replies for archive pages

2004-12-28 Thread Will McCullough
 
 



__ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250--- Begin Message ---
That will result in the same problem, some lines after
replies, then would be:

<<

And finding out how to delete that with the < in front
is my problem

--- Jason Wong <[EMAIL PROTECTED]> wrote:

> On Tuesday 28 December 2004 13:26, Will McCullough
> wrote:
> 
> > We are writing a web archive to a mail list
> server.
> > We want to be able to delete the footer that comes
> > through on every email so that we don't end up
> with
> > those long footers that are 4x repeated sometimes
> like
> > in the example here:
> 
> If everyone followed standards and long established
> conventions then life 
> would be a breeze. If the signature (ie your footer)
> is separated from the 
> body by '-- ' (note the space) then
> standards/conventions compliant clients 
> will automatically strip the signature when needed.
> 
> The PHP list does correctly use '-- ' when it
> appends its signature. 
> Unfortunately Yahoo doesn't (probably because it
> doesn't *want* its 
> signatures stripped so that it becomes advertising
> for them).
> 
> > So in this case we want to delete each one of
> those
> > lines and the > in front of them.  What would be
> the
> > best way to do this?
> 
> Look for the '-- ', otherwise good luck :)
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Chicken Little was right.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




__ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

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

[PHP] CMS

2004-12-28 Thread Javier Leyba

Hi

I'm looking for a good CMS recommendation.

I've seen comments in opencms and tested a few (Xaraya was good when I read
features but so slow at testing time) but I can't test all and may be other
user experience could reduce my test universe.

I want a CMS with html code separated from PHP code, fully customizable,
easy to implement and fast...

Any clue ?

Thanks in advance

Javier

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



Re: [PHP] How to delete text with replies for archive pages

2004-12-28 Thread Jason Wong
On Tuesday 28 December 2004 13:26, Will McCullough wrote:

> We are writing a web archive to a mail list server.
> We want to be able to delete the footer that comes
> through on every email so that we don't end up with
> those long footers that are 4x repeated sometimes like
> in the example here:

If everyone followed standards and long established conventions then life 
would be a breeze. If the signature (ie your footer) is separated from the 
body by '-- ' (note the space) then standards/conventions compliant clients 
will automatically strip the signature when needed.

The PHP list does correctly use '-- ' when it appends its signature. 
Unfortunately Yahoo doesn't (probably because it doesn't *want* its 
signatures stripped so that it becomes advertising for them).

> So in this case we want to delete each one of those
> lines and the > in front of them.  What would be the
> best way to do this?

Look for the '-- ', otherwise good luck :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Chicken Little was right.
*/

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