|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Fri Jan 24 2003 - 14:26:48 CST
php-general Digest 24 Jan 2003 20:26:48 -0000 Issue 1842
Topics (messages 132954 through 133032):
Re: Something difference betwen php-4.0.3 and php-4.2.3
132954 by: andre.lagadec.education.gouv.fr
132956 by: Chris Hewitt
132966 by: Ford, Mike [LSS]
132979 by: Chris Hewitt
Re: $_GET space in index changed to underscore
132955 by: Per
132958 by: Marek Kilimajer
Re: how to verify the available email address
132957 by: Chris Hewitt
Re: why is mv copying ??
132959 by: Marek Kilimajer
133012 by: Jim Lucas
value not displayed
132960 by: Rahul
132961 by: Ernest E Vogelsinger
132963 by: Don Mc Nair
File Permissions
132962 by: Don Mc Nair
132967 by: Jason Wong
132968 by: Maxim Maletsky
Problem with simple update
132964 by: Steve Jackson
132976 by: Marek Kilimajer
132980 by: Marek Kilimajer
reading mail in php
132965 by: Bartosz Matosiuk
Files PHP in tmp ?
132969 by: nico
132971 by: Marek Kilimajer
132972 by: nico
132973 by: nico
132975 by: Marek Kilimajer
132977 by: nico
132985 by: Michael Sims
133007 by: nico
Re: URLencode issues - halp! - code included
132970 by: Marek Kilimajer
How do you update multiple rows at the same time?
132974 by: Steve Jackson
How do I know alive session at this moment?
132978 by: Henry
"writing" a backspace or del char in a file
132981 by: ng
Has This Been Done?
132982 by: Stephen
132998 by: Maxim Maletsky
133001 by: 1LT John W. Holmes
WorldPay examples...
132983 by: Brian McGarvie
Re: Who is foo & what is bar?
132984 by: bob parker
Re: Word Count
132986 by: Craig
Starting sessions, registering variables, destroying sessions with global_variables off....
132987 by: Phil Schwarzmann
132990 by: Rich Gray
Re: php performance
132988 by: Brent Baisley
Re: Strange anomolie with each() and mysql_fetch_array()
132989 by: Daevid Vincent
132991 by: Rick Emery
IP address
132992 by: K.C.P. van Zijl
132999 by: Chris Shiflett
DPHPEdit New version
132993 by: Davor Pleskina
Chmod funk
132994 by: Liam.Gibbs.dfait-maeci.gc.ca
ob_start strangness
132995 by: Serge Paquin
132997 by: Serge Paquin
Php support for Java
132996 by: John Wells
help with perl equivalent ?
133000 by: R'twick Niceorgaw
133002 by: Sean Burlington
133006 by: R'twick Niceorgaw
Re: ? in URLS.
133003 by: Chris Shiflett
133005 by: 1LT John W. Holmes
Need Coding Help With getdate()
133004 by: Guru Geek
133008 by: Philip Hallstrom
ob woes...
133009 by: Serge Paquin
Re: URLencode issues - halp!
133010 by: Ernest E Vogelsinger
File upload problems beginning in 4.3.0
133011 by: Felicia Neff
file upload question
133013 by: Andrew Rench
133014 by: Adam Voigt
133016 by: Ford, Mike [LSS]
133020 by: Andrew Rench
133029 by: Mark Heintz PHP Mailing Lists
Re: help me
133015 by: Jim Lucas
Evaluate PHP var in stored sql statement?
133017 by: CF High
133018 by: Maxim Maletsky
133024 by: CF High
133025 by: Maxim Maletsky
133027 by: Matt
SSH change password!
133019 by: Mantas Kriauciunas
133021 by: Tom Woody
133023 by: Mantas Kriauciunas
133026 by: Serge Paquin
domxml_new_doc() utf8 encoding
133022 by: Øyvind Vestavik
Upload is corrupting files
133028 by: Petr Gotthard
ob_gzhandler bug???
133030 by: Serge Paquin
133031 by: 1LT John W. Holmes
checkboxes & php
133032 by: Greg
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I modifiy my php.ini to redirect error message in log of server web and I change
error_reporting = E_ALL & ~E_NOTICE by error_reporting = E_ALL
Now, I get in server log this message :
[24-Jan-2003 08:59:31] PHP Notice: Undefined offset: 4 in /appli/PHP/test/__xyz__.php on
line 15
and I get all code HTML : the program doesn't fail !
So, PHP detect an error, but it work. It's strange !
What do you think about that ?
AL
Marek Kilimajer a écrit :
> As you noted, there really should be
> while ( $j < $i )
> because $i is incremented after last element to $selectTab is added. But
> it still should not die quietly. Do you have display_errors off?
>
> andre.lagadec
education.gouv.fr wrote:
>
> >Hi
> >
> >There is no error or notice message on the screen and in the log of the web server.
> >The PHP program stop and don't generate all the HTML code of the page.
> >
> >Marek Kilimajer a écrit :
> >
> >
> >
> >>I have never heard of "out of range" error, but is it really an error
> >>or just a notice? If it is a notice, adjust error reporting to not
> >>display notices
> >>
> >>andre.lagadec
education.gouv.fr wrote:
> >>
> >>
> >>
> >>>Hello,
> >>>
> >>>I try to move an Web application in Php-4.0.3 to php-4.2.3, and some
> >>>programs
> >>>don't work well on some pages. I make search in the code, and after
> >>>tests, I find that
> >>>the following code doesn't work in php-4.2.3, but works in php-4.0.3pl1
> >>>------------------------------------------------------------------------------------
> >>>
> >>><html>
> >>><body>
> >>><form>
> >>><?
> >>>$i = 0;
> >>>while ($i<=3) {
> >>> $selected = "";
> >>> $selectTab[$i] = "<option value='".$i."' ".$selected."> bla bla
> >>></option>\n";
> >>> $i++;
> >>> }
> >>>printf("<select name='filiere' multiple size='%d' class='textNoir'>\n",
> >>>($i-1) );
> >>>$j = 0;
> >>>while ( $j <= $i ) {
> >>> printf($selectTab[$j]);
> >>> $j++;
> >>> }
> >>>printf("</select>");
> >>>?>
> >>></body>
> >>></html>
> >>>------------------------------------------------------------------------------------
> >>>
> >>>It's because there is an error in the code : this instruction is wrong
> >>>while ( $j <= $i ),
> >>>there is an "out of range" in the array selectTab[] when $j=$i=4
> >>>the good instruction is while ( $j < $i )
> >>>
> >>>Is there something changed in the gestion of the error "out of range" in
> >>>an array
> >>>betwen php-4.0.3pl1 and php-4.2.4 ?
> >>>
> >>>Thanks for your help ?
> >>>
> >>>AL
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
attached mail follows:
andre.lagadec
education.gouv.fr wrote:
>I modifiy my php.ini to redirect error message in log of server web and I change
>error_reporting = E_ALL & ~E_NOTICE by error_reporting = E_ALL
>
>Now, I get in server log this message :
>[24-Jan-2003 08:59:31] PHP Notice: Undefined offset: 4 in /appli/PHP/test/__xyz__.php on
>line 15
>and I get all code HTML : the program doesn't fail !
>
That is working correctly, it is what should happen. You changed your
error reporting to include "notices". These are not errors but warnings
to tell you that you _may_ have something not right.
In this case, an undefined offset means that the variable you used in
the offset has not been previously set a value, so:
$myarray[$myoffset];
will produce this error if $myoffset has not already been set a value.
If you do:
$myoffset = 4;
$myarray[$myoffset];
then you should not get the warning.
HTH
Chris
attached mail follows:
> -----Original Message-----
> From: Chris Hewitt [mailto:g0pae
manordat.demon.co.uk]
> Sent: 24 January 2003 09:13
>
> andre.lagadec
education.gouv.fr wrote:
>
> >I modifiy my php.ini to redirect error message in log of
> server web and I change
> >error_reporting = E_ALL & ~E_NOTICE by error_reporting = E_ALL
> >
> >Now, I get in server log this message :
> >[24-Jan-2003 08:59:31] PHP Notice: Undefined offset: 4 in
> /appli/PHP/test/__xyz__.php on
> >line 15
> >and I get all code HTML : the program doesn't fail !
> >
> That is working correctly, it is what should happen. You changed your
> error reporting to include "notices". These are not errors
> but warnings
> to tell you that you _may_ have something not right.
Correct.
>
> In this case, an undefined offset means that the variable you used in
> the offset has not been previously set a value, so:
> $myarray[$myoffset];
> will produce this error if $myoffset has not already been set
> a value.
> If you do:
> $myoffset = 4;
> $myarray[$myoffset];
> then you should not get the warning.
Wrong. The offset is 4, the error message says so. Undefined offset means you are trying to access a character from a string that doesn't exist -- in this case, the 5th character of a string that is shorter than 5 characters. (If $myoffset was undefined, you'd get an undefined variable warning.)
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Ford, Mike [LSS] wrote:
>
>Wrong. The offset is 4, the error message says so. Undefined offset means you
>
Yes, true. That is me not looking hard enough at it!
Chris
attached mail follows:
1lt John W. Holmes wrote:
>>Anyone who knows why get variables whit spaces in looking like this in
>>the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in
>>$_GET['aa_bb'] instead of $_GET['aa bb']?
>
>
> That's just what PHP does. It'll also convert any periods in a form element
> name to an underscore.
>
> Otherwise, if you have register globals on, it would try to create a
> variable of "$aa bb" which doesn't make sense, or "$aa.bb" which doesn't
> make sense, either, because the dot is a concatinator.
>
> ---John Holmes...
>
Makes some kind of sence I guess... but I think it would be better if
those using register_globals=on had to suffer instead of me;)
Is there a way to know if the underscore is an original one or just a
replacement for an underscore?
/P
attached mail follows:
You can use $_SERVER['QUERY_STRING']
Per wrote:
> 1lt John W. Holmes wrote:
>
>>> Anyone who knows why get variables whit spaces in looking like this in
>>> the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in
>>> $_GET['aa_bb'] instead of $_GET['aa bb']?
>>
>>
>>
>> That's just what PHP does. It'll also convert any periods in a form
>> element
>> name to an underscore.
>>
>> Otherwise, if you have register globals on, it would try to create a
>> variable of "$aa bb" which doesn't make sense, or "$aa.bb" which doesn't
>> make sense, either, because the dot is a concatinator.
>>
>> ---John Holmes...
>>
>
> Makes some kind of sence I guess... but I think it would be better if
> those using register_globals=on had to suffer instead of me;)
>
> Is there a way to know if the underscore is an original one or just a
> replacement for an underscore?
>
> /P
>
>
attached mail follows:
ocean wrote:
>In a signup page , I want to verify some information what the user fill in ,inculde user name¡¢password¡¢email etc.But I don't know how to verify the available email address.Who can help me ?
>
There is an email validation class here:
http://phpclasses.lightwood.net/browse.html/package/13.html
There is a choice of more than one class too!
Hope this helps
Chris
>
attached mail follows:
And does apache have write permissions to the directory where the
original file is located?
Christian wrote:
> Hi all,
>
> Any idea why when I execute 'mv' in a php script
> the file is copied not moved?
>
> Apache is a member of the group which owns the file
> and has wrx permissions.
>
> Thanx,
> Christian
>
>
attached mail follows:
I am guessing that apache isn't the owner of the file. therefor it can't
delete it from it original position.
mv in unix basically copies the file pointer from one place and to another
place.
then deletes the original pointer. if you don't have permission to delete
the file from its original point, then you can't do an mv command
successfully.
Check your permissions on the original file, find out if apache is the
owner. that will tell you if you can delete the file.
Jim
----- Original Message -----
From: "Christian" <sub2
webplugins.net>
To: <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 5:01 PM
Subject: [PHP] why is mv copying ??
> Hi all,
>
> Any idea why when I execute 'mv' in a php script
> the file is copied not moved?
>
> Apache is a member of the group which owns the file
> and has wrx permissions.
>
> Thanx,
> Christian
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hello All,
When i pass a value through browser to a php page as below
http://www.xyz.com/test.php?abc=test
But when i try to display the variable abc as below
<?php echo $abc; ?>
It is not showing anything in php-4.3.0. but the value is displayed in
php-4.2.2 version.
Regards,
-sadha
attached mail follows:
At 10:55 24.01.2003, Rahul said:
--------------------[snip]--------------------
>When i pass a value through browser to a php page as below
>
>http://www.xyz.com/test.php?abc=test
>
>But when i try to display the variable abc as below
>
><?php echo $abc; ?>
>
>It is not showing anything in php-4.3.0. but the value is displayed in
>php-4.2.2 version.
--------------------[snip]--------------------
Perhaps the 4.2.2 server is configured with register_globals on, and the
4.3.0 has set this to off?
Try
<?php echo $_REQUEST['abc']; ?>
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Use <?php echo $_GET['abc']; ?>
"Rahul" <shadhanker
gmx.net> wrote in message
news:00b301c2c38e$c9d83f80$3b0110ac
kovaiteam.com...
> Hello All,
>
> When i pass a value through browser to a php page as below
>
> http://www.xyz.com/test.php?abc=test
>
> But when i try to display the variable abc as below
>
> <?php echo $abc; ?>
>
> It is not showing anything in php-4.3.0. but the value is displayed in
> php-4.2.2 version.
>
> Regards,
> -sadha
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
attached mail follows:
Sorry if this is not really PHP related but I can't get it to work.
I am using fopen and I get the following:
Warning: fopen("testfile2.php", "w") - Permission denied in /usr/local/psa/home/vhosts/complementarymedicines.net/httpdocs/reg/regformte st.php on line 411
I have tried setting this particular folder, it's parent folder and the folder where the file will be created to 777 but I still get the error. I know it is probably simple but it is driving me nuts.
Any help is appreciated.
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
attached mail follows:
On Friday 24 January 2003 18:00, Don Mc Nair wrote: > Sorry if this is not really PHP related but I can't get it to work. > > I am using fopen and I get the following: > > Warning: fopen("testfile2.php", "w") - Permission denied in > /usr/local/psa/home/vhosts/complementarymedicines.net/httpdocs/reg/regformt >e st.php on line 411
Try specifying the full path to the file.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* When the English language gets in my way, I walk over it. -- Billy Sunday */
attached mail follows:
try this:
echo "you " . ( is_writable("testfile2.php")? 'can ' : 'cannot' ) . " write";
the function is_writable() will tell you in advance whether the file is writable or not.
-- Maxim Maletsky maximphp.net
"Don Mc Nair" <don
mcn.ie> wrote... :
> Sorry if this is not really PHP related but I can't get it to work. > > I am using fopen and I get the following: > > Warning: fopen("testfile2.php", "w") - Permission denied in > /usr/local/psa/home/vhosts/complementarymedicines.net/httpdocs/reg/regformte > st.php on line 411 > > I have tried setting this particular folder, it's parent folder and the > folder where the file will be created to 777 but I still get the error. I > know it is probably simple but it is driving me nuts. > > Any help is appreciated. > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I am trying to set the order of a set of categories. Previously the catid field sorted the order of the categories. However I changed this to Order By catorder and then set about writing a simple update query to allow people to set the order.
I can't see anything wrong with this: Basically I pull the details from the categories DB into an array and then display in a table. This works fine <? while ($array = mysql_fetch_array($mysql)) { echo "<tr><td width='150'><span class='adminisoleipa'>"; echo "<input type='hidden' name='categoryid' value='{$array["catid"]}'>"; echo "{$array["catname"]}"; echo "</td><td><input type='text' size='2' name='catorder' value='{$array["catorder"]}'>"; echo "</span></td></tr>"; } ?> Then using this to update it seems to work till you check the update. It sets the first two fields to one for some reason. $query = "update categories set catorder = '$catorder' where catid='$categoryid'";
Any suggestions?
Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
stephen.jackson
violasystems.com
Mobile +358 50 343 5159
attached mail follows:
remove the hidden field and use
<input type='text' size='2' name='catorder[{$array["catid"]}]' value='{$array["catorder"]}'>
in action script you do
foreach($_POST['catorder'] as $catid => $catorder) { update categories set catorder=$catorder where catid=$catid }
Steve Jackson wrote:
>I am trying to set the order of a set of categories. Previously the
>catid field sorted the order of the categories. However I changed this
>to Order By catorder and then set about writing a simple update query to
>allow people to set the order.
>
>I can't see anything wrong with this:
>Basically I pull the details from the categories DB into an array and
>then display in a table. This works fine
><?
>while ($array = mysql_fetch_array($mysql))
>{
>echo "<tr><td width='150'><span class='adminisoleipa'>";
>echo "<input type='hidden' name='categoryid'
>value='{$array["catid"]}'>";
>echo "{$array["catname"]}";
>echo "</td><td><input type='text' size='2' name='catorder'
>value='{$array["catorder"]}'>";
>echo "</span></td></tr>";
>}
>?>
>Then using this to update it seems to work till you check the update. It
>sets the first two fields to one for some reason.
>$query = "update categories
> set catorder = '$catorder'
> where catid='$categoryid'";
>
>Any suggestions?
>
>Steve Jackson
>Web Developer
>Viola Systems Ltd.
>http://www.violasystems.com
>stephen.jackson
violasystems.com
>Mobile +358 50 343 5159
>
>
>
>
attached mail follows:
You must run
$result = mysql_query($query) or die("Query failure: " .mysql_error());
within the foreach loop, else $query will be only the last query assigned.
If you use get method in your form you need to use $_GET (or $_REQUEST) instead of $_POST
Steve Jackson wrote:
>I can't get this to work.
>I am trying to update multiple rows at the same time?
>This is the code I have now adjusted to your specifications:
><?
>while ($array = mysql_fetch_array($mysql))
>{
>echo "<tr><td width='150'><span class='adminisoleipa'>";
>//echo "<input type='hidden' name='categoryid{$array["catid"]}'>";
>echo "{$array["catname"]}";
>echo "</td><td><input type='text' size='2'
>name='catorder[{$array["catid"]}]' value='{$array["catorder"]}'>
>";
>//echo "</td><td><input type='text' size='2' name='catorder'
>value='{$array["catorder"]}'>";
>echo "</span></td></tr>";
>}
>?>
>
>And the action:
>foreach($_POST["catorder"] as $catid => $catorder)
> {
> $query = "update categories set catorder=$catorder where
>catid=$catid";
> }
>$result = mysql_query($query) or die("Query failure: " .mysql_error());
>
>The error:
>Warning: Invalid argument supplied for foreach() in
>eshop_processcatorder.php on line 27
>Query failure: Query was empty
>
>Steve Jackson
>Web Developer
>Viola Systems Ltd.
>http://www.violasystems.com
>stephen.jackson
violasystems.com
>Mobile +358 50 343 5159
>
>
>
>
>
>
>
>>-----Original Message-----
>>From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
>>Sent: 24. tammikuuta 2003 13:55
>>To: Steve Jackson
>>Cc: PHP General
>>Subject: Re: [PHP] Problem with simple update
>>
>>
>>remove the hidden field and use
>>
>><input type='text' size='2'
>>name='catorder[{$array["catid"]}]' value='{$array["catorder"]}'>
>>
>>in action script you do
>>
>>foreach($_POST['catorder'] as $catid => $catorder) {
>> update categories set catorder=$catorder where catid=$catid }
>>
>>Steve Jackson wrote:
>>
>>
>>
>>>I am trying to set the order of a set of categories. Previously the
>>>catid field sorted the order of the categories. However I
>>>
>>>
>>changed this
>>
>>
>>>to Order By catorder and then set about writing a simple
>>>
>>>
>>update query
>>
>>
>>>to allow people to set the order.
>>>
>>>I can't see anything wrong with this:
>>>Basically I pull the details from the categories DB into an
>>>
>>>
>>array and
>>
>>
>>>then display in a table. This works fine <?
>>>while ($array = mysql_fetch_array($mysql))
>>>{
>>>echo "<tr><td width='150'><span class='adminisoleipa'>";
>>>echo "<input type='hidden' name='categoryid'
>>>value='{$array["catid"]}'>";
>>>echo "{$array["catname"]}";
>>>echo "</td><td><input type='text' size='2' name='catorder'
>>>value='{$array["catorder"]}'>";
>>>echo "</span></td></tr>";
>>>}
>>>?>
>>>Then using this to update it seems to work till you check
>>>
>>>
>>the update. It
>>
>>
>>>sets the first two fields to one for some reason.
>>>$query = "update categories
>>> set catorder = '$catorder'
>>> where catid='$categoryid'";
>>>
>>>Any suggestions?
>>>
>>>Steve Jackson
>>>Web Developer
>>>Viola Systems Ltd.
>>>http://www.violasystems.com
>>>stephen.jackson
violasystems.com
>>>Mobile +358 50 343 5159
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
attached mail follows:
hi
I'm writting an php application, a mail client, and I got a small problem.
Reading mail is quite simple if it's a normall text, but I'm not sure how to read MIME mail. I thougt i could use eregi() and read separately every part, but I'm not sure if it's the best way to do this. Maybe someone know the better one.
thanks for any help bartosz matosiuk
attached mail follows:
Hello,
I've a lot of files named phpxxxx in my tmp folders ..
What's these files ?
Nico
attached mail follows:
Those are temporery uploaded files, they should be there only while some script handling the upload is running, otherwise you have some problems.
nico wrote:
> Hello, > > I've a lot of files named phpxxxx in my tmp folders .. > > What's these files ? > > Nico > > > > >
attached mail follows:
No, I have some 300 phpxxxx and in these files , there is some html of my sites.
Nico
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
news:3E3127F0.40107
webglobe.sk...
> Those are temporery uploaded files, they should be there only while some
> script handling the upload is running, otherwise you have some problems.
>
> nico wrote:
>
> > Hello,
> >
> > I've a lot of files named phpxxxx in my tmp folders ..
> >
> > What's these files ?
> >
> > Nico
> >
> >
> >
> >
> >
>
attached mail follows:
For information : i have php 4.3 (perhaps a new caching system) ?
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
news:3E3127F0.40107
webglobe.sk...
> Those are temporery uploaded files, they should be there only while some
> script handling the upload is running, otherwise you have some problems.
>
> nico wrote:
>
> > Hello,
> >
> > I've a lot of files named phpxxxx in my tmp folders ..
> >
> > What's these files ?
> >
> > Nico
> >
> >
> >
> >
> >
>
attached mail follows:
Well, you should know what have installed, but there is no caching system by default.
nico wrote:
> For information : i have php 4.3 (perhaps a new caching system) ?
>
>
>"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
>news:3E3127F0.40107
webglobe.sk...
>
>
>>Those are temporery uploaded files, they should be there only while some
>>script handling the upload is running, otherwise you have some problems.
>>
>>nico wrote:
>>
>>
>>
>>>Hello,
>>>
>>>I've a lot of files named phpxxxx in my tmp folders ..
>>>
>>>What's these files ?
>>>
>>>Nico
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>
>
attached mail follows:
'./configure' '--with-mysql' '--with-apache=../apache_1.3.27' '--enable-track-vars' '--with-imap=/var/imap-2002b/' '--with-gettext' '--with-png-dir=/var/libpng-1.0.15' '--with-zlib-dir=/var/zlib-1.1.4'
My installation..
and my ls dir -rw------- 1 nobody nobody 3687 Jan 23 14:25 phpqlG5ny -rw------- 1 nobody nobody 621 Jan 22 21:06 phpqt95I4 -rw------- 1 nobody nobody 424 Jan 23 00:04 phprM5Vkx -rw------- 1 nobody nobody 1344 Jan 23 20:07 phprO0kTb -rw------- 1 nobody nobody 467 Jan 23 20:07 phprYggVM -rw------- 1 nobody nobody 621 Jan 23 23:52 phpriIcUP -rw------- 1 nobody nobody 621 Jan 23 21:08 phprjpEzF -rw------- 1 nobody nobody 3687 Jan 23 13:47 phproPwxN -rw------- 1 nobody nobody 621 Jan 23 16:56 phprwP7pg -rw------- 1 nobody nobody 3687 Jan 23 20:50 phps4QMnn -rw------- 1 nobody nobody 3687 Jan 23 12:54 phpsLvAsn -rw------- 1 nobody nobody 3687 Jan 23 09:43 phpsQY0fq -rw------- 1 nobody nobody 621 Jan 23 03:55 phpsWuQcW -rw------- 1 nobody nobody 3687 Jan 23 20:51 phpsXCDrA -rw------- 1 nobody nobody 621 Jan 23 13:02 phpsZFvoS -rw------- 1 nobody nobody 621 Jan 23 13:49 phpsaQV5G -rw------- 1 nobody nobody 3687 Jan 23 09:52 phpsblh9N -rw------- 1 nobody nobody 3687 Jan 22 23:34 phpspGQgX -rw------- 1 nobody nobody 621 Jan 23 21:07 phpsrzy5U -rw------- 1 nobody nobody 3687 Jan 22 19:13 phptN0sEj -rw------- 1 nobody nobody 467 Jan 23 00:09 phptTPVTf -rw------- 1 nobody nobody 621 Jan 23 20:07 phptgELvT
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
news:3E31294E.7030306
webglobe.sk...
> Well, you should know what have installed, but there is no caching
> system by default.
>
> nico wrote:
>
> > For information : i have php 4.3 (perhaps a new caching system) ?
> >
> >
> >"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
> >news:3E3127F0.40107
webglobe.sk...
> >
> >
> >>Those are temporery uploaded files, they should be there only while some
> >>script handling the upload is running, otherwise you have some problems.
> >>
> >>nico wrote:
> >>
> >>
> >>
> >>>Hello,
> >>>
> >>>I've a lot of files named phpxxxx in my tmp folders ..
> >>>
> >>>What's these files ?
> >>>
> >>>Nico
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
> >
>
attached mail follows:
On Fri, 24 Jan 2003 13:05:16 +0100, you wrote:
>and my ls dir >-rw------- 1 nobody nobody 3687 Jan 23 14:25 phpqlG5ny >-rw------- 1 nobody nobody 621 Jan 22 21:06 phpqt95I4 >-rw------- 1 nobody nobody 424 Jan 23 00:04 phprM5Vkx [...]
Some PHP applications do their own caching (Horde/Imp, for example) if you configure them to do so. Perhaps one of your installed apps is creating these files.
attached mail follows:
No it's simple php file on websites with include on websites
Nico
"Michael Sims" <mhsims
midsouth.rr.com> wrote in message
news:juf23v832jc1uqmjg73s5qjb8dbvv4frpa
4ax.com...
On Fri, 24 Jan 2003 13:05:16 +0100, you wrote:
>and my ls dir >-rw------- 1 nobody nobody 3687 Jan 23 14:25 phpqlG5ny >-rw------- 1 nobody nobody 621 Jan 22 21:06 phpqt95I4 >-rw------- 1 nobody nobody 424 Jan 23 00:04 phprM5Vkx [...]
Some PHP applications do their own caching (Horde/Imp, for example) if you configure them to do so. Perhaps one of your installed apps is creating these files.
attached mail follows:
besides urlencode you should also use htmlspecialchars
SpyProductions Support Team wrote:
>Here is some code:
>
>>From a form, I get username as $name and it goes to the processing file for
>the form, where a sale happens and it sends the code to a different server
>like this:
>
>
>$data = urlencode($name);
>print "<META HTTP-EQUIV='refresh'
>CONTENT='0;URL=http://somedestination.php?name=$data'>";
>
>
>
>That server then processes the person and puts them into the MySQL - but if
>the name is bad, it errors out and stops the script:
>
>$name = urldecode($name);
>if(!$name) { print "You entered an invalid name. Please stop and call us
>at...."; }
>else { Inserts record into database. }
>
>
>
>That's it. It doesn't seem to matter what the name entered is; there is no
>rhyme or reason (seemingly) to the names it fails on (as per my previous
>post).
>
>urlencode may just be a flaky thing to use? Perhaps depending on the
>browser?
>
>Thanks,
>
>-Mike
>
>
>
>
>
>
>
>
>
>>-----Original Message-----
>>From: David T-G [mailto:davidtg-php
justpickone.org]
>>Sent: Thursday, January 23, 2003 3:31 PM
>>To: PHP General list
>>Cc: SpyProductions Support Team
>>Subject: Re: [PHP] URLencode issues - halp!
>>
>>
>>Mike --
>>
>>...and then SpyProductions Support Team said...
>>%
>>% I am having some issues, apparently, with URL encode.
>>...
>>%
>>% I decided to use this because people are allowed to use *any*
>>key as part of
>>% their name, so a name like "rt'$%^*&'rt" is perfectly allowable.
>>
>>Makes sense, but I'd use base64_encode (with base64_decode, of course)
>>rather than urlencode; it will properly shield everything. No, I don't
>>know why 'normal' names fail and goofy ones don't; without some code and
>>some specific examples we can't really tell too well :-)
>>
>>
>>HTH & HAND
>>
>>:-D
>>--
>>David T-G * There is too much animal courage in
>>(play) davidtg
justpickone.org * society and not sufficient moral courage.
>>(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science
>>and Health"
>>http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
>>
>>
>>
>>
>
>
>
>
>
attached mail follows:
I am having trouble with this. I need to update 1column in a variable number of rows depending on how many categories are in my database at a given time. Can anyone provide any pointers or example code
Steve Jackson
Web Developer
Viola Systems Ltd.
<http://www.violasystems.com/> http://www.violasystems.com
stephen.jackson
violasystems.com
Mobile +358 50 343 5159
attached mail follows:
attached mail follows:
Hi
i want to erease 'one' or more caracters in a file, so, if this file is too big ( >10MB ) i don't want to read entirely it to substr(); the last line and entirely re-write it...
i like to write -at the end by exemple- the char backspace ( 0x08 ) ex : <?php $fp = fopen('some_file','a'); // or 'ab' fputs($fp, sprintf("%c",8)); fclose($fp); ?>
but this simply add the char "backspace" at the end and doesn't delete it ! the same problem appears with the character 127 ( delete ).
i don't really know if that i want is possible ( perhaps with direct i/o methods ? ) so, please show me the way :)
attached mail follows:
Just a question but has something like ever been done?
A PHP script that would create an installation form for any other PHP script developed by the user. It would create the install form and make the configuration file.
If it has, where can I find it?
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
Pear has an interesting installer. Try checking it out
-- Maxim Maletsky maximphp.net
"Stephen" <webmaster
melchior.us> wrote... :
> Just a question but has something like ever been done? > > A PHP script that would create an installation form for any other PHP script developed by the user. It would create the install form and make the configuration file. > > If it has, where can I find it? > > Thanks, > Stephen Craton > http://www.melchior.us > > "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
I wrote a simple little class last night that does something like this. It'll parse php.ini style configuration files and turn the "variable=value" lines into form elements and make the comments into regular HTML lines and throws it all into table rows. Then, when the form is submitted, you simply loop through $_POST and match the $key of $_POST in the text of the file and rewrite the new value submitted after it. Two methods and a couple preg_replace() functions is all it is. I don't know what the PEAR installer does, but this is a simple solution.
---John Holmes...
----- Original Message -----
From: "Stephen" <webmaster
melchior.us>
To: "PHP List" <php-general
lists.php.net>
Sent: Friday, January 24, 2003 7:50 AM
Subject: [PHP] Has This Been Done?
Just a question but has something like ever been done?
A PHP script that would create an installation form for any other PHP script developed by the user. It would create the install form and make the configuration file.
If it has, where can I find it?
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
----------------------------------------------------------------------------
----> -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I'm looking for an example of making payments via worldpay...
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03
attached mail follows:
On Fri, 24 Jan 2003 16:39, Rick Emery wrote: > It comes from the acronym, FUBAR. This is military slang that has been > around since WWII. FUBAR stands for: > "F**ked Up Beyond All Repair" > Ah! Now I understand why those are the only 2 class names used in tutorials and books on C++
Bob
attached mail follows:
Using these methods, could you use it to insert additional text before and after the first word (or the nth word)
e.g. $text = "This is my text, for placement"; $textWithAddedString = "(word1 start)This(word1 end) is my text, for placement";
"Maxim Maletsky" <maxim
php.net> wrote in message
news:20030123222535.5E19.MAXIM
php.net...
> words, for a programming language, are nothing more than just the spaces.
> So, as previousely was shown - could the mount of spaces in the string
> to get the amount of `words' in between them.
>
>
> --
> Maxim Maletsky
> maxim
php.net
>
>
>
> "Craig" <craig
sitedesign.net> wrote... :
>
> > Is there a way to count the number of words in a string?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
I just switched from a 4.06 server with global_variables ON to a 4.22 with global_variables OFF....
Can someone give me a quick run down of how to set/unset variables and register/destroy sessions with PHP 4.22 (global_variables OFF).
I've been all through the php.net manual and still can't figure it out.
I know that I have to use $_SESSION['foo'] instead of just $foo now, but for some reason I can't get session_start(); to properly start a session.
Any ideas??
Thanks!!
attached mail follows:
Phil It should be as easy as .. <? session_start(); $_SESSION['foo'] = 'bar'; ?> You'll need a session_start() on all pages that will be using the $_SESSION[] array. Is your session.save_path pointing to a writable directory? Do you see any errors in the server logs when you try to start a session?
Rich
-----Original Message-----
From: Phil Schwarzmann [mailto:phil
filanya.com]
Sent: 24 January 2003 13:36
To: php-general
lists.php.net
Subject: [PHP] Starting sessions, registering variables, destroying
sessions with global_variables off....
I just switched from a 4.06 server with global_variables ON to a 4.22 with global_variables OFF....
Can someone give me a quick run down of how to set/unset variables and register/destroy sessions with PHP 4.22 (global_variables OFF).
I've been all through the php.net manual and still can't figure it out.
I know that I have to use $_SESSION['foo'] instead of just $foo now, but for some reason I can't get session_start(); to properly start a session.
Any ideas??
Thanks!!
attached mail follows:
It doesn't sound like you've testing to see where the bottleneck is. I would first recommend inserting some microtime() commands into you PHP code, like around your queries and blocks of PHP code. This will tell you what is taking the longest time and will point you in the right direction. Next I would look in your MySQL logs to see if you have slow queries or find out what MySQL is spending it's time on.
On Thursday, January 23, 2003, at 04:42 PM, arch wrote:
> I'm running php4 on apache on linux. I'm having performance problems > with > php getting data from the mysql database.
-- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577
attached mail follows:
> First, if you expect only a single row returned, why are you > using a while(){} construct? > Third, each() operates on succeeding elements of an array; > there are only two elements aparrently, > so what are you expecting eac() to do?
Because that magic incantation that Rasmus taught me many years ago will take every field/column of the returned database row and make a variable named the same thing with the corresponding value. So, for example, I will get $customer_id = 5, $customer_name = "Joe Blow", etc... And when you have a pant load of fields in one row, it comes in very very handy.
> Second, mysql_fetch_array() does not like to operate within > another function call. I've tried it on > multiple occasions; failed.
That seems like a bug to me then. Hence the reason I bring it up.
Seems to me there is no reason the second statement shouldn't work just
as the first.
> ----- Original Message -----
> From: "Daevid Vincent" <daevid
daevid.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, January 23, 2003 11:38 PM
> Subject: [PHP] Strange anomolie with each() and mysql_fetch_array()
>
>
> How come I *can* do these commands:
>
> $row = mysql_fetch_array($result,MYSQL_ASSOC);
> while(list($myVariableName,$sqlFieldName)=each($row))
> { $$myVariableName = $sqlFieldName; }
>
> But I can't do this command?
>
>
> while(list($myVariableName,$sqlFieldName)=each(mysql_fetch_arr
> ay($result
> ,MYSQL_ASSOC)))
> { $$myVariableName = $sqlFieldName; }
>
> Notice the only differenceis that the first one assigns the array to
> $row FIRST, whereas the second tries to avoid that extra call,
> especially since I know I'm only getting one row back. Hmmm?
attached mail follows:
> Because that magic incantation that Rasmus taught me many years ago will > take every field/column of the returned database row and make a variable > named the same thing with the corresponding value
Use this (damned sight easier): extract($row)
----- Original Message -----
From: "Daevid Vincent" <daevid
daevid.com>
To: "'Rick Emery'" <remery
emeryloftus.com>; <php-general
lists.php.net>
Sent: Friday, January 24, 2003 7:46 AM
Subject: RE: [PHP] Strange anomolie with each() and mysql_fetch_array()
> First, if you expect only a single row returned, why are you > using a while(){} construct? > Third, each() operates on succeeding elements of an array; > there are only two elements aparrently, > so what are you expecting each() to do?
Because that magic incantation that Rasmus taught me many years ago will take every field/column of the returned database row and make a variable named the same thing with the corresponding value. So, for example, I will get $customer_id = 5, $customer_name = "Joe Blow", etc... And when you have a pant load of fields in one row, it comes in very very handy.
> Second, mysql_fetch_array() does not like to operate within > another function call. I've tried it on > multiple occasions; failed.
That seems like a bug to me then. Hence the reason I bring it up.
Seems to me there is no reason the second statement shouldn't work just
as the first.
> ----- Original Message -----
> From: "Daevid Vincent" <daevid
daevid.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, January 23, 2003 11:38 PM
> Subject: [PHP] Strange anomolie with each() and mysql_fetch_array()
>
>
> How come I *can* do these commands:
>
> $row = mysql_fetch_array($result,MYSQL_ASSOC);
> while(list($myVariableName,$sqlFieldName)=each($row))
> { $$myVariableName = $sqlFieldName; }
>
> But I can't do this command?
>
>
> while(list($myVariableName,$sqlFieldName)=each(mysql_fetch_arr
> ay($result
> ,MYSQL_ASSOC)))
> { $$myVariableName = $sqlFieldName; }
>
> Notice the only differenceis that the first one assigns the array to
> $row FIRST, whereas the second tries to avoid that extra call,
> especially since I know I'm only getting one row back. Hmmm?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi all,
Is it possible in PHP to determine the IP address of a server which is requesting a page from my own server? When I use $REMOTE_ADDR, I get the wrong IP address. In that case I get the IP address of a person who is requesting the page on that other server.
Hopefully my question is clear enough
Thanks,
Karel van Zijl
attached mail follows:
--- "K.C.P. van Zijl" <karel
sonosol.nl> wrote:
> Is it possible in PHP to determine the IP address
> of a server which is requesting a page from my own
> server? When I use $REMOTE_ADDR, I get the wrong IP
> address. In that case I get the IP address of a
> person who is requesting the page on that other
> server.
$_SERVER['REMOTE_ADDR'] is the IP address of the requesting client, whether it is an HTTP proxy, a person's PC, or another Web server playing the role of an Web client. My guess is that you are wrong about who is requesting what.
Chris
attached mail follows:
Hello, PHP developers,
A new version (1.03, 2003-01-24) of Davor's PHP Editor has just been released.
This version includes many recently requested features, including following:
1) Editor now supports following languages: English - Croatian - French - German (Many thanks to Louis Philippe Huberdeau and Jörg Thode for help with French and German translations! Please be tolerant about translation errors and report them via e-mail or in DPHPEdit forum! 2) Relative file path display in Project Manager (files with same names but from different locations can now be a part of the same project) 3) File PRINT capability 4) Editor recognizes ASP script tags 5) You can now choose to save files in Windows or UNIX/Linux format
This version can be downloaded from http://www.pleskina.com/dphped
For more recent changes and history, please check home page too.
Regards,
-- Davor Pleskina ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ davorpleskina.com http://www.pleskina.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ICQ#: 38632789
Programmers don't die; they just GOSUB without RETURN...
attached mail follows:
This line of code:
if(!is_readable("Constants.inc")) chmod("Constants.inc", 0644);
Produces this error:
Warning: chmod() [function.chmod]: Operation not permitted in /home/mastersite/public_html/index.php on line 6
What I'm trying to do is determine if Constants.inc is readable. If not, I want to change its permissions. At this point, I'm not worried about if it exists or not.
I'm not sure why I can't set it. The owner and group for the file are both 'mastersite', and my PHP is running as 'root' (I know, I know, not a good idea, but I'm in the testing phase right now, and if it's hacked at the moment, it's not a problem). Does anyone have a possible explanation? The file perms for Constants.inc are currently set at executable for all.
attached mail follows:
Hello,
I am trying to get ob_start to work the way I expect but I am running into some problems.
Take the following example code:
/* Start of code snippet */ function ob_spit_content_length ($buffer) { $len=strlen($buffer); if($len>0) Header( "Content-Length: $len" ); return $buffer; }
if( !function_exists("ob_end_clean_all") ) { function ob_end_clean_all () { while ( ob_get_level() ) { ob_end_clean(); } } }
ob_start("ob_spit_content_length"); ob_start("ob_gzhandler");
print "There is lots of stuff right here!";
ob_end_clean_all();
/* End of code snippet */
I am running PHP 4.3.0 and my desire is to compress all output (if browser supports) and also send the content-length header rather than sending chunked so that my output looks as close to static as possible.
My understanding is that ob_start can be nested and since I registered "ob_spit_content_length" first and then "ob_gzhandler" second that "ob_gzhandler" will run first and therefor $buffer being send to "ob_spit_content_length" with either be clear text "browser does not support compression" or the compress version of the page. Either way strlen will get me my length.
Well I get very strang effects and as soon as I comment out my 2 ob_start calls every think works fine. Often times op_spit_content_length will say 0 bytes even though I *KNOW* output was sent.
Am I missing something here? Did I layer things wrong? Any suggestions would be much appreciated.
Thanks, Serge.
attached mail follows:
Ok. It was a late night. A fresh morning helped me solve my own problem.
I was using ob_end_clean rather than ob_end_flush. I though I was going crazy!
Serge.
In article <20030124.095912.2025187190.1300
skycomp.ca>, "Serge Paquin"
<serge
skycomp.ca> wrote:
> Hello, > > I am trying to get ob_start to work the way I expect but I am running > into some problems.
attached mail follows:
In an app I'm developing I have a need to call java classes, and am hoping to use PHP's java integration.
However, the manual page (http://www.php.net/manual/en/ref.java.php) says "This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk."
My question is, how EXPERIMENTAL is it? Anyone using it in a production system? Have any problems yet? I may be willing to risk it, but wanted to hear "lessons learned" from others on the list.
Thanks, John
attached mail follows:
Hi all, I'm pretty much a stranger to perl and now got to convert a perl script to php. however, at once place I can not understand what the lines are doing and what could be the equivalent of them in php. Could some one help me with this ?
Here's my perl code :
$choice=~s/\.rm//; $choicedir=substr($choice, 0, 3); $choicedir=~s/^AKM/ogx/;
Regards -R'twick
attached mail follows:
R'twick Niceorgaw wrote: > Hi all, > I'm pretty much a stranger to perl and now got to convert a perl script to > php. however, at once place I can not understand what the lines are doing > and what could be the equivalent of them in php. Could some one help me with > this ? > > Here's my perl code : > > $choice=~s/\.rm//; $choice = str_replace('.rm', '', $choice); > $choicedir=substr($choice, 0, 3); $choicedir=substr($choice, 0, 3); > $choicedir=~s/^AKM/ogx/ $choice = preg_replace('/^AKM/', 'ogx', $choice);
--Sean
attached mail follows:
Thanks Sean
That worked :)
-R'twick
----- Original Message -----
From: "Sean Burlington" <sean
uncertainty.org.uk>
To: "R'twick Niceorgaw" <public
utkalika.net>
Cc: "php" <php-general
lists.php.net>
Sent: Friday, January 24, 2003 11:07 AM
Subject: Re: [PHP] help with perl equivalent ?
> R'twick Niceorgaw wrote: > > Hi all, > > I'm pretty much a stranger to perl and now got to convert a perl script to > > php. however, at once place I can not understand what the lines are doing > > and what could be the equivalent of them in php. Could some one help me with > > this ? > > > > Here's my perl code : > > > > $choice=~s/\.rm//; > $choice = str_replace('.rm', '', $choice); > > $choicedir=substr($choice, 0, 3); > $choicedir=substr($choice, 0, 3); > > $choicedir=~s/^AKM/ogx/ > $choice = preg_replace('/^AKM/', 'ogx', $choice); > > > > -- > > Sean >
attached mail follows:
--- Martin Towell <martin.towell
world.net> wrote:
> if it's just the string after the ? then use
> $QUERY_STRING can't remember which $_* variable
> it's under...
$_GET is the superglobal array for URL variables.
Chris
attached mail follows:
> > if it's just the string after the ? then use > > $QUERY_STRING can't remember which $_* variable > > it's under... > > $_GET is the superglobal array for URL variables.
And the Query_String is in $_SERVER, as $_SERVER['QUERY_STRING'].
---John Holmes...
attached mail follows:
Hello,
I'm trying to use getdate() and then create a numeric value based on putting the month (numeric), the date, and the year all together, side by side in one variable.
Here's my code: <?php $today = getdate(); $month = $today['mon']; $mday = $today['mday']; $year = $today['year'];
$date = $today['mon'.'mday'.'year']; ?>
But all I get is a blank when I look at $date in the browser. Any idea why that is?
Thanks in advance, Roger
attached mail follows:
Replace your last line with this...
$date = $month . $mday . $year
Or take a look at the date() command... something like:
$date = date("mdy", time());
would do the same thing (check the man page for sure).
On Fri, 24 Jan 2003, Guru Geek wrote:
> Hello, > > I'm trying to use getdate() and then create a numeric value based on > putting the month (numeric), the date, and the year all together, side > by side in one variable. > > Here's my code: > <?php > $today = getdate(); > $month = $today['mon']; > $mday = $today['mday']; > $year = $today['year']; > > $date = $today['mon'.'mday'.'year']; > ?> > > But all I get is a blank when I look at $date in the browser. Any idea > why that is? > > Thanks in advance, > Roger > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello All,
I am making headway but I still seem to be having some problems.
Whenever I have executing I get the following message:
<b>Warning</b>: ob_gzhandler() [<a href='http://www.php.net/ref.outcontrol'>ref.outcontrol</a>]: output handler 'ob_gzhandler' cannot be used twice in
This happens on ob_end_flush() The strange thing is that ob_start("ob_gzhandler") only exists ONCE! in the source file. I do have other ob_start("handler") calls but they never call ob_gzhandler().
I do use the following function to ensure that ALL handlers are called and flushed: function ob_end_flush_all () { while ( ob_get_level() ) { ob_end_flush(); } }
I'm getting this error on ob_end_flush()
Someone please help...
Serge.
attached mail follows:
At 22:30 23.01.2003, David T-G spoke out and said: --------------------[snip]-------------------- >...and then SpyProductions Support Team said... >% >% I am having some issues, apparently, with URL encode. >... >% >% I decided to use this because people are allowed to use *any* key as part of >% their name, so a name like "rt'$%^*&'rt" is perfectly allowable. > > >Makes sense, but I'd use base64_encode (with base64_decode, of course) >rather than urlencode; it will properly shield everything. No, I don't >know why 'normal' names fail and goofy ones don't; without some code and >some specific examples we can't really tell too well :-) --------------------[snip]--------------------
I believe you could even use md5() to "encode" the logon... would shield everything too :)
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
I am running the following code in php-4.3.0: <? $portrait = $_FILES["portrait"];
print "<hr>_FILES[portrait]: <pre>\n"; print_r($portrait); print "</pre>";
$portrait = $_GLOBALS["portrait"];
print "<hr>_FILES[portrait]: <pre>\n"; print_r($portrait); print $_FILES["portrait"]["error"]; print "</pre>";
?> <form method="post" action="t.cgi" ENCTYPE="multipart/form-data"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000"> <input type=file name=portrait> <input type="submit"> </form>
The file does not appear to be uploaded. However, with php-4.2.3, everything works fine. I have confirmed that both file_uploads and register_globals are on. This problem occurs in both the apache module and the standalone version. Any help would be appreciated. Thanks! -- Felicia
~~~~~~~~~~~~~~
fn
panix.com
Panix Staff
attached mail follows:
the following code:
<html> <body> <form enctype="multipart/form-data" action="<?= $PHP_SELF ?>" method ="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000"> Send this file: <input name="userfile" type="file"> <input type="submit" value="Send File"> </form> <?php echo $_FILES['userfile']['tmp_name']; ?> </body> </html>
produces the following after upload:
/var/tmp/phplSTEVp (or php[something-or-other])
When I view that directory, it is empty.
I put togther this simple test script because I was having problems with similar script that uses the move_uploaded_file() function. I realize that there are many pitfalls related to filesize and uploading- I'm testing using very small files (1-4k). I also made sure that file uploads was enabled in the php.ini file.
Any ideas?
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
This may just be me but I've never gotten upload to work where the form is posting to the same page, try moving it to two pages.
On Fri, 2003-01-24 at 12:05, Andrew Rench wrote:
the following code: <html> <body> <form enctype="multipart/form-data" action="<?= $PHP_SELF ?>" method ="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000"> Send this file: <input name="userfile" type="file"> <input type="submit" value="Send File"> </form> <?php echo $_FILES['userfile']['tmp_name']; ?> </body> </html> produces the following after upload: /var/tmp/phplSTEVp (or php[something-or-other]) When I view that directory, it is empty. I put togther this simple test script because I was having problems with similar script that uses the move_uploaded_file() function. I realize that there are many pitfalls related to filesize and uploading- I'm testing using very small files (1-4k). I also made sure that file uploads was enabled in the php.ini file. Any ideas? __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+MXSoF9k9BmZXCWYRAq8jAJ9dohL77q/USqBzsjkzDBzwNjnpKACgvYgT i+w4GrYRS+i+Wg5Ip9kvqUU=R1Yp -----END PGP SIGNATURE-----
attached mail follows:
> -----Original Message-----
> From: Andrew Rench [mailto:andrewrench
yahoo.com]
> Sent: 24 January 2003 17:05
>
> the following code:
>
> <html>
> <body>
> <form enctype="multipart/form-data" action="<?= $PHP_SELF ?>" method
> ="post">
> <input type="hidden" name="MAX_FILE_SIZE" value="1000">
> Send this file: <input name="userfile" type="file">
> <input type="submit" value="Send File">
> </form>
> <?php
> echo $_FILES['userfile']['tmp_name'];
> ?>
> </body>
> </html>
>
> produces the following after upload:
>
> /var/tmp/phplSTEVp (or php[something-or-other])
>
> When I view that directory, it is empty.
When you upload a file, the file PHP puts it in is a temporary file -- hence the ['tmp_name'] key -- which is your /var/tmp/php??????. Because it's a temporary file, PHP automatically deletes it when the script ends. If you haven't done something with it in the script (such as move_uploaded_file() it), it's gone forever.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
thanks for the advice- this makes sense as to why I'm not seeing the file. I added the move_uploaded_file() to the script to see what happens and I end up getting the following error: PHP Warning: Unable to move '/var/tmp/phpfcwVyC' to '/usr/local/etc/httpd/htdocs/blast/images' in /usr/local/etc/httpd/htdocs/blast/upload_test2.php on line 10
Am I setting the path wrong? Should it be relative to the 'upload_test2.php' file?
thanks
--- "Ford, Mike [LSS]" <M.Ford
lmu.ac.uk> wrote:
> > -----Original Message-----
> > From: Andrew Rench [mailto:andrewrench
yahoo.com]
> > Sent: 24 January 2003 17:05
> >
> > the following code:
> >
> > <html>
> > <body>
> > <form enctype="multipart/form-data" action="<?= $PHP_SELF ?>" method
> > ="post">
> > <input type="hidden" name="MAX_FILE_SIZE" value="1000">
> > Send this file: <input name="userfile" type="file">
> > <input type="submit" value="Send File">
> > </form>
> > <?php
> > echo $_FILES['userfile']['tmp_name'];
> > ?>
> > </body>
> > </html>
> >
> > produces the following after upload:
> >
> > /var/tmp/phplSTEVp (or php[something-or-other])
> >
> > When I view that directory, it is empty.
>
> When you upload a file, the file PHP puts it in is a temporary file -- hence the ['tmp_name']
> key -- which is your /var/tmp/php??????. Because it's a temporary file, PHP automatically
> deletes it when the script ends. If you haven't done something with it in the script (such as
> move_uploaded_file() it), it's gone forever.
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.ford
lmu.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
You have to include a filename along with the path when you're using move_uploaded_file(); if you're only specifying '/usr/local/etc/httpd/htdocs/blast/images' as your destination string, php is trying to create a file named 'images' in '/usr/local/etc/httpd/htdocs/blast'. If there's still a problem, the user that your webserver (and therefore php, in most cases) runs as may not have write permission to the directory you're trying to move to. Make sure the webserver can write to the destination directory.
mh.
On Fri, 24 Jan 2003, Andrew Rench wrote:
> thanks for the advice- this makes sense as to why I'm not seeing the file. I added the
> move_uploaded_file() to the script to see what happens and I end up getting the following error:
> PHP Warning: Unable to move '/var/tmp/phpfcwVyC' to '/usr/local/etc/httpd/htdocs/blast/images' in
> /usr/local/etc/httpd/htdocs/blast/upload_test2.php on line 10
>
> Am I setting the path wrong? Should it be relative to the 'upload_test2.php' file?
>
> thanks
>
> --- "Ford, Mike [LSS]" <M.Ford
lmu.ac.uk> wrote:
> > > -----Original Message-----
> > > From: Andrew Rench [mailto:andrewrench
yahoo.com]
> > > Sent: 24 January 2003 17:05
> > >
> > > the following code:
> > >
> > > <html>
> > > <body>
> > > <form enctype="multipart/form-data" action="<?= $PHP_SELF ?>" method
> > > ="post">
> > > <input type="hidden" name="MAX_FILE_SIZE" value="1000">
> > > Send this file: <input name="userfile" type="file">
> > > <input type="submit" value="Send File">
> > > </form>
> > > <?php
> > > echo $_FILES['userfile']['tmp_name'];
> > > ?>
> > > </body>
> > > </html>
> > >
> > > produces the following after upload:
> > >
> > > /var/tmp/phplSTEVp (or php[something-or-other])
> > >
> > > When I view that directory, it is empty.
> >
> > When you upload a file, the file PHP puts it in is a temporary file -- hence the ['tmp_name']
> > key -- which is your /var/tmp/php??????. Because it's a temporary file, PHP automatically
> > deletes it when the script ends. If you haven't done something with it in the script (such as
> > move_uploaded_file() it), it's gone forever.
> >
> > Cheers!
> >
> > Mike
> >
> > ---------------------------------------------------------------------
> > Mike Ford, Electronic Information Services Adviser,
> > Learning Support Services, Learning & Information Services,
> > JG125, James Graham Building, Leeds Metropolitan University,
> > Beckett Park, LEEDS, LS6 3QS, United Kingdom
> > Email: m.ford
lmu.ac.uk
> > Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
the only difference to structure is this line is in the first file and not the second.
fw_menu_2.addMenuItem("STANDARD PROMOTION","location='http://www.bis.org.in/sf/sfp2.htm'");
diff is a wonderful tool!!!
Enjoy
Jim
----- Original Message -----
From: "Amit Gupta" <amitgupta
emailacc.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 9:21 PM
Subject: [PHP] help me
Hi,
How are you?
My friends following are two javascript files for pop-up menus. menu2.js is working satisfactorily while menu.js is not working. I tried lot to trace the loophole but all in vain. kindly compare the two files and help me.
menu2.js function fwLoadMenus() {
if (window.fw_menu_0) return;
window.fw_menu_1_1 = new Menu("DIRECTORY",130,17,"Arial",10,"#003300","#ccffff","#cc9966","#003333");
fw_menu_1_1.addMenuItem("HEADQUATER","location='http://www.bis.org.in/dir/hq .htm'");
fw_menu_1_1.fontWeight="bold";
fw_menu_1_1.hideOnMouseOut=true;
window.fw_menu_1 = new Menu("root",213,17,"Helvetica",10,"#003300","#ccffff","#cc9966","#003333");
fw_menu_1.addMenuItem(fw_menu_1_1);
fw_menu_1.fontWeight="bold";
fw_menu_1.hideOnMouseOut=true;
window.fw_menu_2 = new Menu("root",208,0,"sans-serif",10,"#003300","#ccffff","#cc9966","#003333");
fw_menu_2.addMenuItem("STANDARD PROMOTION","location='http://www.bis.org.in/sf/sfp2.htm'");
fw_menu_2.fontWeight="bold";
fw_menu_2.hideOnMouseOut=true;
window.fw_menu_3 = new Menu("root",208,17,"Helvetica",10,"#003300","#ccffff","#cc9966","#003333");
fw_menu_3.addMenuItem("STANDARD PROMOTION","location='http://www.bis.org.in/sf/sfp2.htm'");
fw_menu_3.fontWeight="bold";
fw_menu_3.hideOnMouseOut=true;
fw_menu_3.writeMenus();}
menu.js function fwLoadMenus() {
if (window.fw_menu_0) return;
window.fw_menu_1 = new Menu("root",213,17,"Verdana, Arial, Helvetica, sans-serif",11,"#003300","#ccffff","#cc9966","#003333");
window.fw_menu_1_1 = new Menu("2222",213,17,"Verdana, Arial, Helvetica, sans-serif",11,"#003300","#ccffff","#cc9966","#003333");
fw_menu_1_1.addMenuItem("u","location='http://www.bi2s.org.in/other/iscd.htm '");
fw_menu_1_1.fontWeight="bold";
fw_menu_1_1.hideOnMouseOut=true;
fw_menu_1.addMenuItem(fw_menu_1_1);
fw_menu_1.fontWeight="bold";
fw_menu_1.hideOnMouseOut=true;
window.fw_menu_2 = new Menu("root",208,17,"Helvetica",10,"#003300","#ccffff","#cc9966","#003333");
fw_menu_2.fontWeight="bold";
fw_menu_2.hideOnMouseOut=true;
window.fw_menu_3 = new Menu("root",213,17,"Verdana, Arial, Helvetica, sans-serif",11,"#003300","#ccffff","#cc9966","#003333");
fw_menu_3.addMenuItem("cccc","location=' http://www.bi3s.org.in/other/iscd.htm'");
fw_menu_3.fontWeight="bold";
fw_menu_3.hideOnMouseOut=true;
fw_menu_3.writeMenus();
}
Keep smiling. It cost nothing but gives everything.
Yours
Amit Gupta
attached mail follows:
Hey all.
I need to find out how to get PHP to evaluate a PHP variable stored in our MySql database.
Currently the variable is being read as a string; i.e. select * from table where column = $myrow[0] -- instead of evaluating $myrow[0] as a variable.
The SQL statement is retrieved in the first call to dbConnect (see code below)
dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE section_id = $_REQUEST[section_id] order by header");
$set = $result; /* Give initial result set a unique name */
while ($myrow = mysql_fetch_row($set)) {
echo(Display the header title here);
dbConnect($myrow[2]); /* $myrow[2] is the sql_query gotten from the first dbConnect() call */
$set1 = $result; /* Give next result set a unique name */
while ($myrow = mysql_fetch_row($set1)) {
echo(Display category rows here);
}
}
-- Any leads/suggestions much appreciated..........--Noah
attached mail follows:
use eval()
www.php.net/eval
-- Maxim Maletsky maximphp.net
"CF High" <noah
newminddesign.com> wrote... :
> Hey all. > > I need to find out how to get PHP to evaluate a PHP variable stored in our > MySql database. > > Currently the variable is being read as a string; i.e. select * from table > where column = $myrow[0] -- instead of evaluating $myrow[0] as a variable. > > > The SQL statement is retrieved in the first call to dbConnect (see code > below) > > > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE > section_id = $_REQUEST[section_id] order by header"); > > $set = $result; /* Give initial result set a unique name */ > > while ($myrow = mysql_fetch_row($set)) { > > echo(Display the header title here); > > > dbConnect($myrow[2]); /* $myrow[2] is the sql_query gotten > from the first dbConnect() call */ > > $set1 = $result; /* Give next result set a unique name */ > > while ($myrow = mysql_fetch_row($set1)) { > > echo(Display category rows here); > > } > > } > > -- > Any leads/suggestions much appreciated.......... > > --Noah > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Don't quite understand why this works, but it does:
/* Escape quotes in sql_query so our header_id gets evaluated */ eval("\$myrow[2] = \"$myrow[2]\";");
What's the deal with the leading backslash in ' eval("\$myrow[2] '?
Does eval() tell php to evaluate the string as php code; i.e. text without quotes?
Thanks for the help.......
--Noah
----- Original Message -----
From: "Maxim Maletsky" <maxim
php.net>
To: "CF High" <noah
newminddesign.com>
Cc: <php-general
lists.php.net>
Sent: Friday, January 24, 2003 9:59 AM
Subject: Re: [PHP] Evaluate PHP var in stored sql statement?
>
> use eval()
>
> www.php.net/eval
>
>
> --
> Maxim Maletsky
> maxim
php.net
>
>
>
> "CF High" <noah
newminddesign.com> wrote... :
>
> > Hey all.
> >
> > I need to find out how to get PHP to evaluate a PHP variable stored in
our
> > MySql database.
> >
> > Currently the variable is being read as a string; i.e. select * from
table
> > where column = $myrow[0] -- instead of evaluating $myrow[0] as a
variable.
> >
> >
> > The SQL statement is retrieved in the first call to dbConnect (see code
> > below)
> >
> >
> >
> > dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE
> > section_id = $_REQUEST[section_id] order by header");
> >
> > $set = $result; /* Give initial result set a unique name */
> >
> > while ($myrow = mysql_fetch_row($set)) {
> >
> > echo(Display the header title here);
> >
> >
> > dbConnect($myrow[2]); /* $myrow[2] is the sql_query
gotten
> > from the first dbConnect() call */
> >
> > $set1 = $result; /* Give next result set a unique name
*/
> >
> > while ($myrow = mysql_fetch_row($set1)) {
> >
> > echo(Display category rows here);
> >
> > }
> >
> > }
> >
> > --
> > Any leads/suggestions much appreciated..........
> >
> > --Noah
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
eval takes the string and executes PHP in that string. So,
eval("\$myrow[2] = \"$myrow[2]\";");
is equivalent to:
$myrow[2] = "$myrow[2]";
I'd reccomend you using single quotes and then escape only backslashes and single quotes within a string
-- Maxim Maletsky maximphp.net
"Noah" <noah
newminddesign.com> wrote... :
> Don't quite understand why this works, but it does: > > /* Escape quotes in sql_query so our header_id gets evaluated */ > eval("\$myrow[2] = \"$myrow[2]\";"); > > What's the deal with the leading backslash in ' eval("\$myrow[2] '? > > Does eval() tell php to evaluate the string as php code; i.e. text without > quotes? > > Thanks for the help....... > > --Noah > > > ----- Original Message ----- > From: "Maxim Maletsky" <maxim
php.net> > To: "CF High" <noah
newminddesign.com> > Cc: <php-general
lists.php.net> > Sent: Friday, January 24, 2003 9:59 AM > Subject: Re: [PHP] Evaluate PHP var in stored sql statement? > > > > > > use eval() > > > > www.php.net/eval > > > > > > -- > > Maxim Maletsky > > maxim
php.net > > > > > > > > "CF High" <noah
newminddesign.com> wrote... : > > > > > Hey all. > > > > > > I need to find out how to get PHP to evaluate a PHP variable stored in > our > > > MySql database. > > > > > > Currently the variable is being read as a string; i.e. select * from > table > > > where column = $myrow[0] -- instead of evaluating $myrow[0] as a > variable. > > > > > > > > > The SQL statement is retrieved in the first call to dbConnect (see code > > > below) > > > > > > > > > > > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE > > > section_id = $_REQUEST[section_id] order by header"); > > > > > > $set = $result; /* Give initial result set a unique name */ > > > > > > while ($myrow = mysql_fetch_row($set)) { > > > > > > echo(Display the header title here); > > > > > > > > > dbConnect($myrow[2]); /* $myrow[2] is the sql_query > gotten > > > from the first dbConnect() call */ > > > > > > $set1 = $result; /* Give next result set a unique name > */ > > > > > > while ($myrow = mysql_fetch_row($set1)) { > > > > > > echo(Display category rows here); > > > > > > } > > > > > > } > > > > > > -- > > > Any leads/suggestions much appreciated.......... > > > > > > --Noah > > > > > > > > > > > > -- > > > 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 >
attached mail follows:
> From: "Noah" <noah
newminddesign.com>
> To: <maxim
php.net>
> Sent: Friday, January 24, 2003 4:39 PM
> Subject: Re: [PHP] Evaluate PHP var in stored sql statement?
> eval("\$myrow[2] = \"$myrow[2]\";"); > > What's the deal with the leading backslash in ' eval("\$myrow[2] '?
It's escaping the $ so you keep the literal on the left hand side of the expression.
attached mail follows:
Hey!
I was wondering with what command do you execute shell commands?
What I need is to change users password on the server, I want to write that script and it needs to be safe. So I don't know what should I use. I think I will need to check username and password, then log in through website with it and then use passwd command on that user to change the password. Or maybe I am wrong, I never done something like that.
Thanks for any info!
-mNTKz
attached mail follows:
The one problem and serious security risk you will be introducing is that if you run passwd as an unprivliged user you can only change the password of the user you are running it as. Therefore, the webserver would be running as apache, so the only password it could change would be for user apache.
To get passwd to change any password it has to be run as root, therefore you would need to run the webserver as root. You would be opening a serious pandora's box with that option.
Since your users have access to the server through a shell account (otherwise why bother with user accounts), you would be better served by PuTTY or another ssh client that the users change their passwords by logging in to the shell account.
On Fri, 24 Jan 2003 11:48:50 -0600
"Mantas Kriauciunas" <Mantuks
attbi.com> wrote:
> Hey! > > I was wondering with what command do you execute shell commands? > > What I need is to change users password on the server, I want to write > that script and it needs to be safe. So I don't know what should I > use. I think I will need to check username and password, then log in > through website with it and then use passwd command on that user to > change the password. Or maybe I am wrong, I never done something like > that. > > Thanks for any info! > > -mNTKz > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-- Tom Woody Systems Administrator NationWide Flood Research, Inc. phone: 214-631-0400 x209 fax: 214-631-0800Don't throw your computer out the window, throw the Windows out of your computer!
attached mail follows:
Hey! Thanks for reply.
Well hmm.. is there any way to open some socket and log in with other account or something like that? I mean use IE or other browser but the main point is to log in with different account and change the password. User can change password of their own not only root can change it.
And what I need this script for, is, not everyone knows how to use ssh and I don't want to give access to 50 users that can run their processes, my server will freeze. That's why I need to change it somehow different, what about loging in with root and changing passwords, but now again how to open connection to sshd.
By your reply I can guess that you state that there is no chanse..and if there is it will be big security hole.
:/
thnx again
-mNTKz
-----Original Message-----
From: Tom Woody [mailto:woody
nfri.com]
Sent: Friday, January 24, 2003 12:03 PM
To: Mantas Kriauciunas
Cc: php-general
lists.php.net
Subject: Re: [PHP] SSH change password!
The one problem and serious security risk you will be introducing is that if you run passwd as an unprivliged user you can only change the password of the user you are running it as. Therefore, the webserver would be running as apache, so the only password it could change would be for user apache.
To get passwd to change any password it has to be run as root, therefore you would need to run the webserver as root. You would be opening a serious pandora's box with that option.
Since your users have access to the server through a shell account (otherwise why bother with user accounts), you would be better served by PuTTY or another ssh client that the users change their passwords by logging in to the shell account.
On Fri, 24 Jan 2003 11:48:50 -0600
"Mantas Kriauciunas" <Mantuks
attbi.com> wrote:
> Hey! > > I was wondering with what command do you execute shell commands? > > What I need is to change users password on the server, I want to write > that script and it needs to be safe. So I don't know what should I > use. I think I will need to check username and password, then log in > through website with it and then use passwd command on that user to > change the password. Or maybe I am wrong, I never done something like > that. > > Thanks for any info! > > -mNTKz > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-- Tom Woody Systems Administrator NationWide Flood Research, Inc. phone: 214-631-0400 x209 fax: 214-631-0800Don't throw your computer out the window, throw the Windows out of your computer!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Not the more secure solution but should do the trick:
I will assume that your webserver is run as apache.apache
Make a copy of passwd and call it (for example) apache_passwd execute the following as root:
$>chown root.apache apache_passwd $>chmod u+rwxs,g+rwx,o-rwx
Notice the "s" in the u+. This sets the sticky bit or (Set UID) for the program meaning that when the program runs it will execute with the privs of the owner (root). Now since your are running the webserver in the group "apache" we set the group to be apache and give "rwx" to the group.
We also make sure nobody else can run the program "o-rwx".
The problem that you will still have is that *ANY* script run on the webserver *COULD* execute apache_passwd and change anyones password but it is much beter than running the webserver as root.
Just remember that someone could change the root password then gain access to your server and lock you out.
I'm sure there are better solutions but this will work.
There is a module for SquirrelMail (IMAP Webmail Client) that supports password changing. I can't remember how they did it though.
Serge.
In article <004401c2c3d6$8a380520$e0dffb0c
mntkz>, "Mantas Kriauciunas"
<Mantuks
attbi.com> wrote:
> Hey!
> Thanks for reply.
>
> Well hmm.. is there any way to open some socket and log in with other
> account or something like that? I mean use IE or other browser but the
> main point is to log in with different account and change the password.
> User can change password of their own not only root can change it.
>
> And what I need this script for, is, not everyone knows how to use ssh
> and I don't want to give access to 50 users that can run their
> processes, my server will freeze. That's why I need to change it somehow
> different, what about loging in with root and changing passwords, but
> now again how to open connection to sshd.
>
> By your reply I can guess that you state that there is no chanse..and if
> there is it will be big security hole.
>
> :/
>
> thnx again
>
> -mNTKz
>
> -----Original Message-----
> From: Tom Woody [mailto:woody
nfri.com] Sent: Friday, January 24, 2003
> 12:03 PM To: Mantas Kriauciunas
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] SSH change password!
>
> The one problem and serious security risk you will be introducing is
> that if you run passwd as an unprivliged user you can only change the
> password of the user you are running it as. Therefore, the webserver
> would be running as apache, so the only password it could change would
> be for user apache.
>
> To get passwd to change any password it has to be run as root, therefore
> you would need to run the webserver as root. You would be opening a
> serious pandora's box with that option.
>
> Since your users have access to the server through a shell account
> (otherwise why bother with user accounts), you would be better served by
> PuTTY or another ssh client that the users change their passwords by
> logging in to the shell account.
>
> On Fri, 24 Jan 2003 11:48:50 -0600
> "Mantas Kriauciunas" <Mantuks
attbi.com> wrote:
>
>> Hey!
>>
>> I was wondering with what command do you execute shell commands?
>>
>> What I need is to change users password on the server, I want to write
>> that script and it needs to be safe. So I don't know what should I use.
>> I think I will need to check username and password, then log in through
>> website with it and then use passwd command on that user to change the
>> password. Or maybe I am wrong, I never done something like that.
>>
>> Thanks for any info!
>>
>> -mNTKz
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
>> http://www.php.net/unsub.php
>
>
attached mail follows:
how do i create <?xml version="1.0" encoding="utf8"?>?
domxml_new_doc("1.0") only creates <?xml version="1.0"?>
vennlig hilsen Øyvind
STOPP BARNEPORNO PÅ INTERNET:
Send tips om barneporno til Redd Barna:
children
risk.online.no
Øyvind Vestavik oyvindve at idi dot ntnu dot no ICQ-number: 218699329 mobil: 41422911
attached mail follows:
Hi,
I have troubles with my php installation and file uploads. It's kind of a strange problem. When files are uploaded via a form in php they double in size and become corrupt. A text file smaller than about 2K will work, but past the text starts getting repeated spuratically throuought the file and causes the file doubles in size. The same happens with any file type that I've tried (.jpg, .txt, .pdf) and with several different PHP applications that I have downloaded.
I'm using Apache 2.0.40 with PHP 4.3.0 (./configure --with-mysql --with-mhash --enable-mbstring --enable-mbregex --with-zlib --enable-xml).
Would somebody know what is wrong?
Petr Gotthard
attached mail follows:
Here is a very simple APP to test my problem. Below you can see my result. This is done on PHP 4.3.0
Serge.
<? function ob_end_flush_all () { while ( ob_get_level() ) { ob_end_flush(); } }
function ob_spit_content_length ($buffer) { $len=strlen($buffer); if($len>0) { Header( "Content-Length: $len" ); } return $buffer; }
ob_start("ob_spit_content_length"); ob_start("ob_gzhandler"); ?> Test Message <? ob_end_flush_all(); ?>
Test:
[serge
beamer ~]$ telnet beamer 91
Trying 127.0.0.1...
Connected to beamer.localdomain (127.0.0.1).
Escape character is '^]'.
GET /test.php HTTP/1.1
Host: beamer:91
Accept-Encoding: gzip
HTTP/1.1 200 OK Date: Fri, 24 Jan 2003 19:22:12 GMT Server: Stronghold/3.0 Apache/1.3.22 RedHat/3015c (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b mod_perl/1.25 Content-Length: 243 Connection: close Content-Type: text/html
Test Message <br /> <b>Warning</b>: ob_gzhandler() [<a href='http://www.php.net/ref.outcontrol'>ref.outcontrol</a>]: output handler 'ob_gzhandler' cannot be used twice in <b>/home/httpd/devel_planetcharter/test.php</b> on line <b>4</b><br /> Connection closed by foreign host.
attached mail follows:
Is output_handler set in your php.ini?
---John Holmes...
----- Original Message -----
From: "Serge Paquin" <serge
skycomp.ca>
To: <php-general
lists.php.net>
Sent: Friday, January 24, 2003 2:24 PM
Subject: [PHP] ob_gzhandler bug???
> Here is a very simple APP to test my problem. Below you can see my
> result. This is done on PHP 4.3.0
>
> Serge.
>
> <?
> function ob_end_flush_all () {
> while ( ob_get_level() ) {
> ob_end_flush();
> }
> }
>
> function ob_spit_content_length ($buffer) {
> $len=strlen($buffer);
> if($len>0) {
> Header( "Content-Length: $len" );
> }
>
> return $buffer;
> }
>
> ob_start("ob_spit_content_length");
> ob_start("ob_gzhandler");
> ?>
> Test Message
> <?
> ob_end_flush_all();
> ?>
>
> Test:
> [serge
beamer ~]$ telnet beamer 91
> Trying 127.0.0.1...
> Connected to beamer.localdomain (127.0.0.1).
> Escape character is '^]'.
> GET /test.php HTTP/1.1
> Host: beamer:91
> Accept-Encoding: gzip
>
> HTTP/1.1 200 OK
> Date: Fri, 24 Jan 2003 19:22:12 GMT
> Server: Stronghold/3.0 Apache/1.3.22 RedHat/3015c (Unix) mod_ssl/2.8.4
OpenSSL/0.9.6b mod_perl/1.25
> Content-Length: 243
> Connection: close
> Content-Type: text/html
>
> Test Message
> <br />
> <b>Warning</b>: ob_gzhandler() [<a
href='http://www.php.net/ref.outcontrol'>ref.outcontrol</a>]: output handler
'ob_gzhandler' cannot be used twice in
<b>/home/httpd/devel_planetcharter/test.php</b> on line <b>4</b><br />
> Connection closed by foreign host.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
If I have 3 checkboxes labeled "user", but each one has a seperate value, how do I get the values of each checkbox? For example, how would I tell if the following checkboxes are checked?
<input type="checkbox" name="user" value="1"> <input type="checkbox" name="user" value="2"> <input type="checkbox" name="user" value="3"> <input type="submit" name="Submit" value="Submit">
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]