Re: [PHP] php can do this

2007-05-13 Thread Richard Lynch


On Sun, May 13, 2007 1:43 am, suresh kumar wrote:
> Hi,
>  I want to know whether its possible to implement this
> functionality in PHP and MySQL.. I will allow web users to
> download one .bat file from my Application.
>
>  This .bat contains something like this  'c:\\program
> files\Internet Explorer\iexplore.exe'
> http://x.com/download.php";
>
>  download.php file will contain images for downloading.
>
>  when he execute this .bat file from his local machine.  I need to
> download some image files from the server to his local hard
> drive.i want to download automatically to this hard drive.
>
>(I don't want 'save as' dialog box where user can select the
> location to download.)
>
>In PHP code(server).Is there any way where i can tell the images to
> get download automatically to the local user desktop.
>
>I searched google.but i can't able to find any solution
>
>  i am looking for some help from you guys.

If you can find users dumb enough to download and execute a .bat file
from your site, that .bat file can do *anything* *it* *wants*...

You'll have to ask on some kind of .bat list (or perhaps .bat cave)
how to download a file without prompting, but it's got nothing to do
with PHP at that point...

Good luck!

PS *NOBODY* should be downloading your .bat file and running it in the
first place...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Application support both chinese and english lang

2007-05-13 Thread Richard Lynch
A) Try the i18n list on php.net
B) I think Chinese might need UTF-16... Or maybe simplified Chinese
doesn't can be done in UTF-8...  I'm just guessing wildly at this
point...

On Sun, May 13, 2007 1:02 am, suresh kumar wrote:
> Hi,
>
>   I am developing one application using PHP and MySQL.Right now my
> application supports English language.i like to integrate
> chinese language in my application.i like to implement similar
> to this website.
>
>   http://www.dynasign.net.cn/dynasign/login.do
>
>   'Language' combo box contain 'English' and 'chinese',when user
> select 'English'.i like to display the page details  in english
> and when he select 'chinese' i like to display page details in
> 'chinese'.
>
> i set the  .but chinese font is not displaying.i think we
> need to do some PHP programatic unicode conversion.I dont know how
> to proceed .
>
>  I am looking for some help from you guys.
>
> 
> A.suresh
>
>
>
>
> -
>  Office firewalls, cyber cafes, college labs, don't allow you to
> download CHAT? Here's a solution!


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] GET variable unexpectedly assigned to session variable

2007-05-13 Thread Richard Lynch
On Thu, May 10, 2007 1:51 pm, Armando Acosta wrote:
> Problem is, that, once the page "usr_frm.php" have been hit, the
> session variable $_SESSION["usr_type"] gets changed (unexpectedly) to
> exactly the same value passed to the script via GET variable "typ".
>
> But even worse: this code works perfectly well on my developer machine
> (Windows) but in doesn't on the actual server (Linux).
>
> I realized that the server uses a different PHP configuration,
> specially: "register_globals" set to ON. I already got them to change
> this value to OFF... but this did not solve the problem.

It should have solved it, unless you've messed up your session data
with the previous script already...

Are you SURE they turned it OFF?  Check phpinfo again.

If all else fails, just change the variable name to something else in
the usr_frm.php script, so they don't "collide" with session data...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] GET variable unexpectedly assigned to session variable

2007-05-13 Thread Richard Lynch
On Thu, May 10, 2007 2:00 pm, Robert Cummings wrote:
> BTW, what's the point of abbreviating short words like "user" to "usr"
> and "type" to "typ"?

Mayb his 'e' ky is brokn?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] sorting via PHP or MySQL?

