Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-20 Thread John Wells
I don't know if MS Access will behave the same, but in MySQL you can
have a query like so:

SELECT *, DATE_FORMAT(end_date, '%d %m %Y') as end_date_formatted FROM projects;

And it will retrieve all columns from your projects table, plus the
extra one you've created on the fly, and it will be named
"end_date_formatted".

HTH,
John W

On 4/19/06, Bing Du <[EMAIL PROTECTED]> wrote:
> > Do the search as Richard suggested.
> >
> > MS Access might have a similar function you can use, but you'll need
> > to do some searching yourself to find the answer.
> >
> Sure.  I always appreciate various opinions.  I've checked with an Access
> expert.  It can be done for Access like Format([DateFieldName], " 
> ").  But if fields of date type should be formated as needed in the
> query, there is one situation in which I'm not clear how that would work.
> Say, I need to query all the fields from a table which has quite a fields.
>  Some of the fields are of some kind of date type.  Enumerating the fields
> is not feasible.
>
> SELECT * from table;
>
> So in this case, how should the date fields be formated in the query?
>
> Thanks,
>
> Bing
>
> --
> 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] Pushing Vars into $_SESSION

2006-04-20 Thread Chris Grigor

Richard Lynch wrote:


On Wed, April 19, 2006 1:36 am, Chris Grigor wrote:
 


Richard Lynch wrote:

   


On Tue, April 18, 2006 10:05 am, Chris Grigor wrote:
 


Was wondering if there is an easier way to get returned variables
into
the $_SESSION rather than going through each one??
   



 


foreach($line as $key => $value) $_SESSION[$key] = $value;
 



 


Why do this?
Is it really going to help you to have the data stored in TWO
places?
I predict that if you really think about what you are doing, you
won't
want to do this.  There are simply too many pitfalls for this to be a
 



 


The point of me doing this is that I will be pulling menu flags from a
database on a user level.
   



 


in the db I will have menu items 1 to 20 turned on or off. When a user
logs in these flags are pulled
and depending if they are truned on or off, the menu will display.
Catch my drift??
   



Tell us the part about where having them copied into $_SESSION makes
your software better... :-)

Database -> Menu is a very simple and common web design.

Database -> $_SESSION -> Menu only adds an extra step, AFAICT.

Are you able to completely avoid connecting to the database on many
subsequent pages this way?  That could be Good Code.

Or are you just avoiding a single simple query that, with indexed
fields, should run in a splintered second?  That's probably Bad Code.

$_SESSION data is not free.

It's not even cheaper than MySQL data, as a general rule -- though it
might be in specific cases.

Simplify, grasshopper.
:-)

 

The method behind the madness here, is that I am only pulling the data 
once from the db throughout the whole session. This means that all the 
user info is available on every page they visit. I can also
then identify on each page that loads if a user has signed in and a 
session is present. Do you think I am going about this in the wrong way? 
What would you suggest is a better idea???


Chris

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Richard Lynch
On Wed, April 19, 2006 9:42 am, Matt Todd wrote:
> Honestly, I'd love to see basic variables be objects, as models of
> real world data with properties for the data such as a $number->length
> or $word->as_array() giving you letters.

I think you might want to consider using Common Lisp, then.

Cuz pretty much everyting in Common Lisp is an Object.

'Course, it's even WAY older than PHP, so you won't, but there it is.

I am curious to know what you think this should do:

$number = 5;
echo $number->length;

Exactly what is the length of a number?

Is 5 longer than 4?

How about -5?

Is that the same length as 5?

Sheesh!

Let me know when Web 2.0 is actually released.  Until then: SHUT UP!

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Pushing Vars into $_SESSION

2006-04-20 Thread Barry

Chris Grigor wrote:


The method behind the madness here, is that I am only pulling the data 
once from the db throughout the whole session. This means that all the 
user info is available on every page they visit. I can also
then identify on each page that loads if a user has signed in and a 
session is present. Do you think I am going about this in the wrong way? 
What would you suggest is a better idea???


Chris


All the user info? Wouldn't it be enough to have a link on that User?
So that you can get the information you need rather than have all stored 
in a Session.

Btw. what would you do if the User starts updating his Profile.
Wouldn't it be easier to just update the Data-Field of the User rather 
than updating session and Data-Field?


--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] Execute script and redirect

2006-04-20 Thread Peter Lauri
Best groupmember,

 

I have a form that is being filled out. This is the process:

 

1.  Fill out form and click submit
2.  Script validates data
3.  Data is being sent to external source via Web Service
4.  A file is being downloaded (redirects to files location)

 

The problem is that #3 is taking around 15 seconds to complete because the
Web Service is very slow. I would like to run #3 in the background and
directly jump to #4.

 

Is this possible?

 

A little confused :)

 

/Peter

 

 

 

 



[PHP] Re: Execute script and redirect

2006-04-20 Thread Barry

Peter Lauri wrote:

Best groupmember,

 


I have a form that is being filled out. This is the process:

 


1.  Fill out form and click submit
2.  Script validates data
3.  Data is being sent to external source via Web Service
4.  A file is being downloaded (redirects to files location)

 


The problem is that #3 is taking around 15 seconds to complete because the
Web Service is very slow. I would like to run #3 in the background and
directly jump to #4.

 


Is this possible?



Yes. you might use the shell execution for that OR fopen() without url 
restriction and send the commands to the file.


There are lots of ways to do that...

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] programming contests as a way of finding/evaluating offshore talent...

2006-04-20 Thread Richard Lynch
On Wed, April 19, 2006 9:58 am, bruce wrote:
> i'm looking for opinions on the "worth" of programming contests as a
> way of
> judging the talent of potential software developers...
>
> any thoughts/pros/cons would be appreciated..
>
> and yeah.. i know this is a little off topic.. but some of us here
> deal with
> these issues.. if you know of a better email list for this kind of
> question,
> let me know, and i'll move it to there..

Seems to me the BEST candidates will be much too busy working to play
around with the contest...

Even assuming you only want currently-unemployed with nothing better
to do people, I doubt that the contest will really exercise nearly
enough of their skillset to be of much value.

A strong portfolio and years of experience are better indicators.

Not to mention that the code might "win" the contest, but does that
make it good code?  Guess you can write the rules any way you want to
cover that, but so what?  Does being able to code once to your "rules"
mean my code is always that neat and clean?

Seems to me you'd be better off winnowing down the candidate pool
first, then hiring the best on a trial basis for a few weeks/months. 
If it doesn't work out, start calling down the list of second best and
so on and give them a trial run.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-20 Thread Richard Lynch
On Wed, April 19, 2006 9:38 am, Bing Du wrote:
>> Do the search as Richard suggested.
>>
>> MS Access might have a similar function you can use, but you'll need
>> to do some searching yourself to find the answer.
>>
> Sure.  I always appreciate various opinions.  I've checked with an
> Access
> expert.  It can be done for Access like Format([DateFieldName], "
> 
> ").  But if fields of date type should be formated as needed in
> the
> query, there is one situation in which I'm not clear how that would
> work.
> Say, I need to query all the fields from a table which has quite a
> fields.
>  Some of the fields are of some kind of date type.  Enumerating the
> fields
> is not feasible.
>
> SELECT * from table;
>
> So in this case, how should the date fields be formated in the query?

If you've got too many fields in the table to enumerate them all and
apply Format() to them, then you've got MUCH bigger problems on your
hands than date format... :-^

That said, there MAYBE is some kind of introspection function in
whatever you are using to find out which fields are date type and
which are not.

PHP and MySQL have it as:
http://php.net/mysql_field_type

So you should be able to come up with a script that:
#1. Examines the table and finds all the fields of type: 'date'
#2. Constructs a query that gets all the fields, but for those of type
'date' wraps Format(date, '-MM-DD HH:II:SS') around them. (Or
whatever you need to get what you want)
#3. Send your programmatically-constructed query to the database to
get the data you want, the way you want it.
#4. Drive-through Burger King.

You're on your own to actually find the functions that do the
introspection, if they exist for Access.  Ain't nobody got enough
money to make me actually use Access.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Forking a search - pcntl

2006-04-20 Thread Richard Lynch
On Wed, April 19, 2006 3:17 am, James Nunnerley wrote:
> Thanks for everyone's replies - but I'm a little uncertain as to what
> the
> reasons for not running the pcntl functions under the web browser are
> - is
> it down to security?

I could be wrong, but I believe the correct response is:

No, it's down to various threads tromping all over each other
corrupting RAM and crashing your machine in about 5 seconds under any
kind of load.

Other than that, though, you're all set. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] New image already cached.

2006-04-20 Thread Richard Lynch

$image_file = 'foo.jpg';
$random = mt_rand(1, 20);
$url = "http://example.com/program/$random/$image_file";;
echo "

In program, if you echo out $_SERVER['PATHINFO'] you will see:
/454398574395/foo.jpg

The number will change, of course.

You can tear that apart and get the foo.jpg part to do whatever you want.

Or, you could have the URL sometimes have 'copyright' in it, and
sometimes not, and merge only when the URL has copyright in it.

You could even pass is paraeters like this:
http://example.com/program/width=200/2343242343/foo.jpg

Take the width=200 and scale the image to be 200 pixels wide.

Here is a real live example where I do this:
http://uncommonground.com/artist_profile/Ellen+Rosner

Right-click on that image of Ellen in the chair and check out that URL.

thumbnail is my PHP script.
target is a max width/height (I scale it proporationally and 200 is
max for both)
credits is the photographer credits from my database.
The rest is the URL of the actual real image I'm dinking with.

Feel free to play with the URL and change the 200 to, say, 100, or
make believe YOU took that photograph.

All just from the URL which, as far as the browser can tell, is a
perfectly valid set of directory paths on my machine, so the browser
can't possibly screw up.  (Rule #1: Never trust the browser.)

And in the main link, artist_profile is the PHP script, and if you
look at the links to the other artists at the bottom of the page,
you'll see that it also uses PATH_INFO to either show an artist by ID
or to search for their name in our database.

If multiple matches are found, the user is asked which one they meant:
http://uncommonground.com/artist_profile/Ellen

If I have the ID, then I know exactly which one to display.

I actually would suggest you go with:

/width=200/ though, instead of /width/200/ as it's easier to code and
have optional parameters using = and / as an arg separator.

I haven't bothered to fix that old script, but that's how I do it
nowadays.

On Wed, April 19, 2006 8:19 am, tedd wrote:
>>You're also better off embedding the parameters in the URL so that it
>>"looks like" a directory to the browser:
>>
>>http://example.com/actual_script/57823642346963/copyright/whatever.png
>>
>>The PHP scritp is actual_script.
>>
>>You can use .htaccess and ForceType to make Apache run it.
>>
>>$_SERVER['PATH_INFO'] will have all the parameters you need.
>>
>>The embedded parameters pretty much give the browser NO opportunity
>> to
>>screw up.
>
>
>
> Richard:
>
> Far out ! -- I never saw .htaccess and ForceType used before. But it
> works slick in dropping the extension of "program.php" to "program".
> (Now if I can only get my editor to still treat the document as php,
> but that's a different matter).
>
> However, I don't see how I can generate a random number for a url
> each time an image is needed and have .htaccess and ForceType make
> Apache run it -- do I rewrite. htaccess each time, or what?
>
> Also, $_SERVER['PATH_INFO'] (or in my case
> $_SERVER['PATH_TRANSLATED'] ) gives me the path -- so how does that
> fit in?
>
> Please explain.
>
> Thanks.
>
> tedd
>
> --
> 
> http://sperling.com
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Session_destroy

2006-04-20 Thread Richard Lynch
On Wed, April 19, 2006 9:11 am, Paul Waring wrote:
>   setcookie(session_name(), '', (time() - 86400), /);

/ should be in quotes or apostrophes.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Execute script and redirect

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 2:23 am, Peter Lauri wrote:
> 1.Fill out form and click submit
> 2.Script validates data
> 3.Data is being sent to external source via Web Service
> 4.A file is being downloaded (redirects to files location)
>
> The problem is that #3 is taking around 15 seconds to complete because
> the
> Web Service is very slow. I would like to run #3 in the background and
> directly jump to #4.
>
> Is this possible?

There's possible, and then there's possible...

How about this:

The BEST solution would be to insert the [valid/clean] data into a
database, and run a cron job to send off everything to the Web
Service.

You'll have to mark what's sent and what isn't and be careful not to
run two jobs at once when it's really slow (sending duplicate data)
nor to "skip" data that didn't safely get sent.

But should do all that anyway in your script.

There might even be functions in the Web Service to make it easy for
you to send a whole BUNCH of records at once, saving a lot of time on
your end.

And, for sure, if all your script has to do is insert to a database
table for step 3, it's gonna be pretty fast.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Execute script and redirect

2006-04-20 Thread Peter Lauri
That was a smart solution. However, my client have not given me access to
the MySQL database at this stage (just doing a small side project of the
clients web site). If you could not take advantage of database and cron job,
what would you do?

PS! I am not sure that my clients host supports cron jobs  DS!



-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 2:57 PM
To: Peter Lauri
Cc: php-general@lists.php.net
Subject: Re: [PHP] Execute script and redirect

On Thu, April 20, 2006 2:23 am, Peter Lauri wrote:
> 1.Fill out form and click submit
> 2.Script validates data
> 3.Data is being sent to external source via Web Service
> 4.A file is being downloaded (redirects to files location)
>
> The problem is that #3 is taking around 15 seconds to complete because
> the
> Web Service is very slow. I would like to run #3 in the background and
> directly jump to #4.
>
> Is this possible?

There's possible, and then there's possible...

How about this:

The BEST solution would be to insert the [valid/clean] data into a
database, and run a cron job to send off everything to the Web
Service.

You'll have to mark what's sent and what isn't and be careful not to
run two jobs at once when it's really slow (sending duplicate data)
nor to "skip" data that didn't safely get sent.

But should do all that anyway in your script.

There might even be functions in the Web Service to make it easy for
you to send a whole BUNCH of records at once, saving a lot of time on
your end.

And, for sure, if all your script has to do is insert to a database
table for step 3, it's gonna be pretty fast.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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] issue with MySQL procedure and a result set

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 1:55 am, Alain Roger wrote:
> I'm trying to run a MySQL Procedure from one of my PHP page.
>
> 1. the procedure works perfectly under MySQL (it gives the correct
> results),
> so no issue from this side.
> 2.user is able to connect without any issue to MySQL RDBMS, so no
> issue from
> this side.
>
> Here is what i've as error message when PHP page is displayed :
> "PROCEDURE test1 can't return a result set in the given context"
>
> i've searched on internet and i've found 2 intereseting information :
> 1. i should update MyODBC connector. But i do not understand it as it
> work
> perfectly under MySQL query browser or under another Query tool.

Are you using MyODBC?

Why?!

If you are, then this is probably the problem/solution.

See, what MySQL supports and what MyODBC will support in terms of SQL
and PROCEDURES and whatnot don't have to match up.

So you need the new MyODBC and that's all there is to it.

Or switch to using PHP's mysql() functions.

> 2. i should add a flag in my command : mysql_connect();
> this flag should be something like MULTI_CLIENT_. After controling
> the
> PHP documentation (v5.1 and 4.6) this flag does not exist...

Check the MySQL docs.  It's probably a constant in MySQL, not in PHP.

Also just try this:



Only type the real constant name.

If it's not defined in PHP, you'll just see 'MULTI_CLIENT'

If it is defined, it will probably be a number like 15 or 63 or
something.

If it is not defined, you can probably find out what the number is in
the MySQL docs.  If you find out that it is, say, 3, then do:

and just follow the directions about connect.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Best way to start a CRON

2006-04-20 Thread Barry

Hello Everyone!

What would be the best way to start a PHP Script via CRONJOB?
Should i use the 'php' command or use curl or lynx or something to
open that URL?

The Script does a MySQL query, collects data and sends it via E-Mail 
every monday morning to the recipient.


Any help will be appriciated :)

Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Best way to start a CRON

2006-04-20 Thread nicolas figaro

Barry a écrit :

Hello Everyone!

What would be the best way to start a PHP Script via CRONJOB?
Should i use the 'php' command or use curl or lynx or something to
open that URL?


Hi,
unless you need to be sure the http server is up and running, it's a 
better way to run your script via a cronjob.


N F
The Script does a MySQL query, collects data and sends it via E-Mail 
every monday morning to the recipient.


Any help will be appriciated :)

