php-general Digest 7 Jun 2002 13:52:04 -0000 Issue 1391

Topics (messages 101055 through 101111):

Re: NEWBIE- Is this possible? How?!
        101055 by: Peter
        101058 by: Justin French
        101067 by: Kevin J

PHP and ZIP/TAR.GZ files
        101056 by: Mukherjee, Devraj
        101069 by: Manuel Lemos

Re: How can i resize images after upload?
        101057 by: Andre Dubuc
        101059 by: Jason Wong

Re: UNSET & Arrays
        101060 by: Jason Wong
        101089 by: Jason Caldwell

Re: Extracting specific data from a URL using PHP...
        101061 by: Jason Wong

return array
        101062 by: Jule Slootbeek
        101064 by: Jason Wong
        101066 by: Jule Slootbeek
        101072 by: Martin Towell

Re: [PLEASE HELP] Passing variable to new page.
        101063 by: David Freeman

Re: majordomo in php?
        101065 by: David Freeman

Getting http:// include to return?
        101068 by: Leif K-Brooks
        101070 by: Sqlcoders.com Programming Dept

high % of capital letters in a string
        101071 by: Justin French
        101073 by: Evan Nemerson
        101074 by: Lars Torben Wilson
        101077 by: Justin French

Best way to store 1000 char in a database
        101075 by: webmaster.tececo.com
        101079 by: Tyler Longren
        101080 by: Analysis & Solutions

Need info abou ASP/Java HTML Form handling
        101076 by: Yasuo Ohgaki
        101081 by: Chris Knipe
        101087 by: Yasuo Ohgaki

Re: Anyone?
        101078 by: Analysis & Solutions

Missing posted variables in target script when multipart/form-data is set
        101082 by: Ed Greenberg
        101086 by: Jason Wong

Re: am i just a session tracking idiot?
        101083 by: dan radom

Files
        101084 by: Uma Shankari T.
        101088 by: Martin Towell

Re: OOP style question
        101085 by: Analysis & Solutions

?eregi?
        101090 by: Nikolai Jeliazkov

Thumbnail pages - alot of them
        101091 by: rory oconnor
        101095 by: David Freeman
        101102 by: David Robley
        101111 by: Erik Price

Re: emulating  --enable-trans-sid  --  project idea?
        101092 by: Giancarlo Pinerolo
        101094 by: Giancarlo Pinerolo

SUID ROOT
        101093 by: Yamin Prabudy

Re: [PHP Classes] Latest PHP news in the site newsletter and comp.lang.php newsgroup 
to be approved with your help]
        101096 by: Manuel Lemos

the ?PHPSESSID=spoofme 'bug'
        101097 by: Giancarlo Pinerolo
        101098 by: Giancarlo Pinerolo
        101099 by: Giancarlo Pinerolo
        101103 by: Josep R. Raurell

PHP-MySQL AND Case Sentivity
        101100 by: fincom
        101101 by: fincom

Re: Trying to list a directory content HELP PLEASE
        101104 by: webmaster mbtradingco
        101110 by: Naintara Jain

yEnc decode code
        101105 by: Herbert Groot Jebbink

Re: oracle again!!!!
        101106 by: Chris Hewitt

Setting Cookies
        101107 by: Scott 'INtense!' Reismanis

link to external php scripts?
        101108 by: Hawk

Question about Mail function time out
        101109 by: Al

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
 have a look at something like http://phpnuke.org   or the like ... maybe
this is what ur after ...



-----Original Message-----
From: Kevin J [mailto:[EMAIL PROTECTED]]
Sent: Friday, 7 June 2002 11:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] NEWBIE- Is this possible? How?!



Hello All Helpers!  :)

I was wondering if it is possible to mix Dynamic Content with Layers?

If not I was wondering if someone can help me with my idea:

I have designed a website for a band (see below name) and I would like to
add a feature where the band members can log in and write something, and
have it displayed on the page...i guess kinda like a guestbook, but I would
like to have the content to be overwritable..... I guess if the band members
had their own page, they could add their own content whenever they wanted
to, and it would update accordingly.

Be warned I have no background in PhP.

I would basically like to know what it is I am looking for to creating this.
I have bought Beginning PhP 4 by Wrox, and I am slowly getting into it. I
just need some direction please.

Thanks,

Kevin

Thanks,

Kevin J

--
http://www.wishpocket.com




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


--- End Message ---
--- Begin Message ---
Translation:

You want a password-protected form, which the band members can access, which
overwrites (updates) a central (or individual) chunk of text.

This text is placed inside a HTML page (dynamic, whatever, doesn't matter)
at run time, and is visible each time the page is hit, until someone else in
the band overwrites it.

This can be achieved quite easily, but may not be an ideal "first go" at
PHP.

In simple terms, you want:

- a form
- validation of that form (user, password, content validity, minor security
checks)
- overwrite a text file or MySQL database field with the new text
- include that text in your home page (or whatever).


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------



on 07/06/02 11:50 AM, Kevin J ([EMAIL PROTECTED]) wrote:

> 
> Hello All Helpers!  :)
> 
> I was wondering if it is possible to mix Dynamic Content with Layers?
> 
> If not I was wondering if someone can help me with my idea:
> 
> I have designed a website for a band (see below name) and I would like to
> add a feature where the band members can log in and write something, and
> have it displayed on the page...i guess kinda like a guestbook, but I would
> like to have the content to be overwritable..... I guess if the band members
> had their own page, they could add their own content whenever they wanted
> to, and it would update accordingly.
> 
> Be warned I have no background in PhP.
> 
> I would basically like to know what it is I am looking for to creating this.
> I have bought Beginning PhP 4 by Wrox, and I am slowly getting into it. I
> just need some direction please.
> 
> Thanks,
> 
> Kevin
> 
> Thanks,
> 
> Kevin J
> 
> --
> http://www.wishpocket.com
> 
> 
> 

--- End Message ---
--- Begin Message ---
Yup, you just hit the nail on the head with that one Justin.

I am sure this isn't the best way to learn PhP, but I am running out of
ideas for making this website work. Static content just seems boring these
days, so I would liek to "spice" up the site by having the band members
themselves contribute to the site, instead of me always doing it.

It might bring people to the site more often, and make it more interesting
for the band members.

I just have to figure out whwre to start, thats all.

Thanks,

Kevin J

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Translation:
>
> You want a password-protected form, which the band members can access,
which
> overwrites (updates) a central (or individual) chunk of text.
>
> This text is placed inside a HTML page (dynamic, whatever, doesn't matter)
> at run time, and is visible each time the page is hit, until someone else
in
> the band overwrites it.
>
> This can be achieved quite easily, but may not be an ideal "first go" at
> PHP.
>
> In simple terms, you want:
>
> - a form
> - validation of that form (user, password, content validity, minor
security
> checks)
> - overwrite a text file or MySQL database field with the new text
> - include that text in your home page (or whatever).
>
>
> Justin French
> --------------------
> Creative Director
> http://Indent.com.au
> --------------------
>
>
>
> on 07/06/02 11:50 AM, Kevin J ([EMAIL PROTECTED]) wrote:
>
> >
> > Hello All Helpers!  :)
> >
> > I was wondering if it is possible to mix Dynamic Content with Layers?
> >
> > If not I was wondering if someone can help me with my idea:
> >
> > I have designed a website for a band (see below name) and I would like
to
> > add a feature where the band members can log in and write something, and
> > have it displayed on the page...i guess kinda like a guestbook, but I
would
> > like to have the content to be overwritable..... I guess if the band
members
> > had their own page, they could add their own content whenever they
wanted
> > to, and it would update accordingly.
> >
> > Be warned I have no background in PhP.
> >
> > I would basically like to know what it is I am looking for to creating
this.
> > I have bought Beginning PhP 4 by Wrox, and I am slowly getting into it.
I
> > just need some direction please.
> >
> > Thanks,
> >
> > Kevin
> >
> > Thanks,
> >
> > Kevin J
> >
> > --
> > http://www.wishpocket.com
> >
> >
> >
>