2007-05-13 Thread Richard Lynch
On Thu, May 10, 2007 1:00 pm, James Tu wrote:
> (I've cross posted at the MySQL list as well)
>
> Here's an example with a simple table:
>
> describe collection;
>
> +--+-+--+-
> +-++
> | Field| Type| Null | Key |
> Default | Extra  |
> +--+-+--+-
> +-++
> | id   | bigint(20) unsigned |  | PRI |
> NULL| auto_increment |
> | receiver_id  | bigint(20) unsigned |  | MUL |
> 0   ||
> | set_type_id  | int(2) unsigned |  | |
> 0   ||
> | card_id  | int(3) unsigned |  | |
> 0   ||
> | completed_set_id | bigint(20) unsigned |  | |
> 0   ||
> | created_on_gmt   | datetime|  | | -00-00
> 00:00:00 ||
> +--+-+--+-
> +-++
>
>
> I want to end up with two PHP arrays.  One for set_type_id = 22 and
> one for set_type_id=21.
>
> (1) one query method:
> SELECT * from collection WHERE set_type_id=22 OR set_type_id=21;
> ...do query...
> while( $row = $this->db->fetch_array_row() ){

/*
>   if ($row['set_type_id'] == 21){
>   $array_a[] = $row;
>   } else {
>   $array_b[] = $row;
>   }
*/
$array[$row['set_type_id']][] = $row;

> }

var_dump($array);

You'll have one array of all the 21s, and one of all the 22s.

> Which method is better?  Take a hit using MySQL or take a hit using
> PHP?

Honestly, is really doesn't make a damn bit of difference unless you
have ZILLIONS of records in the first place, in which case you
shouldn't be sucking them all down at once anyway...

So write whatever you can figure out what's going on next month/year
without beating your head against the wall trying to read your own
code.

Worry about optimizing only after you identify bottlenecks.

Anything else is optimize-wankery.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] scrolling HTML tables

2007-05-13 Thread Richard Lynch
On Thu, May 10, 2007 11:45 am, C.R.Vegelin wrote:
> I hope it's not the wrong place to ask, but has anyone experience with
> scrolling HTML tables ?

Actually, it *is* the wrong place to ask... :-v

> According http://www.w3schools.com/tags/tag_thead.asp
> "The thead, tfoot and tbody elements enable you to group rows in a
> table.
>  When you create a table, you might want to have a header row, some
> rows with data, and a row with totals at bottom.
>  This division enables browsers to support scrolling of table bodies
> independently of the table header and footer."
>
> I don't want to reinvent the wheel in own software.
> Or is it better to ignore these tags because of bad browser support ?

I've never seen any browser do anything useful with these goofy tags...

But the Designers seem to luv them...

If you really want scrolling, you'd better put them in a DIV or
IFRAME, I think.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] WSDL Generator class

2007-05-13 Thread Richard Lynch
IIRC, the nuSoap.php did what you want, and PHP's nifty new SOAP class
does everything else better...

So run nuSoap once to get the WSDL thingie, and use PHP 5 SOAP for the
rest.

YMMV

I may be out-dated (again) on my PHP knowledge.

Or should I say "still"?

On Thu, May 10, 2007 10:10 am, Brice wrote:
> Hello all,
>
> I'am looking for an WSDL generator class. The aim is to generate an
> wsdl
> file to use with the soap extension. The generator will look at the
> included
> classes and print all functions (except maybe abstract or private) in
> a
> correct xml format.
>
> I tried this one which is great :
> http://www.schlossnagle.org/~george/blog/index.php?/archives/234-WSDL-Generation.htmlbut
> i have to modify a lot of code and it appears it's not maintained.
>
> So what do you do in order to create WSD?
>
> Is the soap extension or a PEAR classes will include this kind of
> function?
>
> Thanks
> Brice
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Function Declared in Included File Not Being Found

2007-05-13 Thread Chris

Richard,

Neither removing the if/else nor the function_exists() not call worked.

If I declared the function in the same file I called it works even  
when defining it after the call.


If the function is declaring in a different file than the one I call  
it in and I include the files after the call, it simply doesn't work.  
Unless I did something subtly wrong or am back on the drugs.


This SEEMS contrary to the documentation.

The "issue"  occurs in PHP-CLI 4.4.4, PHP 5.2.1, and PHP 5.2.2.