Barry


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



Re: [PHP] Best way to start a CRON

2006-04-20 Thread Pure Web Solution
I run several PHP scripts via CRON in the following way:

put the following in the top of the php script:

#!/usr/local/bin/php -q (linux system - location of php bin)

and in the CRONTAB I have the following:

10 1 * * * root /usr/local/bin/php -q /script/CRONexport.php

the -q supress HTML headers.

hope this helps!


Pure Web Solution
http://www.purewebsolution.co.uk
PHP, MYSQL, Web Design & Web Services

Barry <[EMAIL PROTECTED]> wrote:

> Hello Everyone!
> 
> What would be the best way to start a PHP Script via CRONJOB?
> Should i use the 'php' command or use curl or lynx or something to
> open that URL?
> 
> The Script does a MySQL query, collects data and sends it via E-Mail 
> every monday morning to the recipient.
> 
> Any help will be appriciated :)
> 
> Barry

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



Re: [PHP] Best way to start a CRON

2006-04-20 Thread Barry

Pure Web Solution wrote:

I run several PHP scripts via CRON in the following way:

put the following in the top of the php script:

#!/usr/local/bin/php -q (linux system - location of php bin)

and in the CRONTAB I have the following:

10 1 * * * root /usr/local/bin/php -q /script/CRONexport.php

the -q supress HTML headers.

hope this helps!


Yes it does. Thanks :)

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] POST arrays?

2006-04-20 Thread William Stokes
Hello,

How to post an array with associated values?

This works ok



But if I post it to another form with this:

">

And print there with:

print_r($arr_siirt_jouk);

prints: Array

So how can post the values forward?

Thanks
-Will 

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



[PHP] Re: POST arrays?

2006-04-20 Thread Barry

William Stokes wrote:

Hello,

How to post an array with associated values?

This works ok



But if I post it to another form with this:

">

And print there with:

print_r($arr_siirt_jouk);

prints: Array

So how can post the values forward?

Thanks
-Will 

serialize() unserialize()

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:


How to post an array with associated values?

This works ok



But if I post it to another form with this:

">

And print there with:

print_r($arr_siirt_jouk);

prints: Array

So how can post the values forward?
 



http://php.net/serialize

-Stut

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
No other way?


"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>How to post an array with associated values?
>>
>>This works ok
>>
>>>$arr_siirto = array(1,2,3);
>>print_r($arr_siirto);
>>
>>$arse = $arr_siirto;
>>print_r($arse);
>>?>
>>
>>But if I post it to another form with this:
>>
>>">
>>
>>And print there with:
>>
>>print_r($arr_siirt_jouk);
>>
>>prints: Array
>>
>>So how can post the values forward?
>>
>
> http://php.net/serialize
>
> -Stut 

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



Re: [PHP] POST arrays?

2006-04-20 Thread chris smith
On 4/20/06, William Stokes <[EMAIL PROTECTED]> wrote:
> Hello,
>
> How to post an array with associated values?
>
> This works ok
>
>  $arr_siirto = array(1,2,3);
> print_r($arr_siirto);
>
> $arse = $arr_siirto;
> print_r($arse);
> ?>
>
> But if I post it to another form with this:
>
> ">
>
> And print there with:
>
> print_r($arr_siirt_jouk);
>
> prints: Array
>
> So how can post the values forward?

Instead of posting the values forward, you could store it all in a
session and access it that way.

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] POST arrays?

2006-04-20 Thread Barry

William Stokes wrote:

No other way?




Over sessions or saving as file and loading it in the following page.

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
Can someone help me to get started with serializing? I think I did'nt quite 
understand the manual here...

How to post to $PHP_SELF and read this simple array?

">
?>


I tried:

">
?>

Which, to my great surprice, didn't work :)


Thanks
-Will


"Barry" <[EMAIL PROTECTED]> kirjoitti 
viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>> No other way?
>>
>>
>
> Over sessions or saving as file and loading it in the following page.
>
> -- 
> Smileys rule (cX.x)C --o(^_^o)
> Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) 

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:

Can someone help me to get started with serializing? I think I did'nt quite 
understand the manual here...


How to post to $PHP_SELF and read this simple array?
 



Why do you want to post it to itself? Why not use a session instead? 
It's a lot more efficient.



">

?>


I tried:

 


You need to put the unserialized array somewhere, change this to
$arr_siirt_jouk = unserialize($arr_siirt_jouk);


print_r($arr_siirt_jouk);

//create the array and post it in another name
$arr_siirto = array((serialize('1','2','3'));
 


Here you are still putting an array into the input field. You probably want
$arr_siirto = serialize(array('1','2','3'));

">

?>

Which, to my great surprice, didn't work :)
 

I was surpriced too! Is the manual really that poorly written? I can't 
see how you got to your code by following the examples provided.


-Stut

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



Re: [PHP] POST arrays?

2006-04-20 Thread nicolas figaro

William Stokes a écrit :
Can someone help me to get started with serializing? I think I did'nt quite 
understand the manual here...


  
serialize and unserialize don't modify your variable, but the return 
value is a string or a "mixed" (which means it can be a very complicated 
structure, or a simple

array, an object, etc).

first_script.php :
$string_from_array = serialize($array);





second_script.php :
print_r($POST);
$string = $_POST["art_siirt_jouk"];
$array = unserialize($string);

hope this'll help.

N F



How to post to $PHP_SELF and read this simple array?

">

?>


I tried:

">

?>

Which, to my great surprice, didn't work :)


Thanks
-Will

  


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



[PHP] PHP error log

2006-04-20 Thread Weber Sites LTD
Hi

I'm using PHP 4.4.0 (cli) and all of the errors / warnings are written to
file.
I can see all of the direct errors but when I have an error inside an
include
file the script fails and the error is not shown in the log. I have to
"guess" 
Where the error is.

Any idea what I'm missing.

Thanks
Berber

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



RE: [PHP] POST arrays?

2006-04-20 Thread Weber Sites LTD
Have a look at :
http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=serializ

berber 

-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 1:17 PM
To: php-general@lists.php.net
Subject: Re: [PHP] POST arrays?

Can someone help me to get started with serializing? I think I did'nt quite
understand the manual here...

How to post to $PHP_SELF and read this simple array?

"> ?>


I tried:

">
?>

Which, to my great surprice, didn't work :)


Thanks
-Will


"Barry" <[EMAIL PROTECTED]> kirjoitti 
viestissה:[EMAIL PROTECTED]
> William Stokes wrote:
>> No other way?
>>
>>
>
> Over sessions or saving as file and loading it in the following page.
>
> -- 
> Smileys rule (cX.x)C --o(^_^o)
> Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) 

-- 
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 Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
When you go to http://www.weberdev.com you need to create an account
For some of the options. IF you go to http://www.weberforums.com you
Need to create a 2nd account cause there is no connection between
The two sites.

I'm looking for a script (I found something on phpbb.com but it's not
Working very well) that will save the users the need to open two
Account.

Thanks. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 19, 2006 9:41 PM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

For the purpose of creating phpBB accounts?  As in, automated creation of
mass amounts of phpBB accounts maybe for the purpose of spamming phpBB's?

Just curious. Please clarify the need to automate creation of phpBB accounts
if that's what you're asking for.

-TG

= = = Original message = = =

I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.

NE!?

Thanks

berber


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
"Why do you want to post it to itself? Why not use a session instead? "
-I dont know. Never tried "session"

"It's a lot more efficient."
-OK. Is it more complicated to write?

-Will