--- End Message ---
--- Begin Message ---
Hello All,

I am new on this list serve and am the developer of the Terracotta project 
(http://terracotta.sourceforge.net) which is an extentsive document management system 
written in PHP.

Terracotta uses, stores all it's contents as files. I am attempting to introduce a 
feature, where by users can download a ZIP or a TAR.GZ archive of all files on the 
server, introducing an easy backup solution for them.

If any one has any ideas about dynamically creating archives using PHP please send me 
links to the resources.

Regards,
Devraj


--- End Message ---
--- Begin Message ---
Hello,

On 06/06/2002 11:03 PM, Devraj Mukherjee wrote:
> Hello All,
> 
> I am new on this list serve and am the developer of the Terracotta project 
>(http://terracotta.sourceforge.net) which is an extentsive document management system 
>written in PHP.
> 
> Terracotta uses, stores all it's contents as files. I am attempting to introduce a 
>feature, where by users can download a ZIP or a TAR.GZ archive of all files on the 
>server, introducing an easy backup solution for them.
> 
> If any one has any ideas about dynamically creating archives using PHP please send 
>me links to the resources.

Just use use the zip and tar/gzip programs.

-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
Hi Ragnar,

I had the same problem whenI wanted to display an uploaded image file. 
Unfortunately, Imagemagick isn't pre-compiled with Linux-Mandrake 8.2 distro. 
So I couldn't do it the usual way. However, I solved it in a very easy way.

Since the file was referenced in my db, and the actual file resided in ~/pix, 
I simply issued:

****************************************************************************************

<?php
// The actual uploaded file was 320x380 in size and a jpeg (could be anything)

print <td align='left'><img src='/pix/{$_SESSION['rpix']}' width='40' 
height='40'></a></td>"

?>

**
***************************************************************************************

Works for me . . . no need to alter/mogrify/resize. Perhaps I am missing 
something, but after struggling with resizing, I remembered that the image 
file automatically resizes itself to whatever size or shape you put it in -- 
especially jpg/jpeg and tiff.

Hth,
Andre



On Thursday 06 June 2002 09:05 pm, you wrote:
> On Thu, 6 Jun 2002 23:44:06 +0200, Ragnar wrote:
> >Is there a way in php to change the size of a posted/uploaded image
> >regardless of the imagetype?
>
> install imagemagick and then do something like:
>
> exec("/path/to/mogrify -geometry ".$width."x".$height." ".$file);

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
On Friday 07 June 2002 10:09, Andre Dubuc wrote:

> <?php
> // The actual uploaded file was 320x380 in size and a jpeg (could be
> anything)
>
> print <td align='left'><img src='/pix/{$_SESSION['rpix']}' width='40'
> height='40'></a></td>"

> Works for me . . . no need to alter/mogrify/resize. Perhaps I am missing
> something, but after struggling with resizing, I remembered that the image
> file automatically resizes itself to whatever size or shape you put it in
> -- especially jpg/jpeg and tiff.

This doesn't resize the image, all it does is tell the browser to display the 
image at a certain size!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I love you, not only for what you are, but for what I am when I am with you.
                -- Roy Croft
*/

--- End Message ---
--- Begin Message ---
On Friday 07 June 2002 09:04, Jason Caldwell wrote:
> i'm trying to unset an array element within my array --
>
> my array looks like;
>
> $foo[0][magazine]
> $foo[0][subscription]
> $foo[0][term]
> $foo[0][rate]
>
> $foo[1][magazine]
> $foo[1][subscription]
> $foo[1][term]
> $foo[1][rate]
>
> and so forth --
>
> when i call unset($foo[0]) for example, the entire array goes away, not
> just the [0] elements.
>
> how can i unset a multi-dimensional array?  i have no problems using unset
> single-dimension arrays.

You must be doing something wrong. unset($foo[0]) is correct and should work. 
If you're still having problems, post your real code.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The value of a program is proportional to the weight of its output.
*/

--- End Message ---
--- Begin Message ---
I was doing something wrong... ;)  I figured it out.  Sorry for the post --
it was one of those things that took me *forever* to figure it out and when
I saw the problem I felt like an idiot -- oh well.

Thanks anyway.
Jason


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Friday 07 June 2002 09:04, Jason Caldwell wrote:
> > i'm trying to unset an array element within my array --
> >
> > my array looks like;
> >
> > $foo[0][magazine]
> > $foo[0][subscription]
> > $foo[0][term]
> > $foo[0][rate]
> >
> > $foo[1][magazine]
> > $foo[1][subscription]
> > $foo[1][term]
> > $foo[1][rate]
> >
> > and so forth --
> >
> > when i call unset($foo[0]) for example, the entire array goes away, not
> > just the [0] elements.
> >
> > how can i unset a multi-dimensional array?  i have no problems using
unset
> > single-dimension arrays.
>
> You must be doing something wrong. unset($foo[0]) is correct and should
work.
> If you're still having problems, post your real code.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> The value of a program is proportional to the weight of its output.
> */
>


--- End Message ---
--- Begin Message ---
On Friday 07 June 2002 06:57, Anthony Ritter wrote:
> Newbie question.
>
> I understand that one can open a page off an existing website to extract
> text data using a PHP script by using the fopen and fread functions.
>
> And by using the strip_tags() function, one can extract data without the
> html markup as a literal string.
>
> Here's my question...
>
> Let's say that a html page from a website out on the 'net consists of three
> paragraphs of text and four html tables.
>
> Within each of those tables is text.
>
> And let's say that the second table down has three columns - water
> temperature, water level and cfs flow along with numerous records.
>
> Is there any way to extract *specific* data off a page - in this case - the
> second table - while leaving the balance of the text and the other tables
>  1, 3 and 4) alone?

You need to use regular expressions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Most burning issues generate far more heat than light.
*/

--- End Message ---
--- Begin Message ---
Hey guys and gals,

if i have a function
and i return an array from it

function my_function() {
blabla;
return array ($array['name'], $array['password']);
}

how do i get this into an array on the page i call the function?

$array = my_function() doesn't work?

any ideas?
thanks

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 
        

--- End Message ---
--- Begin Message ---
On Friday 07 June 2002 10:56, Jule Slootbeek wrote:
> Hey guys and gals,
>
> if i have a function
> and i return an array from it
>
> function my_function() {
> blabla;
> return array ($array['name'], $array['password']);
> }
>
> how do i get this into an array on the page i call the function?
>
> $array = my_function() doesn't work?

try:

list($doo, $dah) = my_function();

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If A equals success, then the formula is _A = _X + _Y + _Z.  _X is work.  
_Y
is play.  _Z is keep your mouth shut.
                -- Albert Einstein
*/

--- End Message ---
--- Begin Message ---

> 
> try:
> 
> list($doo, $dah) = my_function();
> 

thanks alot
that was it

list ($array['name'], $array['password']);

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 
        

--- End Message ---
--- Begin Message ---
that seems odd
I've got a function that returns an array something like you had in your
example. eg

function blah()
{
  return array("C"=>3,"D"=>9,"M"=>1);
}
$arr = blah();

then doing  echo $arr["C"]  output's  3



-----Original Message-----
From: Jule Slootbeek [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 1:06 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] return array



> 
> try:
> 
> list($doo, $dah) = my_function();
> 

thanks alot
that was it

list ($array['name'], $array['password']);

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 
        


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

 > echo "<script language=\"JavaScript\">";
 > echo" function pop1() {";
 > echo" window.open(\"info.php?prod_id=$result[0]\"); }";
 > echo "</script>";

 > I am calling this function in the following manner: echo"<img
 > onclick=\"pop1();\"";

OK, I tend not to put javascript inside php echo statements as it
confuses things - which variables belong to which language.  Second, as
it stands, if I understand you correctly, it won't matter which image is
clicked on, you'll always get the same prod_id.  That's a logic problem.

 > <?
 > $myid = $_GET['prod_id'];
 > echo" Product ID: $myid<br>";
 > ?>

You don't seem to be doing anything much on this yet - except trying to
display text.

Anyway, if you're serious about solving this why not start simpler and
work up.  Create yourself some html with the javascript in it to call
your new php page.  This way you _know_ what is being passed to your
popup.  If this doesn't work then you need to fix your javascript.  If
it does work you can start putting your php back into the first one and
see where it stops working - this will likely be what you need to fix.

In future please reply to the group rather than to me personally - and
no, I'm not going to write your code for you.

CYA, Dave


--- End Message ---
--- Begin Message ---

 > Anyone knows of a majordomo type mailing list made with php 
 > somewhere?

Why would you want to do that?  If you need mailing list software you'd
be infinitely better off using one that already exists - if you need
features that it doesn't support (eg. A web front-end for majordomo)
then perhaps you could conribute that (and write it in php even).

CYA, Dave


--- End Message ---
--- Begin Message ---
I'm trying to make a script that people using PHP can get information 
from my site from by including it.  They would do something like:
    $var = 
include("http://mydomain.com/infoscript.php?infotoget=info1";); //returns 
"This is info 1."
Is there anything I can do in my script to make return() work even 
though they're not loading it locally?

--- End Message ---
--- Begin Message ---
It's not exactly what you wanted, but try this:

<?
echo HTTPReturnTest();


function HTTPReturnTest(){
 $intFileHandle = fopen("http://www.hysp.net","r";);
 while (!feof ($intFileHandle)) {
  $intFileOutput .= fgets($intFileHandle, 4096);
 }
 fclose($intFileHandle);
 return $intFileOutput;
}
?>

HTH,
Dw.

Sqlcoders.com Dynamic data driven web solutions 
----- Original Message ----- 
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: June 06 2002 08:08 PM
Subject: [PHP] Getting http:// include to return?


> I'm trying to make a script that people using PHP can get information 
> from my site from by including it.  They would do something like:
>     $var = 
> include("http://mydomain.com/infoscript.php?infotoget=info1";); //returns 
> "This is info 1."
> Is there anything I can do in my script to make return() work even 
> though they're not loading it locally?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
Hi,

How would I determine if there was a high % (say > 40%) of capital letters
in a string?  I'm trying to think of a way of preventing endless use of
capital letters in a message board, to stop YELLERS.

Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------

--- End Message ---
--- Begin Message ---
/* Perhaps something like this? */

// UNTESTED
$string = "ThE sTrInG tO tEsT";
function str2arr($str)
{
        for ( $x = 0 ; $x < ( strlen($str) ) ; $x++ )
        {
                $arr[$x] = substr($str, $x, 1);
        }
        return $arr;
}
foreach ( (str2arr($string)) as $char )
{
        if ( strtolower($char) != $char )
        {
                $res["cap"]++;
        }
        else
        {
                $res["low"]++;
        }
}
if ( ($res["cap"]/($res["cap"]+$res["low"])) >= ".4" )
{
        exit("Too many capital letters, LaMeR!");
}

--- End Message ---
--- Begin Message ---
On Thu, 2002-06-06 at 20:20, Justin French wrote:
> Hi,
> 
> How would I determine if there was a high % (say > 40%) of capital letters
> in a string?  I'm trying to think of a way of preventing endless use of
> capital letters in a message board, to stop YELLERS.
> 
> Justin French
> --------------------
> Creative Director
> http://Indent.com.au
> --------------------

One I wrote last year sometime:

<?php
error_reporting(E_ALL);

$strings = array('This is a test with only one cap.',
                 'This One Has Some More',
                 'AND THIS ONE IS SHOUTING');

function get_caps_pct($string) 
{
    $string = preg_replace('/[^a-z]/i', '', $string);
    $non_caps = strlen(preg_replace('/[^A-Z]/', '', $string));
    $caps = strlen(preg_replace('/[A-Z]/', '', $string));
    return $caps ? ($non_caps / $caps) * 100 : 100;
}

foreach ($strings as $string)
{
    $pct = (int) get_caps_pct($string);
    echo "Percentage of characters which are CAPITALS: $pct%\n";
}
?>

Output:

Percentage of characters which are CAPITALS: 4%
Percentage of characters which are CAPITALS: 38%
Percentage of characters which are CAPITALS: 100%


Cheers,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506

--- End Message ---
--- Begin Message ---
Thanks Lars & Evan... much appreciated!

Justin French


on 07/06/02 2:13 PM, Lars Torben Wilson ([EMAIL PROTECTED]) wrote:

> On Thu, 2002-06-06 at 20:20, Justin French wrote:
>> Hi,
>> 
>> How would I determine if there was a high % (say > 40%) of capital letters
>> in a string?  I'm trying to think of a way of preventing endless use of
>> capital letters in a message board, to stop YELLERS.
>> 
>> Justin French
>> --------------------
>> Creative Director
>> http://Indent.com.au
>> --------------------
> 
> One I wrote last year sometime:
> 
> <?php
> error_reporting(E_ALL);
> 
> $strings = array('This is a test with only one cap.',
> 'This One Has Some More',
> 'AND THIS ONE IS SHOUTING');
> 
> function get_caps_pct($string)
> {
> $string = preg_replace('/[^a-z]/i', '', $string);
> $non_caps = strlen(preg_replace('/[^A-Z]/', '', $string));
> $caps = strlen(preg_replace('/[A-Z]/', '', $string));
> return $caps ? ($non_caps / $caps) * 100 : 100;
> }
> 
> foreach ($strings as $string)
> {
> $pct = (int) get_caps_pct($string);
> echo "Percentage of characters which are CAPITALS: $pct%\n";
> }
> ?>
> 
> Output:
> 
> Percentage of characters which are CAPITALS: 4%
> Percentage of characters which are CAPITALS: 38%
> Percentage of characters which are CAPITALS: 100%
> 
> 
> Cheers,
> 
> Torben