I'll files a bug report in the hope of an explanation but I'm pretty  
sure that it isn't considered a bug.



Chris




On May 13, 2007, at 1:38 AM, Richard Lynch wrote:


On Fri, May 11, 2007 3:43 pm, Chris wrote:

Hello,

According to the PHP manual on functions (http://www.php.net/manual/
en/language.functions.php):

"In PHP 3, functions must be defined before they are referenced. No
such requirement exists since PHP 4. Except when a function is
conditionally defined..."


Does moving the require BEFORE the if/else change anything?


If that is true then why does the following not work as I expect?


Not sure, really...

Seems like you're right, but maybe I'm also missing something.

If you take out the 'require' statements, and just put c inside a,
does it work?


I expect the result to be "Function was called!" but it actually is
"Function test() does not exist!".


Perhaps the if (function_exists()) business is trying to be "smart"
and is run because at the time it was compiled, the function didn't
exist, so you could define the function there -- which is a much more
common idiom than what you are doing, truth to tell...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




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



[PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Micky Hulse

Hi,

I am in the process of writing a simple but useful plugin for a blogging 
application


Long story short, I want to give-back to the community (i.e. free 
plugin), but would like to make an attempt at retaining some credit if 
folks port/use to/in other scripts/blogs/cms apps.


Any tips or links ya'll could share with me?

Anyone have any /* comment blocks */ I could put in my code?

Something like this, for example:

/*
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
** OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
** LIMITED   TO  THE WARRANTIES  OF  MERCHANTABILITY,
** FITNESSFORAPARTICULARPURPOSE   AND
** NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR
** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
** OR  OTHER  LIABILITY,  WHETHER  IN  AN  ACTION  OF
** CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF
** OR  IN  CONNECTION WITH THE SOFTWARE OR THE USE OR
** OTHER DEALINGS IN THE SOFTWARE.
*/

Different verbiage, of course...

Or, should I just not worry about this?

Lol! I hope I am phrasing my question right... I have been up all night 
coding, so my brain is kinda mushy right about now. :D


Many TIA's!
Cheers,
Micky

--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Micky Hulse

Micky Hulse wrote:

Or, should I just not worry about this?


Well shux! I love it when I answer my own questions:



I blame it on lack of sleep!

The GNU GPL License sounds like what I need. :D

Cheers,
M



--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Daniel Brown

   If you want to retain some credit but don't care about
distribution/modification/redistribution, check out the MIT license (more
commonly referred to as the X or X11 license).  We're using it in a project
that combines PHP and text-to-speech technology.  It allows people to
improve (or degrade) our code, but says that we should still get our names
at the top as the original authors.


On 5/13/07, Micky Hulse <[EMAIL PROTECTED]> wrote:


Micky Hulse wrote:
> Or, should I just not worry about this?

Well shux! I love it when I answer my own questions:



I blame it on lack of sleep!

The GNU GPL License sounds like what I need. :D

Cheers,
M



--
Wishlists: 
Switch: 
  BCC?: 
My: 

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





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Tijnema !

On 5/13/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

   If you want to retain some credit but don't care about
distribution/modification/redistribution, check out the MIT license (more
commonly referred to as the X or X11 license).  We're using it in a project
that combines PHP and text-to-speech technology.  It allows people to
improve (or degrade) our code, but says that we should still get our names
at the top as the original authors.


You know more than me daniel :P

All current releases aren't packed with any license, and in
sourceforge the PHP license is selected i believe :P

I'd say, don't worry too much about the license, just put your name on
top of the code, and some other nonsense, like:
You're allowed to use this code, as long as you leave above lines
intact., where above your credit is listed of course.

Tijnema



On 5/13/07, Micky Hulse <[EMAIL PROTECTED]> wrote:
>
> Micky Hulse wrote:
> > Or, should I just not worry about this?
>
> Well shux! I love it when I answer my own questions:
>
> 
>
> I blame it on lack of sleep!
>
> The GNU GPL License sounds like what I need. :D
>
> Cheers,
> M
>
>
>
> --
> Wishlists: 
> Switch: 
>   BCC?: 
> My: 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Micky Hulse

Daniel Brown wrote:

   If you want to retain some credit but don't care about
distribution/modification/redistribution, check out the MIT license (more
commonly referred to as the X or X11 license).  We're using it in a project


Ah, great tip! :D

I will definitely read-up on the MIT license after I get some zzZZzz's!

It sure does sounds like what I am looking for. ;)