"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>Can someone help me to get started with serializing? I think I did'nt 
>>quite understand the manual here...
>>
>>How to post to $PHP_SELF and read this simple array?
>>
>
> Why do you want to post it to itself? Why not use a session instead? It's 
> a lot more efficient.
>
>>>//print the posted array here
>>print_r($arr_siirt_jouk);
>>
>>//create the array and post it in another name
>>$arr_siirto = array(1,2,3);
>>">
>>?>
>>
>>
>>I tried:
>>
>>>//print the posted array here
>>unserialize($arr_siirt_jouk);
>>
> You need to put the unserialized array somewhere, change this to
> $arr_siirt_jouk = unserialize($arr_siirt_jouk);
>
>>print_r($arr_siirt_jouk);
>>
>>//create the array and post it in another name
>>$arr_siirto = array((serialize('1','2','3'));
>>
> Here you are still putting an array into the input field. You probably 
> want
> $arr_siirto = serialize(array('1','2','3'));
>
>>">
>>?>
>>
>>Which, to my great surprice, didn't work :)
>>
> I was surpriced too! Is the manual really that poorly written? I can't see 
> how you got to your code by following the examples provided.
>
> -Stut 

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



Re: [PHP] Best way to start a CRON

2006-04-20 Thread M. Sokolewicz
Actually, you can even use less "code" to do exactly the same thing 
(since you can EITHER make an excutable file with the shebang, which you 
start doing, but never actually do, OR call php to just read the file 
and execute the code inside it, which you in the end do).


Basically, either:
#!/usr/local/bin/php -q (linux system - location of php bin)
at the top of the file, and make sure the crontab has execute 
permissions on that script,


OR

10 1 * * * root /usr/local/bin/php -q /script/CRONexport.php
and make sure your crontab has read permission on the php file (no need 
for the shebang).


As for the -q, I'm sure you meant HTTP headers and not HTML headers ;) 
(at least, I hope you did)


- tul

Pure Web Solution wrote:

I run several PHP scripts via CRON in the following way:

put the following in the top of the php script:

#!/usr/local/bin/php -q (linux system - location of php bin)

and in the CRONTAB I have the following:

10 1 * * * root /usr/local/bin/php -q /script/CRONexport.php

the -q supress HTML headers.

hope this helps!


Pure Web Solution
http://www.purewebsolution.co.uk
PHP, MYSQL, Web Design & Web Services

Barry <[EMAIL PROTECTED]> wrote:



Hello Everyone!

What would be the best way to start a PHP Script via CRONJOB?
Should i use the 'php' command or use curl or lynx or something to
open that URL?

The Script does a MySQL query, collects data and sends it via E-Mail 
every monday morning to the recipient.


Any help will be appriciated :)

Barry


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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Google was the 1st place I looked.

I have been on this list since 1998. Looking at some of the 
answers on this list lately it must be a real disappointment for 
many people. There are many people that like to help but then 
there are those that just love to open the joke threads.

If everything is on Google, what do we need this list for?
If you don't have anything better to write, why don't you
Save us all the BW? I can find cool jokes on Google too...

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 19, 2006 9:39 PM
To: Weber Sites LTD; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

[snip]
I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.
{/snip]

I am looking for a good hearted woman who likes to dance. I used Google.

--
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: SQL result

2006-04-20 Thread M. Sokolewicz

Mohsen Pahlevanzadeh wrote:


Dear all,
I remember that i use a func that it return an array what it consist of 
result of my sql query.

Please name me that.
Yours,Mohsen

it's called "RTFM"

glad to be of help,
- tul

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:


"Why do you want to post it to itself? Why not use a session instead? "
-I dont know. Never tried "session"

"It's a lot more efficient."
-OK. Is it more complicated to write?
 



"session" is great, gets me high every time. See your local supplier or 
go to http://php.net/session to order yours.


In summary...

1) Call session_start(); at the top, that is to say the very first line, 
of every script

2) Use the $_SESSION superglobal at will (no pun intended)
3) PHP takes care of storing the contents of $_SESSION between pages
4) Remember that the session will expire after a period of inactivity or 
when the user closes their browser (subject to the configuration in 
php.ini - the URL above explains all that)

5) There is no step 5!

-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Stut

Weber Sites LTD wrote:


When you go to http://www.weberdev.com you need to create an account
For some of the options. IF you go to http://www.weberforums.com you
Need to create a 2nd account cause there is no connection between
The two sites.

I'm looking for a script (I found something on phpbb.com but it's not
Working very well) that will save the users the need to open two
Account.
 



Maybe I'm just feeling grumpy this morning, but the solution here seems 
obvious and your approach to finding a solution seems wrong.


My solution would be... All user registrations end up in the phpBB 
database. All user logins authenticate against said database.


My method for working our how would be... the phpBB code, seeing as how 
it does this already, is an ideal place to look for the code required to 
do this is it not? Additionally, failing that, surely their support 
resources are probably a better place to seek help for this 'problem' 
than here. I'm sure they get this question regularly.


Oh, and if you want jokes, try Googling for "four spring duck 
technique". Gave me a chuckly this morning.


Yours grumpily,
-Stut

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
OK. Must try that.

BTW theres something odd about my serialize. I got it return something but 
not quite what was expected :) Here's the result "a:3:{i:0;s:1:"

-W

"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>"Why do you want to post it to itself? Why not use a session instead? "
>>-I dont know. Never tried "session"
>>
>>"It's a lot more efficient."
>>-OK. Is it more complicated to write?
>>
>
> "session" is great, gets me high every time. See your local supplier or go 
> to http://php.net/session to order yours.
>
> In summary...
>
> 1) Call session_start(); at the top, that is to say the very first line, 
> of every script
> 2) Use the $_SESSION superglobal at will (no pun intended)
> 3) PHP takes care of storing the contents of $_SESSION between pages
> 4) Remember that the session will expire after a period of inactivity or 
> when the user closes their browser (subject to the configuration in 
> php.ini - the URL above explains all that)
> 5) There is no step 5!
>
> -Stut 

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:


OK. Must try that.

BTW theres something odd about my serialize. I got it return something but 
not quite what was expected :) Here's the result "a:3:{i:0;s:1:"
 



