|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Thu Apr 04 2002 - 12:34:42 CST
php-general Digest 4 Apr 2002 18:34:42 -0000 Issue 1267
Topics (messages 91489 through 91572):
Re: Cannot upload JPEG only
91489 by: Martin Towell
Changing PHPSESSID= to something else?
91490 by: Nick Richardson
91491 by: Richard Baskett
Re: suggestions on work-arounds to highlight_file() ?
91492 by: Philip Olson
91493 by: Philip Olson
91494 by: Bob
hidden value
91495 by: Joe
91496 by: Rudolf Visagie
Re: some kind of "library loader" - Thanks
91497 by: Arpad Tamas
CCS Question -- anyone know?
91498 by: Jason Caldwell
91501 by: Maxim Maletsky
91507 by: Justin French
Re: Tools for creating a faq
91499 by: Maxim Maletsky
Authorize.net
91500 by: David Johansen
91503 by: heinisch.creaction.de
Command failed for target
91502 by: Warren Daly
checkbox doesn't pass?
91504 by: savaidis
91509 by: heinisch.creaction.de
91519 by: Jason Wong
91528 by: savaidis
91535 by: Eugene Mah
91537 by: Matt Schroebel
91540 by: Chris Boget
91563 by: Philip Olson
Re: Using ob_gzhandler
91505 by: Andrew Brampton
91508 by: Daniel Swarbrick
91516 by: Andrew Brampton
FTP
91506 by: Edward van Bilderbeek - Bean IT
91512 by: Jason Sheets
mail to authenticated smtp on WIN2K
91510 by: Rodrigo Figueiredo
Current URL, Last URL, error handeling
91511 by: Ben Edwards
91513 by: Jason Wong
Emulation: $var = print_r($array)
91514 by: Julio Nobrega Trabalhando
91518 by: Jason Wong
91561 by: Philip Olson
Using ODBC
91515 by: Someone Somewhere
91517 by: Rance Hall
91520 by: Someone Somewhere
91521 by: Andrew Hill
91527 by: Rance Hall
91539 by: Someone Somewhere
Logfile of Mysql Queries?
91522 by: Moschitz Martin
91526 by: Jason Wong
91536 by: Rick Emery
Re: Current URL, Last URL, error handling
91523 by: Ben Edwards
91524 by: Julio Nobrega Trabalhando
91525 by: Jason Wong
91529 by: Ben Edwards
91532 by: Julio Nobrega Trabalhando
Exit();
91530 by: Mauricio Cuenca
91531 by: Ben Edwards
91533 by: Darren Gamble
91534 by: Julio Nobrega Trabalhando
Re: [Zend Engine 2] Unsigned Right(Maybee Left) Shift [Again]
91538 by: Rick Emery
php_oci8 Lib on win32
91541 by: Talucci Andrea
91545 by: heinisch.creaction.de
New to PHP Need Help
91542 by: Jason Tobias
91543 by: Rick Emery
91544 by: Hiroshi Ayukawa
91568 by: Philip Olson
Classes??
91546 by: Gerard Samuel
91547 by: Rick Emery
91548 by: Steve Cayford
91550 by: Miguel Cruz
91551 by: Gerard Samuel
Re: English/Arabic Mysql problem...
91549 by: Steve Cayford
(null)
91552 by: Vladislav Kulchitski
91553 by: Vladislav Kulchitski
session variables
91554 by: Lee, Ford
91555 by: Wolfram Kriesing
91558 by: Lee, Ford
91569 by: Lee, Ford
Block IP Script?
91556 by: Devin Atencio
91564 by: Miguel Cruz
configure problem?
91557 by: Boris Wong
91565 by: Miguel Cruz
91567 by: Boris Wong
91570 by: Miguel Cruz
mySQL join query error
91559 by: ROBERT MCPEAK
91560 by: Rick Emery
91566 by: Miguel Cruz
Re: configuration problem?
91562 by: Boris Wong
cvs tags (version?)
91571 by: Jeff D. Hamann
91572 by: John S. Huggins
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:
The reason I asked about the .htaccess files is because I thought that
_maybe_ there might be something in prod site that allows jpegs and gifs to
be uploaded, or the other way 'round, on the dev site that stops the
uploading.
It's a shot in the dark but worth a look.
Martin
-----Original Message-----
From: Carl Schmidt [mailto:cschmi4
gl.umbc.edu]
Sent: Thursday, April 04, 2002 4:06 PM
To: Martin Towell
Cc: php-general
lists.php.net
Subject: RE: [PHP] Cannot upload JPEG only
>
https://skunkWerkz.hosting-advantage.com/superSecretTesting/updateAdmin/MP3_
> Add.php
>
> not very secret, now that you've told everyone :)
Yep, I was waitin' for that one :-)
>
> anyway - do you have any .htaccess directives in one directory, you don't
> have in the other?
>
I do have separate .htaccess files for 2 separate sections. There is one
controlling the "devArea" realm, and it is at:
https://skunkWerkz.hosting-advantage.com/superSecretTesting/
The second one I have is at:
https://skunkWerkz.hosting-advantage.com/updateAdmin
to control the "administration" realm
There is some other info, related to this that may be of use:
The real name name of the site is www.imperialthrust.com. Since this is
just a rock band's web site, I didn't need my own certificate for
ecommerce, but I did want to use the web hosts shared cert so I could
secure a section of the site for administration. I was given the 3rd
level domain alias: skunkWerkz.hosting-advantage.com that apparently
bounces me through their authentication server. For a while the web site
was not registered, so I've been connecting directly to
skunkWerkz.hosting-advantage.com
directly.
But I've been running some tests and it looks as if when I go
through
https://www.imperialthrust.com/superSecretTesting/updateAdmin/MP3_Add.php,
for some strange reason, jpegs and gifs are now able to be uploaded. It
appears to be working, but I sure wish I knew why....
Carl
>
> -----Original Message-----
> From: Carl Schmidt [mailto:cschmi4
gl.umbc.edu]
> Sent: Thursday, April 04, 2002 3:39 PM
> To: Miguel Cruz
> Cc: Bob; php-general
lists.php.net
> Subject: Re: [PHP] Cannot upload JPEG only
>
>
> And here's the really wacky part i just found out. I have a page in prod
> that uploads MP3s.
> Part off what it does is upload the file, examine its' type , and then
> discard the file if it's not the type expected. Assuming the web host was
> set to not allow uploads of jpg and gif, the MP3 page wouldve errored out
> , saying it couldn't upload the file; but the weird thing is that it
> _can_ upload jpgs and gifs, but needless to say discards them because
> they are the wrong type.
>
> I tried the same MP3 page in developmen, but it exhibits the same behavior
> as the image upload page in that it won't even upload a jpeg or gif. This
> leads me to bleieve I've got some sort of configuration issue here.
> Both eprod and dev are on the same box. Here's the paths to the 2 pages:
>
> Prod:
> https://skunkWerkz.hosting-advantage.com/updateAdmin/MP3_Add.php
> Dev:
>
https://skunkWerkz.hosting-advantage.com/superSecretTesting/updateAdmin/MP3_
> Add.php
>
> Carl
>
>
>
> On Wed, 3 Apr 2002, Miguel Cruz wrote:
>
> > On Wed, 3 Apr 2002, Carl Schmidt wrote:
> > > Thank you for the code snippets. Unfortunately the problem is that I
> > > can'tget far enough to process the file. When the php script that
> > > supposed to process the file tests with is_uploaded_file, it fails.
In
> > > addtion, the $HTTP_POST_FILE['userfile']['tmp_name']=none. So i can't
> > > process anything since, as far as php is concerned, it appears nothing
> is
> > > uploaded.
> >
> > What happens if you take a file that works, and rename it so the
extension
> > is .GIF, and try uploading it? I mean, obviously it won't be a valid
> > image, but will it transfer and show up?
> >
> > miguel
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi all,
What would i put in my php.ini to change PHPSESSID to something else, like
's', so that my URL for sessions would be:
http://foo/bar.php?s=00as9s8fa9s0a7as9125 instead of
http://foo/bar.php?PHPSESSID=a8as982t8as8268
AND, can this be done w/ ini_set inside the script?
Thanks in advance!
//Nick Richardson
//esoteric.web
gte.net
attached mail follows:
Check out the session_name function.. That will do what you want :) Just
make sure you call it before session_start on each of your pages though.
Cheers!
Rick
"Trust in the Lord with all your heart, And lean not on your own
understanding; In all your ways acknowledge Him, And he shall direct your
paths." - Proverbs 3:5-6
> From: "Nick Richardson" <esoteric.web
gte.net>
> Date: Wed, 3 Apr 2002 23:15:31 -0800
> To: "PHP General" <php-general
lists.php.net>
> Subject: [PHP] Changing PHPSESSID= to something else?
>
> Hi all,
>
> What would i put in my php.ini to change PHPSESSID to something else, like
> 's', so that my URL for sessions would be:
>
> http://foo/bar.php?s=00as9s8fa9s0a7as9125 instead of
> http://foo/bar.php?PHPSESSID=a8as982t8as8268
>
> AND, can this be done w/ ini_set inside the script?
>
> Thanks in advance!
>
> //Nick Richardson
> //esoteric.web
gte.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
A note exists at http://www.php.net/highlight_file that says:
Note: The return parameter became available in PHP 4.2.0. Before
this time it behaved like the default, which is FALSE
So if you want to capture the output of highlight_file before
4.2.0 then you'll need to use output buffering, something like:
function ob_highlight_file($filename)
{
ob_start();
highlight_string($filename);
$source = ob_get_contents();
ob_end_clean();
return $source;
}
Be sure to pay attention to notes and warnings within the
PHP manual.
Regards,
Philip Olson
On Thu, 4 Apr 2002, Hugh Bothwell wrote:
> using PHP 4.1.3-dev on WinME, I call
>
> $a = "str" . highlight_file("file.php", true);
>
> and get a warning,
>
> Warning: Wrong parameter count for highlight_file() in myfile.php
>
> and *don't* get the highlighted source I want. show_source()
> does precisely the same thing.
>
> The manual says that PHP version >= 4.0.0 should support
> a second optional parameter... why would this fail?
> Is there some other easy way to do this? I have to get it returned
> in a string to stuff it into my template.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I meant to use highlight_file instead of highlight_string, doh!
I'll go back in time and modify the source below :)
Philip
On Thu, 4 Apr 2002, Philip Olson wrote:
>
> A note exists at http://www.php.net/highlight_file that says:
>
> Note: The return parameter became available in PHP 4.2.0. Before
> this time it behaved like the default, which is FALSE
>
> So if you want to capture the output of highlight_file before
> 4.2.0 then you'll need to use output buffering, something like:
function ob_highlight_file($filename)
{
ob_start();
highlight_file($filename);
$source = ob_get_contents();
ob_end_clean();
return $source;
}
> Be sure to pay attention to notes and warnings within the
> PHP manual.
>
> Regards,
> Philip Olson
>
>
> On Thu, 4 Apr 2002, Hugh Bothwell wrote:
>
> > using PHP 4.1.3-dev on WinME, I call
> >
> > $a = "str" . highlight_file("file.php", true);
> >
> > and get a warning,
> >
> > Warning: Wrong parameter count for highlight_file() in myfile.php
> >
> > and *don't* get the highlighted source I want. show_source()
> > does precisely the same thing.
> >
> > The manual says that PHP version >= 4.0.0 should support
> > a second optional parameter... why would this fail?
> > Is there some other easy way to do this? I have to get it returned
> > in a string to stuff it into my template.
> >
> >
> >
> > --
> > 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:
How about just make a symbolic link with .phps to the file:
ln -s /www/htdocs/phpdoc.php /www/htdocs/phpdoc.phps
Then make sure that your httpd.conf file has the following line in it:
AddType application/x-httpd-php-source .phps
Then url.com/phpdoc.phps would view the colored source for the file..
Later,
Bob
attached mail follows:
I had designed a web survery.
As there is some bugs of "session" function on php windows version.
so i use hidden value to pass the data to next page.
here are the code:
<html>
.....
<form name="survey"....>
<input type="radio" value="Jan" name="birth_month" checked>January
.....
.....
<input type=hidden name="birth_month" value=<? echo "survey->'$birth_month'"
?>
.....
.....
</html>
It seems that it can pass the data/variable to next page.
but i don't know why the variable display on the page, not hidden.
I think my php code that pass hidden value had error but i don't know how to
correct.
Can anyone help me?
thx!
best regards,
Joe
attached mail follows:
This should work:
<input type="hidden" name="chosen_birth_month" value="<?echo
$birth_month?>">
If the hidden input structure name is the same as the radio buttons' name,
you could run into trouble. Also, you forgot quotes around the 'hidden'. Why
try to use the form name as a class (survey->'$birth_month')?
Cheers
Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions
<mailto:rudolf
dhsolutions.co.za>
-----Original Message-----
From: Joe [mailto:joeyan
ctimail3.com]
Sent: Thursday, April 04, 2002 9:59 AM
To: php-general
lists.php.net
Subject: [PHP] hidden value
I had designed a web survery.
As there is some bugs of "session" function on php windows version.
so i use hidden value to pass the data to next page.
here are the code:
<html>
.....
<form name="survey"....>
<input type="radio" value="Jan" name="birth_month" checked>January
.....
.....
<input type=hidden name="birth_month" value=<? echo "survey->'$birth_month'"
?>
.....
.....
</html>
It seems that it can pass the data/variable to next page.
but i don't know why the variable display on the page, not hidden.
I think my php code that pass hidden value had error but i don't know how to
correct.
Can anyone help me?
thx!
best regards,
Joe
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Ok, Thank you for your help Miguel and Maxim, I'm trying to do it by the help of your suggestions.
Arpi
> > >Also, you can find out if a class was defined by calling > > >'class_exists()'. In this way you might save something. > > >The best way thought is what Miguel was saying: load the files > > >conditionally with a logic. > > > > That's what I'm trying to do, but still searching for the logic. > > But as I see, there's no better way of doing this other than > > checking if the needed classes are defined before every > > instantiation. > > Perhaps you can conjure up some sort of namespace scheme, and then > use a global array to track which class files have been loaded, or > which classes have been instantiated, or whatever it is you need to > keep track of. > > In your file with a dependency: > > global $LOAD_STATUS; > if (!$LOAD_STATUS['classes-db-queryops']) > include 'lib/classes/db/queryops.php'; > > In lib/classes/db/queryops.php: > > global $LOAD_STATUS; > $LOAD_STATUS['class-db-queryops'] = 1; > > Seems fairly cheap to do. > > miguel
attached mail follows:
I have several checkboxes on my webpage -- all within a particular table. It seems there is some weird spacing *around* the (or a) checkbox as I cannot tighten up my table and my text, that contain the checkboxes -- so, it looks like the table rows are spaced out just a little too much -- kinda annoying...
Is there a checkbox CCS style that I can apply that will take away the spacing around a checkbox object? much like the DISPLAY: INLINE; CCS for the FORM tag.
Thanks Jason
attached mail follows:
Style sheets can easily be applied.
But, I rather think that you should make sure your table is having cellpadding on 0.
something like this:
<table border=0 align="center" cellpadding=0 cellspacing=0 width=550>
I think this is your problem, I never noticed any unusual behavor of checkbox within tables.
P.S: this was an answer to a message that originally shouldn't been posted on this list.
Maxim Maletsky
Founder, Chief Developer PHPBeginner.com (Where PHP Begins)
www.PHPBeginner.com
maxim
phpbeginner.com
Jason Caldwell writes:
> I have several checkboxes on my webpage -- all within a particular table. > It seems there is some weird spacing *around* the (or a) checkbox as I > cannot tighten up my table and my text, that contain the checkboxes -- so, > it looks like the table rows are spaced out just a little too much -- kinda > annoying... > > Is there a checkbox CCS style that I can apply that will take away the > spacing around a checkbox object? much like the DISPLAY: INLINE; CCS for > the FORM tag. > > Thanks > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
Maxim Maletsky
Founder, Chief Developer PHPBeginner.com (Where PHP Begins)
www.PHPBeginner.com
maxim
phpbeginner.com
attached mail follows:
This is the wrong group to post this question. Soooo wrong.
Would you ask a flute player about the sound characteristics of a tuba????
a simple search for a newsgroup would have found comp.infosystems.www.authoring.stylesheets
and then there's also the millions of CSS and HTML references on the web, starting with a simple google search.
Justin French
on 04/04/02 7:14 PM, Jason Caldwell (jason
thinkingman.org) wrote:
> I have several checkboxes on my webpage -- all within a particular table. > It seems there is some weird spacing *around* the (or a) checkbox as I > cannot tighten up my table and my text, that contain the checkboxes -- so, > it looks like the table rows are spaced out just a little too much -- kinda > annoying... > > Is there a checkbox CCS style that I can apply that will take away the > spacing around a checkbox object? much like the DISPLAY: INLINE; CCS for > the FORM tag. > > Thanks > Jason > >
attached mail follows:
I rather agree here:
* Beginner * Intermediate * Advanced
will make it more sence. A newbie always knows he's notthing else than a beginner, someone who knows PHP but not sure of many silly things knows that in intermediate-categorized FAQs we have most of the answers, and an advanced user is not scared of read the complex programming terminology in the advaced section.
Kewl, no?
we're getting closer now.
Maxim Maletsky
Founder, Chief Developer PHPBeginner.com (Where PHP Begins)
www.PHPBeginner.com
maxim
phpbeginner.com
Jason Wong writes:
> On Thursday 04 April 2002 09:11, J. Scott Johnson wrote: >> One point. Faq items are rated on a 0 to 4 rating expressed as: >> >> Newbie >> Beginner >> Mid Level Geek >> Pro >> Senior DemiGod of PHP >> >> Obviously text can be changed. This way the faq can be sorted section by >> section with more complex stuff at the end. > > Having so many levels seems confusing and cluttered. How would one decide > between "Pro" & "senior DemiGod of PHP"? I would say 3 levels: > > Newbie > Intermediate > Advanced > > are more than enough. > > > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > Life is a series of rude awakenings. > -- R.V. Winkle > */
Maxim Maletsky
Founder, Chief Developer PHPBeginner.com (Where PHP Begins)
www.PHPBeginner.com
maxim
phpbeginner.com
attached mail follows:
I know that this is way off topic, but I was wondering if someone could help me. I couldn't think of anywhere else to look for info. So here are my questions. If someone could help me out or point me in the direction of a good resource I would be very grateful. But here goes. I just started setting everything up with Authorize.net. I've set it up to send all of the information correctly to Authorize.net, but I had some questions about the relay script that recieves the information. How am I supposed to handle the times when x_Response_Code doesn't equal 1? How do I get it so that the input fields reappear? On most sites they pop back up if an invalid credit card number is entered or any other error, but on mine it doesn't. Do I have to set up the fields myself or is there something I can do to make it reput them all back on the page? Also when it's approved and goes through the user can keep hitting refresh and it charges them multiple times and sends them an email each time. Is this just because I'm in test mode or is there something I can do to prevent this? Thanks a ton, Dave
attached mail follows:
At 04.04.2002 03:03, you wrote: >I know that this is way off topic, but I was wondering if someone could help >me. I couldn't think of anywhere else to look for info. So here are my >questions. If someone could help me out or point me in the direction of a >good resource I would be very grateful. But here goes. >I just started setting everything up with Authorize.net. I've set it up to >send all of the information correctly to Authorize.net, but I had some >questions about the relay script that recieves the information. How am I >supposed to handle the times when x_Response_Code doesn't equal 1?
I don´t know about authorized.net, only that I cannot access them ?? But that´s not the answer
> How do I >get it so that the input fields reappear? On most sites they pop back up if >an invalid credit card number is entered or any other error, but on mine it >doesn't.
If you only send some data to authorized.net You have to store the data, your clients entered in some, connected by a cookie or session, file, or db. When the data has to be showed again, you select the cookie/session and take the data from file/db to show again. Your form looks like: <form> echo '<input type="text" name="name" '; if($name) { echo 'value='.$name.'>'; } else { echo '>'; } ... other fields </form>
>Do I have to set up the fields myself or is there something I can >do to make it reput them all back on the page? Also when it's approved and >goes through the user can keep hitting refresh and it charges them multiple >times and sends them an email each time. Is this just because I'm in test >mode or is there something I can do to prevent this? Thanks a ton,
Look in the list, this questions was asked some times ago. For a little help, store a value, which is connected to your clients pay-page. if this f.e. hidden value is send again, the client clicked twice.
BTW I wouldn´t store any creditcardinformation in the file/db for sec. reasons. And delete the other informations, after the deal is complete.
HTH Oliver
attached mail follows:
HI, I am running a Sun Ultra 10 with Solaris 8 installed. I have installed Apache V2.0.32. It works fine. (IPV6 is great :-) Now I require PHP 4 support so I downloaded PHP 4.1.2 so I run
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql it configures fine. but when I make I get the error below :( please help!! thanks, Warren
Making all in apache2filter /bin/sh /home/root/php-4.1.2/libtool --silent --mode=compile /home/root/php-4.1.2/meta_ccld -I. -I/home/root/php-4.1.2/sapi/apache2filter -I/home/root/php-4.1.2/main -I/home/root/php-4.1.2 -I/usr/local/apache2/include -I/home/root/php-4.1.2/Zend -I/usr/local/mysql/include -I/home/root/php-4.1.2/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/home/root/php-4.1.2/TSRM -g -O2 -pthreads -DZTS -prefer-pic -c sapi_apache2.c sapi_apache2.c: In function `php_apache_sapi_register_variables': sapi_apache2.c:148: warning: initialization discards qualifiers from pointer target type sapi_apache2.c: In function `php_input_filter': sapi_apache2.c:247: incompatible type for argument 4 of `ap_get_brigade' sapi_apache2.c:247: too few arguments to function `ap_get_brigade' sapi_apache2.c: In function `php_register_hook': sapi_apache2.c:408: warning: passing arg 2 of `ap_register_input_filter' from incompatible pointer type *** Error code 1 make: Fatal error: Command failed for target `sapi_apache2.lo' Current working directory /home/root/php-4.1.2/sapi/apache2filter *** Error code 1 make: Fatal error: Command failed for target `all-recursive' Current working directory /home/root/php-4.1.2/sapi/apache2filter *** Error code 1 make: Fatal error: Command failed for target `all-recursive' Current working directory /home/root/php-4.1.2/sapi *** Error code 1 make: Fatal error: Command failed for target `all-recursive'
Warren Daly HEAnet Ltd.
Network Engineer Brooklawn House,
Tel:+353-1-660 9040 Crampton Avenue,
Fax:+353-1-660 3666 Shelbourne Rd,Dublin 4.
mailto:warren.daly
heanet.ie
Web: <http://www.heanet.ie>
attached mail follows:
I have a html form with some "text" (T1) and "checkbox" (C1) fields to pass it to a php script.
Accessing "text" fields has no problem.
There is a problem when I use $C1=$HTTP_POST_VARS['C1'] to take the value of C1 (ON) If it is not checked, then it is not set at all. (??why??) So I use : if (!isset($C1)) { $C1="0" } but still I get an warning that C1 is not set, on my screen. That happens before the use of isset function. How can I susspent this warning message?
What's wrong?
Makis Savaidis Thessaloniki Greece
attached mail follows:
At 04.04.2002 15:23, you wrote: > > >I have a html form with some "text" (T1) and "checkbox" (C1) fields to pass >it to a php script. > >Accessing "text" fields has no problem. > >There is a problem when I use >$C1=$HTTP_POST_VARS['C1'] >to take the value of C1 (ON) >If it is not checked, then it is not set at all. (??why??) >So I use : >if (!isset($C1)) { $C1="0" } >but still I get an warning that C1 is not set, on my screen. >That happens before the use of isset function. >How can I susspent this warning message? Makis, why do you use $HTTP_POST_VARS? Do I miss something? if you have a form and send it, the vars have the same names as in your form, will say if your checkbox name="foo" value="someval" will be transmitted, then in the following page there´s a var named $foo. and the value will be "someval" if the box is checked, otherwise there´s no (or NULL or FALSE ???) value in it. I personally prefer put checkbox vars (if there are several) in an array f.e. $foo[] In the following page I just scan the array and if there´s a value in a field thats fine. HTH Oliver
attached mail follows:
On Thursday 04 April 2002 20:46, heinisch
creaction.de wrote:
> why do you use $HTTP_POST_VARS? Do I miss something?
For security reasons.
Manual > Security
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* Above all things, reverence yourself. */
attached mail follows:
Thank you both for help and info! You were both very fast :) I didn't know I could not to use $HTTP_POST_VARS . Now it works all right. But IF I still want to use $HTTP_POST_VARS, what then? What about the warning when checkbox is not checked?
Thanks
Makis
> -----Original Message-----
> From: Jason Wong [mailto:php-general
gremlins.com.hk]
> Sent: Thursday, April 04, 2002 5:51 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] checkbox doesn't pass?
>
>
> On Thursday 04 April 2002 20:46, heinisch
creaction.de wrote:
>
> > why do you use $HTTP_POST_VARS? Do I miss something?
>
> For security reasons.
>
> Manual > Security
>
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> Above all things, reverence yourself.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
At 18:17 04-04-02 +0300, savaidis wrote:
>But IF I still want to use $HTTP_POST_VARS, what then? What about the >warning when checkbox is not checked? I use empty() to check the for the existence of checkbox variables.
-- --------------------------------------------------------------------- Eugene Mah, M.Sc., DABR eugenemix.netcom.com Medical Physicist/Misplaced Canuck maheug
musc.edu Department of Radiology "For I am a Bear of Very Little Medical University of South Carolina Brain, and long words Bother Charleston, South Carolina me." Winnie the Pooh http://home.netcom.com/~eugenem/ PGP KeyID = 0x1F9779FD, 0x319393F4 PGP keys available on request ICQ 3113529 O- ---------------------------------------------------------------------
attached mail follows:
You should use $HTTP_POST_VARS (or $_POST) all of the time. There's security risks in using register_globals. It's not risky in all cases. But register_globals will allow arbitrary variables to be added to into the name space of your script by simply putting them on the uri. Code not expecting such input, and expecting variables not to exist unless the script set them may behave unexpectedly.
The reason the variable is not set is that the checkbox isn't checked. You can test the variable with isset(), or empty() before you use it so you don't get the warning.
To learn what your script it seeing when you submit the page, do a: foreach ($HTTP_POST_VARS as $key => $value) { echo "Key: $key Value: $value<br>\n"; } at the top of your action handler script, and watch the variables come in when you check or not check the checkboxes. Once you understand that, then write the code to handle the situation.
> -----Original Message-----
> From: savaidis [mailto:savaidis
hol.gr]
> Sent: Thursday, April 04, 2002 10:17 AM
> Thank you both for help and info! You were both very fast :)
> I didn't know I could not to use $HTTP_POST_VARS . Now it
> works all right.
> But IF I still want to use $HTTP_POST_VARS, what then? What about the
> warning when checkbox is not checked?
attached mail follows:
> >But IF I still want to use $HTTP_POST_VARS, what then? What about the > >warning when checkbox is not checked? > I use empty() to check the for the existence of checkbox variables.
You can also use isset();
Chris
attached mail follows:
Unchecked checkboxes pass no values, that's how it works. It's either set or not. Default value for a checkbox is 'on' although you can change that. isset() will work fine.
Regards, Philip
attached mail follows:
I would guess before any output to the browser... so nearer the top the better
Andrew
"Daniel Swarbrick" <daniel
pressure.net.nz> wrote in message news:20020404043911.4782.qmail
pb1.pair.com...
> Can someone please confirm the correct place to call
> ob_start("ob_gzhandler") in a script? I am using sessions also, and the
> start of my scripts is like so:
>
> <?php
> require_once("DB.php");
> include("lib.inc.php");
>
> session_start();
> if ( ! $_SESSION[sess_auth]) {
> header("location: index.php");
> exit();
> }
>
> $db = DB::connect($conn_str, TRUE);
> $db->setFetchMode(DB_FETCHMODE_OBJECT);
>
> // rest of script
> ?>
>
>
>
attached mail follows:
What I'm trying to ascertain is whether it should go before or after session_start(), or any other headers for that matter...
"Andrew Brampton" <andrew
bramp.freeserve.co.uk> wrote in message
news:012401c1dbd9$c4266000$0100a8c0
STUDENT5830...
I would guess before any output to the browser... so nearer the top the
better
Andrew
"Daniel Swarbrick" <daniel
pressure.net.nz> wrote in message
news:20020404043911.4782.qmail
pb1.pair.com...
> Can someone please confirm the correct place to call
> ob_start("ob_gzhandler") in a script? I am using sessions also, and the
> start of my scripts is like so:
>
> <?php
> require_once("DB.php");
> include("lib.inc.php");
>
> session_start();
> if ( ! $_SESSION[sess_auth]) {
> header("location: index.php");
> exit();
> }
>
> $db = DB::connect($conn_str, TRUE);
> $db->setFetchMode(DB_FETCHMODE_OBJECT);
>
> // rest of script
> ?>
>
>
>
attached mail follows:
Yes before any output is sent to the browser So I guess before any headers are sent. and maybe before the session_start.. But it doesn't harm you to place it before everything, put it as the first line if you want to be 100% safe.
If you want to test if your pages are being GZiped then check out: http://leknor.com/code/gziped.php
Andrew
----- Original Message -----
From: "Daniel Swarbrick" <daniel
pressure.net.nz>
To: <php-general
lists.php.net>
Sent: Thursday, April 04, 2002 2:29 PM
Subject: Re: [PHP] Using ob_gzhandler
> What I'm trying to ascertain is whether it should go before or after
> session_start(), or any other headers for that matter...
>
> "Andrew Brampton" <andrew
bramp.freeserve.co.uk> wrote in message
> news:012401c1dbd9$c4266000$0100a8c0
STUDENT5830...
> I would guess before any output to the browser... so nearer the top the
> better
>
> Andrew
> "Daniel Swarbrick" <daniel
pressure.net.nz> wrote in message
> news:20020404043911.4782.qmail
pb1.pair.com...
> > Can someone please confirm the correct place to call
> > ob_start("ob_gzhandler") in a script? I am using sessions also, and the
> > start of my scripts is like so:
> >
> > <?php
> > require_once("DB.php");
> > include("lib.inc.php");
> >
> > session_start();
> > if ( ! $_SESSION[sess_auth]) {
> > header("location: index.php");
> > exit();
> > }
> >
> > $db = DB::connect($conn_str, TRUE);
> > $db->setFetchMode(DB_FETCHMODE_OBJECT);
> >
> > // rest of script
> > ?>
> >
> >
> >
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi,
I'm creating an FTP script for uploading files... but now, when I pull out the network plug of the server (so the connection is lost), my program doesn't stop running... any ideas of how to check if a connection is still alive?
Edward
// partial code:
for ($i=0; $i<mysql_numrows($query); $i++) { $ip = mysql_result($query, 0, 'locatie.ip'); $titel = mysql_result($query, 0, 'locatie.titel'); $gebruiker = mysql_result($query, 0, 'locatie.gebruiker'); $wachtwoord = mysql_result($query, 0, 'locatie.wachtwoord');
$connid = ftp_connect($ip); $login_result = ftp_login($connid, $gebruiker, $wachtwoord);
if (!$connid || ! $login_result) { $error[] = array("con", "FTP connection failed at $titel ($ip) for $gebruiker"); } else { $query_ftp = mysql_query("SELECT * FROM bestanden WHERE locatienummer='$locatienummer' && code != 'N'"); for ($j=0; $j<mysql_numrows($query_ftp); $j++) { $id = mysql_result($query_ftp, $j, 'id'); $bestand = mysql_result($query_ftp, $j, 'path'); $code = mysql_result($query_ftp, $j, 'code'); $doel = eregi_replace("^$path/", "", $bestand);
ftp_chdir($connid, "~");
if (strtolower(substr($bestand, -3))=='txt' ||
strtolower(substr($bestand, -3))=='sca') {
$upload =
ftp_put($connid, $doel, $bestand,
FTP_ASCII);
} else {
$upload =
ftp_put($connid, $doel, $bestand,
FTP_BINARY);
}
if (!$upload) {
$error[] = array("upl", "Upload failed: $bestand, at:
$titel ($ip) for $gebruiker");
} else {
mysql_query("UPDATE bestanden SET code='N' WHERE
id='$id'");
}
}
if (!ftp_exec($connid, "NOOP")) {
/// ********* HERE I WANNA CHECK OF THERE IS A CONNECTION
/// ********* BUT IT LOOKS LIKE IT KEEPS TRYING TO SEND THE
FILES
/// ********* AND GETS STUCK IN THE ftp_put()'s ABOVE...
$error[] = array("lost", "Connection lost to $titel ($ip) for $gebruiker"); break; } } } ftp_quit($connid); }
attached mail follows:
Hi Edward
Look at ftp_set_option in the manual, you can access it online at http://www.php.net/manual/en/function.ftp-set-option.php.
FTP_TIMEOUT_SEC sounds like it might do what you are looking for.
Jason
----- Original Message -----
From: "Edward van Bilderbeek - Bean IT" <edward
bean-it.nl>
To: "PHP-General" <php-general
lists.php.net>
Sent: Thursday, April 04, 2002 6:16 AM
Subject: [PHP] FTP
> Hi,
>
> I'm creating an FTP script for uploading files... but now, when I pull out
> the network plug of the server (so the connection is lost), my program
> doesn't stop running... any ideas of how to check if a connection is still
> alive?
>
> Edward
>
>
> // partial code:
>
> for ($i=0; $i<mysql_numrows($query); $i++) {
> $ip = mysql_result($query, 0, 'locatie.ip');
> $titel = mysql_result($query, 0, 'locatie.titel');
> $gebruiker = mysql_result($query, 0, 'locatie.gebruiker');
> $wachtwoord = mysql_result($query, 0, 'locatie.wachtwoord');
>
> $connid = ftp_connect($ip);
> $login_result = ftp_login($connid, $gebruiker, $wachtwoord);
>
> if (!$connid || ! $login_result) {
> $error[] = array("con", "FTP connection failed at $titel ($ip) for
> $gebruiker");
> } else {
> $query_ftp = mysql_query("SELECT * FROM bestanden WHERE
> locatienummer='$locatienummer' && code != 'N'");
> for ($j=0; $j<mysql_numrows($query_ftp); $j++) {
> $id = mysql_result($query_ftp, $j, 'id');
> $bestand = mysql_result($query_ftp, $j, 'path');
> $code = mysql_result($query_ftp, $j, 'code');
> $doel = eregi_replace("^$path/", "", $bestand);
>
> ftp_chdir($connid, "~");
> if (strtolower(substr($bestand, -3))=='txt' ||
> strtolower(substr($bestand, -3))=='sca') {
> $upload =
ftp_put($connid, $doel, $bestand,
> FTP_ASCII);
> } else {
> $upload =
ftp_put($connid, $doel, $bestand,
> FTP_BINARY);
> }
> if (!$upload) {
> $error[] = array("upl", "Upload failed: $bestand, at:
> $titel ($ip) for $gebruiker");
> } else {
> mysql_query("UPDATE bestanden SET code='N' WHERE
> id='$id'");
> }
> }
> if (!ftp_exec($connid, "NOOP")) {
> /// ********* HERE I WANNA CHECK OF THERE IS A CONNECTION
> /// ********* BUT IT LOOKS LIKE IT KEEPS TRYING TO SEND
THE
> FILES
> /// ********* AND GETS STUCK IN THE ftp_put()'s ABOVE...
>
> $error[] = array("lost", "Connection lost to $titel ($ip)
for
> $gebruiker");
> break;
> }
> }
> }
> ftp_quit($connid);
> }
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi,
I've tried the following script:
<?php
mail("myaddr
provider.com", 'Subject', 'Message', "From:
myaddr
provider.com");
?>
on PHP 4.1.2-32 with Apache on a Win2k machine.
The ISP smtp is known as "smtp" in the Outlook send server acct and the smtp
server requires requires authentication. If I ping it, I get the real smtp
name, let's say ssmtp.domain.com, so I tried in php.ini (at the system dir):
SMTP = smtp
sendmail_from = myaddr
provider.com
or
SMTP = ssmtp.domain.com
sendmail_from = myaddr
provider.com
Neither option makes the above script work. Nor the numeric IP address itself. I get "Server Error" response. I suspect this is because of the authentication requirement. If this is so, is there a way to specify this authentication either in php.ini or in the script?
Any input is greatly appreciated. Thanks.
Rodrigo
attached mail follows:
Is there a way I can get the whole URL of the current page for error handling/reporting. Also is there a way of getting the previous/referrer URL for a similar purpose.
Lastly if anyone could point me in the direction on error handling strategy/techniques in general this would be good.
Regards, Ben
**************************************************************** * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builder http://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ****************************************************************
attached mail follows:
On Thursday 04 April 2002 21:56, Ben Edwards wrote: > Is there a way I can get the whole URL of the current page for error > handling/reporting. Also is there a way of getting the previous/referrer > URL for a similar purpose.
Have a look at the values inside $HTTP_SERVER_VARS:
print_r($HTTP_SERVER_VARS);
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* "Because he's a character who's looking for his own identity, [He-Man is] an interesting role for an actor." -- Dolph Lundgren, "actor" */
attached mail follows:
Is there a way to do something like this?
I wrote a wanna-be debugger. It just write to a file simple and common used function and variables, array or objects. Then when I activate it, a new window is opened with these information. Simple stuff.
The problem is that if I do this:
fwrite($fp, $_SESSION);
It will record Array, of course. If I serialize it, it's unreadble compared to print_r();
$var = print_r($array), well, prints the array like I suspected.
Is there a way to "emulate" var_dump(), print_r() so I can write it to a file and when I open this file the information are shown like if I really did a print_r();?
Any help is great! :-)
Thanks,
--Julio Nobrega.
attached mail follows:
On Thursday 04 April 2002 22:43, Julio Nobrega Trabalhando wrote: > Is there a way to do something like this? > > I wrote a wanna-be debugger. It just write to a file simple and common > used function and variables, array or objects. Then when I activate it, a > new window is opened with these information. Simple stuff. > > The problem is that if I do this: > > fwrite($fp, $_SESSION); > > It will record Array, of course. If I serialize it, it's unreadble > compared to print_r(); > > $var = print_r($array), well, prints the array like I suspected. > > Is there a way to "emulate" var_dump(), print_r() so I can write it to a > file and when I open this file the information are shown like if I really > did a print_r();?
ob_start(); print_r($doo); $dah = ob_get_contents(); ob_end_clean(); echo $dah;
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* Whatever you do will be insignificant, but it is very important that you do it. -- Gandhi */
attached mail follows:
> > Is there a way to "emulate" var_dump(), print_r() so I can write it to a > > file and when I open this file the information are shown like if I really > > did a print_r();? > > ob_start(); > print_r($doo); > $dah = ob_get_contents(); > ob_end_clean(); > echo $dah;
and just a fyi, var_export() exists in PHP 4.2.0.
Regards, Philip
attached mail follows:
Does anyone have any experience using ODBC to connect to an Access database, I'm runing php and Apache in Windows 2000. Any help will be apreciated.
Thanks Someone
attached mail follows:
Where were you yesterday when I was discussing this left and right. :)
What do you want do know?
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
Sent: Thursday, April 04, 2002 9:17 AM
To: php-general
lists.php.net
Subject: [PHP] Using ODBC
Does anyone have any experience using ODBC to connect to an Access database, I'm runing php and Apache in Windows 2000. Any help will be apreciated.
Thanks Someone
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Everything from setting up the DSN stuff to the commands for connecting and extracting info from the access database
"Rance Hall" <Rance.Hall
Buckle.com> wrote in message
news:09973C1DC8153344A6180D641B25A6A1012C0CC4
mailbox.bucklehq.com...
Where were you yesterday when I was discussing this left and right. :)
What do you want do know?
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
Sent: Thursday, April 04, 2002 9:17 AM
To: php-general
lists.php.net
Subject: [PHP] Using ODBC
Does anyone have any experience using ODBC to connect to an Access database, I'm runing php and Apache in Windows 2000. Any help will be apreciated.
Thanks Someone
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
What problems are you having? It's fairly straightforward - create a System DSN and test it in the ODBC Administrator, and use it in the odbc functions in PHP.
Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server
> -----Original Message-----
> From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
> Sent: Thursday, April 04, 2002 10:17 AM
> To: php-general
lists.php.net
> Subject: [PHP] Using ODBC
>
>
> Does anyone have any experience using ODBC to connect to an
> Access database,
> I'm runing php and Apache in Windows 2000. Any help will be apreciated.
>
>
> Thanks
> Someone
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
There is a fine tutorial on the subject (including how to set up a DSN on an NT box) located at: http://www.phpbuilder.com/columns/siddarth20000228.php3
I would suggest that you take the time to read it, and then let us know what you don't understand or have problems with. It fixed me.
PS, in the PHP manual read up on the unified ODBC command structure, and be advised that ODBC_NUM_ROWS does not return any meaningful value from an access database, do don't use that command
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
Sent: Thursday, April 04, 2002 9:57 AM
To: php-general
lists.php.net
Subject: Re: [PHP] Using ODBC
Everything from setting up the DSN stuff to the commands for connecting and extracting info from the access database
"Rance Hall" <Rance.Hall
Buckle.com> wrote in message
news:09973C1DC8153344A6180D641B25A6A1012C0CC4
mailbox.bucklehq.com...
Where were you yesterday when I was discussing this left and right. :)
What do you want do know?
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
Sent: Thursday, April 04, 2002 9:17 AM
To: php-general
lists.php.net
Subject: [PHP] Using ODBC
Does anyone have any experience using ODBC to connect to an Access database, I'm runing php and Apache in Windows 2000. Any help will be apreciated.
Thanks Someone
-- 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:
Thanks alot
"Rance Hall" <Rance.Hall
Buckle.com> wrote in message
news:09973C1DC8153344A6180D641B25A6A101315D37
mailbox.bucklehq.com...
There is a fine tutorial on the subject (including how to set up a DSN on an
NT box) located at:
http://www.phpbuilder.com/columns/siddarth20000228.php3
I would suggest that you take the time to read it, and then let us know what you don't understand or have problems with. It fixed me.
PS, in the PHP manual read up on the unified ODBC command structure, and be advised that ODBC_NUM_ROWS does not return any meaningful value from an access database, do don't use that command
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
Sent: Thursday, April 04, 2002 9:57 AM
To: php-general
lists.php.net
Subject: Re: [PHP] Using ODBC
Everything from setting up the DSN stuff to the commands for connecting and extracting info from the access database
"Rance Hall" <Rance.Hall
Buckle.com> wrote in message
news:09973C1DC8153344A6180D641B25A6A1012C0CC4
mailbox.bucklehq.com...
Where were you yesterday when I was discussing this left and right. :)
What do you want do know?
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: Someone Somewhere [mailto:cirkitbraker
hotmail.com]
Sent: Thursday, April 04, 2002 9:17 AM
To: php-general
lists.php.net
Subject: [PHP] Using ODBC
Does anyone have any experience using ODBC to connect to an Access database, I'm runing php and Apache in Windows 2000. Any help will be apreciated.
Thanks Someone
-- 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:
Is there any possibility of logging all the Insert, Update and Delete Commands to a database of Mysql-Server? I would like to fetch them with php and display them in HTML.
thanxs martin
attached mail follows:
On Thursday 04 April 2002 22:54, Moschitz Martin wrote: > Is there any possibility of logging all the Insert, Update and Delete > Commands to a database of Mysql-Server? I would like to fetch them with php > and display them in HTML.
Yes. This is off-topic, look in the MySQL manual.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* If a guru falls in the forest with no one to hear him, was he really a guru at all? -- Strange de Jim, "The Metasexuals" */
attached mail follows:
on a unix/linux box, all queries are in /var/log/mysqld
-----Original Message-----
From: Moschitz Martin [mailto:Martin.Moschitz
arcs.ac.at]
Sent: Thursday, April 04, 2002 8:55 AM
To: php-general
lists.php.net
Subject: [PHP] Logfile of Mysql Queries?
Is there any possibility of logging all the Insert, Update and Delete Commands to a database of Mysql-Server? I would like to fetch them with php and display them in HTML.
thanxs martin
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Kind of but not quite. Was wondering if PHP help the actual full url.
Ben
At 15:26 04/04/2002, you wrote:
>On Thursday 04 April 2002 21:56, Ben Edwards wrote: > > Is there a way I can get the whole URL of the current page for error > > handling/reporting. Also is there a way of getting the previous/referrer > > URL for a similar purpose. > >Have a look at the values inside $HTTP_SERVER_VARS: > > >print_r($HTTP_SERVER_VARS); > > > >-- >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > >/* >"Because he's a character who's looking for his own identity, [He-Man is] >an interesting role for an actor." >-- Dolph Lundgren, "actor" >*/ > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
**************************************************************** * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builder http://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ****************************************************************
attached mail follows:
$REQUEST_URI?
If it's not the full you can complement with $HTTP_HOST or similar.
--Julio Nobrega.
Um dia eu chego lá: http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Ben Edwards" <ben
videonetwork.org> wrote in message news:5.1.0.14.2.20020404155516.029ef140
post.gifford.co.uk... > Kind of but not quite. Was wondering if PHP help the actual full url. > > Ben > > At 15:26 04/04/2002, you wrote: > > >On Thursday 04 April 2002 21:56, Ben Edwards wrote: > > > Is there a way I can get the whole URL of the current page for error > > > handling/reporting. Also is there a way of getting the previous/referrer > > > URL for a similar purpose. > > > >Have a look at the values inside $HTTP_SERVER_VARS: > > > > > >print_r($HTTP_SERVER_VARS); > > > > > > > >-- > >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > > >/* > >"Because he's a character who's looking for his own identity, [He-Man is] > >an interesting role for an actor." > >-- Dolph Lundgren, "actor" > >*/ > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > **************************************************************** > * Ben Edwards +44 (0)117 9400 636 * > * Critical Site Builder http://www.criticaldistribution.com * > * online collaborative web authoring content management system * > * i-Contact Progressive Video http://www.videonetwork.org * > * Smashing the Corporate image http://www.subvertise.org * > * Bristol Indymedia http://bristol.indymedia.org * > * Bristol's radical news http://www.bristle.org.uk * > * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * > **************************************************************** >
attached mail follows:
On Thursday 04 April 2002 22:56, Ben Edwards wrote: > Kind of but not quite. Was wondering if PHP help the actual full url.
If you look closely you can concatenate two of those values together to get what you want.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* The good life was so elusive It really got me down I had to regain some confidence So I got into camouflage */
attached mail follows:
Don't seem to exist, neither douse REQUEST_URL?
At 16:13 04/04/2002, Julio Nobrega Trabalhando wrote:
>$REQUEST_URI?
>
> If it's not the full you can complement with $HTTP_HOST or similar.
>
>--
>
>Julio Nobrega.
>
>Um dia eu chego lá:
>http://sourceforge.net/projects/toca
>
>Ajudei? Salvei? Que tal um presentinho?
>http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
>
>
>"Ben Edwards" <ben
videonetwork.org> wrote in message
>news:5.1.0.14.2.20020404155516.029ef140
post.gifford.co.uk...
> > Kind of but not quite. Was wondering if PHP help the actual full url.
> >
> > Ben
> >
> > At 15:26 04/04/2002, you wrote:
> >
> > >On Thursday 04 April 2002 21:56, Ben Edwards wrote:
> > > > Is there a way I can get the whole URL of the current page for error
> > > > handling/reporting. Also is there a way of getting the
>previous/referrer
> > > > URL for a similar purpose.
> > >
> > >Have a look at the values inside $HTTP_SERVER_VARS:
> > >
> > >
> > >print_r($HTTP_SERVER_VARS);
> > >
> > >
> > >
> > >--
> > >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > >
> > >/*
> > >"Because he's a character who's looking for his own identity, [He-Man is]
> > >an interesting role for an actor."
> > >-- Dolph Lundgren, "actor"
> > >*/
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > ****************************************************************
> > * Ben Edwards +44 (0)117 9400 636 *
> > * Critical Site Builder http://www.criticaldistribution.com *
> > * online collaborative web authoring content management system *
> > * i-Contact Progressive Video http://www.videonetwork.org *
> > * Smashing the Corporate image http://www.subvertise.org *
> > * Bristol Indymedia http://bristol.indymedia.org *
> > * Bristol's radical news http://www.bristle.org.uk *
> > * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 *
> > ****************************************************************
> >
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
**************************************************************** * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builder http://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ****************************************************************
attached mail follows:
Okay, just phpinfo(); and use the variables. You can see whetever you will need there for url script construction. If you need, setup two pages with phpinfo() and a link between them so you can check for Referers (the Last Url you need)
--Julio Nobrega.
Um dia eu chego lá: http://sourceforge.net/projects/toca
attached mail follows:
Hello,
I'm using recursive functions and call a function from inside another one. The problem is that when I call the Exit(); function the whole program is aborted. How can I quit just the current function, not the whole program ?
<example> Function One() { If (!$var) { Exit(); } }
Function Two(); { One(); //This line kills the program Print("Hello"); //This is not printed =( } </example>
TIA,
______________________ Mauricio Cuenca
attached mail follows:
return maybe.
At 16:24 04/04/2002, Mauricio Cuenca wrote:
>Hello, > >I'm using recursive functions and call a function from inside another one. >The problem is that when I call the Exit(); function the whole program is >aborted. How can I quit just the current function, not the whole program ? > ><example> >Function One() >{ > If (!$var) { Exit(); } >} > >Function Two(); >{ > One(); //This line kills the program > Print("Hello"); //This is not printed =( >} ></example> > >TIA, > >______________________ >Mauricio Cuenca > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
**************************************************************** * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builder http://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ****************************************************************
attached mail follows:
Good day,
As the documentation says, exit() will end your script.
http://www.php.net/manual/en/function.exit.php
Use return() to end a function.
============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948
-----Original Message-----
From: Mauricio Cuenca [mailto:fauro
mindless.com]
Sent: Thursday, April 04, 2002 8:25 AM
To: php-general
lists.php.net
Subject: [PHP] Exit();
Hello,
I'm using recursive functions and call a function from inside another one. The problem is that when I call the Exit(); function the whole program is aborted. How can I quit just the current function, not the whole program ?
<example> Function One() { If (!$var) { Exit(); } }
Function Two(); { One(); //This line kills the program Print("Hello"); //This is not printed =( } </example>
TIA,
______________________ Mauricio Cuenca
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
return; stops a function execution.
Function One() { If (!$var) { return; } }
--Julio Nobrega.
Um dia eu chego lá: http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Mauricio Cuenca" <fauro
mindless.com> wrote in message news:00f501c1dbec$d8f11e90$0201a8c0
telesat56evlre... > Hello, > > I'm using recursive functions and call a function from inside another one. > The problem is that when I call the Exit(); function the whole program is > aborted. How can I quit just the current function, not the whole program ? > > <example> > Function One() > { > If (!$var) { Exit(); } > } > > Function Two(); > { > One(); //This line kills the program > Print("Hello"); //This is not printed =( > } > </example> > > TIA, > > ______________________ > Mauricio Cuenca >
attached mail follows:
Count me as AGAINST, because <<< is heredoc operator
-----Original Message-----
From: Jason Greene [mailto:jason
inetgurus.net]
Sent: Thursday, April 04, 2002 9:43 AM
To: PHP-Dev; Andi Gutmans; Zend Engine 2
Subject: [Zend Engine 2] Unsigned Right(Maybee Left) Shift [Again]
So far, after posting to php-general and php-dev about whether or not we should add a <<< operator to match the >>> operator, I have received 4 total responses.
2 for it 2 against it
Reasons expressed for it ------------------------ Consistent Doesn't hurt anything
Reasons expressed against it ---------------------------- It is the heredoc operator Not really needed Could be confusing
I am personally neutral, because I don't think it matters either way; however, I need a tie breaker.
Anyone want to help me out here?
Thanks
-- Jason T. Greene Internet Software Engineer<jason
inetgurus.net> <jason
php.net> <jason.greene
tdstelecom.com>
Use PHP: http://www.php.net
attached mail follows:
Hi all, I'm new to the list (and php too...) I noticed that using the binary distribution of php_oci8.dll with oracle 8.0.5 leads to an error becouse of the lob functions (not supplied with 8.0.5 oci or not implemented in oracle 8.0.5 ?), so that I had to recompile the lib putting somewhere in php_oci8.h #undef HAVE_OCI8_TEMP_LOB
This manner I have an oci lib without lob functions (I don't know what they are (large object bxxx ???), so maybe I don't need them...).
I'd like to know if I'm doing well or the oci lib are supported only using oracle 8.1.7 client. I didn't find anything in docs or src. Tx, andrea
attached mail follows:
At 04.04.2002 18:05, you wrote: > >Hi all, I'm new to the list (and php too...) >I noticed that using the binary distribution of php_oci8.dll with oracle >8.0.5 leads to an error becouse of the lob functions (not supplied with >8.0.5 oci or not implemented in oracle 8.0.5 ?), so that I had to recompile >the lib putting somewhere in php_oci8.h >#undef HAVE_OCI8_TEMP_LOB > >This manner I have an oci lib without lob functions (I don't know what they >are (large object bxxx ???), so maybe I don't need them...). > >I'd like to know if I'm doing well or the oci lib are supported only using >oracle 8.1.7 client. I didn't find anything in docs or src. >Tx, >andrea Wrong List, check out http://metalink.oracle.com maybe they could help you. Or as everywhere noted "google is your friend" Oliver
attached mail follows:
I am trying to define variables through an anchor tag to retrive data from MySQL, When the script runs it displays Array. I am running WIN2K and IIS 5
echo "<a href=location.php?location=2>Camp Street Cafe</a>";
Here is the script that is called.
<?php
$db = mysql_connect("localhost", "", "") or die ("Could not connect to Localhost"); mysql_select_db ("ETM", $db) or die ("Could not connect to the Database");
$table = "locations"; $location = ($_REQUEST["location"]); $query = "Select * from $table where Location_ID = $location"; $result= mysql_query($query); $Location_Info = mysql_fetch_row($result);
echo "<p>$Location_Info";
?>
attached mail follows:
change: $Location_Info = mysql_fetch_row($result);
to: $row = mysql_fetch_array($result); $Location_Info = $row['fieldname'];
replace "fieldname" with the real name of your database field
-----Original Message-----
From: Jason Tobias [mailto:jtobias
risecom.net]
Sent: Thursday, April 04, 2002 9:29 AM
To: php-db
lists.php.net; php-general
lists.php.net;
php-windows
lists.php.net
Subject: [PHP] New to PHP Need Help
I am trying to define variables through an anchor tag to retrive data from MySQL, When the script runs it displays Array. I am running WIN2K and IIS 5
echo "<a href=location.php?location=2>Camp Street Cafe</a>";
Here is the script that is called.
<?php
$db = mysql_connect("localhost", "", "") or die ("Could not connect to Localhost"); mysql_select_db ("ETM", $db) or die ("Could not connect to the Database");
$table = "locations"; $location = ($_REQUEST["location"]); $query = "Select * from $table where Location_ID = $location"; $result= mysql_query($query); $Location_Info = mysql_fetch_row($result);
echo "<p>$Location_Info";
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello, The result $Location_info is an array.So you've got the answer 'Array'. Consider that you requested MySQL to fetch several columns through SQL "Select * from...". So the result was an array. You can get the content of the result like $Location_info[0],$Location_ info[2],....and so on.
Hiroshi Ayukawa http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php
>I am trying to define variables through an anchor tag to retrive data from >MySQL, When the script runs it displays Array. I am running WIN2K and IIS >5 > >echo "<a href=location.php?location=2>Camp Street Cafe</a>"; > >Here is the script that is called. > ><?php > >$db = mysql_connect("localhost", "", "") > or die ("Could not connect to Localhost"); >mysql_select_db ("ETM", $db) > or die ("Could not connect to the Database"); > >$table = "locations"; >$location = ($_REQUEST["location"]); >$query = "Select * from $table where Location_ID = $location"; >$result= mysql_query($query); >$Location_Info = mysql_fetch_row($result); > >echo "<p>$Location_Info"; > >?> > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Firstly, cross-posting like this is a huge no-no, please don't do that again.
> When the script runs it displays Array.
Printing arrays directly will do that. Logically speaking, how do you expect PHP to know what value to get here? You are SELECTing many.
> I am running WIN2K and IIS 5
I'm sorry ;)
> echo "<a href=location.php?location=2>Camp Street Cafe</a>"; > > Here is the script that is called. > > <?php > > $db = mysql_connect("localhost", "", "") > or die ("Could not connect to Localhost"); > mysql_select_db ("ETM", $db) > or die ("Could not connect to the Database");
If you start running into problems, please consider mysql_error()
> $table = "locations"; > $location = ($_REQUEST["location"]);
No need for the () here.
> $query = "Select * from $table where Location_ID = $location";
Notice how you're selecting many columns here, not just one.
> $result= mysql_query($query); > $Location_Info = mysql_fetch_row($result);
Looking in the manual, the entry for mysql_fetch_row tells us:
mysql_fetch_row -- Get a result row as an enumerated array array mysql_fetch_row ( resource result)
So it returns an array. If you prefer the _row format then continue to use it, for example using list():
list($id, $name, $email) = mysql_fetch_row($result);
Or just:
$row = mysql_fetch_row($result); print $row[0]; // This is an enumerated array (numerical) print $row[1];
Or use a function like mysql_fetch_assoc instead:
$row = mysql_fetch_assoc($result); print $row['id']; // with id being a column name // selected via the query print $row['name'];
And lastly, if you're not going to use all the data, don't SELECT * of it.
Good start, keep it going :)
Regards, Philip Olson
attached mail follows:
Maybe a simple question. But can one file contain 2 or more classes?? Thanks
attached mail follows:
yes
-----Original Message-----
From: Gerard Samuel [mailto:gsam
trini0.org]
Sent: Thursday, April 04, 2002 10:43 AM
To: PHP
Subject: [PHP] Classes??
Maybe a simple question. But can one file contain 2 or more classes?? Thanks
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Yeah, sure.
-Steve
On Thursday, April 4, 2002, at 10:42 AM, Gerard Samuel wrote:
> Maybe a simple question. > But can one file contain 2 or more classes?? > Thanks > > > -- PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
On Thu, 4 Apr 2002, Gerard Samuel wrote: > Maybe a simple question. > But can one file contain 2 or more classes??
A general solution to questions like this:
Try it and see.
miguel
attached mail follows:
Yes true, but I have only written one class 3 weeks ago, and now Im about to go deep into it. I wasn't sure like down the line like 2 months from now that Im unable to extend it etc, because I didn't follow guidelines...
Miguel Cruz wrote: > On Thu, 4 Apr 2002, Gerard Samuel wrote: > >>Maybe a simple question. >>But can one file contain 2 or more classes?? > > > A general solution to questions like this: > > Try it and see. > > miguel > >
attached mail follows:
Are you using unicode? I don't know the answer for you - maybe check the mysql site - but I'd be interested in hearing an answer as well if anyone has one.
-Steve
On Thursday, April 4, 2002, at 12:11 AM, Dhaval Desai wrote:
> Hello people, > > I am making a bilingual website English/Arabic. I am facing some > problem with this. The problem is that I am not able to insert arabic > lanaguage characters ionto Mysql databse. It gets junk > characters...when I try to display it... > > Thank You > > Best Regards, > Dhaval Desai > > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > -- PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi,
Can anyone point out the simplest and shall I say the primitive search engine script on the NET somewhere (i.e. open source of tutorial)
I need an engine that will serve table in mysql database with three fields, ULRid, URLdescription, URLcategory.
Functionality needed is to search through the table, sort by category, and stuff. I'd rather say directory structure instead of search engine, much like yahoo or dmoz open source.
Thanks, Vlad kulchitski.com
attached mail follows:
I meant to say 'open source OR tutorial' instead of 'open source of tutorial'
Sorry
-----Original Message-----
From: Vladislav Kulchitski
Sent: Thursday, April 04, 2002 12:14 PM
To: php-general
lists.php.net
Subject: [PHP]
Hi,
Can anyone point out the simplest and shall I say the primitive search engine script on the NET somewhere (i.e. open source of tutorial)
I need an engine that will serve table in mysql database with three fields, ULRid, URLdescription, URLcategory.
Functionality needed is to search through the table, sort by category, and stuff. I'd rather say directory structure instead of search engine, much like yahoo or dmoz open source.
Thanks, Vlad kulchitski.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I seem to have configuration problems....i just can't seem to get session variables written to in files under win2000, NTFS w/ Apache and PHP......i've already done everything from session_start() on every page to making var global....anybody can help?? thanks....btw, i got the same system on a Linux box running apache and php and it works fine....
attached mail follows:
On Thursday 04 April 2002 19:15, Lee, Ford wrote: > I seem to have configuration problems....i just can't seem to get > session variables written to in files under win2000, NTFS w/ Apache and > PHP......i've already done everything from session_start() on every page > to making var global....anybody can help?? thanks....btw, i got the > same system on a Linux box running apache and php and it works fine....
this is a bug in PHP 4.1.2 on win http://bugs.php.net/?id=16423 i am also looking for a workaround :-(
-- Wolfram... translating template engine .... http://sf.net/projects/simpletpl
... authentication system .... http://sf.net/projects/auth
attached mail follows:
I've even tried the new php4apache.dll that was on that bug list and still did not work. I'm suprised nobody else has this session problem on Windows 2000 and Apache...
-----Original Message-----
From: Wolfram Kriesing [mailto:lists
kriesing.de]
Sent: Thursday, April 04, 2002 12:21 PM
To: Lee, Ford; php-general
lists.php.net
Subject: Re: [PHP] session variables
On Thursday 04 April 2002 19:15, Lee, Ford wrote: > I seem to have configuration problems....i just can't seem to get > session variables written to in files under win2000, NTFS w/ Apache and > PHP......i've already done everything from session_start() on every page > to making var global....anybody can help?? thanks....btw, i got the > same system on a Linux box running apache and php and it works fine....
this is a bug in PHP 4.1.2 on win http://bugs.php.net/?id=16423 i am also looking for a workaround :-(
-- Wolfram... translating template engine .... http://sf.net/projects/simpletpl
... authentication system .... http://sf.net/projects/auth
attached mail follows:
Apparently under the bug report database for bug number 16043, my exactly problem was described. According to the PHP team, this windows/apache1.3.23/php4.1.2 session not writing to file bug has been fixed in the 4.2.0RC1 binaries. I've patched my php4apache.dll with the ones from 4.2.0RC1 AND it still doesn't work!!! Anyone who used 4.2.0RC1 came across this problem and made it work?
-----Original Message-----
From: SHEETS,JASON (Non-HP-Boise,ex1) [mailto:jason_sheets
non.hp.com]
Sent: Thursday, April 04, 2002 12:43 PM
To: Lee, Ford
Subject: RE: [PHP] session variables
This isn't limited to windows 2000, I've seen it on nt and xp as well. I believe it is just a php on windows bug in general. I've heard 4.1.1 was not broken however 4.1.1 has a security hole, if you are just using windows as a test/development platform you may consider trying 4.1.1.
Jason
-----Original Message-----
From: Lee, Ford [mailto:LeeF
sdc-moses.com]
Sent: Thursday, April 04, 2002 10:33 AM
To: Wolfram Kriesing
Cc: php-general
lists.php.net
Subject: RE: [PHP] session variables
I've even tried the new php4apache.dll that was on that bug list and still did not work. I'm suprised nobody else has this session problem on Windows 2000 and Apache...
-----Original Message-----
From: Wolfram Kriesing [mailto:lists
kriesing.de]
Sent: Thursday, April 04, 2002 12:21 PM
To: Lee, Ford; php-general
lists.php.net
Subject: Re: [PHP] session variables
On Thursday 04 April 2002 19:15, Lee, Ford wrote: > I seem to have configuration problems....i just can't seem to get > session variables written to in files under win2000, NTFS w/ Apache and > PHP......i've already done everything from session_start() on every page > to making var global....anybody can help?? thanks....btw, i got the > same system on a Linux box running apache and php and it works fine....
this is a bug in PHP 4.1.2 on win http://bugs.php.net/?id=16423 i am also looking for a workaround :-(
-- Wolfram... translating template engine .... http://sf.net/projects/simpletpl
... authentication system .... http://sf.net/projects/auth
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I was wondering If I made a database to store a list of IP CIDR in a database to block, how I could take an IP of a customer coming in and find a quick way if it matches a blocked IP in the database?
For instance, in the database I would store something like this:
208.219.20.0/24
Then if someone came in on 208.219.20.22, it would know that the entire class C was blocked. Is there an easy way to deal with this type of thing in PHP/MySQL?
attached mail follows:
On Thu, 4 Apr 2002, Devin Atencio wrote: > I was wondering If I made a database to store a list of IP CIDR > in a database to block, how I could take an IP of a customer coming > in and find a quick way if it matches a blocked IP in the database? > > For instance, in the database I would store something like this: > > 208.219.20.0/24 > > Then if someone came in on 208.219.20.22, it would know that the entire > class C was blocked. Is there an easy way to deal with this type of > thing in PHP/MySQL?
Here's a little (tested just once but I'm guessing it's sound) example of IP/subnet checking in PHP (converting between /24 and 255.255.255.0 notation is left as a homework exercise). Store them as INTs in MySQL and you can use the & operator when selecting. However I don't think that MySQL yet supports bitwise indexes so no promises on speed.
------------------
<?
if ($_REQUEST['go']) { $subnet = dotted_to_int($_REQUEST['subnet']); $netmask = dotted_to_int($_REQUEST['netmask']); $ip = dotted_to_int($_REQUEST['ip']); if (($ip & $netmask) == $subnet) print 'Address is in range'; else print 'Address out of range'; }
function dotted_to_int($addr) { $octets = explode('.', ereg_replace('[^0-9\.]', '', $addr)); return $octets[3] + (256 * $octets[2]) + (65536 * $octets[1]) + (16777216 * $octets[0]); } ?>
<form method="post" action="<?= $PHP_SELF ?>"> Subnet: <input name="subnet"> <br>Netmask: <input name="netmask"> <br>IP to check: <input name="ip"> <br><input name="go" value="Check it" type="submit"></form>
------------------
miguel
attached mail follows:
hi,
got a question on the usage of include:
when i do something like this:
<? include('http://www.myurl.com'); ?>
where my php file is located under the same directory structure of www.my.url.com, the browse seems keep on loading until it returns a blank page. does this mean that php can't include any file located in the same directory structure of itself? or is it more like a configuration problem?
here's my configure command from phpinfo(), if this helps:
'./configure' '--prefix=/opt/third-party/depot/Linux-2.2c2.1-i686/php-4.0.5' '--with-apache=/workplace/dpd/btp/apache_1.3.20' '--enable-bcmath' '--with-config-file-path=/opt/third-party/depot/Linux-2.2c2.1-i686/php-4.0.5 /lib' '--enable-exif' '--enable-track-vars' '--with-calendar=shared' '--enable-safe-mode' '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--with-ldap'
thank you!
/bw
attached mail follows:
On Thu, 4 Apr 2002, Boris Wong wrote: > got a question on the usage of include: > > when i do something like this: > > <? include('http://www.myurl.com'); ?> > > where my php file is located under the same directory structure of > www.my.url.com, the browse seems keep on loading until it returns a blank > page. does this mean that php can't include any file located in the same > directory structure of itself? or is it more like a configuration problem?
Um, does the page at http://www.myurl.com/ by any chance execute that include statement? Because then you have an infinite recursion.
I of course can't really figure out what you're talking about because you have made up domains like www.myurl.com and www.my.url.com and I don't know whether they're different because you weren't paying attention or because you meant them to be different. Use real data.
miguel
attached mail follows:
sorry, my bad. i meant the two urls are the same. they're intranet pages so giving out real data won't be useful.
>Um, does the page at http://www.myurl.com/ by any chance execute that >include statement? Because then you have an infinite recursion.
that's not likely the case.
i also noticed that the 'Virtual Directory Support' is disabled. thought this could be the root of the problem?
/bw
-----Original Message-----
From: Miguel Cruz [mailto:mnc
stoic.net]
Sent: Thursday, April 04, 2002 10:10 AM
To: Boris Wong
Cc: php-general
lists.php.net
Subject: Re: [PHP] configure problem?
On Thu, 4 Apr 2002, Boris Wong wrote: > got a question on the usage of include: > > when i do something like this: > > <? include('http://www.myurl.com'); ?> > > where my php file is located under the same directory structure of > www.my.url.com, the browse seems keep on loading until it returns a blank > page. does this mean that php can't include any file located in the same > directory structure of itself? or is it more like a configuration problem?
Um, does the page at http://www.myurl.com/ by any chance execute that include statement? Because then you have an infinite recursion.
I of course can't really figure out what you're talking about because you have made up domains like www.myurl.com and www.my.url.com and I don't know whether they're different because you weren't paying attention or because you meant them to be different. Use real data.
miguel
attached mail follows:
On Thu, 4 Apr 2002, Boris Wong wrote: > sorry, my bad. i meant the two urls are the same. they're intranet pages so > giving out real data won't be useful.
Yeah, it's not so much that I have any interest in visiting that page, as that the process of making stuff up always introduces extra confusion.
>> Um, does the page at http://www.myurl.com/ by any chance execute that >> include statement? Because then you have an infinite recursion. > > that's not likely the case.
I'd check your server's error log just to be sure. Also, try including that same address from a test page outside its directory structure, just to see what happens.
miguel
attached mail follows:
I get an error with the follow query. There is a field "user" in both tables, tifrequest & tifexpire. Can anybody see what's wrong with it? Thanks.
SELECT * FROM tifrequest LEFT JOIN USING(user) WHERE tifexpire.exp_date >=2002-04-04
attached mail follows:
change to: SELECT * FROM tifrequest LEFT JOIN USING(user) WHERE tifexpire.exp_date >="2002-04-04"
It helps if you provide the error message. Also, this would have been found when you entered it directly into the mysql command line prompt.
-----Original Message-----
From: ROBERT MCPEAK [mailto:RMCPEAK
jhuccp.org]
Sent: Thursday, April 04, 2002 11:45 AM
To: php-general
lists.php.net
Subject: [PHP] mySQL join query error
I get an error with the follow query. There is a field "user" in both tables, tifrequest & tifexpire. Can anybody see what's wrong with it? Thanks.
SELECT * FROM tifrequest LEFT JOIN USING(user) WHERE tifexpire.exp_date >=2002-04-04
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Thu, 4 Apr 2002, ROBERT MCPEAK wrote: > I get an error with the follow query. There is a field "user" in both > tables, tifrequest & tifexpire. Can anybody see what's wrong with it? > Thanks. > > SELECT * FROM tifrequest LEFT JOIN USING(user) WHERE tifexpire.exp_date > >=2002-04-04
You didn't tell it which table to join to.
select * from tifrequest left join tifexpire using (user) where tifexpire.exp_date>=2002-04-04
miguel
attached mail follows:
btw, the reason i want to use include() is that i have a cgi script under the same directory structure but i don't want to use exec() since this command can't execute the cgi well enough (for one thing, the cgi script doesn't work well when i include "use warnings;" or create an object)....
and including the cgi script won't execute it so this won't work.
i'm thinking of including the cgi script via http like:
include ('http://www.myurl.com/hello.cgi')
but the browser keeps on loading the page and returns a blank page eventually.
contrastly, including a cgi script from other domains works just fine.
/bw
-----Original Message-----
From: Boris Wong [mailto:borisw
amazon.com]
Sent: Thursday, April 04, 2002 9:32 AM
To: php-general
lists.php.net
Subject: [PHP] configure problem?
hi,
got a question on the usage of include:
when i do something like this:
<? include('http://www.myurl.com'); ?>
where my php file is located under the same directory structure of www.my.url.com, the browse seems keep on loading until it returns a blank page. does this mean that php can't include any file located in the same directory structure of itself? or is it more like a configuration problem?
here's my configure command from phpinfo(), if this helps:
'./configure' '--prefix=/opt/third-party/depot/Linux-2.2c2.1-i686/php-4.0.5' '--with-apache=/workplace/dpd/btp/apache_1.3.20' '--enable-bcmath' '--with-config-file-path=/opt/third-party/depot/Linux-2.2c2.1-i686/php-4.0.5 /lib' '--enable-exif' '--enable-track-vars' '--with-calendar=shared' '--enable-safe-mode' '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--with-ldap'
thank you!
/bw
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I'm trying to find a way to insert the cvs version into a footer of my php files so I can simple ask the client to tell me the "version" number at the bottom of the page. I can then send an update or even better have the browser request an update for the file.
-- Jeff D. Hamann Hamann, Donald & Associates, Inc. PO Box 1421 Corvallis, Oregon USA 97339-1421 Bus. 541-753-7333 Cell. 541-740-5988 jeff_hamannhamanndonald.com www.hamanndonald.com
attached mail follows:
print("<p>$Revision: $</p>");
The next time you commit a file with this in it, the $Revision:$ will be replaced by $Revision: 1.38$ if you version is in fact 1.38.
On Thu, 4 Apr 2002, Jeff D. Hamann wrote:
>-I'm trying to find a way to insert the cvs version into a footer of my php
>-files so I can simple ask the client to tell me the "version" number at the
>-bottom of the page. I can then send an update or even better have the
>-browser request an update for the file.
>-
>---
>-Jeff D. Hamann
>-Hamann, Donald & Associates, Inc.
>-PO Box 1421
>-Corvallis, Oregon USA 97339-1421
>-Bus. 541-753-7333
>-Cell. 541-740-5988
>-jeff_hamann
hamanndonald.com
>-www.hamanndonald.com
>-
>-
>-
>-
>---
>-PHP General Mailing List (http://www.php.net/)
>-To unsubscribe, visit: http://www.php.net/unsub.php
>-
**************************************
John Huggins VANet
jhuggins
va.net
http://www.va.net/
**************************************
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]