that combines PHP and text-to-speech technology.  It allows people to
improve (or degrade) our code, but says that we should still get our names
at the top as the original authors.


Oh, wow! That sounds like a great project... and it is cool to hear what 
you/your team decided to use for licensing. :)


Many thanks Daniel! I really appreciate the help and advice.

Have a great day,
Cheers,
Micky


--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Micky Hulse

Hey! Tijnema! Thanks for the quick reply. :)

Tijnema ! wrote:

I'd say, don't worry too much about the license, just put your name on
top of the code, and some other nonsense, like:
You're allowed to use this code, as long as you leave above lines
intact., where above your credit is listed of course.


Ah, well, that does sound good too. I a mainly looking to keep my 
name/website somewhere in the comments. :D


Whichever route I end-up taking, it is definitely nice to hear what the 
pros prefer. ;)


Thanks again Tijnema!

Have a great day.
Cheers,
Micky




--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] Function Declared in Included File Not Being Found

2007-05-13 Thread Stut

Chris wrote:

Richard,

Neither removing the if/else nor the function_exists() not call worked.

If I declared the function in the same file I called it works even when 
defining it after the call.


If the function is declaring in a different file than the one I call it 
in and I include the files after the call, it simply doesn't work. 
Unless I did something subtly wrong or am back on the drugs.


This SEEMS contrary to the documentation.

The "issue"  occurs in PHP-CLI 4.4.4, PHP 5.2.1, and PHP 5.2.2.

I'll files a bug report in the hope of an explanation but I'm pretty 
sure that it isn't considered a bug.


It's not contrary to the documentation. The docs say that a function 
does not need to be declared before use - this is true, so long as it's 
declared in the same file.


When PHP parses a file it first looks through it looking for 
declarations and adds them to the global scope. It then goes through it 
again executing the code. Require/include and their _once versions don't 
get executed until the second pass, and they get done at the point where 
they're called.


So, if you're going to use functions in an included file, you need to 
include that file before trying to use them. If you're using functions 
in the same file, the order of things in that file does not matter.


This is *not* a bug!!

Hope that clears it up.

-Stut


On May 13, 2007, at 1:38 AM, Richard Lynch wrote:


On Fri, May 11, 2007 3:43 pm, Chris wrote:

Hello,

According to the PHP manual on functions (http://www.php.net/manual/
en/language.functions.php):

"In PHP 3, functions must be defined before they are referenced. No
such requirement exists since PHP 4. Except when a function is
conditionally defined..."


Does moving the require BEFORE the if/else change anything?


If that is true then why does the following not work as I expect?


Not sure, really...

Seems like you're right, but maybe I'm also missing something.

If you take out the 'require' statements, and just put c inside a,
does it work?


I expect the result to be "Function was called!" but it actually is
"Function test() does not exist!".


Perhaps the if (function_exists()) business is trying to be "smart"
and is run because at the time it was compiled, the function didn't
exist, so you could define the function there -- which is a much more
common idiom than what you are doing, truth to tell...

--Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




--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] What is the best way to protect the PHP page that returns the AJAX data? [solved]

2007-05-13 Thread Stut

Richard Lynch wrote:

On Fri, May 11, 2007 9:59 pm, [EMAIL PROTECTED] wrote:

Set ajaxObject.setRequestHeader("User-Agent","SecretName"); in
Javascript and check for it in PHP. Not fool-proof, but the average
person wouldn't be able to get in.