--- End Message ---
--- Begin Message ---
What is the best way to store text with up to 1000 characters in a mySQL database?
 
Sorry for the slightly of topic posting but I am not going to join another mailing list unless I have to.
 
I am going to create a weekly qoute generator thingy for my site.
 
--- End Message ---
--- Begin Message ---
What do you mean "the best way"?  Do you mean which data type you should
give the field?  A bit more info please.  :-)

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 06, 2002 8:50 PM
Subject: [PHP] Best way to store 1000 char in a database


What is the best way to store text with up to 1000 characters in a mySQL
database?

Sorry for the slightly of topic posting but I am not going to join another
mailing list unless I have to.

I am going to create a weekly qoute generator thingy for my site.

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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

--- End Message ---
--- Begin Message ---
On Fri, Jun 07, 2002 at 11:50:10AM +1000, [EMAIL PROTECTED] wrote:

> What is the best way to store text with up to 1000 characters in a
> mySQL database?

http://mysql.com/doc/C/o/Column_types.html

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
Hi All.

Could anyone tell me any reference for ASP and/or Java HTML
form handling script/program/module/class/etc?

I'm going to write PHP module for easier HTML form
handling and would like to know what kind of feature/options
ASP/Java have.

Thanks.

--
Yasuo Ohgaki

--- End Message ---
--- Begin Message ---
*urgh*

So off topic it's not funny....  http://www.microsoft.com/vbscript /
http://www.microsoft.com/jscript/

I might not be 100% correct on the urls.  Just search for VB / JS Script
Refence at microsoft.com


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

----- Original Message -----
From: "Yasuo Ohgaki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 6:24 AM
Subject: [PHP] Need info abou ASP/Java HTML Form handling


> Hi All.
>
> Could anyone tell me any reference for ASP and/or Java HTML
> form handling script/program/module/class/etc?
>
> I'm going to write PHP module for easier HTML form
> handling and would like to know what kind of feature/options
> ASP/Java have.
>
> Thanks.
>
> --
> Yasuo Ohgaki
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Chris Knipe wrote:
> *urgh*
> 
> So off topic it's not funny....  http://www.microsoft.com/vbscript /
> http://www.microsoft.com/jscript/
> 
> I might not be 100% correct on the urls.  Just search for VB / JS Script
> Refence at microsoft.com

Thanks for the input, but I know the url of cource.

I'm one of a PHP developer writing C code for you
and asking some inputs to develop HTML Form handling
module for PHP written in C.

There should be many people know much more about ASP/Java
than me especially ASP.

Anyway, I don't mind if it a commercial product or not.
Anyone knows what kind of HTML form handling mechanism
(I mean thing that does, automatic JavaScript validatator
code creation, automatic user input validator such as
CGISPAWN mentioned in MSDN, automatic HTML4 form generation
from XML definition, regular expression based server side
validation, etc)

I need feature list so that I can write better module.
It's always good to know what others do before starting
my own ;)

--
Yasuo Ohgaki
[EMAIL PROTECTED]
[EMAIL PROTECTED]


> 
> 
> Kind Regards,
> 
> Chris Knipe
> MegaLAN Corporate Networking Services
> Tel: +27 21 854 7064
> Cell: +27 72 434 7582
> 
> ----- Original Message -----
> From: "Yasuo Ohgaki" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 07, 2002 6:24 AM
> Subject: [PHP] Need info abou ASP/Java HTML Form handling
> 
> 
> 
>>Hi All.
>>
>>Could anyone tell me any reference for ASP and/or Java HTML
>>form handling script/program/module/class/etc?
>>
>>I'm going to write PHP module for easier HTML form
>>handling and would like to know what kind of feature/options
>>ASP/Java have.
>>
>>Thanks.
>>
>>--
>>Yasuo Ohgaki
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> 
> 
> 



--- End Message ---
--- Begin Message ---
Hi Jas:

> if ((!$u_name) || (!$p_word) || (!$image)){

What if the variables aren't submitted at all?  Better to test for 
empty() on each variable.  Avoids Warnings if error reporting is high.


> require '/path/to/database/connection/script/dbcon.php';

Put a @ in front of that require to keep an error message from revealing 
the paths of your two vital scripts.


> $sql = "SELECT * from $db_table WHERE un = \"$user\" AND pw =
> password(\"$pw\")";

You're sending uncleaned information to your database.  Not cool.  Use 
regular expressions to make sure there are no nasty characters and that 
the items conform to expected parameters.


>   $p_hash = "$p_word";
>   $to_hash = "$image";

Why waste time assigning these things to other variables when you don't 
need to?  Also, the quotes are superfluous.


>   $pstring = md5($to_hash);
>   $image_sel = md5(uniqid(microtime($p_word),1));
>    session_start();
>    session_register('user');
>    session_register('$pstring');
>    session_register('$image_sel');

Exactly why are you storing all of this stuff in the session?  You've 
aleady validated them upfront.


Dude, let me be straight up.  The reason I didn't reply thusfar is you
sent a huge mass of poorly formatted code to the list.  I took one look 
at it and thought, why do I need to deal with that mess.

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
I have a small test script which fails when enctype="multipart/form-data" is
set.

<form action="action.php" method="post" enctype="multipart/form-data">
Your name: <input type="text" name="name">
You age: <input type="text" name="age">
You file: <input type="file" name="myfile">
<input type="submit">

When the above is submitted to action.php, $_POST and $HTTP_POST_VARS are
both empty.  If I remove the enctype="multipart/form-data" portion of the
form tag, the arrays are set correctly, and in fact, the global_variables
are created since register_globals is on.

Platform is RedHat Linux 7.3 (Valhalla) with PHP 4.1.2 and Apache 1.3.23 as
installed from RedHat's Valhalla RPMS.

I've seen several postings similar to this, but none of them carried a
solution or even a hint.

I hope I've given enough info.

</edg>
Ed Greenberg

PS: Resolving this would resolve issues that I have with a bunch of popular
PHP packages such as Gallery, Pagetool and phpWebSite.  The authors of these
packages all have multipart/form-data on almost all their forms, whether or
not uploading a file is required.


--- End Message ---
--- Begin Message ---
On Friday 07 June 2002 12:32, Ed Greenberg wrote:
> I have a small test script which fails when enctype="multipart/form-data"
> is set.
>
> <form action="action.php" method="post" enctype="multipart/form-data">
> Your name: <input type="text" name="name">
> You age: <input type="text" name="age">
> You file: <input type="file" name="myfile">
> <input type="submit">
>
> When the above is submitted to action.php, $_POST and $HTTP_POST_VARS are
> both empty.  If I remove the enctype="multipart/form-data" portion of the
> form tag, the arrays are set correctly, and in fact, the global_variables
> are created since register_globals is on.
>
> Platform is RedHat Linux 7.3 (Valhalla) with PHP 4.1.2 and Apache 1.3.23 as
> installed from RedHat's Valhalla RPMS.

Have you enabled file uploads in php.ini?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
A Smith & Wesson beats four aces.
*/

--- End Message ---
--- Begin Message ---
i got everything working tonihgt.  the problem seems to be that i was running this 
from an apache vhost, and not the real server.  why would that matter?  how can i fix 
that?

dan
--- End Message ---
--- Begin Message ---


Hello,

  Can anyone please clear my doubt...
I am having the input data in one file.
i need check whether some lines are there continuosly in that file and i
have to extract that line using file operation commands in php..how do i
go about with that ?? can anyone please tell me

Waiting for your reply
Uma


--- End Message ---
--- Begin Message ---
if the file's not too long, you could use file() to read the file into
memory, then loop through the array you get back and look for the line(s)
you're after.

if you don't want to read the entire file into memory, you can loop through
the file with:

$f = fopen($file, "r") or die("can't open file");
while (!foef($f))
{
  $line = fgets($f, 1024);  // increase length if your lines are longer
  // line checking code here
}
fclose($f);

HTH

-----Original Message-----
From: Uma Shankari T. [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 2:55 PM
To: PHP
Subject: [PHP] Files




Hello,

  Can anyone please clear my doubt...
I am having the input data in one file.
i need check whether some lines are there continuosly in that file and i
have to extract that line using file operation commands in php..how do i
go about with that ?? can anyone please tell me

Waiting for your reply
Uma



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

It's getting late, so I may not be thinking clearly...


On Thu, Jun 06, 2002 at 04:57:42PM -0400, Erik Price wrote:

> I have a method in my class that essentially unsets an array element.  

Uh, I know you're a sharp guy, but I've got to ask anyway.  If it's 
doing such a simple thing, why do you need a method to do it?  Why not 
go ahead and unset the array directly?


> Now, originally I was doing all of this method calling from the script 
> itself.  For each variable POSTed by the user, I call the first method.  

Why not have the function automatically check each variable in POST (you
know, do a while loop for each $_POST) rather than have to call the
function over and over?  That way you can call the thing once and you're
done.  Plus, you can then either put that second, clean up, step in here
or have it a separate function called at the end of this POST check
stuff.


> But now that I have a second "clean-up" method that needs to be called, 
> how should I go about it?  Should I have one "master" method in the 
> class that is called from the script, and itself does all the work?  
> This keeps all of the work in the class, and out of the calling script.
> 
> OR...
> 
> Should I keep the class free of code that only executes according to 
> POST variables from the user, and keep this kind of thing in the calling 
> script.  That way, the object's class is more flexible, and can be used 
> in more contexts.

I tend to use classes for reusable purposes throughout my projects.  
So, I wouldn't bog it down with things you're only going to use in one
place.  Perhaps put this second, clean-up, process in an extension of
the primary class?

Good night (or good morning by the time y'all read this),

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
Can anybody help me!!!

In my Windows2000 machine I use Apache 3.24 and PHP 4.0.6 and all is OK.
But when I transfer my code to work machine (Apache/1.3.22 (Unix) 
(Red-Hat/Linux) mod_ssl/2.8.5 OpenSSL/0.9.6b DAV/1.0.2 PHP/4.0.6 
mod_perl/1.26)
the following script returns FALSE.

<?php
define(COUNTRY_OPTION, preg_quote('value="') . '(.*)' . preg_quote('">') 
. '(.*)' . preg_quote('</option>'));
$aaa = "<option value=\"100\">ANTIGUA AND BARBUDA</option>";
echo (eregi(COUNTRY_OPTION,$aaa,$regs))?"TRUE":"FALSE";
exit;
?>


--- End Message ---
--- Begin Message ---
I have a mysql database table of about 7000 images (they are not
actually in the db, just references), as yet uncategorized.  I need to
put them online and allow my client to browse 12-18 thumbnails per page.

what would be the most efficient method to code that with PHP?  any help
is appreciated!

Thanks,

Rory

--- End Message ---
--- Begin Message ---

 > I have a mysql database table of about 7000 images (they are 
 > not actually in the db, just references), as yet 
 > uncategorized.  I need to put them online and allow my 
 > client to browse 12-18 thumbnails per page.
 > 
 > what would be the most efficient method to code that with 
 > PHP?  any help is appreciated!

Query your database to with an appropriate 'ORDER BY' and use 'LIMIT' to
get the number you want per page.

Display them to a page from within a 'while' loop.

Process as you require.

Include page navigation to do the next set.

What have you tried?  Are you having trouble with something specific?

If you're not sure what to do then perhaps downloading something that
will do it already will work - try www.hotscripts.com or perhaps
sourceforge.net or freshmeat.net as good places to start - or even just
do a search on google - I suspect searching for 'mysql php image
browser' would get you close.

CYA, Dave


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I have a mysql database table of about 7000 images (they are not
> actually in the db, just references), as yet uncategorized.  I need to
> put them online and allow my client to browse 12-18 thumbnails per page.
> 
> what would be the most efficient method to code that with PHP?  any help
> is appreciated!
> 
> Thanks,
> 
> Rory
> 
> 
Look into mysql's LIMIT which permits you to define the number of records 
returned from a query

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---

On Friday, June 7, 2002, at 03:06  AM, rory oconnor wrote:

> I have a mysql database table of about 7000 images (they are not
> actually in the db, just references), as yet uncategorized.  I need to
> put them online and allow my client to browse 12-18 thumbnails per page.
>
> what would be the most efficient method to code that with PHP?  any help
> is appreciated!

First a disclaimer -- what I am about to tell you may sound very 
complicated, but only because it's hard to explain.  Really, the concept 
is simple once you "get" it.

Some people have said look into the LIMIT clause in a MySQL SELECT 
query.  This is the right direction, but specifically you need to use 
the (implicit) OFFSET argument to LIMIT.

Fundamentally, what you do is this:

You perform a SELECT as normal, which would return all results from your 
database, but you use LIMIT 0, 10 which means "Limit it to 10 records 
starting at the first one".  [Yes, it's weird since your row's primary 
key column probably starts with 1, but if you think about it it's not 
really weird, MySQL doesn't care what value is in your row's primary key 
column.  The first record/row is 0.]

The offset is going to be passed via a GET variable, so your query will 
look something like:

SELECT  row_id,
                row_content
FROM            table
WHERE   where conditions here
LIMIT   $offset, 10;

This is because if the person clicks the "next 10 rows" link, which you 
will provide, this link will have a querystring attached that looks 
something like "?offset=10" or whatever offset it is.

So how do you implement this into a PHP script?  Well, sure there's a 
lot of ways to do it but essentially, you do this:

On the first page, you have two queries -- first a COUNT to see how many 
records are in the table, and second the above SELECT query that does 
the work you want done (getting the information).

Now, using the first query's results (which are nothing more than the 
number of records in the table), you figure out how many more rows are 
left AFTER the offset that you are at.  If this is the first page, and 
you are displaying ten results on the first page, then simply subtract 
ten from the total.  If this is the second page, you have now displayed 
twenty records, so subtract twenty.  Save this value as a variable like 
$rowsLeft or something.  Also, you want to save the number of rows 
PREVIOUS to your current offset, which for the first page would be 0 but 
for the second page would be 10, and for the third page would be 20.  
Get it?  This is how you will make a link that says "next 10 thumbnails" 
or "previous 10 thumbnails" or whatever.

Next step is easy: you simply display the data however you wish to do 
it.  I'm not going to tell you how to do this because it's the same way 
you'd display the data normally.

Finally, you need to make the links to go backward or forward.  This is 
the whole trick of the operation.  You make a link to the page's self, 
but you pass along the offset so that the next query knows how to build 
the proper SELECT statement to return the -next- ten rows, etc.  Like 
this:

print("<a href=\"" . $_SERVER['PHP_SELF'] . "?offset=" . $offset . 
"\">Next 10 Thumbnails</a>");

Of course, the above link is really too simple.  You would want to 
determine the number of rows that will be returned, which will usually 
be 10 but not always -- on the second to last page, if there are only 4 
rows left to display, you don't want to say "Next 10 thumbnails" if 
there are only 4 left.  So you need to do a simple bit of processing to 
get the number of rows left and print that value.

Do the same for the "previous 10 thumbnails", although if you do this 
right you will always have a value of 10 in this section.  (When would 
you ever end up at an offset that is not a multiple of 10?)

That's all there is to it.  It's complicated at first, but once you get 
it, you'll always be able to do it.  I strongly recommend that you 
create a class called "ThumbnailResults" and store all of this logic in 
the class, since it'll keep your script cleaner.

Good luck,


Erik




----

Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
Justin French wrote:
> 
> Hi all,
> 
> About 2.30 in the morning I started kicking around an idea, based on the
> recent discussions on sessions, and what --enable-trans-sid did.
> 
> From my understanding:
> 
> +   if there is no session cookie, set a cookie AND append a
>     session ID to URLs on the first (session start) page
> 

AND do a redirect to self. This is how phplib worked. How do you
distinguish the 'first page' from the others?

> +   on the next page, the session is carried, and it checks to
>     see if the cookie set on the prev. page can be found
> 
>     -   if it can, it now knows (presumably by setting a session
>         var) that cookies are okay
> 
>     -   if it can't, it assumes cookies are not avail, and it
>         knows that the session must be appended to each URL
> 

Not quite like that. This is the same as saying: if there's a session in
the URL ad no cookie, presume  cookies are not available. Wrong
presumption. This is the reason why now it is spoofable by opening any
page with a user-provided session in the URL

> +   if the session ID must be appended, it waves a magic wand
>     over every .php page and appends a session id... i GUESS
>     through buffering or parsing the entire output.
> 
> So, couldn't this be emulated by :
> 
> + following the same set/check routine above
> + if needed, wave a magic wand over the output before it's sent to the page,
> by the use of output buffering?
> 
> If some enough ppl on this list believe it's a good idea to pursue this, and
> don't think it will result in a big performance drop or anything, I'm keen
> to start work on it as an opensource project, hopefully with the support of
> this list to make sure it stays on the right track.
> 
> On the other hand, there may be a huge flaw in my idea :D
> 
> Justin French
--- End Message ---
--- Begin Message ---
Justin French wrote:
> 
> Hi all,
> 
> About 2.30 in the morning I started kicking around an idea, based on the
> recent discussions on sessions, and what --enable-trans-sid did.
> 
> From my understanding:
> 
> +   if there is no session cookie, set a cookie AND append a
>     session ID to URLs on the first (session start) page

+  CREATE THAT PHP SESSION as soon as the sid is generated. And THEN
redirect to self
 
> 
> +   on the next page, the session is carried, and it checks to
>     see if the cookie set on the prev. page can be found
> 
>     -   if it can, it now knows (presumably by setting a session
>         var) that cookies are okay
> 
>     -   if it can't, it assumes cookies are not avail, and it
>         knows that the session must be appended to each URL
> 

+ IF THE SESSION IS FOUND EXISTENT. It should, because you created it
when generated the sid, before doing the redirect to self.
 Otherwise someone is spoofing.

I've recently modified the PHPLIB behavior about session creation
policy, to behave like this. The patch is commited and published at the
project's site.



> +   if the session ID must be appended, it waves a magic wand
>     over every .php page and appends a session id... i GUESS
>     through buffering or parsing the entire output.
> 
> So, couldn't this be emulated by :
> 
> + following the same set/check routine above
> + if needed, wave a magic wand over the output before it's sent to the page,
> by the use of output buffering?
> 
> If some enough ppl on this list believe it's a good idea to pursue this, and
> don't think it will result in a big performance drop or anything, I'm keen
> to start work on it as an opensource project, hopefully with the support of
> this list to make sure it stays on the right track.
> 
> On the other hand, there may be a huge flaw in my idea :D
> 
> Justin French
--- End Message ---
--- Begin Message ---
Hi there,
I used rasmus script (PEAR) (with a change a little bit to fit to
FreeBSD) to adduser/changepassword/verifypassword for my user from
web
I got some problem with the SUID
to read the file and rewrite the file from the web
i had set the
safe_mode = On
safe_mode_gid = On
in php.ini and the script already own my root.wheel

can anyone enlight me ? 

Thanks in advance
Yamin Prabudy


-------------------------------------------------------------------
PRONET INTERNET SERVICE PROVIDER
http://www.pro.net.id
-------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Hello,

Please read the second part of the message being forwarded and 
contribute to make PHP have better recognition by voting for the 
creation of the comp.lang.php newsgroup. The explantion about the 
importance of this is in the message.

-- 

Regards,
Manuel Lemos
--- Begin Message ---

Hello,

Finally I implemented something that I have been willing to have for a
long time. I have just include in the PHP Classes site newsletter the head
lines of the latest PHP news that were released in several other sites.

So, now everybody subscribed to the site newsletter can be kept up to date
with the latest news in the PHP world without having to keep polling many
sites to know if any interesting news were released.

This addition to the site newsletter was made possible thanks to the
cooperation of the CodingTheWeb.com site that provided the news feed
aggregating news articles from several sources that are popular sites in
the PHP community.

As usual, you may see a preview of the site newsletter already with this
new news feed here:

http://www.phpclasses.org/newsletter.html


Another issue that is not really related with the PHP Classes site but is
very important for the recognition of PHP as a language well supported
within the programming community, is the fact that finally a newsgroup
named comp.lang.php is about to be voted for approval in the Usenet.

For those that do not know what this means, Usenet is probably the oldest
network of discussion groups distributed over the Internet. It has several
hierarchies of groups but only the Big 8 are well distributed among ISPs.
The comp hierarchy is one of the Big 8 hierarchies.

There are already the alt.php, alt.php.sql and the alt.comp.lang.php news
groups but the alt hierarchy is not one of the Big 8 hierarchies and so it
is not so widely available as the comp hierarchy. There are also several
regional PHP newsgroups that are even less well distributed.

The official mailing lists maintained by the PHP Group are also available
via NNTP but AFAIK no ISP redistributes those news groups.

Having a PHP newsgroup sub-hierarchy under comp.lang.php is not just a
matter of having a better distributed hierarchy of PHP news groups. It is
also a matter of status for PHP as well recognized language.

If you go to Google and see the list of languages under the comp.lang
hierarchy, you see there 55 languages and none of them is PHP, as if PHP
would be such a minor language that would not justify a hierarchy for
itself.

http://groups.google.com/groups?hl=en&lr=&group=comp.lang

So, it is very important for PHP and all of those that work with it, that
the comp.lang.php group just submitted for voting becomes approved.

The Call For votes message was posted here:

http://groups.google.com/groups?selm=1023125386.82479%40isc.org

So, all you need to do to contribute to the process of approval is to send
a message to [EMAIL PROTECTED] with the text "I vote YES on
comp.lang.php" in the body of the message.

Eventually this link will help you do it without much effort:

mailto:[EMAIL PROTECTED]?Body=I%20vote%20YES%20on%20comp.lang.php

Of course, you should only vote YES if you agree with the creation of the
news group, but as subscriber of the PHP Classes site I assume that you
most likely agree that it is a good idea.

In the name of the PHP community, thank you for your cooperation.

Regards,
Manuel Lemos

.

--- End Message ---
--- End Message ---
--- Begin Message ---
Can I tell you more than what the subject says?
proceeding:
Close the browser, clean all your cookies, and open any page with that
?PHPSESSID=spoofme appended.
And see what  happens.

1) No cookies are left
2) a session 'spoofme' is created