You need to use htmlentities() (http://php.net/htmlentities) on the 
serialized data when putting it into the value attribute of the input tag.


-Stut

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
Is it bad just to remove the single quotes [ ' ]  ?

"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>OK. Must try that.
>>
>>BTW theres something odd about my serialize. I got it return something but 
>>not quite what was expected :) Here's the result "a:3:{i:0;s:1:"
>>
>
> You need to use htmlentities() (http://php.net/htmlentities) on the 
> serialized data when putting it into the value attribute of the input tag.
>
> -Stut 

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:


Is it bad just to remove the single quotes [ ' ]  ?
 



From what? In fact, yes, almost certainly bad.

-Stut


"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
 


William Stokes wrote:

   


OK. Must try that.

BTW theres something odd about my serialize. I got it return something but 
not quite what was expected :) Here's the result "a:3:{i:0;s:1:"


 

You need to use htmlentities() (http://php.net/htmlentities) on the 
serialized data when putting it into the value attribute of the input tag.


-Stut



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



[PHP] GregorianToJD

2006-04-20 Thread tedd

Hi gang:

While looking for a solution to the "Date time Comparison" post, I 
came across a function that looked interesting, namely gregoriantojd 
-- see:


http://www.weberdev.com/gregoriantojd

Everything I've read about it says that it works for PHP 3-5. 
However, I'm working in PHP 4.3.1 and calls to that function give me:


Fatal error: Call to undefined function: gregoriantojd()

What's up with that?

Thanks.

tedd

--

http://sperling.com

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
>From here:
$arr_siirto = array((serialize('1','2','3'));

after removing the single quotes it started to work.

-W

"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>Is it bad just to remove the single quotes [ ' ]  ?
>>
>
> From what? In fact, yes, almost certainly bad.
>
> -Stut
>
>>"Stut" <[EMAIL PROTECTED]> kirjoitti 
>>viestissä:[EMAIL PROTECTED]
>>
>>>William Stokes wrote:
>>>
>>>
OK. Must try that.

BTW theres something odd about my serialize. I got it return something 
but not quite what was expected :) Here's the result "a:3:{i:0;s:1:"


>>>You need to use htmlentities() (http://php.net/htmlentities) on the 
>>>serialized data when putting it into the value attribute of the input 
>>>tag.
>>>
>>>-Stut
>>> 

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:


From here:
$arr_siirto = array((serialize('1','2','3'));

after removing the single quotes it started to work.
 



Yes, the quotes here are not needed because they're numbers. If they 
were not numbers then the quotes would still be needed.


-Stut

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



Re: [PHP] GregorianToJD

2006-04-20 Thread Stut

tedd wrote:

Everything I've read about it says that it works for PHP 3-5. However, 
I'm working in PHP 4.3.1 and calls to that function give me:


Fatal error: Call to undefined function: gregoriantojd()

What's up with that?



That function is part of the calendar extension. Check that this 
extension is compiled in or being loaded.


-Stut

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
You're right.

BTW, can sessions and $POST be mixed? If yes is there any reason what so 
ever to do that?

-W

"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>From here:
>>$arr_siirto = array((serialize('1','2','3'));
>>
>>after removing the single quotes it started to work.
>>
>
> Yes, the quotes here are not needed because they're numbers. If they were 
> not numbers then the quotes would still be needed.
>
> -Stut 

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



Re: [PHP] Best way to start a CRON

2006-04-20 Thread John Nichel

Pure Web Solution wrote:

I run several PHP scripts via CRON in the following way:

put the following in the top of the php script:

#!/usr/local/bin/php -q (linux system - location of php bin)


^^^  If you're going to use this


and in the CRONTAB I have the following:

10 1 * * * root /usr/local/bin/php -q /script/CRONexport.php


There's no need to repeat it here ^^^ (make the script executable)


the -q supress HTML headers.



_HTTP_ headers.  This is only necessary if you're running an older 
version.  The CLI (since 4.2 I think) automatically does this.


http://www.php.net/manual/en/features.commandline.php

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] POST arrays?

2006-04-20 Thread Stut

William Stokes wrote:


You're right.
 



I'm also shocked, but only mildly.

BTW, can sessions and $POST be mixed? If yes is there any reason what so 
ever to do that?
 



Your question indicates that you don't understand what sessions are. 
Please read http://www.oreilly.com/catalog/webdbapps/chapter/ch08.html 
for a well-written introduction.


-Stut

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread John Wells
Here's an invitation to take this off-list.  I've posted my thoughts
on my (currently design-less and under massive construction &
relocation) website.

Direct link to post:
http://s153531379.onlinehome.us/index.php/journal/the-clash-of-the-php-mailing-list-and-the-proverbial-web-2-0-iceberg

Permanent Site:
http://www.johndwells.com

Cheers,
John W

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Not exactly, we are talking about two different sites with two different
Databases. Each site has it's own userbase and authentication will
Still be against the respected DB. I just want the account to be ready
For the user if he already opened it.

Obviously I can reverse engineer the phpBB2 code but that would be
A hard and long task since it's allot of code in allot of files.

If I don't have any other option I will probably do it but isn't the idea
To reuse code? If someone already wrote a script that does exactly
That, and is willing to share it, it will save me much time I can spend
doing other things on WeberDev.com. There are thousands of code
Examples on WeberDev, and they save allot of time to allot of people.
I was hoping someone could save me the time...

Btw, did you mean "four spring duck technique" or "four sprung duck
technique" ?

Thanks
berber
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 2:09 PM
To: Weber Sites LTD
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:

>When you go to http://www.weberdev.com you need to create an account 
>For some of the options. IF you go to http://www.weberforums.com you 
>Need to create a 2nd account cause there is no connection between The 
>two sites.
>
>I'm looking for a script (I found something on phpbb.com but it's not 
>Working very well) that will save the users the need to open two 
>Account.
>  
>

Maybe I'm just feeling grumpy this morning, but the solution here seems
obvious and your approach to finding a solution seems wrong.

My solution would be... All user registrations end up in the phpBB database.
All user logins authenticate against said database.

My method for working our how would be... the phpBB code, seeing as how it
does this already, is an ideal place to look for the code required to do
this is it not? Additionally, failing that, surely their support resources
are probably a better place to seek help for this 'problem' 
than here. I'm sure they get this question regularly.

Oh, and if you want jokes, try Googling for "four spring duck technique".
Gave me a chuckly this morning.

Yours grumpily,
-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Weber Sites LTD wrote:

Google was the 1st place I looked.


Maybe the phpBB site/forums would have been a better choice.

I have been on this list since 1998. Looking at some of the 
answers on this list lately it must be a real disappointment for 
many people. There are many people that like to help but then 
there are those that just love to open the joke threads.


Oh good lawd.  Has everyone gotten overly sensitive these days?  '98 you 
say?  Well, I don't remember you, but one would think being a part of a 
mailing list that long would have given you tougher skin (not to mention 
avoiding top posting (flame away boys)).



If everything is on Google, what do we need this list for?
If you don't have anything better to write, why don't you
Save us all the BW? I can find cool jokes on Google too...



Your time on the soapbox is up.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Stut

Weber Sites LTD wrote:


Not exactly, we are talking about two different sites with two different
Databases. Each site has it's own userbase and authentication will
Still be against the respected DB. I just want the account to be ready
For the user if he already opened it.
 



Are both sites on the same host using the same database server? If so 
why cause the extra work or duplicating the login details?



Obviously I can reverse engineer the phpBB2 code but that would be
A hard and long task since it's allot of code in allot of files.
If I don't have any other option I will probably do it but isn't the idea
To reuse code? If someone already wrote a script that does exactly
That, and is willing to share it, it will save me much time I can spend
doing other things on WeberDev.com. There are thousands of code
Examples on WeberDev, and they save allot of time to allot of people.
I was hoping someone could save me the time...
 



That's fair enough, and I agree that code reuse is good - I publish a 
fair amount myself. However, the correct place to ask for a solution to 
a phpBB-specific problem would be the phpBB community not the general 
PHP community. Or am I still high on "session"?



Btw, did you mean "four spring duck technique" or "four sprung duck
technique" ?
 



Either should work.

-Stut

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
True. I'm not famiar with sessions. I have always used $POST to transmit 
variables.

-W



"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>You're right.
>>
>
> I'm also shocked, but only mildly.
>
>>BTW, can sessions and $POST be mixed? If yes is there any reason what so 
>>ever to do that?
>>
>
> Your question indicates that you don't understand what sessions are. 
> Please read http://www.oreilly.com/catalog/webdbapps/chapter/ch08.html for 
> a well-written introduction.
>
> -Stut 

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



Re: [PHP] POST arrays?

2006-04-20 Thread William Stokes
So. If large amount of variables are needed to be preserved in arrays or 
otherwise is "session" the (normal)way to go?

-W


"Stut" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED]
> William Stokes wrote:
>
>>You're right.
>>
>
> I'm also shocked, but only mildly.
>
>>BTW, can sessions and $POST be mixed? If yes is there any reason what so 
>>ever to do that?
>>
>
> Your question indicates that you don't understand what sessions are. 
> Please read http://www.oreilly.com/catalog/webdbapps/chapter/ch08.html for 
> a well-written introduction.
>
> -Stut 

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Notice that instead of helping, you too, are telling me
to go look for a PHP script somewhere else than the
PHP mailing list where so many php people that may
Have used php to write this script are reading. Why
Is that?

It's not about being overly sensitive, it's about 
The kind of answers that create a negative atmosphere.
If it's just me thinking like that... Forget it. But the
Answers I saw here lately are plain rude.

Btw, http://www.weberdev.com does that ring a bell?
Has been online since April 1998 holding tons
Of php material for anyone looking for it.


berber

 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 3:08 PM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Google was the 1st place I looked.

Maybe the phpBB site/forums would have been a better choice.

> I have been on this list since 1998. Looking at some of the answers on 
> this list lately it must be a real disappointment for many people. 
> There are many people that like to help but then there are those that 
> just love to open the joke threads.

Oh good lawd.  Has everyone gotten overly sensitive these days?  '98 you
say?  Well, I don't remember you, but one would think being a part of a
mailing list that long would have given you tougher skin (not to mention
avoiding top posting (flame away boys)).

> If everything is on Google, what do we need this list for?
> If you don't have anything better to write, why don't you Save us all 
> the BW? I can find cool jokes on Google too...
> 

Your time on the soapbox is up.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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



Re: [PHP] POST arrays?

2006-04-20 Thread tedd

At 3:55 PM +0300 4/20/06, William Stokes wrote:

BTW, can sessions and $POST be mixed? If yes is there any reason what so
ever to do that?


Yes, you can use sessions, post, get, and cookies all in the same 
script if you want.


Yes, there can be reasons to do that.

tedd

--

http://sperling.com

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Stut

Weber Sites LTD wrote:


Notice that instead of helping, you too, are telling me
to go look for a PHP script somewhere else than the
PHP mailing list where so many php people that may
Have used php to write this script are reading. Why
Is that?
 



I can't speak for John, but I pointed you at the phpBB community because 
this is a *general* PHP mailing list. You are looking for *specific* 
help with a *specific* product built using PHP. You wouldn't ask Tarmac 
for help adding a window to a shed built on a Tarmac base would you?


-Stut

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Yes, both sites are on the same server but weberdev was built by me
And weberforums is phpBB2. No sense in writing my own forums application.

WeberDev is the main site and has it's own user base and phpBB2 is 
Pretty complex and I didn't have the time to create a single logon. It
Will not be trivial and will need to be maintained with every phpBB2 
Upgrade.

All I want is to open a phpBB account when someone opens one
On WeberDev.

I don't agree that php-general is the wrong place. I looked in the
phpBB forums for this and found something that doesn't currently
Work. On this list there are many php developers that use phpBB
So why not ask them if anyone already did what I did.

It's not like I'm asking anyone to do the work for me. I devoted
Years of my time on WeberDev for the PHP community (it's my
Hobby and not my main workplace) and all I asked was to know
If someone has created a specific PHP script. Btw, I got several
Off line emails asking me to share the solution if I get it.

Anyway, instead of all of these emails, I'll try to do it myself
And hope someone contacts me soon.

Thanks
berber

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 3:12 PM
To: Weber Sites LTD
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:

>Not exactly, we are talking about two different sites with two 
>different Databases. Each site has it's own userbase and authentication 
>will Still be against the respected DB. I just want the account to be 
>ready For the user if he already opened it.
>  
>

Are both sites on the same host using the same database server? If so why
cause the extra work or duplicating the login details?

>Obviously I can reverse engineer the phpBB2 code but that would be A 
>hard and long task since it's allot of code in allot of files.
>If I don't have any other option I will probably do it but isn't the 
>idea To reuse code? If someone already wrote a script that does exactly 
>That, and is willing to share it, it will save me much time I can spend 
>doing other things on WeberDev.com. There are thousands of code 
>Examples on WeberDev, and they save allot of time to allot of people.
>I was hoping someone could save me the time...
>  
>

That's fair enough, and I agree that code reuse is good - I publish a fair
amount myself. However, the correct place to ask for a solution to a
phpBB-specific problem would be the phpBB community not the general PHP
community. Or am I still high on "session"?

>Btw, did you mean "four spring duck technique" or "four sprung duck 
>technique" ?
>  
>

Either should work.

-Stut

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



[PHP] Offshore hosting

2006-04-20 Thread Dave Goodchild
Hi all, I AM a PHP developer and I KNOW this is off topic, so apologies, but
don't respond if you don't feel like it. One of my clients has a poker site
which we have to move to an offshore dedicated server located in Cyprus,
Malta, Isle Of Man, Alderney or Costa Rica. I am finding it hard to find a
decent company that leases boxes in these locations, some of them are
registered in these countries but have the hardware in the US. Does anyone
have any advice on how to locate a dedicated box? Cheers, next question will
be PHP-related I promise.

--
http://www.web-buddha.co.uk
dynamic web programming from Reigate, Surrey UK

look out for project karma, our new venture, coming soon!


Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-20 Thread Bing Du
> I don't know if MS Access will behave the same, but in MySQL you can
> have a query like so:
>
> SELECT *, DATE_FORMAT(end_date, '%d %m %Y') as end_date_formatted FROM
> projects;
>
> And it will retrieve all columns from your projects table, plus the
> extra one you've created on the fly, and it will be named
> "end_date_formatted".

Great.  Thanks, John.  Yes, it works for Access as well.

Bing

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Martin Alterisio \"El Hombre Gris\"



Matt Todd wrote:


There's nothing wrong with staying true to the philosophy at all, I
just think that it may well be detrimental in the end. And that is
what I said in the (toilet)paper, that there will be (emphasis on the
eventuality, not on the present actuality) a time that PHP will become
the old stuff because it did not evolve with the philosophies.
 

It's true that a language that doesn't evolve with the market will die, 
but still you can expect us to follow any new trend because they believe 
it's "the way to salvation". Try to think first if the new philosophies 
can be properly applied to this market, if they can bring a proper 
solution to our problems (if not they will become a new problem and we 
don't want that). Anyway, programming languages have proved to live 
longer that one could ever expect. Before attending to PHP's funeral, 
I'm pretty sure we'll be burying another die harder language, like the C 
language, in a very emotional ceremony (I can almost see it, someone 
will cry loudly: "I'll miss using your precompiler macros!").



These philosophies are new and I can understand thinking that it's
hype, but it's important to recognize it as legitimate. Agile
Development (and the broader term Web 2.0) is, right now, the bleeding
edge of development, and I and many others see it as the future of
development philosophies.
 

Don't say it's good, prove it! All I can see in "Web 2.0" is "those guys 
are making more money than us, let's copy them!"
"Those guys" are exploring uncharted area in web development and they're 
more worried in making their software work rather than worrying if the 
philosophy is appropiate or not. Still, marketing rules say "no mather 
how unappropiate your company's philosophy is, it's the best". Of course 
they will say "Web 2.0 is the best", is what they're doing and they 
don't want anyone to think they aren't giving the clients the best there 
is. And now we have to deal with even crazier request from our clients, 
like making an AJAX application in a week that supports all imaginable 
browsers in the market. They really believe that AJAX is a fucking walk 
in the park! AJAX is a fricking cocktail of death! Bring out the 
spaghetti code and let us feast on an eternal reengeneering cycle!



I'm not saying that Rasmus can't see, but that he will easily choose
to stay with how he sees the forest – understandable as I choose to
stay with what I see, but I think he has a lot invested in his view
and may not open up as easily.
 

Stop blaming the poor guy! He only made a tool he needed and was kind 
enough to share it with the world. If you want to blame someone for what 
direction PHP has taken, blame us! That's the whole point of PHP being 
open source, isn't it? All the current problems in PHP are directly or 
indirectly caused by whining developers and their extravagant requests. 
Magic quotes are bad? Well, teach those bastards to properly quote their 
sql's strings!


You think that currently PHP is being lead to unavoidable doom? By all 
means, be my guest and make PHP++, for all I care. The code it's there.



To Stut:

Honestly, I'd love to see basic variables be objects, as models of
real world data with properties for the data such as a $number->length
or $word->as_array() giving you letters.

 

Have you stop to think what the efficiency cost would be to make 
everything an object? We're already suffering much to avoid the "waiting 
2.5 second it's way too much" cutline (they say we can't do real time 
applications) and you want to keep adding functionality that will 
deteriorate this? I love the way basic types are handled by PHP, I 
specially love PHP arrays, if you touch them, I fucking kill you!



I know that PHP is a functional language, and secondly, an OO
language, but I think that you can blend these things better and have
the OO brought to the forefront a bit more. Yes, I'm a fan of OO, but
I know that many people aren't and don't use PHP's OO (and don't when
it's appropriate). But I know you can integrate OO without having to
force the functional programmers to give up their way.

 

Have you been attending to your CS lessons? PHP is an *IMPERATIVE* 
language, and secondly, that the language provides OOP features doesn't 
make it an OO language. Maybe you have chosen your language wrongly, you 
should try JSP or any other Java based web server technology.


PS: I think you have the terms wrong. What you're calling functional 
programming may be what is usually known as procedural programming.



This is just ONE thing that could make PHP better and allow for more
modern philosophical development. Particularly, I would like to see
more creativity. Sure, PHP's moving fast, but with our big things
being Unicode support and removing globals and safe mode, I think that
we could be a little more innovative for PHP6.

Again, it's not behind the times right now, but the times are changing
and I'd like to see PHP change with them.

M.T.
 

I won't

Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Weber Sites LTD wrote:

Notice that instead of helping, you too, are telling me
to go look for a PHP script somewhere else than the
PHP mailing list where so many php people that may
Have used php to write this script are reading. Why
Is that?


Actually, saying to go look at the phpBB site/forums *is* helping.  Just 
because phpBB is written in php does not mean the php-general mailing 
list is the best place to find an answer.  If you have a specific 
issue/question about a specific application, where do you think is the 
best place to find an answer?  A forum which deals with the app your 
question is about, or a *general* mailing list?  But I shouldn't have to 
explain that to a 'long time' vet such as yourself, should I?


It's not about being overly sensitive, it's about 
The kind of answers that create a negative atmosphere.

If it's just me thinking like that... Forget it. But the
Answers I saw here lately are plain rude.


This list rude?  This has to be the tamest list I've ever seen.  Hell, 
go try USENET.



Btw, http://www.weberdev.com does that ring a bell?
Has been online since April 1998 holding tons
Of php material for anyone looking for it.



Nope, no bells what-so-ever.  But that doesn't mean anything...sites 
like that are all over the place, and quite honestly, I haven't gone 
looking for help sites in years.


BTW, please fix your clock.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] session

2006-04-20 Thread João Cândido de Souza Neto
Hi everyone.

I hope someone here can help me.

When i start a session in a php page, this session receives an unique id.

If you think about this, if i call a session_destroy() in any page and in
the other paga call a session_start() again, it'll receive other unique id.
But it isn't working. Everything above has been executed but the session
id's always the same.

It can be any config var in php.ini?

Thanks for tips.

-- 
---
João Cândido de Souza Neto
Web Developer

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Brad Bonkoski


Maybe it is just me, but I think these types of discussions/debates 
concerning opposing view points on the direction of web programming is 
as imperative to the general PHP community (i.e. this list) as the 
dangers of register globals and magic quotes etc


At least more relevant then the infamous PHP Interview thread a week or 
so ago ;-)


-B

Martin Alterisio "El Hombre Gris" wrote:




Matt Todd wrote:


There's nothing wrong with staying true to the philosophy at all, I
just think that it may well be detrimental in the end. And that is
what I said in the (toilet)paper, that there will be (emphasis on the
eventuality, not on the present actuality) a time that PHP will become
the old stuff because it did not evolve with the philosophies.
 

It's true that a language that doesn't evolve with the market will 
die, but still you can expect us to follow any new trend because they 
believe it's "the way to salvation". Try to think first if the new 
philosophies can be properly applied to this market, if they can bring 
a proper solution to our problems (if not they will become a new 
problem and we don't want that). Anyway, programming languages have 
proved to live longer that one could ever expect. Before attending to 
PHP's funeral, I'm pretty sure we'll be burying another die harder 
language, like the C language, in a very emotional ceremony (I can 
almost see it, someone will cry loudly: "I'll miss using your 
precompiler macros!").



These philosophies are new and I can understand thinking that it's
hype, but it's important to recognize it as legitimate. Agile
Development (and the broader term Web 2.0) is, right now, the bleeding
edge of development, and I and many others see it as the future of
development philosophies.
 

Don't say it's good, prove it! All I can see in "Web 2.0" is "those 
guys are making more money than us, let's copy them!"
"Those guys" are exploring uncharted area in web development and 
they're more worried in making their software work rather than 
worrying if the philosophy is appropiate or not. Still, marketing 
rules say "no mather how unappropiate your company's philosophy is, 
it's the best". Of course they will say "Web 2.0 is the best", is what 
they're doing and they don't want anyone to think they aren't giving 
the clients the best there is. And now we have to deal with even 
crazier request from our clients, like making an AJAX application in a 
week that supports all imaginable browsers in the market. They really 
believe that AJAX is a fucking walk in the park! AJAX is a fricking 
cocktail of death! Bring out the spaghetti code and let us feast on an 
eternal reengeneering cycle!



I'm not saying that Rasmus can't see, but that he will easily choose
to stay with how he sees the forest – understandable as I choose to
stay with what I see, but I think he has a lot invested in his view
and may not open up as easily.
 

Stop blaming the poor guy! He only made a tool he needed and was kind 
enough to share it with the world. If you want to blame someone for 
what direction PHP has taken, blame us! That's the whole point of PHP 
being open source, isn't it? All the current problems in PHP are 
directly or indirectly caused by whining developers and their 
extravagant requests. Magic quotes are bad? Well, teach those bastards 
to properly quote their sql's strings!


You think that currently PHP is being lead to unavoidable doom? By all 
means, be my guest and make PHP++, for all I care. The code it's there.



To Stut:

Honestly, I'd love to see basic variables be objects, as models of
real world data with properties for the data such as a $number->length
or $word->as_array() giving you letters.

 

Have you stop to think what the efficiency cost would be to make 
everything an object? We're already suffering much to avoid the 
"waiting 2.5 second it's way too much" cutline (they say we can't do 
real time applications) and you want to keep adding functionality that 
will deteriorate this? I love the way basic types are handled by PHP, 
I specially love PHP arrays, if you touch them, I fucking kill you!



I know that PHP is a functional language, and secondly, an OO
language, but I think that you can blend these things better and have
the OO brought to the forefront a bit more. Yes, I'm a fan of OO, but
I know that many people aren't and don't use PHP's OO (and don't when
it's appropriate). But I know you can integrate OO without having to
force the functional programmers to give up their way.

 

Have you been attending to your CS lessons? PHP is an *IMPERATIVE* 
language, and secondly, that the language provides OOP features 
doesn't make it an OO language. Maybe you have chosen your language 
wrongly, you should try JSP or any other Java based web server 
technology.


PS: I think you have the terms wrong. What you're calling functional 
programming may be what is usually known as procedural programming.



This is just ONE thing that could make PHP better 

Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Wolf
OK, so maybe this just seems moot, but...

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me
> And weberforums is phpBB2. No sense in writing my own forums application.
Same server means you can look at the database

> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.

Yeah, I don't see a problem with that one..

> All I want is to open a phpBB account when someone opens one
> On WeberDev.

So, when you open a weberDev account, have your creation script go
through and load the phpBB Database set and run through the same user
login information, dumping it into the phpBB database fields itself.

frankly put, the install MySQL schema has:
# -- Users
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim,
user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile,
user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm,
user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone,
user_dateformat, user_actkey, user_newpasswd, user_notify, user_active)
VALUES ( -1, 'Anonymous', 0, 0, '', '', '', '', '', '', '', '', 0, NULL,
'', '', '', 0, 0, 1, 1, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 0);

# -- username: adminpassword: admin (change this or remove it once
everything is working!)
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim,
user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile,
user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm,
user_popup_pm, user_allow_viewonline, user_rank, user_avatar, user_lang,
user_timezone, user_dateformat, user_actkey, user_newpasswd,
user_notify, user_active) VALUES ( 2, 'Admin', 1, 0,
'21232f297a57a5a743894a0e4a801fc3', '[EMAIL PROTECTED]', '', '', '',
'', '', '', 1, 1, '', '', '', 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, '',
'english', 0, 'd M Y h:i a', '', '', 0, 1);