Unless the user "View Source" and read your AJAX code...

This is not going to stop any serious attempt, but as one more
defense-in-depth mechanism, it wouldn't hurt.


Unless the user is using a browser or going through a proxy that strips 
or replaces the User-Agent header.


-Stut

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Crayon Shin Chan
On Sunday 13 May 2007 21:17, Micky Hulse wrote:

> I will definitely read-up on the MIT license after I get some zzZZzz's!

Don't forget the MIT license allows people to incorporate your code into 
commercial products and sell for profit without having to give anything 
back (money/improved code/etc).

-- 
Crayon

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Daniel Brown

   Right, I alluded to that, but perhaps I should've said that exactly, as
it may bother some people.  In my case, it doesn't bother me in the least,
just as I use LAMP (all open source) to make a living.


On 5/13/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:


On Sunday 13 May 2007 21:17, Micky Hulse wrote:

> I will definitely read-up on the MIT license after I get some zzZZzz's!

Don't forget the MIT license allows people to incorporate your code into
commercial products and sell for profit without having to give anything
back (money/improved code/etc).

--
Crayon

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





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


[PHP] php5 include() problem

2007-05-13 Thread Al

I've got a cgi file in my cgi-bin folder that I'm calling with include(). It 
worked with php4.

My shared host just upgraded to my server to php5.2.0 and the function doesn't work.  I can't tell if the problem is a 
php5 or server configuration [which may have changed during the upgrade] issue.


If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755

file.cgi chmods the designated directory's permissions.  It's a cgi with a php 
shebang #!/usr/bin/php

A simple file_exists() shows the file exists OK, TRUE.

I've tried using both syntaxes.

include("/home/foo/public_html/cgi-bin/file.cgi?dir=test&perms=0755");

include("www.foo.org/cgi-bin/file.cgi?dir=test&perms=0755");

Here is the error msg:
Warning: include(/home/foo/public_html/cgi-bin/file.cgi?dir=/test&perms=0755) 
[function.include]: failed to open stream: No such file or directory in /home/foo/public_html/EditPage/cgi_file_test.php 
on line 15


Bottom line:  It appears include() is not working right, for whatever reason.

Anyone have any ideas?

Thanks, Al

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



Re: [PHP] php5 include() problem

2007-05-13 Thread Tijnema !

On 5/13/07, Al <[EMAIL PROTECTED]> wrote:

I've got a cgi file in my cgi-bin folder that I'm calling with include(). It 
worked with php4.

My shared host just upgraded to my server to php5.2.0 and the function doesn't 
work.  I can't tell if the problem is a
php5 or server configuration [which may have changed during the upgrade] issue.

If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755

file.cgi chmods the designated directory's permissions.  It's a cgi with a php 
shebang #!/usr/bin/php

A simple file_exists() shows the file exists OK, TRUE.

I've tried using both syntaxes.

include("/home/foo/public_html/cgi-bin/file.cgi?dir=test&perms=0755");

include("www.foo.org/cgi-bin/file.cgi?dir=test&perms=0755");

Here is the error msg:
> Warning: include(/home/foo/public_html/cgi-bin/file.cgi?dir=/test&perms=0755)
[function.include]: failed to open stream: No such file or directory in 
/home/foo/public_html/EditPage/cgi_file_test.php
on line 15

Bottom line:  It appears include() is not working right, for whatever reason.

Anyone have any ideas?

Thanks, Al



What the heck are you trying to do?
You want the cgi file to be executed? Or is there PHP code in the cgi file?
If you want the first, you should look at exec() or system() or such.
If there's PHP code, there's no sense in passing variables to the CGI
script, and if you remove the variables it will work.

Tijnema

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



Re: [PHP] Question

2007-05-13 Thread Robert Cummings
On Sun, 2007-05-13 at 00:33 -0500, Richard Lynch wrote:
>
> Here's your cookie:
> http://l-i-e.com/cookie.php
> :-)