Do you need more? Javascript url injection ad cross site scripting
become obsolete with this 'feature'.

PLS!

I mean, as the zend site doesn't quite work like this (do the same test
proceeding as described above...) 
Their session to append to your cookie-enabled browser location are
Zend_Session_DB=whatever and Zend_Session_DB_SECURE=whatever2 on their
login page.

I don't know if this is related to the free downloadable version, and
the one they sell and adopt is more 'fortified'... they should clearly
state it then!


Gian
--- End Message ---
--- Begin Message ---
I myself wrote:
> 
> Can I tell you more than what the subject says?
> proceeding:
> Close the browser, clean all your cookies, and open any page with that
> ?PHPSESSID=spoofme appended.
> And see what  happens.
> 
> 1) No cookies are left
> 2) a session 'spoofme' is created
> 
> Do you need more? Javascript url injection ad cross site scripting
> become obsolete with this 'feature'.
> 
> PLS!
> 
> I mean, as the zend site doesn't quite work like this (do the same test
> proceeding as described above...)
> Their session to append to your cookie-enabled browser location are
> Zend_Session_DB=whatever and Zend_Session_DB_SECURE=whatever2 on their
> login page.
> 
> I don't know if this is related to the free downloadable version, and
> the one they sell and adopt is more 'fortified'... they should clearly
> state it then!
> 
> Gian