So, using that information, make your weberdev connect to the phpBB
database (you have all that information already as you had to set it
up), and use 1 script to make them both.

Wolf

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



Re: [PHP] session

2006-04-20 Thread cajbecu
Hello,

Try generating your own session id and the problem will be solved ;)

cheers,

João Cândido de Souza Neto wrote:
> Hi everyone.
> 
> I hope someone here can help me.
> 
> When i start a session in a php page, this session receives an unique id.
> 
> If you think about this, if i call a session_destroy() in any page and in
> the other paga call a session_start() again, it'll receive other unique id.
> But it isn't working. Everything above has been executed but the session
> id's always the same.
> 
> It can be any config var in php.ini?
> 
> Thanks for tips.
> 

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Weber Sites LTD wrote:

Yes, both sites are on the same server but weberdev was built by me
And weberforums is phpBB2. No sense in writing my own forums application.

WeberDev is the main site and has it's own user base and phpBB2 is 
Pretty complex and I didn't have the time to create a single logon. It
Will not be trivial and will need to be maintained with every phpBB2 
Upgrade.


All I want is to open a phpBB account when someone opens one
On WeberDev.

I don't agree that php-general is the wrong place. I looked in the
phpBB forums for this and found something that doesn't currently
Work. On this list there are many php developers that use phpBB
So why not ask them if anyone already did what I did.


Just looked?  You could have asked.  Wrong/right isn't the proper term. 
 phpBB forums are the *best* place to find answers about phpBB.



It's not like I'm asking anyone to do the work for me. I devoted
Years of my time on WeberDev for the PHP community (it's my
Hobby and not my main workplace) and all I asked was to know
If someone has created a specific PHP script. Btw, I got several
Off line emails asking me to share the solution if I get it.

Anyway, instead of all of these emails, I'll try to do it myself
And hope someone contacts me soon.



The solution is really quite simple.  You have two choices to maintain 
the phpBB code base.  1)  Rewrite your login to use the phpBB user 
accounts, or 2)  keep both sets of user tables, and write a few 
functions to call both the phpBB and your user handling code when 
they're needed.


--
John C. Nichel IV (is going to start plonking top posters)
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Tony Marston

""Martin Alterisio "El Hombre Gris""" <[EMAIL PROTECTED]> wrote in 
message news:[EMAIL PROTECTED]
>
>
> Matt Todd wrote:
>
 

> Have you stop to think what the efficiency cost would be to make 
> everything an object? We're already suffering much to avoid the "waiting 
> 2.5 second it's way too much" cutline (they say we can't do real time 
> applications) and you want to keep adding functionality that will 
> deteriorate this? I love the way basic types are handled by PHP, I 
> specially love PHP arrays, if you touch them, I fucking kill you!

And I'll offer to hold your coat while you're doing it!

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Jeremy Schreckhise
Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.


Jeremy Schreckhise 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 9:11 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
> 
> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.
> 
> All I want is to open a phpBB account when someone opens one On 
> WeberDev.
> 
> I don't agree that php-general is the wrong place. I looked in the 
> phpBB forums for this and found something that doesn't currently Work. 
> On this list there are many php developers that use phpBB So why not 
> ask them if anyone already did what I did.

Just looked?  You could have asked.  Wrong/right isn't the proper term. 
  phpBB forums are the *best* place to find answers about phpBB.

> It's not like I'm asking anyone to do the work for me. I devoted Years 
> of my time on WeberDev for the PHP community (it's my Hobby and not my 
> main workplace) and all I asked was to know If someone has created a 
> specific PHP script. Btw, I got several Off line emails asking me to 
> share the solution if I get it.
> 
> Anyway, instead of all of these emails, I'll try to do it myself And 
> hope someone contacts me soon.
> 

The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.

-- 
John C. Nichel IV (is going to start plonking top posters)
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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



RE: [PHP] POST arrays?

2006-04-20 Thread Ing. Edwin Cruz
I'd try this:
";
}
?>

And when submit do this:




Regards!


Edwin.



-Mensaje original-
De: tedd [mailto:[EMAIL PROTECTED] 
Enviado el: Jueves, 20 de Abril de 2006 08:28 a.m.
Para: William Stokes; php-general@lists.php.net
Asunto: Re: [PHP] POST arrays?


At 3:55 PM +0300 4/20/06, William Stokes wrote:
>BTW, can sessions and $POST be mixed? If yes is there any reason what 
>so ever to do that?

Yes, you can use sessions, post, get, and cookies all in the same 
script if you want.

Yes, there can be reasons to do that.

tedd

-- 


http://sperling.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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Jeremy Schreckhise wrote:

Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.



Gee, I wish I would have said that.



The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.



--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] session

