php-general Digest 14 Oct 2002 12:16:21 -0000 Issue 1643
Topics (messages 119820 through 119870):
Re: $HTTP_GET_VARS within a function ??
119820 by: John Negretti
119839 by: Jason Wong
119848 by: John Negretti
119857 by: Sascha Cunz
Detecting GD version
119821 by: Owen Prime
119823 by: Andrew Brampton
119824 by: Owen Prime
Re: Odd Problem
119822 by: Stephen
119829 by: John W. Holmes
119830 by: Owen Prime
119832 by: Jason Reid
OCIFetchInto: OCI8 problem
119825 by: Faisal Abdullah
119842 by: Faisal Abdullah
Re: php cgi question
119826 by: David Cook
119828 by: Marco Tabini
119835 by: David Cook
119837 by: Marco Tabini
119855 by: David Cook
Re: Simple HTML-Form Question
119827 by: Chip Wiegand
119834 by: . Edwin
119836 by: Chip Wiegand
119838 by: Keith Vance
sesson tutorials
119831 by: Peter Houchin
119833 by: John W. Holmes
119841 by: Peter Houchin
Re: Compiling PHP against net-snmp 5.0.6
119840 by: Harrie Hazewinkel
119862 by: Harrie Hazewinkel
Launching a Browser Win with PHP - Is it possible?
119843 by: Monty
119844 by: . Edwin
119846 by: Owen Prime
119849 by: Owen Prime
magic_quotes_gpc
119845 by: Wilbert Enserink
119847 by: John W. Holmes
119854 by: W. Enserink
file_exists for URLs
119850 by: Adrian Slusarczyk
119851 by: Owen Prime
chmod - some files can be viewed, others cannot
119852 by: Phil Powell
php, java and ssl
119853 by: A3-Mail Proxy Handler
Regular Expression (for ereg(i))
119856 by: Ns_Andy
119858 by: Steel
Re: How to navigate backwards in PHP ???
119859 by: Krzysztof Dziekiewicz
Re: PHP caching ideas?
119860 by: Krzysztof Dziekiewicz
outgoing mail function freezing problem
119861 by: scott
Register Globals
119863 by: Phil Ewington
119864 by: Timothy Hitchens
What's wrong with my regular expression?
119865 by: Ns_Andy
119870 by: Marco Tabini
simple question
119866 by: Jean-François Marseaut
119867 by: Jon Haworth
119868 by: Timothy Hitchens
119869 by: Simon Taylor
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 ---
Marco,
I was reading that there were some security risks with
"register-globals". Is this the same thing as "global".
John Negretti
www.ideablue.com
"Marco Tabini" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try using
>
> global $HTTP_GET_VARS;
>
> at the beginning of your function. $HTTP_GET_VARS has global scope, and
> by default PHP isolates functions from the parent scope.
>
>
> Marco
>
> On Sun, 2002-10-13 at 16:39, John Negretti wrote:
> > Hello All,
> >
> > I am calling a particular function. Within that function I need
access
> > to the $HTTP_GET_VARS array. It seem I could only access that array if
I
> > pass it as a parameter of the function. Is this how it's supposed to
work.
> > Thanks for any direction. NOTE: I am using PHP 4.0.6.
> >
> > John Negretti
> > www.ideablue.com
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
--- End Message ---
--- Begin Message ---
On Monday 14 October 2002 08:36, John Negretti wrote:
> Marco,
>
> I was reading that there were some security risks with
> "register-globals". Is this the same thing as "global".
No, they're totally different things.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Never promise more than you can perform.
-- Publilius Syrus
*/
--- End Message ---
--- Begin Message ---
Jason,
What is the difference?
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Monday 14 October 2002 08:36, John Negretti wrote:
> > Marco,
> >
> > I was reading that there were some security risks with
> > "register-globals". Is this the same thing as "global".
>
> No, they're totally different things.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Never promise more than you can perform.
> -- Publilius Syrus
> */
>
--- End Message ---
--- Begin Message ---
http://localhost/test.php?var=5
results in (global scope)
$var = 5; // Register globals on
$HTTP_GET_VARS['var'] = 5; // Always (?)
$_GET['var'] = 5; // With newer versions of PHP
To access this from a function:
function x() {
global $var;
globsl $HTTP_GET_VARS;
echo $var.'<BR>';
echo $HTTP_GET_VARS['var'].'<BR>';
echo $_GET['var'].'<BR>';
}
Note, that there is no "global $_GET;" - $_GET is a superglobal. That means,
you can always access it.
Sascha
Am Montag, 14. Oktober 2002 09:50 schrieb John Negretti:
> Jason,
>
> What is the difference?
>
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > On Monday 14 October 2002 08:36, John Negretti wrote:
> > > Marco,
> > >
> > > I was reading that there were some security risks with
> > > "register-globals". Is this the same thing as "global".
> >
> > No, they're totally different things.
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> >
> > /*
> > Never promise more than you can perform.
> > -- Publilius Syrus
> > */
--- End Message ---
--- Begin Message ---
Has anyone got any better ideas about how to detect what version of GD is
running other than the following. The reason I ask is that I want to use
imagecopyresampled() only if available ie. GD >= v2.0.
OPTION 1.
Parse phpinfo() output for the GD version info. Expensive.
OPTION 2.
Run imagecopyresampled() suppressing errors and then check the error msg.
ie:
@imagecopyresampled();
if ($php_errormsg != "imagecopyresampled(): requires GD 2.0 or later")
// GD >= v2.0
} else {
// GD < v2.0
}
Option 2 is the best I can come up with at the moment.... luckily the
"requires GD 2.0" error message is triggered before the argument validation
errors.
Anyone got a better idea?
Thanks,
Owen Prime
http://www.noggin.com.au
--- End Message ---
--- Begin Message ---
try function_exists('imagecopyresampled');
otherwise I'm sure there has to be some function that returns versions of
libs.
Andrew
----- Original Message -----
From: "Owen Prime" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 14, 2002 1:37 AM
Subject: [PHP] Detecting GD version
> Has anyone got any better ideas about how to detect what version of GD is
> running other than the following. The reason I ask is that I want to use
> imagecopyresampled() only if available ie. GD >= v2.0.
>
> OPTION 1.
> Parse phpinfo() output for the GD version info. Expensive.
>
> OPTION 2.
> Run imagecopyresampled() suppressing errors and then check the error msg.
> ie:
> @imagecopyresampled();
> if ($php_errormsg != "imagecopyresampled(): requires GD 2.0 or later")
> // GD >= v2.0
> } else {
> // GD < v2.0
> }
>
> Option 2 is the best I can come up with at the moment.... luckily the
> "requires GD 2.0" error message is triggered before the argument
validation
> errors.
>
> Anyone got a better idea?
>
> Thanks,
>
> Owen Prime
> http://www.noggin.com.au
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Been there. The function still exists in GD < 2.0. Thats why it produces
such a specific error message. Otherwise it would say function doesn't
exist.
Thanks for you input anyways.
Cheers,
Owen Prime
http://www.noggin.com.au
Andrew Brampton wrote:
> try function_exists('imagecopyresampled');
>
> otherwise I'm sure there has to be some function that returns versions of
> libs.
>
> Andrew
> ----- Original Message -----
> From: "Owen Prime" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 14, 2002 1:37 AM
> Subject: [PHP] Detecting GD version
>
>
>> Has anyone got any better ideas about how to detect what version of GD is
>> running other than the following. The reason I ask is that I want to use
>> imagecopyresampled() only if available ie. GD >= v2.0.
>>
>> OPTION 1.
>> Parse phpinfo() output for the GD version info. Expensive.
>>
>> OPTION 2.
>> Run imagecopyresampled() suppressing errors and then check the error msg.
>> ie:
>> @imagecopyresampled();
>> if ($php_errormsg != "imagecopyresampled(): requires GD 2.0 or later")
>> // GD >= v2.0
>> } else {
>> // GD < v2.0
>> }
>>
>> Option 2 is the best I can come up with at the moment.... luckily the
>> "requires GD 2.0" error message is triggered before the argument
> validation
>> errors.
>>
>> Anyone got a better idea?
>>
>> Thanks,
>>
>> Owen Prime
>> http://www.noggin.com.au
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--- End Message ---
--- Begin Message ---
I got the spelling and everything right...
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'"
<[EMAIL PROTECTED]>
Sent: Sunday, October 13, 2002 4:17 PM
Subject: RE: [PHP] Odd Problem
> Print your SQL to the screen and verify it's value is what you think it
> is. Make sure it's accessing the right table.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Stephen [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, October 13, 2002 5:03 PM
> > To: PHP List
> > Subject: [PHP] Odd Problem
> >
> > Hello,
> >
> > I'm running a script that inserts a form's contents into a MySQL
> table.
> > However, when I insert the contents, I get an error telling me this:
> >
> > Unknown column 'employee' in 'field list'
> >
> > I can't find the problem. I have a field in my table called employee
> but I
> > guess it doesn't see it. Any ideas why?
> >
> > Thanks,
> > Stephen Craton
> > http://www.melchior.us
> > http://php.melchior.us
>
>
--- End Message ---
--- Begin Message ---
What does your script look like? PHP isn't going to just make up an
error. If it tells you that was the error from a query, then it really
was.
---John Holmes...
> -----Original Message-----
> From: Stephen [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 13, 2002 8:44 PM
> To: PHP List; [EMAIL PROTECTED]
> Subject: Re: [PHP] Odd Problem
>
> I got the spelling and everything right...
>
> ----- Original Message -----
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'"
> <[EMAIL PROTECTED]>
> Sent: Sunday, October 13, 2002 4:17 PM
> Subject: RE: [PHP] Odd Problem
>
>
> > Print your SQL to the screen and verify it's value is what you think
it
> > is. Make sure it's accessing the right table.
> >
> > ---John Holmes...
> >
> > > -----Original Message-----
> > > From: Stephen [mailto:[EMAIL PROTECTED]]
> > > Sent: Sunday, October 13, 2002 5:03 PM
> > > To: PHP List
> > > Subject: [PHP] Odd Problem
> > >
> > > Hello,
> > >
> > > I'm running a script that inserts a form's contents into a MySQL
> > table.
> > > However, when I insert the contents, I get an error telling me
this:
> > >
> > > Unknown column 'employee' in 'field list'
> > >
> > > I can't find the problem. I have a field in my table called
employee
> > but I
> > > guess it doesn't see it. Any ideas why?
> > >
> > > Thanks,
> > > Stephen Craton
> > > http://www.melchior.us
> > > http://php.melchior.us
> >
> >
--- End Message ---
--- Begin Message ---
If you showed us the SQL your trying to execute and the table schema you may
get more helpful responses.
Cheers,
Owen Prime
http://www.noggin.com.au
Stephen wrote:
> Hello,
>
> I'm running a script that inserts a form's contents into a MySQL table.
> However, when I insert the contents, I get an error telling me this:
>
> Unknown column 'employee' in 'field list'
>
> I can't find the problem. I have a field in my table called employee but I
> guess it doesn't see it. Any ideas why?
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
> http://php.melchior.us
--- End Message ---
--- Begin Message ---
Also I would check the case of the column in both the script and the DB
itself.
And yes, the query and the table schema might help if that isnt it.
Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca
----- Original Message -----
From: "Owen Prime" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 13, 2002 8:07 PM
Subject: [PHP] Re: Odd Problem
> If you showed us the SQL your trying to execute and the table schema you
may
> get more helpful responses.
>
> Cheers,
>
> Owen Prime
> http://www.noggin.com.au
>
> Stephen wrote:
>
> > Hello,
> >
> > I'm running a script that inserts a form's contents into a MySQL table.
> > However, when I insert the contents, I get an error telling me this:
> >
> > Unknown column 'employee' in 'field list'
> >
> > I can't find the problem. I have a field in my table called employee but
I
> > guess it doesn't see it. Any ideas why?
> >
> > Thanks,
> > Stephen Craton
> > http://www.melchior.us
> > http://php.melchior.us
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi ppl.
I have something which seems really odd.
I run a SQL query, which is supposed to return 2 rows, but instead, it
returns one with
OCIFetchInto(). I used the exact same query in SQL*Plus, and It returns 2
rows like I want them.
Here's the code.
if(!$iDBConn = OCILogon(DB_USER, DB_PASS, DB_NAME))
echo "Failed to connect to Oracle database<br>";
$stmt = OCIParse($iDBConn,"ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
OCIExecute($stmt,OCI_DEFAULT);
$orasql = "SELECT * FROM gaj_ledjer_potongan WHERE no_gaji =
'".$id["salary_no"].
"' AND kod_potongan = '09' AND tempoh_gaji LIKE '$year%'";
echo $orasql."<br>";
$iStatement = @OCIParse($iDBConn, $orasql);
@OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);
if ($arrError['code']) {
print $arrError['message'];
exit;
}
$total_ded_sal = 0;
$deduction = $id["deduction"];
while(OCIFetchInto($iStatement, &$ora, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo $ora['TEMPOH_GAJI']."<br>";
}
p/s - I tried using a select * from table, and it returns more than one
rows(i suppose all the rows).
Thanks.
______________________________________
--- End Message ---
--- Begin Message ---
I added a little $counter in the while loop.
The count shows 2.
But why do I only get one value?
Thanks,
Faisal
-----Original Message-----
From: Faisal Abdullah [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 9:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] OCIFetchInto: OCI8 problem
Hi ppl.
I have something which seems really odd.
I run a SQL query, which is supposed to return 2 rows, but instead, it
returns one with
OCIFetchInto(). I used the exact same query in SQL*Plus, and It returns 2
rows like I want them.
Here's the code.
if(!$iDBConn = OCILogon(DB_USER, DB_PASS, DB_NAME))
echo "Failed to connect to Oracle database<br>";
$stmt = OCIParse($iDBConn,"ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
OCIExecute($stmt,OCI_DEFAULT);
$orasql = "SELECT * FROM gaj_ledjer_potongan WHERE no_gaji =
'".$id["salary_no"].
"' AND kod_potongan = '09' AND tempoh_gaji LIKE '$year%'";
echo $orasql."<br>";
$iStatement = @OCIParse($iDBConn, $orasql);
@OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);
if ($arrError['code']) {
print $arrError['message'];
exit;
}
$total_ded_sal = 0;
$deduction = $id["deduction"];
while(OCIFetchInto($iStatement, &$ora, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo $ora['TEMPOH_GAJI']."<br>";
}
p/s - I tried using a select * from table, and it returns more than one
rows(i suppose all the rows).
Thanks.
______________________________________
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
______________________________________
--- End Message ---
--- Begin Message ---
Hi again all
Just a bit more info, trying to track some more things down.
I made a few changes, changed getmail so that it would allow the getmailrc
file to be group writable, made a few changes to the user/group structure
(including making apache a member of a specific new group, and then setting
that group read/write on the getmailrc file (in theory now, apache should
have read/write permissions to the file via the group), and did a bit more
testing.
Results,
Executing the cgi script from command line still works (in that it displays
results, whereas from the web the cgi STIL says that the file doesnt exist
(this is via a quick if(file_exists($getmailfile)) etc.. etc..(least I didnt
break anything else) :)
I find this interesting, as the file definately DOES exist, and further,
theoretically the web server should have access via the group permissions.
I was a little curious if this may be a bahaviour of the apache php module,
in that it is incapable of working with files outside docroot? this should
not be the case though, as with a number of the other modules I am using,
and have written, files get written to temp (while they are being uploaded)
and other files are written outside docroot for other purposes, without any
real problems so far, this is getting curiouser and curiouser as Alice said
Any suggestions or thoughts anyone?
Puzzled.
David Cook
--- End Message ---
--- Begin Message ---
I think you might be unable to access documents outside the root if
you're in safe mode.
Just out of curiosity--have you tried su-ing to the Apache user and
executing your script as that user?
On Sun, 2002-10-13 at 21:36, David Cook wrote:
> Hi again all
>
> Just a bit more info, trying to track some more things down.
>
> I made a few changes, changed getmail so that it would allow the getmailrc
> file to be group writable, made a few changes to the user/group structure
> (including making apache a member of a specific new group, and then setting
> that group read/write on the getmailrc file (in theory now, apache should
> have read/write permissions to the file via the group), and did a bit more
> testing.
>
> Results,
>
> Executing the cgi script from command line still works (in that it displays
> results, whereas from the web the cgi STIL says that the file doesnt exist
> (this is via a quick if(file_exists($getmailfile)) etc.. etc..(least I didnt
> break anything else) :)
>
> I find this interesting, as the file definately DOES exist, and further,
> theoretically the web server should have access via the group permissions.
>
> I was a little curious if this may be a bahaviour of the apache php module,
> in that it is incapable of working with files outside docroot? this should
> not be the case though, as with a number of the other modules I am using,
> and have written, files get written to temp (while they are being uploaded)
> and other files are written outside docroot for other purposes, without any
> real problems so far, this is getting curiouser and curiouser as Alice said
>
> Any suggestions or thoughts anyone?
>
> Puzzled.
>
> David Cook
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
hmmm safe mode is disabled - for the apache module version
from phpinfo()
safe_mode Off Off
> Just out of curiosity--have you tried su-ing to the Apache user and
> executing your script as that user?
yep, same result (although I had to change the apache user for a few minutes
so it had a shell.. lol) as if I ran it off the web (file does not exist),
this still seems to tie into permissions perhaps, but I am having trouble
nailing enough data down so far to point to specifics.
I didnt make this server from scratch, it came pre-installed with a lot of
the items on it as part of a co-lo deal, the next few I build however will
be from the ground up even if it takes longer... and probably without using
RPM's for a lot of it... I've learned a fair bit the last 9 months or so
about the shortcomings as well as the benefits of using RPM's.
Thanks again for the thoughts, will test out some more stuff (this is just
plain getting me determined to work it out... stubborn I spose)
Regards
David
--- End Message ---
--- Begin Message ---
Ok, that's a big step forward then. It's possible that your user does
not have access to the directory tree where the file resides? Have you
tried listing that directory and or opening the file (for example with
cat) while using that file? If you can narrow it down to a permission
problem (and, at this point, I think that's exactly where the problem
is), that it should just be a matter of trying a few things out.
On Sun, 2002-10-13 at 23:23, David Cook wrote:
> hmmm safe mode is disabled - for the apache module version
>
> from phpinfo()
> safe_mode Off Off
>
> > Just out of curiosity--have you tried su-ing to the Apache user and
> > executing your script as that user?
> yep, same result (although I had to change the apache user for a few minutes
> so it had a shell.. lol) as if I ran it off the web (file does not exist),
> this still seems to tie into permissions perhaps, but I am having trouble
> nailing enough data down so far to point to specifics.
>
> I didnt make this server from scratch, it came pre-installed with a lot of
> the items on it as part of a co-lo deal, the next few I build however will
> be from the ground up even if it takes longer... and probably without using
> RPM's for a lot of it... I've learned a fair bit the last 9 months or so
> about the shortcomings as well as the benefits of using RPM's.
>
> Thanks again for the thoughts, will test out some more stuff (this is just
> plain getting me determined to work it out... stubborn I spose)
>
> Regards
>
> David
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Okies, FINALLY I think I have the reason (though not the solution as yet)
Marco, you were spot on, which I hadn't pursued properly, only looking at
the immediate parent directory permissions. In fact the whole ~vpopmail
structure down to the individual users directory has a VERY restrictive set
of permissions only the owner (vpopmail) can list read and write to any of
the directories leading down to the
~vpopmail/domains/some.email.domain/some.user/ etc.. etc... no group
permissions at ALL.
I have asked on the vpopmail list what the effect may be of re-setting group
list access (at least) to the structure may be as I dont want to break
anything on a running server... lol... so yep.. permissions it was indeed
(apparantly anyways), I reckon this is a proven case now, just got to work
out the solution as I can't setuid for a web enabled cgi to the vpopmail
user without getting stuck in suEXEC etc...
I dont know why the heck I hadnt tried just cat'ing the file.. lack of sleep
perhaps.. lol
Will let you know how it goes (if you are interested)
Regards, and thanks for all the help
David Cook
"Marco Tabini" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok, that's a big step forward then. It's possible that your user does
> not have access to the directory tree where the file resides? Have you
> tried listing that directory and or opening the file (for example with
> cat) while using that file? If you can narrow it down to a permission
> problem (and, at this point, I think that's exactly where the problem
> is), that it should just be a matter of trying a few things out.
--- End Message ---
--- Begin Message ---
Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53 +0200:
> This beautifies it (even makes it a bit more secure), but one doesn't
> need it really; should have worked without these changes, too. (Of
> course, it's better to include these changes)
>
> Sascha
No it shouldn't have worked the way you had it originally. The isset
statement HAS to have the same value as the submit buttom name or it
won't work at all. As for the beautify part, that's just the way I write
my code, that doesn't matter at all to whether or not the script will
work.
--
Chip
> > The value of name for the submit button is wrong - it should be the
> > same as the value you gave the isset statement, in this case it
> > should be<input type="submit" name="name" value="sendit">
> > Better yet is to use isset($submit) and the value for the submit
> > statement is also name="submit" -
> > <input type="submit" name="submit" value="sendit">
> > of course value is optional. So you end up with this -
> >
> > <?
> > if (isset($_GET['submit']))
> > {
> > echo "Hallo ".$GET['name'];
> > }
> > else
> > {
> > echo "<FORM action='test.php' method=get>
> > <input type='text' name='name'>
> > <input type='submit' name='submit' value='sendit'>";
> > }
> > ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hello,
Just for the sake of the argument...
On Monday, October 14, 2002 10:44 AM
Chip Wiegand wrote:
> Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53 +0200:
>
> > This beautifies it (even makes it a bit more secure), but one doesn't
> > need it really; should have worked without these changes, too. (Of
> > course, it's better to include these changes)
> >
> > Sascha
>
> No it shouldn't have worked the way you had it originally. The isset
> statement HAS to have the same value as the submit buttom name or it
> won't work at all.
Yes it will. Try it. ;)
Of course, I didn't mean to say that it will work the way you want it. I
just wanted to say that it would still work even though the isset statement
doen't have the same value with the submit button. Remember, isset() is
basically a function to check if something is set or not...
So, changing this
> > > if (isset($_GET['submit']))
to this
> > > if (isset($_GET['name']))
will have a similar result (for the short code discussed here).
- E
PS
Typo: (should be $_GET['name'])
> > > echo "Hallo ".$GET['name'];
> As for the beautify part, that's just the way I write
> my code, that doesn't matter at all to whether or not the script will
> work.
>
> --
> Chip
>
> > > The value of name for the submit button is wrong - it should be the
> > > same as the value you gave the isset statement, in this case it
> > > should be<input type="submit" name="name" value="sendit">
> > > Better yet is to use isset($submit) and the value for the submit
> > > statement is also name="submit" -
> > > <input type="submit" name="submit" value="sendit">
> > > of course value is optional. So you end up with this -
> > >
> > > <?
> > > if (isset($_GET['submit']))
> > > {
> > > echo "Hallo ".$GET['name'];
> > > }
> > > else
> > > {
> > > echo "<FORM action='test.php' method=get>
> > > <input type='text' name='name'>
> > > <input type='submit' name='submit' value='sendit'>";
> > > }
> > > ?>
> >
> >
> > --
> > 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 ---
Yep, I've been going over this with John off-list, I learned something
new tonite. One thing about his script - it doesn't print the text
entered in the box, it only prints the work Hallo. To fix that would
require adding
. "$name";
to the end of the echo statement.
Regards,
--
Chip
@ Edwin wrote this stuff back on Mon, 14 Oct 2002 11:55:28 +0900:
> Hello,
>
> Just for the sake of the argument...
>
> On Monday, October 14, 2002 10:44 AM
> Chip Wiegand wrote:
>
> > Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53
> > +0200:
> >
> > > This beautifies it (even makes it a bit more secure), but one
> > > doesn't need it really; should have worked without these changes,
> > > too. (Of course, it's better to include these changes)
> > >
> > > Sascha
> >
> > No it shouldn't have worked the way you had it originally. The isset
> > statement HAS to have the same value as the submit buttom name or it
> > won't work at all.
>
> Yes it will. Try it. ;)
>
> Of course, I didn't mean to say that it will work the way you want it.
> I just wanted to say that it would still work even though the isset
> statement doen't have the same value with the submit button. Remember,
> isset() is basically a function to check if something is set or not...
>
> So, changing this
>
> > > > if (isset($_GET['submit']))
>
> to this
>
> > > > if (isset($_GET['name']))
>
> will have a similar result (for the short code discussed here).
>
> - E
>
> PS
> Typo: (should be $_GET['name'])
> > > > echo "Hallo ".$GET['name'];
>
> > As for the beautify part, that's just the way I write
> > my code, that doesn't matter at all to whether or not the script
> > will work.
> >
> > --
> > Chip
> >
> > > > The value of name for the submit button is wrong - it should be
> > > > the same as the value you gave the isset statement, in this case
> > > > it should be<input type="submit" name="name" value="sendit">
> > > > Better yet is to use isset($submit) and the value for the submit
> > > > statement is also name="submit" -
> > > > <input type="submit" name="submit" value="sendit">
> > > > of course value is optional. So you end up with this -
> > > >
> > > > <?
> > > > if (isset($_GET['submit']))
> > > > {
> > > > echo "Hallo ".$GET['name'];
> > > > }
> > > > else
> > > > {
> > > > echo "<FORM action='test.php' method=get>
> > > > <input type='text' name='name'>
> > > > <input type='submit' name='submit' value='sendit'>";
> > > > }
> > > > ?>
> > >
> > >
> > > --
> > > 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
>
>
--- End Message ---
--- Begin Message ---
I would quote get in method="get" and end the </form> for starters.
Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399
Try my open source PHP authentication system, Rampart by visiting
http://rampart.sourceforge.net/. Commercial support is available at,
http://www.vanceconsulting.net/support/.
On Sun, 13 Oct 2002, Chip Wiegand wrote:
> Yep, I've been going over this with John off-list, I learned something
> new tonite. One thing about his script - it doesn't print the text
> entered in the box, it only prints the work Hallo. To fix that would
> require adding
> . "$name";
> to the end of the echo statement.
> Regards,
> --
> Chip
>
> @ Edwin wrote this stuff back on Mon, 14 Oct 2002 11:55:28 +0900:
>
> > Hello,
> >
> > Just for the sake of the argument...
> >
> > On Monday, October 14, 2002 10:44 AM
> > Chip Wiegand wrote:
> >
> > > Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53
> > > +0200:
> > >
> > > > This beautifies it (even makes it a bit more secure), but one
> > > > doesn't need it really; should have worked without these changes,
> > > > too. (Of course, it's better to include these changes)
> > > >
> > > > Sascha
> > >
> > > No it shouldn't have worked the way you had it originally. The isset
> > > statement HAS to have the same value as the submit buttom name or it
> > > won't work at all.
> >
> > Yes it will. Try it. ;)
> >
> > Of course, I didn't mean to say that it will work the way you want it.
> > I just wanted to say that it would still work even though the isset
> > statement doen't have the same value with the submit button. Remember,
> > isset() is basically a function to check if something is set or not...
> >
> > So, changing this
> >
> > > > > if (isset($_GET['submit']))
> >
> > to this
> >
> > > > > if (isset($_GET['name']))
> >
> > will have a similar result (for the short code discussed here).
> >
> > - E
> >
> > PS
> > Typo: (should be $_GET['name'])
> > > > > echo "Hallo ".$GET['name'];
> >
> > > As for the beautify part, that's just the way I write
> > > my code, that doesn't matter at all to whether or not the script
> > > will work.
> > >
> > > --
> > > Chip
> > >
> > > > > The value of name for the submit button is wrong - it should be
> > > > > the same as the value you gave the isset statement, in this case
> > > > > it should be<input type="submit" name="name" value="sendit">
> > > > > Better yet is to use isset($submit) and the value for the submit
> > > > > statement is also name="submit" -
> > > > > <input type="submit" name="submit" value="sendit">
> > > > > of course value is optional. So you end up with this -
> > > > >
> > > > > <?
> > > > > if (isset($_GET['submit']))
> > > > > {
> > > > > echo "Hallo ".$GET['name'];
> > > > > }
> > > > > else
> > > > > {
> > > > > echo "<FORM action='test.php' method=get>
> > > > > <input type='text' name='name'>
> > > > > <input type='submit' name='submit' value='sendit'>";
> > > > > }
> > > > > ?>
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
howdy
does any one know where i can view an uptodate session tutorial? so far I
have not found any that are up todate.
Cheers
Peter
"the only dumb question is the one that wasn't asked"
--- End Message ---
--- Begin Message ---
> howdy
>
> does any one know where i can view an uptodate session tutorial? so
far I
> have not found any that are up todate.
Sessions are a breeze. Just call session_start() on any page you need to
access the session. You then have a variable called $_SESSION, which is
an array. You can use it as any other array. To save the value "John" to
the session as a "Name", you'd use
$_SESSION['name'] = 'John';
Now, any page you have session_start() on will have the variable
$_SESSION['name'] available to it.
That's the whole tutorial Use $_SESSION as you would any other variable
and it'll be available to any page that has session_start on it.
---John Holmes...
--- End Message ---
--- Begin Message ---
Thanks to John Holmes & Timothy Hitchens for your help
after looking at what both of you said .. i found i had handled the sessions
correctly but not the sql statement in my script and it was the sql out put
that was causing nothing to be registered in my sessions.
Cheers
Peter
> -----Original Message-----
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 14 October 2002 12:50 PM
> To: 'Peter Houchin'; 'php_gen'
> Subject: RE: [PHP] sesson tutorials
>
>
> > howdy
> >
> > does any one know where i can view an uptodate session tutorial? so
> far I
> > have not found any that are up todate.
>
> Sessions are a breeze. Just call session_start() on any page you need to
> access the session. You then have a variable called $_SESSION, which is
> an array. You can use it as any other array. To save the value "John" to
> the session as a "Name", you'd use
>
> $_SESSION['name'] = 'John';
>
> Now, any page you have session_start() on will have the variable
> $_SESSION['name'] available to it.
>
> That's the whole tutorial Use $_SESSION as you would any other variable
> and it'll be available to any page that has session_start on it.
>
> ---John Holmes...
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
I have made a patch some time ago to have the old ucd-snmp and the new
net-snmp reside besides each other. I would like to drop the
ucd-snmp completely, but that is up to the group.
I have made a patch for this which is available at
http://www.lisanza.net/php-snmp/php-snmp.patch.txt
Use --with-net-snmp for configuration with NET-SNMP..
Hope this helps,
Harrie
--On Friday, October 11, 2002 10:10 AM +0100 Peter Hicks <[EMAIL PROTECTED]>
wrote:
> Hi everyone
>
> I'm having terrible trouble compiling PHP with net-snmp:
>
> /bin/sh /usr/local/src/php-4.2.3/libtool --silent --mode=compile gcc
> -I. -I/usr/local/src/php-4.2.3/ext/snmp -I/usr/local/src/php-4.2.3/main
> -I/usr/local/src/php-4.2.3 -I/usr/local/apache/include
> -I/usr/local/src/php-4.2.3/Zend -I/usr/local/include
> -I/usr/local/mysql/include/mysql -I/usr/local/pdflib/include
> -I/usr/local/snmp/include -I/usr/local/src/php-4.2.3/ext/xml/expat
> -DLINUX=22 -DMOD_SSL=208111 -DUSE_HSREGEX -DEAPI -DUSE_EXPAT
> -I/usr/local/src/php-4.2.3/TSRM -g -O2 -prefer-pic -c snmp.c
> snmp.c:62: asn1.h: No such file or directory
> snmp.c:63: snmp_api.h: No such file or directory
> snmp.c:64: snmp_client.h: No such file or directory
> snmp.c:65: snmp_impl.h: No such file or directory
> snmp.c:66: snmp.h: No such file or directory
> snmp.c:67: parse.h: No such file or directory
> snmp.c:68: mib.h: No such file or directory
> snmp.c:69: version.h: No such file or directory
>
> These missing .h files are in a subdirectory called
> 'include/net-snmp/library' on net-snmp 5.0.6, but on ucd-snmp 4.2.6,
> 'include/ucd-snmp/library'.
>
> I'm no great coder, so when I tried hacking the .c file to point to the
> location of the new headers, I came up against unresolved symbols whilst
> compiling.
>
> Has anybody successfuly compiled php with net-snmp? Can anybody help me
> track down the problem and hopefully come up with a patch?
>
> Best wishes,
>
>
> Peter.
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Net-snmp-users mailing list
> [EMAIL PROTECTED]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
Harrie
Internet Management Consulting
mailto: [EMAIL PROTECTED] http://www.lisanza.net/
--------------------------------------------------------------------
Author of MOD-SNMP, enabling SNMP management the Apache HTTP server
--- End Message ---
--- Begin Message ---
Hi all,
I made an error in the URL for the patch.
It is http://www.lisanza.net/php-snmp/php-netsnmp.patch.txt
Sorry,
Harrie
--On Monday, October 14, 2002 8:01 AM +0200 Harrie Hazewinkel
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have made a patch some time ago to have the old ucd-snmp and the new
> net-snmp reside besides each other. I would like to drop the
> ucd-snmp completely, but that is up to the group.
>
> I have made a patch for this which is available at
> http://www.lisanza.net/php-snmp/php-snmp.patch.txt
>
> Use --with-net-snmp for configuration with NET-SNMP..
>
>
>
> Hope this helps,
> Harrie
>
> --On Friday, October 11, 2002 10:10 AM +0100 Peter Hicks
> <[EMAIL PROTECTED]> wrote:
>
>> Hi everyone
>>
>> I'm having terrible trouble compiling PHP with net-snmp:
>>
>> /bin/sh /usr/local/src/php-4.2.3/libtool --silent --mode=compile gcc
>> -I. -I/usr/local/src/php-4.2.3/ext/snmp -I/usr/local/src/php-4.2.3/main
>> -I/usr/local/src/php-4.2.3 -I/usr/local/apache/include
>> -I/usr/local/src/php-4.2.3/Zend -I/usr/local/include
>> -I/usr/local/mysql/include/mysql -I/usr/local/pdflib/include
>> -I/usr/local/snmp/include -I/usr/local/src/php-4.2.3/ext/xml/expat
>> -DLINUX=22 -DMOD_SSL=208111 -DUSE_HSREGEX -DEAPI -DUSE_EXPAT
>> -I/usr/local/src/php-4.2.3/TSRM -g -O2 -prefer-pic -c snmp.c
>> snmp.c:62: asn1.h: No such file or directory
>> snmp.c:63: snmp_api.h: No such file or directory
>> snmp.c:64: snmp_client.h: No such file or directory
>> snmp.c:65: snmp_impl.h: No such file or directory
>> snmp.c:66: snmp.h: No such file or directory
>> snmp.c:67: parse.h: No such file or directory
>> snmp.c:68: mib.h: No such file or directory
>> snmp.c:69: version.h: No such file or directory
>>
>> These missing .h files are in a subdirectory called
>> 'include/net-snmp/library' on net-snmp 5.0.6, but on ucd-snmp 4.2.6,
>> 'include/ucd-snmp/library'.
>>
>> I'm no great coder, so when I tried hacking the .c file to point to the
>> location of the new headers, I came up against unresolved symbols whilst
>> compiling.
>>
>> Has anybody successfuly compiled php with net-snmp? Can anybody help me
>> track down the problem and hopefully come up with a patch?
>>
>> Best wishes,
>>
>>
>> Peter.
>>
>>
>>
>> -------------------------------------------------------
>> This sf.net email is sponsored by:ThinkGeek
>> Welcome to geek heaven.
>> http://thinkgeek.com/sf
>> _______________________________________________
>> Net-snmp-users mailing list
>> [EMAIL PROTECTED]
>> Please see the following page to unsubscribe or change other options:
>> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>>
>
>
>
> Harrie
>
> Internet Management Consulting
> mailto: [EMAIL PROTECTED] http://www.lisanza.net/
> --------------------------------------------------------------------
> Author of MOD-SNMP, enabling SNMP management the Apache HTTP server
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Net-snmp-users mailing list
> [EMAIL PROTECTED]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
Harrie
Internet Management Consulting
mailto: [EMAIL PROTECTED] http://www.lisanza.net/
--------------------------------------------------------------------
Author of MOD-SNMP, enabling SNMP management the Apache HTTP server
--- End Message ---
--- Begin Message ---
For a form that allows people to upload image files to the server, I'd like
to pop open a small browser window with an "Uploading..." message once
someone clicks on Submit button. Then I'd like the window to automatically
close once the process is done and the main browser window refreshes.
Can this be done with PHP or should I be using Javascript? If there are any
examples of how to do this online, I'd appreciate the URL.
Thanks!
--- End Message ---
--- Begin Message ---
Hello,
Just some ideas...
First, I don't think you can "pop open" a small browser window with PHP--use
Javascript. With Javascript you can define the size of the window AND you
can make it "disappear" (after the main browser window refreshes) by using
onBlur() then window.close() command.
Of course, you need to check the correct functions to use. (And make sure
you test it with different browsers...)
- E
On Monday, October 14, 2002 4:20 PM
Monty wrote:
> For a form that allows people to upload image files to the server, I'd
like
> to pop open a small browser window with an "Uploading..." message once
> someone clicks on Submit button. Then I'd like the window to automatically
> close once the process is done and the main browser window refreshes.
>
> Can this be done with PHP or should I be using Javascript? If there are
any
> examples of how to do this online, I'd appreciate the URL.
>
> Thanks!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
You will have to use mainly Javascript for this. What I have done in the
past is:
STEP 1.
In the <form> tag put a onSubmit argument which does a window.open(). This
should pop up a small window which you can use writeln() to add content to
it. Like your 'Uploading...' message or an image.
STEP 2.
Also in the onSubmit argument, set this.target = the new window name. This
will make the form post to the popup window.
STEP 3
When the file is finished uploading, I get the PHP to output the javascript:
window.opener.refresh(); // Refreshes the main window
window.opener.focus(); // Brings the main window to the top
window.close(); // Closes the popup window.
This should sort you out.
Cheers,
Owen Prime
http://www.noggin.com.au
Monty wrote:
> For a form that allows people to upload image files to the server, I'd
> like to pop open a small browser window with an "Uploading..." message
> once someone clicks on Submit button. Then I'd like the window to
> automatically close once the process is done and the main browser window
> refreshes.
>
> Can this be done with PHP or should I be using Javascript? If there are
> any examples of how to do this online, I'd appreciate the URL.
>
> Thanks!
--- End Message ---
--- Begin Message ---
Sorry, that should be window.opener.location.reload() instead of refresh().
Owen Prime wrote:
> You will have to use mainly Javascript for this. What I have done in the
> past is:
>
> STEP 1.
> In the <form> tag put a onSubmit argument which does a window.open(). This
> should pop up a small window which you can use writeln() to add content to
> it. Like your 'Uploading...' message or an image.
>
> STEP 2.
> Also in the onSubmit argument, set this.target = the new window name. This
> will make the form post to the popup window.
>
> STEP 3
> When the file is finished uploading, I get the PHP to output the
> javascript: window.opener.refresh(); // Refreshes the main window
> window.opener.focus(); // Brings the main window to the top
> window.close(); // Closes the popup window.
>
> This should sort you out.
>
> Cheers,
>
> Owen Prime
> http://www.noggin.com.au
>
> Monty wrote:
>
>> For a form that allows people to upload image files to the server, I'd
>> like to pop open a small browser window with an "Uploading..." message
>> once someone clicks on Submit button. Then I'd like the window to
>> automatically close once the process is done and the main browser window
>> refreshes.
>>
>> Can this be done with PHP or should I be using Javascript? If there are
>> any examples of how to do this online, I'd appreciate the URL.
>>
>> Thanks!
--
Cheers,
Owen Prime
http://www.noggin.com.au
--- End Message ---
--- Begin Message ---
Hi all,
I have a quetion on magic_quotes_gpc.
The php.ini file on my test servers shows that magic_quotes_gpc=On.
The php.ini file on the production server shows that magic_quotes_gpc=Off. ==> I know
this is a strange thing:-(
So you guess what happened: all the scripts I have don't function well. All input
fields got escaped in the test environment but don't get escaped in the real
environment. So when I input the name o'brien you gueass what happens.
My Q: Is there a way to set the value for magic_quotes_gpc ?? Or is there another
solution. Or should I adjust all my scripts and use addslashes/stripslashes each time
I put something into mysql databaseor retrieve something from the db.
I searched the manual but I could only find info about retrieving the value of
get_magic_quotes_gpc and stuff about setting the value for set_magic_quotes, but there
is no such a thing for set_magic_quotes_gpc.
Any help on this would be largelly appreciated!
Wilbert Enserink
-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
If you're on apache, you can use an .htaccess file
php_value magic_quotes_gpc 1
otherwise change it in php.ini or program for both settings...
---John Holmes...
> -----Original Message-----
> From: Wilbert Enserink [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 14, 2002 3:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] magic_quotes_gpc
>
> Hi all,
>
> I have a quetion on magic_quotes_gpc.
> The php.ini file on my test servers shows that magic_quotes_gpc=On.
> The php.ini file on the production server shows that
magic_quotes_gpc=Off.
> ==> I know this is a strange thing:-(
>
> So you guess what happened: all the scripts I have don't function
well.
> All input fields got escaped in the test environment but don't get
escaped
> in the real environment. So when I input the name o'brien you gueass
what
> happens.
>
> My Q: Is there a way to set the value for magic_quotes_gpc ?? Or is
there
> another solution. Or should I adjust all my scripts and use
> addslashes/stripslashes each time I put something into mysql
databaseor
> retrieve something from the db.
>
> I searched the manual but I could only find info about retrieving the
> value of get_magic_quotes_gpc and stuff about setting the value for
> set_magic_quotes, but there is no such a thing for
set_magic_quotes_gpc.
>
>
> Any help on this would be largelly appreciated!
>
> Wilbert Enserink
>
>
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -------------------------
--- End Message ---
--- Begin Message ---
Hi John,
that sounds like a great solution for me!! thanx. Can you tell me a bit more
about this solution.
Can I just place the htaccess file in the root of my site? And do I have to
include this file in my php scripts?
thx .alot. Wilbert
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Wilbert Enserink'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, October 14, 2002 9:47 AM
Subject: RE: [PHP] magic_quotes_gpc
> If you're on apache, you can use an .htaccess file
>
> php_value magic_quotes_gpc 1
>
> otherwise change it in php.ini or program for both settings...
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Wilbert Enserink [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 14, 2002 3:40 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] magic_quotes_gpc
> >
> > Hi all,
> >
> > I have a quetion on magic_quotes_gpc.
> > The php.ini file on my test servers shows that magic_quotes_gpc=On.
> > The php.ini file on the production server shows that
> magic_quotes_gpc=Off.
> > ==> I know this is a strange thing:-(
> >
> > So you guess what happened: all the scripts I have don't function
> well.
> > All input fields got escaped in the test environment but don't get
> escaped
> > in the real environment. So when I input the name o'brien you gueass
> what
> > happens.
> >
> > My Q: Is there a way to set the value for magic_quotes_gpc ?? Or is
> there
> > another solution. Or should I adjust all my scripts and use
> > addslashes/stripslashes each time I put something into mysql
> databaseor
> > retrieve something from the db.
> >
> > I searched the manual but I could only find info about retrieving the
> > value of get_magic_quotes_gpc and stuff about setting the value for
> > set_magic_quotes, but there is no such a thing for
> set_magic_quotes_gpc.
> >
> >
> > Any help on this would be largelly appreciated!
> >
> > Wilbert Enserink
> >
> >
> > -------------------------
> > Pas de Deux
> > Van Mierisstraat 25
> > 2526 NM Den Haag
> > tel 070 4450855
> > fax 070 4450852
> > http://www.pdd.nl
> > [EMAIL PROTECTED]
> > -------------------------
-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
Hi,
I'm kinda new to PHP and have the following problem: In a function, I want
to verify whether a
file exists before I go on, and if it doesn´t, return false and stop right
there. So I tried
if(!file_exists($my_file)) {
return false;
exit;
}
But since $my_file is a URL, it doesn´t work. Does anybody know how to do
this so it works with URLs, i.e. w/o using file_exists() ?
Thx!
--- End Message ---
--- Begin Message ---
Have a look at the fopen() function in the FileSystem Function section of
the Docs. fopen() can open a file over http:// and I imagine it returns
FALSE if it cant open it. If it doesn't return false, you could analyse the
headers in $http_response_header.
Hope this helps.
Cheers,
Owen Prime
http://www.noggin.com.au
Adrian Slusarczyk wrote:
> Hi,
>
> I'm kinda new to PHP and have the following problem: In a function, I want
> to verify whether a
> file exists before I go on, and if it doesn´t, return false and stop right
> there. So I tried
>
> if(!file_exists($my_file)) {
> return false;
> exit;
> }
>
> But since $my_file is a URL, it doesn´t work. Does anybody know how to do
> this so it works with URLs, i.e. w/o using file_exists() ?
>
> Thx!
--- End Message ---
--- Begin Message ---
I have a directory $DOCUMENT_ROOT/my/images, permission 0755
I have three images in my folder with the exact same permissions: 0755; same
ownership, same everything.
The files, viewed on my machine, are fine too.
However, two cannot be seen due to permissions errors; one can be seen. All three
were uploaded the exact same way too.
Anyone want to solve this riddle? I am stumped as usual.
Thanx
Phil
--- End Message ---
--- Begin Message ---
Hi,
I have a java class which uses ssl to perform some banking operations. As I have been
instructed, I downloaded certificates, classes (both jar files and class files) and
installed them.
While testing from console, class established ssl connection to remote host and
completed transaction.
While usign within php after making required configuration I get the following error:
"java.net.SocketException: Default SSL context init failed: Algorithm SunX509 not
available "
Please note that, all other java functions are working. Only this function fails.
The same code, the same class works from console without any errors. Only php raises
this error, and only for ssl.
Here is my system:
Linux Redhat 7.1 with kernel 2.4.2
apache 1.3.26
php 4.2.3
java 1.4.0 (02) sdk
openssl 0.9.6g
Thanx...
--- End Message ---
--- Begin Message ---
if I want eregi to return false if the string contains < char,
for example,
"A<B" //false will be returned.
what's the reg expression I can use?
--
Regards,
--- End Message ---
--- Begin Message ---
Hi Ns_Andy,
Monday, October 14, 2002, 1:27:06 PM, I've got:
N> if I want eregi to return false if the string contains < char,
N> for example,
N> "A<B" //false will be returned.
N> what's the reg expression I can use?
eregi will return false if there is no such expression;
For Your example it will be:
eregi ("^[^<]+$","A<B")
will return false.
--
The Same,
Steel mailto:[EMAIL PROTECTED]
http://www.none.ru
--- End Message ---
--- Begin Message ---
> $HTTP_SERVER_VARS["HTTP_REFERER"];
> - or -
> PHP 4.1.0 and later
> $_SERVER["HTTP_REFERER"];
> Not as reliable as passing it yourself though.
Some browsers may block sending http_referer.
--- End Message ---
--- Begin Message ---
> Is the general logic to slice the page into some general pieces. For example
> ones that have always general data and those that change. Then the ones that
> don't change are streamed to the user using passthrough and the rest of the
> page is generated dynamically with the newest relevant data.
If a page has parts that change and not you can make frameset. In a frame that
does not change you send caching headers.
Durign generating page you can cache in memory unchangeble parts.
--- End Message ---
--- Begin Message ---
Hello there
Thanks for all with the help yesterday
My mail function is sending out a few hundred or so mail address but
keeps hanging when it gets to sending a mail form a certain domain.
As the script hangs at this point I can't send anymore mails once the
script encounters an address from x domain. What would be the best way
to work around this? Why is mail() hanging?
How would you suggest incorporating a timeout so that the script
continues once mail() has not exited for more than say 5 seconds????
Thanks in advance for your help Scott
--- End Message ---
--- Begin Message ---
Hi,
I have just upgraded PHP to 4.2.3 and have found that register_globals
defaults to 'off'. I have changed this setting in the php.ini file, yet
phpinfo() still shows register_globals = 'off' and my scripts that rely on
this setting are failing. The file I edited was /etc/httpd/php.ini, so why
is register_globals still set to 'off'?
TIA
Phil
----------------------------
Phil Ewington
Technical Director
----------------------------
43 PLC
35 Broad Street, Wokingham
Berkshire RG40 1AU
Tel: +44 (0)118 978 9500
Fax: +44 (0)118 978 4994
http://www.43plc.com
----------------------------
--- End Message ---
--- Begin Message ---
What is the name of the file that is registered in your phpinfo()..
eg is that the path and name of the config??
Also have you restarted your webserver??
Phil Ewington wrote:
> Hi,
>
> I have just upgraded PHP to 4.2.3 and have found that register_globals
> defaults to 'off'. I have changed this setting in the php.ini file, yet
> phpinfo() still shows register_globals = 'off' and my scripts that rely on
> this setting are failing. The file I edited was /etc/httpd/php.ini, so why
> is register_globals still set to 'off'?
>
> TIA
>
> Phil
>
> ----------------------------
> Phil Ewington
> Technical Director
> ----------------------------
> 43 PLC
> 35 Broad Street, Wokingham
> Berkshire RG40 1AU
> Tel: +44 (0)118 978 9500
> Fax: +44 (0)118 978 4994
>
> http://www.43plc.com
> ----------------------------
>
>
--
Timothy Hitchens
Technologist / Entrepreneur
e-mail: [EMAIL PROTECTED]
mobile: 0419 521 440
-------------------------------------------------
HiTCHO Group - ABN: 85 816 540 110
Web Site: http://www.hitcho.com.au/
Snail Mail: PO Box 101 Arana Hills QLD 4054
Telephone: 07 3351 0951 - Facsimile: 07 3351 0952
IMPORTANT:
This email may be the view of the individual and
not that of the organisation. The contents of
this electronic mail (including attachments) may
be privileged and commercially confidential.
Any unauthorised use of the contents is expressly
prohibited. If you have received this document in
error, please advise us by telephone immediately
and then delete the document.
--- End Message ---
--- Begin Message ---
$line = '<a href="http://www.yahoo.com">http://www.yahoo.com</a>';
if (eregi("<a[ ]+(.*[ ]+)?href=([\"'])?([^<>\"'])+([\"'])?>[^<>]+<\/a[
]*>",$line,$matches)) {
print (htmlspecialchars($matches[0]));
}
it works fine,
however if
$line .= 'X<a href=http:/www.php.net>www.php.net</a>';
is added before eregi,
it doesn't,what's wrong with my code?
--
Regards,
--- End Message ---
--- Begin Message ---
If you want to match more than one occurrence of the same pattern, you
must use preg_match_all with Perl syntax. The matches will be returned
as an array of arrays (that is, an array that contains the result of a
normal ereg call for each match found):
$line = '<a href="http://www.yahoo.com">http://www.yahoo.com</a>';
$line .= 'X<a href=http:/www.php.net>www.php.net</a>';
if (preg_match_all("/(<( )*[Aa]( )*[Hh][Rr][Ee][Ff]( )*=(
)*[\"'][^<>\"']*[\"']( )*>[^<>]*<( )*\/( )*a( )*>)/",$line,$matches))
{
print ($matches[0][0]); // Returns the first match
print ($matches[1][0]); // Returns the second match
}
Also, your regular expression didn't cover all the possibility (eg:
spaces between href and =. I might have overdone it with mine but, hey,
I've got a turkey to cook and it's already late ;-)
Cheers,
Marco
On Mon, 2002-10-14 at 07:40, Ns_Andy wrote:
> $line = '<a href="http://www.yahoo.com">http://www.yahoo.com</a>';
> if (eregi("<a[ ]+(.*[ ]+)?href=([\"'])?([^<>\"'])+([\"'])?>[^<>]+<\/a[
>]*>",$line,$matches)) {
> print (htmlspecialchars($matches[0]));
> }
>
> it works fine,
> however if
> $line .= 'X<a href=http:/www.php.net>www.php.net</a>';
> is added before eregi,
> it doesn't,what's wrong with my code?
> --
> Regards,
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Where can I found last version of the GD library ?
--- End Message ---
--- Begin Message ---
Hi,
> Where can I found last version of the GD library ?
http://www.boutell.com/gd/
HTH
Jon
--- End Message ---
--- Begin Message ---
http://www.boutell.com/gd/http/ is a good start!!
Jean-François Marseaut wrote:
> Where can I found last version of the GD library ?
>
--
Timothy Hitchens
Technologist / Entrepreneur
e-mail: [EMAIL PROTECTED]
mobile: 0419 521 440
-------------------------------------------------
HiTCHO Group - ABN: 85 816 540 110
Web Site: http://www.hitcho.com.au/
Snail Mail: PO Box 101 Arana Hills QLD 4054
Telephone: 07 3351 0951 - Facsimile: 07 3351 0952
IMPORTANT:
This email may be the view of the individual and
not that of the organisation. The contents of
this electronic mail (including attachments) may
be privileged and commercially confidential.
Any unauthorised use of the contents is expressly
prohibited. If you have received this document in
error, please advise us by telephone immediately
and then delete the document.
--- End Message ---
--- Begin Message ---
http://www.boutell.com/gd/
-----Original Message-----
From: Jean-François Marseaut [mailto:[EMAIL PROTECTED]]
Sent: 14 October 2002 13:51
To: [EMAIL PROTECTED]
Subject: [PHP] simple question
Where can I found last version of the GD library ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---