Bah, I was hoping for something a bit more tasty :/  ;)

> PS
> Does the one where I juke the URL to just be iwant.xyz work right at
> least?...

Yep.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] GET variable unexpectedly assigned to session variable

2007-05-13 Thread Robert Cummings
On Sun, 2007-05-13 at 02:05 -0500, Richard Lynch wrote:
> On Thu, May 10, 2007 2:00 pm, Robert Cummings wrote:
> > BTW, what's the point of abbreviating short words like "user" to "usr"
> > and "type" to "typ"?
> 
> Mayb his 'e' ky is brokn?

Mayb his 'o' ky t sinc h shrtnd form to frm.

Prbbly h jst hs n vrsn t vwls.

Chrs,
Rb.

Ps. In case that was as incomprehensible as code created
by abbreviators that I've had the displeasure to come
across it says:

"Maybe his 'o' key too since he shortened form to frm."

"Probably he just has an aversion to vowels."

-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] php5 include() problem

2007-05-13 Thread Myron Turner

Tijnema ! wrote:

On 5/13/07, Al <[EMAIL PROTECTED]> wrote:
I've got a cgi file in my cgi-bin folder that I'm calling with 
include(). It worked with php4.


My shared host just upgraded to my server to php5.2.0 and the 
function doesn't work.  I can't tell if the problem is a
php5 or server configuration [which may have changed during the 
upgrade] issue.


If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755

file.cgi chmods the designated directory's permissions.  It's a cgi 
with a php shebang #!/usr/bin/php


A simple file_exists() shows the file exists OK, TRUE.

I've tried using both syntaxes.

include("/home/foo/public_html/cgi-bin/file.cgi?dir=test&perms=0755");

include("www.foo.org/cgi-bin/file.cgi?dir=test&perms=0755");

Here is the error msg:
> Warning: 
include(/home/foo/public_html/cgi-bin/file.cgi?dir=/test&perms=0755)
[function.include]: failed to open stream: No such file or directory 
in /home/foo/public_html/EditPage/cgi_file_test.php

on line 15

Bottom line:  It appears include() is not working right, for whatever 
reason.


Anyone have any ideas?

Thanks, Al



What the heck are you trying to do?
You want the cgi file to be executed? Or is there PHP code in the cgi 
file?

If you want the first, you should look at exec() or system() or such.
If there's PHP code, there's no sense in passing variables to the CGI
script, and if you remove the variables it will work.

Tijnema


See the examples on this page:  http://ca.php.net/include/
What you probably want to do is to change the cgi script to php and then 
give the full url, incuding http.


--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



RE: [PHP] Question

2007-05-13 Thread WeberSites LTD
Notice the 1st code example :

http://www.php-code-search.com/?q=how%20to%20force%20the%20user%20to%20downl
oad%20a%20file

berber 