2006-04-20 Thread Ing. Edwin Cruz
You should set a name to your session:

Index.php:



LogOff.php

++
| ISC Edwin Cruz <[EMAIL PROTECTED]>| ++
| IT Manager, MySQL GUI Doc Team | ||
| Transportes Medel Rogero SA de CV  | ||
| Desk:  +52 (449) 910 30 90 x3054   | ++
| MX Mobile: +52 (449) 111 29 03 |
| Aguascalientes, Mexico |
| Skype: e-cruz <[EMAIL PROTECTED]> |
| http://www.medel.com.mx|
++



-Mensaje original-
De: cajbecu [mailto:[EMAIL PROTECTED] 
Enviado el: Jueves, 20 de Abril de 2006 09:03 a.m.
Para: João Cândido de Souza Neto
CC: php-general@lists.php.net
Asunto: Re: [PHP] session


Hello,

Try generating your own session id and the problem will be solved ;)

cheers,

João Cândido de Souza Neto wrote:
> Hi everyone.
> 
> I hope someone here can help me.
> 
> When i start a session in a php page, this session receives an unique 
> id.
> 
> If you think about this, if i call a session_destroy() in any page and 
> in the other paga call a session_start() again, it'll receive other 
> unique id. But it isn't working. Everything above has been executed 
> but the session id's always the same.
> 
> It can be any config var in php.ini?
> 
> Thanks for tips.
> 

-- 
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 Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
Hi

My 1st thought was to look at the mysql query log and see what it takes
To create a user. After looking at the set of queries I understood that I
Didn't want to go directly to the DB and bypass the phpBB logic.

I managed to find a script that uses the minimum phpBB internal
functions to create a user. After some more fixing it actually
Opens a user so if anyone needs it :

http://www.weberdev.com/get_example-4383.html

I'm still working on it but the current version works.

Thanks.

berber



-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 4:00 PM
To: Weber Sites LTD
Cc: 'Stut'; php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

OK, so maybe this just seems moot, but...

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
Same server means you can look at the database

> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.

Yeah, I don't see a problem with that one..

> All I want is to open a phpBB account when someone opens one On 
> WeberDev.

So, when you open a weberDev account, have your creation script go through
and load the phpBB Database set and run through the same user login
information, dumping it into the phpBB database fields itself.

frankly put, the install MySQL schema has:
# -- Users
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim,
user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml,
user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline,
user_rank, user_avatar, user_lang, user_timezone, user_dateformat,
user_actkey, user_newpasswd, user_notify, user_active) VALUES ( -1,
'Anonymous', 0, 0, '', '', '', '', '', '', '', '', 0, NULL, '', '', '', 0,
0, 1, 1, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 0);

# -- username: adminpassword: admin (change this or remove it once
everything is working!)
INSERT INTO phpbb_users (user_id, username, user_level, user_regdate,
user_password, user_email, user_icq, user_website, user_occ, user_from,
user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim,
user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml,
user_allowbbcode, user_allow_pm, user_notify_pm, user_popup_pm,
user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone,
user_dateformat, user_actkey, user_newpasswd, user_notify, user_active)
VALUES ( 2, 'Admin', 1, 0, '21232f297a57a5a743894a0e4a801fc3',
'[EMAIL PROTECTED]', '', '', '', '', '', '', 1, 1, '', '', '', 1, 0, 1,
0, 1, 1, 1, 1, 1, 1, '', 'english', 0, 'd M Y h:i a', '', '', 0, 1);

So, using that information, make your weberdev connect to the phpBB database
(you have all that information already as you had to set it up), and use 1
script to make them both.

Wolf

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



[PHP] Re: session

2006-04-20 Thread João Cândido de Souza Neto
João Cândido de Souza Neto wrote:

> Hi everyone.
> 
> I hope someone here can help me.
> 
> When i start a session in a php page, this session receives an unique id.
> 
> If you think about this, if i call a session_destroy() in any page and in
> the other paga call a session_start() again, it'll receive other unique
> id. But it isn't working. Everything above has been executed but the
> session id's always the same.
> 
> It can be any config var in php.ini?
> 
> Thanks for tips.
> 

I found a solution myself.

session_regenerate_id()

Thanks for all.

-- 
---
João Cândido de Souza Neto
Web Developer

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



RE: [PHP] PHP error log

2006-04-20 Thread Ing. Edwin Cruz
Are you using the constants predefined?

__FILE__ __LINE__

Or also try using backtrace, 

http://mx.php.net/debug_backtrace


Regards!
Edwin.



-Mensaje original-
De: Weber Sites LTD [mailto:[EMAIL PROTECTED] 
Enviado el: Jueves, 20 de Abril de 2006 07:43 a.m.
Para: php-general@lists.php.net
CC: [EMAIL PROTECTED]
Asunto: [PHP] PHP error log


Hi

I'm using PHP 4.4.0 (cli) and all of the errors / warnings are written to
file. I can see all of the direct errors but when I have an error inside an
include file the script fails and the error is not shown in the log. I have
to "guess" 
Where the error is.

Any idea what I'm missing.

Thanks
Berber

-- 
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 Script to open phpBB2 accounts

2006-04-20 Thread Jeremy Schreckhise
Wasn't trying to steal anyone's thunder.  Created the response, went to
work, then sent it later.  Your response adequate and complete.  Sorry to
intrude.
 

Jeremy Schreckhise, M.B.A.

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 9:37 AM
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Jeremy Schreckhise wrote:
> Why couldn't you use your login (weberdev).  I.E. when a user creates 
> an account you also push this data onto the phpBB2 db.  Find where 
> phpBB is creating a user, analyze the encryption method use, modify 
> your login to create both entries.


Gee, I wish I would have said that.


> The solution is really quite simple.  You have two choices to maintain 
> the phpBB code base.  1)  Rewrite your login to use the phpBB user 
> accounts, or
> 2)  keep both sets of user tables, and write a few functions to call 
> both the phpBB and your user handling code when they're needed.
> 

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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




Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread John Nichel

Jeremy Schreckhise wrote:

Wasn't trying to steal anyone's thunder.  Created the response, went to
work, then sent it later.  Your response adequate and complete.  Sorry to
intrude.
 


Guess I should have added a ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
As I said, I could but then I would be bypassing all of the phpBB logic
And chances are that I may miss something. 

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 4:34 PM
To: 'John Nichel'; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.


Jeremy Schreckhise 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 9:11 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
> 
> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.
> 
> All I want is to open a phpBB account when someone opens one On 
> WeberDev.
> 
> I don't agree that php-general is the wrong place. I looked in the 
> phpBB forums for this and found something that doesn't currently Work.
> On this list there are many php developers that use phpBB So why not 
> ask them if anyone already did what I did.

Just looked?  You could have asked.  Wrong/right isn't the proper term. 
  phpBB forums are the *best* place to find answers about phpBB.

> It's not like I'm asking anyone to do the work for me. I devoted Years 
> of my time on WeberDev for the PHP community (it's my Hobby and not my 
> main workplace) and all I asked was to know If someone has created a 
> specific PHP script. Btw, I got several Off line emails asking me to 
> share the solution if I get it.
> 
> Anyway, instead of all of these emails, I'll try to do it myself And 
> hope someone contacts me soon.
> 

The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.

--
John C. Nichel IV (is going to start plonking top posters) Programmer/System
Admin (ÜberGeek) Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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

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



Re: [PHP] session

2006-04-20 Thread Martin Alterisio \"El Hombre Gris\"

It's really that hard to read the whole manual page about session_destroy()?

Quoting the php manual:
"In order to kill the session altogether, like to log the user out, the 
session id must also be unset. If a cookie is used to propagate the 
session id (default behavior), then the session cookie must be deleted. 
setcookie()  may be used for that."


In other words session_destroy() is not enough to kill a session.

PS: I just checked the portuguese version of the manual, it seems to be 
outdated (I don't know portuguese but from the examples given and some 
deductive reasoning I'm sure it's either a translation of an old version 
of the manual or a bad translation). If you understand english, rely on 
the english version.


João Cândido de Souza Neto wrote:


Hi everyone.

I hope someone here can help me.

When i start a session in a php page, this session receives an unique id.

If you think about this, if i call a session_destroy() in any page and in
the other paga call a session_start() again, it'll receive other unique id.
But it isn't working. Everything above has been executed but the session
id's always the same.

It can be any config var in php.ini?

Thanks for tips.

 



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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Jeremy Schreckhise
What's there to miss.  The create user logic is centralized and fairly easy
to follow.  If this is too hard for your current situation, you might just
want to pass your user information to the phpBB .php file that processes
user input.  Just another option.  

(I know these aren't the programs, nor the vars I'm just using this
as an example)
phpBB_create.php?user=webdevuser&pass=webdevuserpass

Of course you would do this programmatically with variables from your webdev
form.


Jeremy Schreckhise, M.B.A.


-Original Message-
From: Weber Sites LTD [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 10:51 AM
To: 'Jeremy Schreckhise'; 'John Nichel'; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

As I said, I could but then I would be bypassing all of the phpBB logic And
chances are that I may miss something. 

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 4:34 PM
To: 'John Nichel'; php-general@lists.php.net
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

Why couldn't you use your login (weberdev).  I.E. when a user creates an
account you also push this data onto the phpBB2 db.  Find where phpBB is
creating a user, analyze the encryption method use, modify your login to
create both entries.


Jeremy Schreckhise 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 9:11 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Script to open phpBB2 accounts

Weber Sites LTD wrote:
> Yes, both sites are on the same server but weberdev was built by me 
> And weberforums is phpBB2. No sense in writing my own forums application.
> 
> WeberDev is the main site and has it's own user base and phpBB2 is 
> Pretty complex and I didn't have the time to create a single logon. It 
> Will not be trivial and will need to be maintained with every phpBB2 
> Upgrade.
> 
> All I want is to open a phpBB account when someone opens one On 
> WeberDev.
> 
> I don't agree that php-general is the wrong place. I looked in the 
> phpBB forums for this and found something that doesn't currently Work.
> On this list there are many php developers that use phpBB So why not 
> ask them if anyone already did what I did.

Just looked?  You could have asked.  Wrong/right isn't the proper term. 
  phpBB forums are the *best* place to find answers about phpBB.

> It's not like I'm asking anyone to do the work for me. I devoted Years 
> of my time on WeberDev for the PHP community (it's my Hobby and not my 
> main workplace) and all I asked was to know If someone has created a 
> specific PHP script. Btw, I got several Off line emails asking me to 
> share the solution if I get it.
> 
> Anyway, instead of all of these emails, I'll try to do it myself And 
> hope someone contacts me soon.
> 

The solution is really quite simple.  You have two choices to maintain the
phpBB code base.  1)  Rewrite your login to use the phpBB user accounts, or
2)  keep both sets of user tables, and write a few functions to call both
the phpBB and your user handling code when they're needed.

--
John C. Nichel IV (is going to start plonking top posters) Programmer/System
Admin (ÜberGeek) Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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

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

--
PHP 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 error log

2006-04-20 Thread Martin Alterisio \"El Hombre Gris\"

Please, explain how are you logging the errors.

Weber Sites LTD wrote:


Hi

I'm using PHP 4.4.0 (cli) and all of the errors / warnings are written to
file.
I can see all of the direct errors but when I have an error inside an
include
file the script fails and the error is not shown in the log. I have to
"guess" 
Where the error is.


Any idea what I'm missing.

Thanks
Berber

 



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



Re: [PHP] PHP error log

2006-04-20 Thread Wolf
Run the include file separately and see if it produces an error.  Also
make sure that if you have "short open tags=OFF" that your include file
uses normal tags.

Code normally helps.

Wolf