I've commited the latest PHPLIB version (php-lib-stable) that humbly
tries to prevent this unsecure  behaviour, as I said in one of my prev
messages.
I can't extend it to the so-called PHPLIB4 (that uses native PHP4
session) tree, because PHP is truely holed in that.

Gian
--- End Message ---
--- Begin Message ---
Giancarlo Pinerolo wrote:
> 
> I myself wrote:
> >
> > Can I tell you more than what the subject says?
> > proceeding:
> > Close the browser, clean all your cookies, and open any page with that
> > ?PHPSESSID=spoofme appended.
> > And see what  happens.

spoofme is not the exact term.

?PHPSESSID=hijackme should be more appropriate, but I avoided it for
well known 'historical' reasons :-|

G
--- End Message ---
--- Begin Message ---
If you destroy the session (for exaple with a logoff button) this dosen 
work.

Josep R. Raurell


Giancarlo Pinerolo wrote:

>Giancarlo Pinerolo wrote:
>
>>I myself wrote:
>>
>>>Can I tell you more than what the subject says?
>>>proceeding:
>>>Close the browser, clean all your cookies, and open any page with that
>>>?PHPSESSID=spoofme appended.
>>>And see what  happens.
>>>
>
>spoofme is not the exact term.
>
>?PHPSESSID=hijackme should be more appropriate, but I avoided it for
>well known 'historical' reasons :-|
>
>G
>


--- End Message ---
--- Begin Message ---
Hi,

how to make sql Result case sensitive with php.

thanks


--- End Message ---
--- Begin Message ---
That's Ok
See :

http://www.zend.com/tips/tips.php?id=199&single=1


"Fincom" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hi,
>
> how to make sql Result case sensitive with php.
>
> thanks
>
>


--- End Message ---
--- Begin Message ---
Hey Scott, that at least helped me to find out what is going wrong.

When I use the code as you told me...

           $fd=readdir("/home/casapu/paginas /image/caterleras/");
           if (!$fd) die ("Can't read dir");

It gives me:
Warning: Supplied argument is not a valid Directory resource in
/home/casapu/paginas/mbt/php/dir.php on line 7
Can't read dir

So I'm assuming is not accepting the directory. I have checked the
permits, and it has all enabled, read, write and executable.
I have tried with the final slash, and without it, and so far it keeps
giving me that message... any ideas?



-----Mensaje original-----
De: Scott Hurring [mailto:[EMAIL PROTECTED]] 
Enviado el: Jueves, 06 de Junio de 2002 15:26
Para: '[EMAIL PROTECTED]'
Asunto: RE: [PHP] Trying to list a directory content HELP PLEASE

Instead of chdir() try putting the path directly into 
readdir();  it'll make the code a tiny bit cleaner.

readdir("/home/casapu/paginas/images/carteleras");

** and check return values! **

$fd = readdir(...)
if (!$fd) die("Cannot readdir");

The code you have *should* work, but you'll never
know why it's not working if you don't check return
statuses

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -----Original Message-----
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 3:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Trying to list a directory content HELP PLEASE
> 
> 
> On Friday 07 June 2002 00:47, webmaster mbtradingco wrote:
> > I know my doubt is probable odd, but I would ask your help please.
> >
> > I need a user to be able to select an image from a directory, from a
> > drop down box. For this I need to list all the images 
> available on the
> > directory, hence, I have this code:
> >
> >    <select size="1" name="normal1">
> >     <?php
> >           chdir("/home/casapu/paginas/images/carteleras");
> >           $direc = opendir(".");
> >           while ($f = readdir($direc)); {
> >           print("<option value=\"".$f."\">".$f."</option>");
> >                }
> >     ?>
> >    .</select>");
> >
> > but this is not working. I have reviewed the code against all the
> > manuals/books I have, and it says it should work but it 
> doesn't. Anyone
> > knows what I'm doing wrong?
> 
> how doesn't it work?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications 
> Development *
> 
> /*
> Fashions have done more harm than revolutions.
>               -- Victor Hugo
> */
> 
> 
> -- 
> 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



--- End Message ---
--- Begin Message ---
Is that a space in the directory path?
I think you will have to use opendir() function first.

"opendir: Returns a directory handle to be used in subsequent closedir(),
readdir(), and rewinddir() calls. "

The manual has some good examples.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
t]On Behalf Of webmaster mbtradingco
Sent: Thursday, June 06, 2002 3:56 PM
To: 'Scott Hurring'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Trying to list a directory content HELP PLEASE


Hey Scott, that at least helped me to find out what is going wrong.

When I use the code as you told me...

           $fd=readdir("/home/casapu/paginas /image/caterleras/");
           if (!$fd) die ("Can't read dir");

It gives me:
Warning: Supplied argument is not a valid Directory resource in
/home/casapu/paginas/mbt/php/dir.php on line 7
Can't read dir

So I'm assuming is not accepting the directory. I have checked the
permits, and it has all enabled, read, write and executable.
I have tried with the final slash, and without it, and so far it keeps
giving me that message... any ideas?



-----Mensaje original-----
De: Scott Hurring [mailto:[EMAIL PROTECTED]]
Enviado el: Jueves, 06 de Junio de 2002 15:26
Para: '[EMAIL PROTECTED]'
Asunto: RE: [PHP] Trying to list a directory content HELP PLEASE