-Original Message-
From: Dusan Novakovic [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 13, 2007 2:19 AM
To: php-general@lists.php.net
Subject: [PHP] Question

Hi!
I need a script which will run pop-up menu with the "Save As" button when I
click on a link  (e.g. Click ) so that I could save
that file on my computer. In the example I wrote file.txt file opens in
browser, which I don`t want to happen.
I would be very grateful if someone could send me a possible solution to
this problem.

DuĊĦan



--
made by Dusan

--
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] php5 include() problem

2007-05-13 Thread Richard Davey

Al wrote:

I've got a cgi file in my cgi-bin folder that I'm calling with 
include(). It worked with php4.


My shared host just upgraded to my server to php5.2.0 and the function 
doesn't work.  I can't tell if the problem is a php5 or server 
configuration [which may have changed during the upgrade] issue.


If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755


Check if the new configuration of PHP allows HTTP calls. Include, 
require, fopen, etc are traditionally for local file-system files. 
Obviously you're calling it via HTTP so you get the parsed output and 
not the source code of the CGI script, but if your host has disabled URL 
opens with PHP 5 then it would explain why it no longer works.


Cheers,

Rich
--
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

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



RE: [PHP] Passing an array as a hidden variable

2007-05-13 Thread WeberSites LTD
Check out the 1st code example : 

http://www.php-code-search.com/?q=how%20to%20pass%20an%20array%20from%20one

berber 

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 13, 2007 6:58 AM
To: Todd Cary
Cc: php-general@lists.php.net
Subject: Re: [PHP] Passing an array as a hidden variable



On Fri, May 11, 2007 11:53 pm, Todd Cary wrote:
> When I use the following syntax, the 2 dimensional array loses it's 
> contents.  Can an array be passed this way?
>
> $attend_ary_save .'>'; ?>

No.

You'll just get "Array" back.

You can do a few things:

 $v1){
foreach($v1 as $k2 => $v2){
  ?>
Actually, you should wrap htmlentities() around each value being echo-ed
out.

Another option is to http://php.net/serialize the data before you send it to
HTML, and then (duh) unserialize it when it comes back.

Or, be REALLY smart, and use session_start() and just put the array in
$_SESSION and don't send data back-n-forth over HTTP, which is A) expensive,
and B) subject to user tampering, and C) inefficient.

Actually, A and C technically depend on your bandwidth versus hard drive
speed, or wherever you store you session data, so, in theory, it could be
cheaper or more efficient to use HTTP...  But I sure doubt it in any real
world hardware setup.

PS Just FYI, internally, PHP's session data is just serialized the same way
you'd do it for HTTP.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
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] session destroy callback (onSessionDestroy event)

2007-05-13 Thread Emil Ivanov
Hi,

I need to do some clean-up when the session is destroyed or values are 
removed from it (expired).

using session_set_save_handler does not work for me, as I don't want to 
rewrite session handling, I just need to be notified when a value is 
destroyed.

Regards,
Emil Ivanov

P.S. I'm dealing with temporary pictures, saved on the disk and their path 
stored into the session and I need to delete them when they are no longer 
needed. 

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Daniel Brown

   The biggest thing to remember is that a license is like a key it's
meant to keep an honest man honest, but won't stop someone who is intent on
taking what they want for a profit.



On 5/13/07, Micky Hulse <[EMAIL PROTECTED]> wrote:


Crayon Shin Chan wrote:
> Don't forget the MIT license allows people to incorporate your code into
> commercial products and sell for profit without having to give anything
> back (money/improved code/etc).

Hi Cayon, thanks for clarification.

I just woke up, so I have not had a chance to really research the best
option for my code... Hmm, a part of me does not mind the things you say
above, but another part of me wonders if it would be best to restrict
the commercial usage of it.

Heheh, well, either way, thanks for the help. I appreciate it.

Have a great day.
Cheers,
Micky



--
Wishlists: 
Switch: 
  BCC?: 
My: 

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





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] php5 include() problem

2007-05-13 Thread Al

Is there an alternate way to execute a php in cgi-bin so it can do a chmod() on site 
directories as the "owner"?

My approach was the only way I could think of.  Given the obvious problem(s), 
it appears that it may not be a good choice.


Richard Davey wrote:

Al wrote:

I've got a cgi file in my cgi-bin folder that I'm calling with 
include(). It worked with php4.


My shared host just upgraded to my server to php5.2.0 and the function 
doesn't work.  I can't tell if the problem is a php5 or server 
configuration [which may have changed during the upgrade] issue.


If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755


Check if the new configuration of PHP allows HTTP calls. Include, 
require, fopen, etc are traditionally for local file-system files. 
Obviously you're calling it via HTTP so you get the parsed output and 
not the source code of the CGI script, but if your host has disabled URL 
opens with PHP 5 then it would explain why it no longer works.


Cheers,

Rich


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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Micky Hulse

Crayon Shin Chan wrote:
Don't forget the MIT license allows people to incorporate your code into 
commercial products and sell for profit without having to give anything 
back (money/improved code/etc).


Hi Cayon, thanks for clarification.

I just woke up, so I have not had a chance to really research the best 
option for my code... Hmm, a part of me does not mind the things you say 
above, but another part of me wonders if it would be best to restrict 
the commercial usage of it.


Heheh, well, either way, thanks for the help. I appreciate it.

Have a great day.
Cheers,
Micky



--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Micky Hulse

Daniel Brown wrote:

   Right, I alluded to that, but perhaps I should've said that exactly, as
it may bother some people.  In my case, it doesn't bother me in the least,
just as I use LAMP (all open source) to make a living.


Oh, I think I understood that. But there is always room for 
clarifications. :D


Thanks Daniel,
Cheers,
Micky

--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] scrolling HTML tables

2007-05-13 Thread Larry Garfield
I usually say go ahead and use thead and tbody for semantic completeness.  If 
you're doing anything funky with Javascript, then you can "group" table rows 
by having multiple table bodies (yes, that's legal!) and then operate on each 
tbody separately.

Don't waste time with tfoot.  It's broken.  Completely.  The W3C had this 
brilliant idea to require tfoot to go before tbody, so if you have a footer 
row it appears before the body unless you have a browser that knows to shift 
it to the end of the table, out of lexical order.  Such a browser does not 
exist.  It's completely backward-incompatible.  It's one of the dumbtest 
things the W3C has ever done.

But yeah, tbody and thead are fine, go ahead and use those. :-)  If nothing 
else they're useful for when you start manipulating the table with 
Javascript.

On Sunday 13 May 2007, Richard Lynch wrote:
> On Thu, May 10, 2007 11:45 am, C.R.Vegelin wrote:
> > I hope it's not the wrong place to ask, but has anyone experience with
> > scrolling HTML tables ?
>
> Actually, it *is* the wrong place to ask... :-v
>
> > According http://www.w3schools.com/tags/tag_thead.asp
> > "The thead, tfoot and tbody elements enable you to group rows in a
> > table.
> >  When you create a table, you might want to have a header row, some
> > rows with data, and a row with totals at bottom.
> >  This division enables browsers to support scrolling of table bodies
> > independently of the table header and footer."
> >
> > I don't want to reinvent the wheel in own software.
> > Or is it better to ignore these tags because of bad browser support ?
>
> I've never seen any browser do anything useful with these goofy tags...
>
> But the Designers seem to luv them...
>
> If you really want scrolling, you'd better put them in a DIV or
> IFRAME, I think.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] Making code public -- What steps to take? GPL?

2007-05-13 Thread Larry Garfield
Beware also that if you have an "advertising clause" that requires your name 
to stay on it, then you could be preventing GPLed projects from using it.  
The GPL is incompatible with "advertising clause" licenses.  That's why the 
PHP License, for instance, is GPL-incompatible.  (GPL is the most widely used 
Free Software / Open Source license by a very wide margin.)

If you're OK with both open source and proprietary usage, then consider the 
LGPL.  It's compatible both directions, only requiring modifications to your 
code specifically to be shared.  The modern BSD license is even more 
permissable.  It doesn't have a mandatory advertising clause, but IME if you 
have a good drop-in module that has a "copyright Me and released under the 
LGPL, see home page here" type message most people won't bother taking it 
out.  

The people who would try to take credit for your code wouldn't care what 
license it was under in the first place anyway.  

Thank you for sharing your code!

On Sunday 13 May 2007, Daniel Brown wrote:
> Right, I alluded to that, but perhaps I should've said that exactly, as
> it may bother some people.  In my case, it doesn't bother me in the least,
> just as I use LAMP (all open source) to make a living.
>
> On 5/13/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
> > On Sunday 13 May 2007 21:17, Micky Hulse wrote:
> > > I will definitely read-up on the MIT license after I get some zzZZzz's!
> >
> > Don't forget the MIT license allows people to incorporate your code into
> > commercial products and sell for profit without having to give anything
> > back (money/improved code/etc).
> >
> > --
> > Crayon
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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