Weber Sites LTD wrote:
> Hi
> 
> I'm using PHP 4.4.0 (cli) and all of the errors / warnings are written to
> file.
> I can see all of the direct errors but when I have an error inside an
> include
> file the script fails and the error is not shown in the log. I have to
> "guess" 
> Where the error is.
> 
> Any idea what I'm missing.
> 
> Thanks
> Berber
> 

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



[PHP] Session contamination?

2006-04-20 Thread Ben Liu
Hello All,

I'm using a single development server to host multiple client
projects, many of which require session management. I've noticed that
sometimes when I test these various web apps (which are simply in
separate sub directories) I get session leakage where logging in and
establishing a session on one app allows me access to (automatically
logs me in) to other app(s) on the same server. Or sometimes a session
variable will be set across all the apps, like $_SESSION['username'].

Is this due to the fact that sessions are established between client
browsers and servers, regardless of directory/sub directory?

What is the best way to avoid/prevent this problem? Should I be using
specific Session ID's or Session names?

Thanks for any help,

- Ben

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Joe Henry
On Thursday 20 April 2006 1:18 am, Richard Lynch wrote:
> Is 5 longer than 4?

Size doesn't matter. At least that's what I've been told. ;)
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

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



RE: [PHP] PHP error log

2006-04-20 Thread Weber Sites LTD
Actually I'm not looking for help with the code.
The problem is more of a principle problem.

Because I don't want users to see errors and warnings
When there is a problem all of the errors go to a log file
Instead of the standard output.

As long as the error (any error) occurs in the file I'm
Working on, I can see the error in the error log. If the
Error is in a file I include I don't see the error.

This is not something special for my system. I think
It's a definition in the php.ini to suppress errors to
Standard output and log them to a file instead. 

I have : 

error_reporting  = E_ALL|E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
track_errors = Off
error_log = /usr/local//logs/php_errors (the  Is not the real
path)
warn_plus_overloading = Off

Thanks



-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 5:15 PM
To: Weber Sites LTD
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP error log

Run the include file separately and see if it produces an error.  Also make
sure that if you have "short open tags=OFF" that your include file uses
normal tags.

Code normally helps.

Wolf

Weber Sites LTD wrote:
> Hi
> 
> I'm using PHP 4.4.0 (cli) and all of the errors / warnings are written 
> to file.
> I can see all of the direct errors but when I have an error inside an 
> include file the script fails and the error is not shown in the log. I 
> have to "guess"
> Where the error is.
> 
> Any idea what I'm missing.
> 
> Thanks
> Berber
> 

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



Re: [PHP] Session contamination?

2006-04-20 Thread Robin Vickery
On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> I'm using a single development server to host multiple client
> projects, many of which require session management. I've noticed that
> sometimes when I test these various web apps (which are simply in
> separate sub directories) I get session leakage where logging in and
> establishing a session on one app allows me access to (automatically
> logs me in) to other app(s) on the same server. Or sometimes a session
> variable will be set across all the apps, like $_SESSION['username'].
>
> Is this due to the fact that sessions are established between client
> browsers and servers, regardless of directory/sub directory?

Yes - that's the default behaviour, although if you set
session.cookie_path separately for each app, they shouldn't share
session cookies. You might also want to look at session.save_path
which will allow each app to save their session files in a different
location.

  -robin

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



Re: [PHP] Session contamination?

2006-04-20 Thread Ben Liu
Thanks for the response Robin, I'm reading up on session.cookie_path
now. It seems that this would require creating separate php.ini files
for each application.

On 4/20/06, Robin Vickery <[EMAIL PROTECTED]> wrote:
> On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> > Hello All,
> >
> > I'm using a single development server to host multiple client
> > projects, many of which require session management. I've noticed that
> > sometimes when I test these various web apps (which are simply in
> > separate sub directories) I get session leakage where logging in and
> > establishing a session on one app allows me access to (automatically
> > logs me in) to other app(s) on the same server. Or sometimes a session
> > variable will be set across all the apps, like $_SESSION['username'].
> >
> > Is this due to the fact that sessions are established between client
> > browsers and servers, regardless of directory/sub directory?
>
> Yes - that's the default behaviour, although if you set
> session.cookie_path separately for each app, they shouldn't share
> session cookies. You might also want to look at session.save_path
> which will allow each app to save their session files in a different
> location.
>
>   -robin
>

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread tg-php
The idea of creating a phpBB user when a weberdev one is created has merit, but 
I'm not sure I saw anyone recommend doing the opposite?

Since you have a fair idea of how weberdev creates users (since you created it) 
why not insert some PHP code into phpBB to create a weberdev account when 
someone creates a phpBB account?

Or is that not possible.

-TG

___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Session contamination?

2006-04-20 Thread Ben Liu
Hi Dave,

Thanks, I think the method recommended by Robin using the function
ini_set() would work, but somehow I think this could be done in
simpler fashion by setting separate session names for each app, unless
I am misunderstanding the use of session_name(). Trying this out
now...

- Ben

On 4/20/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:
> You can use ini_set to alter this value locally (until the script exits) in
> the script itself, which saves having to use a separate ini file if that is
> the only value you want to change.
>
>
>  On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> >
>  Thanks for the response Robin, I'm reading up on session.cookie_path
> now. It seems that this would require creating separate php.ini files
> for each application.
>
> On 4/20/06, Robin Vickery < [EMAIL PROTECTED]> wrote:
> > On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> > > Hello All,
> > >
> > > I'm using a single development server to host multiple client
> > > projects, many of which require session management. I've noticed that
> > > sometimes when I test these various web apps (which are simply in
> > > separate sub directories) I get session leakage where logging in and
> > > establishing a session on one app allows me access to (automatically
> > > logs me in) to other app(s) on the same server. Or sometimes a session
> > > variable will be set across all the apps, like $_SESSION['username'].
> > >
> > > Is this due to the fact that sessions are established between client
> > > browsers and servers, regardless of directory/sub directory?
> >
> > Yes - that's the default behaviour, although if you set
> > session.cookie_path separately for each app, they shouldn't share
> > session cookies. You might also want to look at session.save_path
> > which will allow each app to save their session files in a different
> > location.
> >
> >   -robin
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> http://www.web-buddha.co.uk
> dynamic web programming from Reigate, Surrey UK
>
> look out for project karma, our new venture, coming soon!

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



Re: [PHP] Session contamination?

2006-04-20 Thread Jochem Maas

Ben Liu wrote:

Hi Dave,

Thanks, I think the method recommended by Robin using the function
ini_set() would work, but somehow I think this could be done in
simpler fashion by setting separate session names for each app, unless
I am misunderstanding the use of session_name(). Trying this out
now...