Instead of chdir() try putting the path directly into
readdir();  it'll make the code a tiny bit cleaner.

readdir("/home/casapu/paginas/images/carteleras");

** and check return values! **

$fd = readdir(...)
if (!$fd) die("Cannot readdir");

The code you have *should* work, but you'll never
know why it's not working if you don't check return
statuses

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -----Original Message-----
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 3:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Trying to list a directory content HELP PLEASE
>
>
> On Friday 07 June 2002 00:47, webmaster mbtradingco wrote:
> > I know my doubt is probable odd, but I would ask your help please.
> >
> > I need a user to be able to select an image from a directory, from a
> > drop down box. For this I need to list all the images
> available on the
> > directory, hence, I have this code:
> >
> >    <select size="1" name="normal1">
> >     <?php
> >           chdir("/home/casapu/paginas/images/carteleras");
> >           $direc = opendir(".");
> >           while ($f = readdir($direc)); {
> >           print("<option value=\"".$f."\">".$f."</option>");
> >                }
> >     ?>
> >    .</select>");
> >
> > but this is not working. I have reviewed the code against all the
> > manuals/books I have, and it says it should work but it
> doesn't. Anyone
> > knows what I'm doing wrong?
>
> how doesn't it work?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications
> Development *
>
> /*
> Fashions have done more harm than revolutions.
>               -- Victor Hugo
> */
>
>
> --
> 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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.363 / Virus Database: 201 - Release Date: 05/21/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.363 / Virus Database: 201 - Release Date: 05/21/2002

--- End Message ---
--- Begin Message ---
Hi,

Does someone have a PHP yEnc decode routine?

Greetings, Herbert
--- End Message ---
--- Begin Message ---
Michael,

If you used to run it some time ago and it worked then but does not now 
then something has changed (obvious I know). Within the "something that 
has changed" is the answer, we just need to find it.

Is it the same version of Oracle and same means of getting to Oracle 
from php (I mean the non-oci8 library)? Is it that connecting to Oracle 
has simply stopped working or have you done a new installation.

I feel more information would help.

Regards

Chris

Michael P. Carel wrote:

>Thanks Chris , but i used to run this script within the same
>server(localhost) where oracle/php/apache reside. That's why im wondering
>why this error appears. I've tried to setup oracle/php/apache with AIX and
>it work fine. I've also red alot of documentation in setting up with RedHat
>but still it doesnt work.
>Is there something i need to consider when installing this in RedHat?
>
>
>Regards,
>
>Mike
>
>----- Original Message -----
>From: "Chris Hewitt" <[EMAIL PROTECTED]>
>Cc: "php" <[EMAIL PROTECTED]>
>Sent: Thursday, June 06, 2002 5:41 PM
>Subject: Re: [PHP] oracle again!!!!
>
>
>>Michael,
>>
>>I have not used Oracle from PHP but I may be able to provide some
>>pointers/questions.
>>
>>You do not say where the Oracle database is. If it is on the AIX
>>computer then to connect you will need the "system@tnsname" form of user
>>name to specify which connection in your tnsnames.ora file to use. (I
>>assume you have modified the linux firewall to allow the ports used in
>>the tnsnames.ora file to be open).
>>
>>I assume that you have the Oracle client code loaded onto the linux
>>computer.
>>
>>If the database is local on the linux computer then maybe the firewall
>>issue still applies. What Iwould look at first is the first error
>>message. ORA-12546 is TNS:permission denied. This looks like the user
>>that apache is run as cannot open the tnsnames.ora file. From the Oracle
>>home you give, I think it should be trying to open
>>/home/oracle/OraHome1/network/admin/tnsnames.ora
>>but cannot do so. Is the file located here?
>>
>>Hope this helps.
>>
>>Chris
>>
>>Michael P. Carel wrote:
>>
>>>Hi,
>>>
>>>I've tried installing php with oracle support to my RedHat Linux server.
>>>
>Im
>
>>>recieving this error when executing a sample Ora fucntion to connect to
>>>
>the
>
>>>oracle database.My oracle database works fine but my script canot
>>>
>connect.
>
>>>I've tried this sample script with my AIX server but it works fine.  I
>>>really dont know why ...
>>>Please help. heres my sample connect script:
>>>
>>>PutEnv("ORACLE_SID=oracle");
>>>PutEnv("ORACLE_HOME=/home/oracle/OraHome1");
>>>
>>>$connection = Ora_Logon("system","manager");
>>>
>>>
>>>if($connection==false){
>>>       echo Ora_ErrorCode($connection).":".
>>>
>Ora_error($connection)."<BR>";
>
>>>exit;
>>>}
>>>
>>>
>>>
>>>And heres my warning error:
>>>
>>>Warning: Oracle: Connection Failed: Error while trying to retrieve text
>>>
>for
>
>>>error ORA-12546 in /home/www/htdocs/selecting.php on line 9
>>>
>>>Warning: ora_errorcode(): supplied argument is not a valid
>>>Oracle-Connection/Cursor resource in /home/www/htdocs/selecting.php on
>>>
>line
>
>>>13
>>>
>>>Warning: ora_error(): supplied argument is not a valid
>>>Oracle-Connection/Cursor resource in /home/www/htdocs/selecting.php on
>>>
>line
>
>>>13
>>>:
>>>
>>>
>>>
>>>I can connect to oracle remotely with my sqlplus using this account. Is
>>>thereanything that i didnt know when settingup php with oracle in redhat
>>>linux?
>>>
>>>
>>>
>>>Thanks in advance.
>>>
>>>
>>>
>>>Regards,
>>>Mike
>>>
>>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>


--- End Message ---
--- Begin Message ---
Hey all,
 
I am having some troubles setting cookies at the moment wondering if
anyone knows the solution.
 
Anyhow basically what is happening, is that cookies are been set fine,
however say I try to set two cookies in the one script
 
i.e.
setcookie("username", $HTTP_POST_VARS['username'], time()+31536000);
setcookie("password", $HTTP_POST_VARS['password'], time()+31536000);
 
only the cookie that was called last, i.e. 'password' will be set. I
only started noticing this problem since I installed php4.2 and
apache2.0, is that the cause? Has anyone shared a similar experience,
and if so is there a fix? Thanks for your time as always.
 
            Regards,
 
 
                   Scott
--- End Message ---
--- Begin Message ---
Just came to think of it now, is it possible to link to php scripts, on..
lets say my server, from an online account I have, that does not support
php.
I was mostly thinking of counters included on pages now, but other things
to, like $date() and similiar.

wxw.hostedscripts.com uses cgi for the links, is it easy to do?  :)

Håkan


--- End Message ---
--- Begin Message ---
Sorry if this shows twice.  I originally posted it with Mozilla and forgot
that this newsgroup server seems to ignore postings from it.  This one is
posted from IE.

I've got a mail function script that occasionally terminates midway while
sending out about 600 emails.

The symptoms point to the "max_execution_time" [set for 30].

Two questions:

Are their typically any other settings that I need to check.
[e.g.,
session.cache_limiter
session.cache_expire]

What's the best approach to resolving the problem?
Should I get the web host techs to change the php.ini settings?
Or, should I modify my script with "set_time_limit()" ?


Thanks......




--- End Message ---

Reply via email to