passing a different/unique value to session_name() should avoid inadvertent
contamination.
[http://php.net/manual/en/function.session-name.php]

Robin's second suggestion of setting the save path can be done with
session_save_path() as well as via ini_set().
[http://php.net/manual/en/function.session-save-path.php]

Robin's first suggestion is the one I would implement first, you can set the
[url]path for which a given session is valid by way of the 
session_set_cookie_params()
function, the path can also be set via ini_set('session.cookie_path', 
'/my/app/example')

note that session_name() and session_save_path() must be called before you
call session_start()

I recommend going through the info at http://php.net/manual/en/ref.session.php
in order to get a better 'feel' of how to use sessions 'properly'



- Ben

On 4/20/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:


You can use ini_set to alter this value locally (until the script exits) in
the script itself, which saves having to use a separate ini file if that is
the only value you want to change.


On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:

Thanks for the response Robin, I'm reading up on session.cookie_path
now. It seems that this would require creating separate php.ini files
for each application.

On 4/20/06, Robin Vickery < [EMAIL PROTECTED]> wrote:


On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:


Hello All,

I'm using a single development server to host multiple client
projects, many of which require session management. I've noticed that
sometimes when I test these various web apps (which are simply in
separate sub directories) I get session leakage where logging in and
establishing a session on one app allows me access to (automatically
logs me in) to other app(s) on the same server. Or sometimes a session
variable will be set across all the apps, like $_SESSION['username'].

Is this due to the fact that sessions are established between client
browsers and servers, regardless of directory/sub directory?


Yes - that's the default behaviour, although if you set
session.cookie_path separately for each app, they shouldn't share
session cookies. You might also want to look at session.save_path
which will allow each app to save their session files in a different
location.

 -robin



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




--
http://www.web-buddha.co.uk
dynamic web programming from Reigate, Surrey UK

look out for project karma, our new venture, coming soon!





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



Re: [PHP] POST arrays?

2006-04-20 Thread Jim Lucas

William Stokes wrote:

Hello,

How to post an array with associated values?

This works ok



But if I post it to another form with this:

">

And print there with:

print_r($arr_siirt_jouk);

prints: Array

So how can post the values forward?

Thanks
-Will 

  


Here is the answer that you are looking for.

Just create multiple hidden fields

$arr_siirto = array(1,2,3);
foreach ($arr_siirto AS $key => $value) {
   echo "\n";
}

Jim

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Weber Sites LTD
It's possible and I may do that however, weberdev, by far
Has much more traffic so it's the side that I want to start
With.

Thanks
berber 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 6:25 PM
To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP Script to open phpBB2 accounts

The idea of creating a phpBB user when a weberdev one is created has merit,
but I'm not sure I saw anyone recommend doing the opposite?

Since you have a fair idea of how weberdev creates users (since you created
it) why not insert some PHP code into phpBB to create a weberdev account
when someone creates a phpBB account?

Or is that not possible.

-TG

___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread Jochem Maas

[EMAIL PROTECTED] wrote:

The idea of creating a phpBB user when a weberdev one is created has merit, but 
I'm not sure I saw anyone recommend doing the opposite?

Since you have a fair idea of how weberdev creates users (since you created it) 
why not insert some PHP code into phpBB to create a weberdev account when 
someone creates a phpBB account?

Or is that not possible.


having read the whole thread I like to say:

1. we should be paying John Nichel for his comic input (aside from the fact 
that he
has lots of tips/advice/etc as well) - the man makes me laugh again and again
- and in this hectic world we work in that's a good thing.

2. for someone who has been on the list since 1998, taking a knife to phpBB
and integrating a 2-way synchronization wotsit between your user data and 
phpBB's
should be a piece of cake - maybe a big piece but cake none the less.

3. I do know of weberdev because it's often in the list of results when I 
search for
php related stuff - BUT I have also got to know that it's mainly full of 
beginner level
code/tips/etc, that's great for many people starting out in php but those of us 
on this
list who regularly post help/answers (& jokes ;-) it's not the kind of resource 
that of
any use - personally I aspire to write code on the level of people like Derick 
R., Chris S.,
Ilia A et al (to name a few) and not at the level of some kid who can barely 
find his way
to a search engine (that's not directed at you Berber, although there is one 
Indian chap
who is free to feel he is being implied ;-).

4. there is no spoon.



-TG

___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.



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



[PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Mark Baldwin

Greetings all,

Does anyone know how static objects work behind the scenes in PHP5?  
More specifically, is there a benefit to declaring an object and its  
methods as static vs the more traditional OO way of instantiating an  
object and then calling methods through the -> operator?


For example if I have:

class Example {
public static function doSomething() {
/* doing something here */
}
}

and

class Example {

private __construct() {
/* constructing here */
}   

public function doSomething() {
/* doing something here */
}

}

Is it more/less/equally efficient for the engine and parser to do:
$result = Example::doSomething();

or

$example = new Example();
$result = $example->doSomething();

Thanks in advance,
Mark

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



Re: [PHP] Session contamination?

2006-04-20 Thread Ben Liu
Thanks Jochem, this should give me all I need to solve this problem. -Ben

On 4/20/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Ben Liu wrote:
> > Hi Dave,
> >
> > Thanks, I think the method recommended by Robin using the function
> > ini_set() would work, but somehow I think this could be done in
> > simpler fashion by setting separate session names for each app, unless
> > I am misunderstanding the use of session_name(). Trying this out
> > now...
>
> passing a different/unique value to session_name() should avoid inadvertent
> contamination.
> [http://php.net/manual/en/function.session-name.php]
>
> Robin's second suggestion of setting the save path can be done with
> session_save_path() as well as via ini_set().
> [http://php.net/manual/en/function.session-save-path.php]
>
> Robin's first suggestion is the one I would implement first, you can set the
> [url]path for which a given session is valid by way of the 
> session_set_cookie_params()
> function, the path can also be set via ini_set('session.cookie_path', 
> '/my/app/example')
>
> note that session_name() and session_save_path() must be called before you
> call session_start()
>
> I recommend going through the info at http://php.net/manual/en/ref.session.php
> in order to get a better 'feel' of how to use sessions 'properly'
>
> >
> > - Ben
> >
> > On 4/20/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:
> >
> >>You can use ini_set to alter this value locally (until the script exits) in
> >>the script itself, which saves having to use a separate ini file if that is
> >>the only value you want to change.
> >>
> >>
> >> On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> >>
> >> Thanks for the response Robin, I'm reading up on session.cookie_path
> >>now. It seems that this would require creating separate php.ini files
> >>for each application.
> >>
> >>On 4/20/06, Robin Vickery < [EMAIL PROTECTED]> wrote:
> >>
> >>>On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> >>>
> Hello All,
> 
> I'm using a single development server to host multiple client
> projects, many of which require session management. I've noticed that
> sometimes when I test these various web apps (which are simply in
> separate sub directories) I get session leakage where logging in and
> establishing a session on one app allows me access to (automatically
> logs me in) to other app(s) on the same server. Or sometimes a session
> variable will be set across all the apps, like $_SESSION['username'].
> 
> Is this due to the fact that sessions are established between client
> browsers and servers, regardless of directory/sub directory?
> >>>
> >>>Yes - that's the default behaviour, although if you set
> >>>session.cookie_path separately for each app, they shouldn't share
> >>>session cookies. You might also want to look at session.save_path
> >>>which will allow each app to save their session files in a different
> >>>location.
> >>>
> >>>  -robin
> >>>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >>
> >>--
> >>http://www.web-buddha.co.uk
> >>dynamic web programming from Reigate, Surrey UK
> >>
> >>look out for project karma, our new venture, coming soon!
> >
> >
>
>

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



Re: [PHP] Session contamination?

2006-04-20 Thread Ben Liu
Hi Dave,

After a bit more research, I think I understand why Jochem recommends
use of session_save_path() rather than just naming each session
differently. The former method provides more security as you can set
the location where session cookies are stored. This will help prevent
an attacker from gaining access to session information and then using
it to gain inappropriate access to the application the session was
created for or even other applications running on the same shared
server. Anyway, I think that's why.

- Ben

On 4/20/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:
> Let me know how you get on. I have encountered the session leakage issue
> before also and it scared the willies out of me.
>
>
> On 20/04/06, Ben Liu < [EMAIL PROTECTED]> wrote:
> > Hi Dave,
> >
> > Thanks, I think the method recommended by Robin using the function
> > ini_set() would work, but somehow I think this could be done in
> > simpler fashion by setting separate session names for each app, unless
> > I am misunderstanding the use of session_name(). Trying this out
> > now...
> >
> > - Ben
> >
> > On 4/20/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:
> > > You can use ini_set to alter this value locally (until the script exits)
> in
> > > the script itself, which saves having to use a separate ini file if that
> is
> > > the only value you want to change.
> > >
> > >
> > >  On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> > > >
> > >  Thanks for the response Robin, I'm reading up on session.cookie_path
> > > now. It seems that this would require creating separate php.ini files
> > > for each application.
> > >
> > > On 4/20/06, Robin Vickery < [EMAIL PROTECTED] > wrote:
> > > > On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> > > > > Hello All,
> > > > >
> > > > > I'm using a single development server to host multiple client
> > > > > projects, many of which require session management. I've noticed
> that
> > > > > sometimes when I test these various web apps (which are simply in
> > > > > separate sub directories) I get session leakage where logging in and
> > > > > establishing a session on one app allows me access to (automatically
> > > > > logs me in) to other app(s) on the same server. Or sometimes a
> session
> > > > > variable will be set across all the apps, like
> $_SESSION['username'].
> > > > >
> > > > > Is this due to the fact that sessions are established between client
> > > > > browsers and servers, regardless of directory/sub directory?
> > > >
> > > > Yes - that's the default behaviour, although if you set
> > > > session.cookie_path separately for each app, they shouldn't share
> > > > session cookies. You might also want to look at session.save_path
> > > > which will allow each app to save their session files in a different
> > > > location.
> > > >
> > > >   -robin
> > > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> > >
> > > --
> > > http://www.web-buddha.co.uk
> > > dynamic web programming from Reigate, Surrey UK
> > >
> > > look out for project karma, our new venture, coming soon!
> >
>
>
>
> --
>
> http://www.web-buddha.co.uk
> dynamic web programming from Reigate, Surrey UK
>
> look out for project karma, our new venture, coming soon!

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



Re: [PHP] New image already cached.

2006-04-20 Thread Richard Lynch


Here's the crucial info you are missing:

The URL does not have to *END* in the name of the PHP file.

The PHP file could be in the MIDDLE of the URL.

In other words, Apache is perfectly happy to take a url like this:
http://example.com/program.php/whatever_you-want=to+put_here

Example setup:

~/public_html/program
~/public_html/.htaccess

.htaccess:

  ForceType application/x-httpd-php


program:
\n";
$_PATH[$key] = $value;
  }

  //create your image, using:
  //$_PATH['width'] from the URL, max width of image
  //$_PATH['copyright'] from the URL, watermark with copyright or not
  //$_PATH['filename'] which image file to start with as 'source'
  $image = imagecreatefromjpeg($_PATH['filename']);
  //etc
?>

So when your URL is this:
http://example.com/program/width=200/copyright=1/filename=source.jpg

Your PHP script in 'program' is called, and Apache gives you all the
other stuff in the URL in 'PATHINFO' which you can use as your
arguments.

It's really just replacing:

?width=200©right=1&filename=source.jpg
and using $_GET with:

/width=200/copyright=1/filename=source.jpg
and using $_PATH (aka $_SERVER['PATHINFO'])

Variants:
To keep the browser from using 'filename=source.jpg' if the user
right-clicks, you could change the URL to just end in the filename,
and you'd have to handle that differently than the explode('=', $part)

To keep the browser from caching your image, embed some random number
in the URL, and your program will just IGNORE that key/value in $_PATH

The whole point of this exercise is to provide the browser with a URL
that it cannot distinguish from a valid static image URL, so the
browser can't screw up.  Cuz it will if it can.

On Thu, April 20, 2006 9:06 am, tedd wrote:
> Richard:
>
> I'm confused -- let's get back to the basic problem.
>
> I'm using an image tag ( in my html.
>
> Some browsers are caching the image because it's the same url (same
> "image.png" name) each time. However, the image is something I
> generate each time it's called, so it's new.
>
> Now, you and examples have shown me that I could use .htaccess and
> ForceType to make the browser load anything regardless of it's name.
>
> You suggested using a random string and using that in the url to
> trick the browser into loading the image each time. OK, I can see how
> that could work, but I don't see how I can use .htaccess and
> ForceType to firce the browser to load the image without rewriting .
> htaccess each time.
>
> That's where I'm confused.
>
> tedd
>
> ---
>
>
>
>>$image_file = 'foo.jpg';
>>$random = mt_rand(1, 20);
>>$url = "http://example.com/program/$random/$image_file";;
>>echo "
>>
>>In program, if you echo out $_SERVER['PATHINFO'] you will see:
>>/454398574395/foo.jpg
>>
>>The number will change, of course.
>>
>>You can tear that apart and get the foo.jpg part to do whatever you
>> want.
>>
>>Or, you could have the URL sometimes have 'copyright' in it, and
>>sometimes not, and merge only when the URL has copyright in it.
>>
>>You could even pass is paraeters like this:
>>http://example.com/program/width=200/2343242343/foo.jpg
>>
>>Take the width=200 and scale the image to be 200 pixels wide.
>>
>>Here is a real live example where I do this:
>>http://uncommonground.com/artist_profile/Ellen+Rosner
>>
>>Right-click on that image of Ellen in the chair and check out that
>> URL.
>>
>>thumbnail is my PHP script.
>>target is a max width/height (I scale it proporationally and 200 is
>>max for both)
>>credits is the photographer credits from my database.
>>The rest is the URL of the actual real image I'm dinking with.
>>
>>Feel free to play with the URL and change the 200 to, say, 100, or
>>make believe YOU took that photograph.
>>
>>All just from the URL which, as far as the browser can tell, is a
>>perfectly valid set of directory paths on my machine, so the browser
>>can't possibly screw up.  (Rule #1: Never trust the browser.)
>>
>>And in the main link, artist_profile is the PHP script, and if you
>>look at the links to the other artists at the bottom of the page,
>>you'll see that it also uses PATH_INFO to either show an artist by ID
>>or to search for their name in our database.
>>
>>If multiple matches are found, the user is asked which one they
>> meant:
>>http://uncommonground.com/artist_profile/Ellen
>>
>>If I have the ID, then I know exactly which one to display.
>>
>>I actually would suggest you go with:
>>
>>/width=200/ though, instead of /width/200/ as it's easier to code and
>>have optional parameters using = and / as an arg separator.
>>
>>I haven't bothered to fix that old script, but that's how I do it
>>nowadays.
>>
>>On Wed, April 19, 2006 8:19 am, tedd wrote:
You're also better off embedding the parameters in the URL so that
 it
"looks like" a directory to the browser:

http://example.com/actual_script/57823642346963/copyright/whatever.png

The PHP scritp is actual_script.

You can use .htaccess and ForceType to make Apache run it.


Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Ryan A

> On Thursday 20 April 2006 1:18 am, Richard Lynch
> wrote:
> > Is 5 longer than 4?
> 
> Size doesn't matter. At least that's what I've been
> told. ;)
> -- 

You've been lied to m8
:-D

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] issue with MySQL procedure and a result set

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 3:48 am, Alain Roger wrote:
> personally i do not use MyODBC. i just wrote that this is a common
> answer
> for such error message.
> but why should i check within MySQL documentation if the flag to write
> (if
> it is really the solution???) belongs to PHP command "mysql_connect" ?

Because the flag would have been made up and documented by the MySQL
guys.

Almost for sure.  A handful of exceptions like CURLOPT_BINARYTRANSFER
do exist.

PHP mysql *MIGHT* have caught that constant as one you need and
imported it.  Or not.

> or is
> "mysql_connect" command just a wripping command to ODBC command (and
> in this case i understand why to check in MySQL doc.).

mysql_connect() in PHP is a thinly-disguised wrapper for a MySQL
function of a very similar (if not the same) name.

99% of what many people think of as "PHP" is really a thinly-disguised
wrapper for functionality provided by the extension modules.

'Course, it took a TON of work to get those wrappers to work right, to
play well together, to not mess up other wrappers in PHP, and so on!

But the sooner you understand how PHP really "works" in relation to
the extension modules, the better off you'll be.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Passing Form As Argument

2006-04-20 Thread Chris Kennon

Hi,


I'm new to the list so "Hello" to all. I'm drafting a function.php  
page, which will be included() in the pages in need. How would I pass  
a form as an argument of a function? From the name parameter of the  
form element or perhaps an ID:



function checkForm(theForm){
//Form validation code omitted.




}


Also, I seem to recall some caution is needed when using user-defined  
functions?




"Art is an expression of life and transcends both time and space.
We must employ our own souls through art to give a
new form and a new meaning to nature or the world."

 -- Bruce Lee

_
Return True,

Christopher Kennon
Principal/Designer/Programmer -Bushidodeep
http://bushidodeep.com

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



Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 1:25 pm, Mark Baldwin wrote:
> Does anyone know how static objects work behind the scenes in PHP5?
> More specifically, is there a benefit to declaring an object and its
> methods as static vs the more traditional OO way of instantiating an
> object and then calling methods through the -> operator?

Didja try it?... o.O

-- 
Like Music?
http://l-i-e.com/artists.htm

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



  1   2   >