php-general Digest 17 Mar 2006 05:38:31 -0000 Issue 4020
Topics (messages 232040 through 232079):
Re: help with setting menu styles with PHP
232040 by: tedd
232053 by: Anthony Ettinger
Re: How does one obtain the resolution of an image in PHP?
232041 by: Simon M. Campden-Main
232044 by: tedd
232045 by: tedd
232049 by: Simon M. Campden-Main
232050 by: John Hinton
232051 by: Richard Lynch
Re: GD2 gif resizing problem
232042 by: John Nichel
232043 by: tedd
232052 by: Al
yahoo webshosting
232046 by: pfancy
232047 by: Jay Blanchard
232048 by: Anthony Ettinger
232055 by: pfancy
Two functions, one javascript, one php, one on_click event?
232054 by: Jay Blanchard
232057 by: Satyam
Re: Two functions, one javascript, one php, one on_click event? [SOLVED]
232056 by: Jay Blanchard
adding code and beginning and end without includes
232058 by: blackwater dev
232059 by: Jochem Maas
232060 by: Claudio Corlatti
Re: php 5 installation problem
232061 by: Anthony Ettinger
232062 by: Miles Thompson
232064 by: Anthony Ettinger
232069 by: Miles Thompson
232079 by: - Edwin -
IE quirk
232063 by: PHP
232065 by: Jay Blanchard
VxWorks PHP port??
232066 by: Shawn N
232067 by: Shawn N
MySQL NOT IN Query not working
232068 by: Kevin Murphy
232070 by: Miles Thompson
232071 by: Ligaya Turmelle
232072 by: Kevin Murphy
Best practice to set up register_globals locally?
232073 by: Nicolas Verhaeghe
232074 by: Chris
Best practice to set up register_globals
232075 by: Nicolas Verhaeghe
232076 by: Curt Zirzow
Re: setcookie security concerns [medium]
232077 by: Rafael
session_cache_expire()
232078 by: suresh kumar
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:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
http://www.inspired-evolution.com/About_Me.php
What I want to do next is to change the menu from being hard coded on all of
my pages to being an include making the menu more manageable. The stumbling
block is I want to be able to keep the CSS functionality where you have the
active indicator which has different CSS for the link of the page you are
on. I have seen this done with PHP before with something like IF on active
page use this style ELSE use this style. Can any PHP gurus assist me in
coding something like this?
I don't believe it is too difficult, but beyond by scope right at the
moment.
It's not a php solution, but you can change it to one easy enough.
This will give you the idea.
http://www.sperling.com/examples/menu_aware/
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
I did something similar on my page. I did a simple comparison in a
loop through the menu DOM,
foreach ($nodeList as $node){
if ($currentPage eq $nodeHref) { //set class attribute = 'active'; }
}
On 3/16/06, tedd <[EMAIL PROTECTED]> wrote:
> >http://www.inspired-evolution.com/About_Me.php
> >
> >What I want to do next is to change the menu from being hard coded on all of
> >my pages to being an include making the menu more manageable. The stumbling
> >block is I want to be able to keep the CSS functionality where you have the
> >active indicator which has different CSS for the link of the page you are
> >on. I have seen this done with PHP before with something like IF on active
> >page use this style ELSE use this style. Can any PHP gurus assist me in
> >coding something like this?
> >
> >I don't believe it is too difficult, but beyond by scope right at the
> >moment.
>
> It's not a php solution, but you can change it to one easy enough.
> This will give you the idea.
>
> http://www.sperling.com/examples/menu_aware/
>
> tedd
> --
> --------------------------------------------------------------------------------
> http://sperling.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
--- End Message ---
--- Begin Message ---
Thank you for your response, Tedd.
T> There was a discussion on this a few weeks back -- you might look through
the archives.
I'm reasonably certain I saw the thread but it was no help. I will go back
and review it in case I missed something.
T> However, the bottom line was that images (other than exif notations) do
not
contain any resolution information because the resolution of any image is up
to
the method you wish to view it.
Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes
up
with PPI (Image - Image information). I have several thousand scanned
images
with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint
Shop
Pro) and want to discard, or more likely tag as rejected, any that suffer a
resolution of less than 150 PPI. As you might imagine, I find the thought
of
doing it manually with Paint Shop Pro repugnant.
T> For example, if you take an image that is 1000 x 1000 pixels and wish
to view it at 72 dpi, then the image size will be 13.8 x 13.8 inches.
If you want to view it at 300 dpi, then the image size will be 3.33
by 3.33 inches in size.
Understand?
I think so, but I am a bit dense. I'm not concerned with image size but
rather
native resolution. Thanks again for taking the time.
Simon
[EMAIL PROTECTED]
"tedd" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >Good morning, folks.
>>
>>Can any one direct me to a snippet or suggest an approach to obtaining the
>>resolution of an image [file] with PHP. exif_read_data() is great if the
>>image
>>was taken with a camera that is exif compliant, but is no help with my
>>scanned
>>images. getimagesize() gives me height and width - not much help that I
>>can
>>see. I want ppi! I've no doubt that this is another case where the answer
>>is
>>painfully obvious and my mind to dull, but I've spent the better part of
>>the
>>day searching usenet groups and the PHP docs and come up with naught.
>>I'm running the current Cent OS distribution of EL, PHP Version 4.3.9
>>with,
>>of
>>course, GD support. Any suggestions would be most appreciated.
>>Thank you.
>>Simon
>
> Simon:
>
> There was a discussion on this a few weeks back -- you might look through
> the archives.
>
> However, the bottom line was that images (other than exif notations) do
> not contain any resolution information because the resolution of any image
> is up to the method you wish to view it.
>
> For example, if you take an image that is 1000 x 1000 pixels and wish to
> view it at 72 dpi, then the image size will be 13.8 x 13.8 inches. If you
> want to view it at 300 dpi, then the image size will be 3.33 by 3.33
> inches in size.
>
> Understand?
>
> tedd
> --
> --------------------------------------------------------------------------------
> http://sperling.com
--- End Message ---
--- Begin Message ---
Simon:
Thank you for your response, Tedd.
No problem, glad to help if I can.
I think so, but I am a bit dense. I'm not concerned with image size but
rather
native resolution. Thanks again for taking the time.
Simon
Yes, but that's a different question.
On one hand, you have an image that can be presented in numerous resolutions.
On the other hand, how was the image first obtained?
Some images contain that information, but it's defined by the device
that captured the image, for example:
http://www.exif.org/samples.html
In that data set is a host of other information, such as
shutter-speed, flash, focal-length, camera make, model, and such.
Check out:
http://www.digicamhelp.com/what-is-exif/
If you want to access these data via php, check out:
http://us3.php.net/exif
But understand, not all images contain that information.
HTH's
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Simon:
One more link:
http://www.weberdev.com/Manuals/PHP/function.exif-read-data.html
There's code there.
HTH's
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Thanks again, Tedd.
I've checked out the links but still no luck. As I stated (Or implied.)
in my first post, I have played with exif_read_data() but it is of little
use with the scanned images I've examined. You can see results of my
experiments with exif_read_data() and getimagesize() at:
http://www.campden-main.com/~orchids/test/test_exif.php
You'll note that if I simply divide the dimensions in pixels by the
dimensions in inches, I'll get the resolution in PPI. Perhaps the solution
to my problem lies in simply finding a way to obtain the dimensions in
inches
(As either exif_read_data() or getimagesize() will give me the dimensions in
pixels.) and just do the math.
Again, thanks for your help!
Simon
[EMAIL PROTECTED]
"tedd" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Simon:
>
>>Thank you for your response, Tedd.
>
> No problem, glad to help if I can.
>
>>I think so, but I am a bit dense. I'm not concerned with image size but
>>rather
>>native resolution. Thanks again for taking the time.
>>Simon
>
> Yes, but that's a different question.
>
> On one hand, you have an image that can be presented in numerous
> resolutions.
>
> On the other hand, how was the image first obtained?
>
> Some images contain that information, but it's defined by the device that
> captured the image, for example:
>
> http://www.exif.org/samples.html
>
> In that data set is a host of other information, such as shutter-speed,
> flash, focal-length, camera make, model, and such. Check out:
>
> http://www.digicamhelp.com/what-is-exif/
>
> If you want to access these data via php, check out:
>
> http://us3.php.net/exif
>
> But understand, not all images contain that information.
>
> HTH's
>
> tedd
>
> --
> --------------------------------------------------------------------------------
> http://sperling.com
--- End Message ---
--- Begin Message ---
Simon M. Campden-Main wrote:
Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes
up
with PPI (Image - Image information). I have several thousand scanned
images
with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint
Shop
Pro) and want to discard, or more likely tag as rejected, any that suffer a
resolution of less than 150 PPI. As you might imagine, I find the thought
of
doing it manually with Paint Shop Pro repugnant.
PPI or pixels per inch is a printing term. It has nothing to do with
viewing on a monitor as a monitor's pixel setting is your set
resolution, as in 800x600, 1024x768, 1600x1200.. etc. This is a
constantly debated urban legend. A pixel on a monitor is a pixel...
Pixels per inch are used in the printing world and relates to how many
pixels are used to provide one inch of printed space. Obviously, at
least up to the limits of the printer being used, a high PPI setting
produces a higher quality 'printed' image.
If you don't believe me, use your paint program, change the PPI of an
image and notice how the image doesn't change size on the screen. Also,
do this and switch the image size display back and forth between inches
and pixels.. the pixel count doesn't change, only the inches change..
but again... that's the printing world and has nothing to do with
display on a monitor or webbrowser.
So, an image 10,000pixels by 10,000pixels will be huge on screen. If set
to a resolution of 1000ppi, the image would be printed at 10" x 10", but
you still can't view the whole image on a monitor without zooming out.
If resolution we set to 10,000dpi, the image would print as 1" x 1", but
you still wouldn't be able to view it on a monitor (unless you have an
awesome multi-display setup that can reach 10,000 pixels wide and tall).
That's the bottom line.
So, I keep seeing 'display size' when I'm thinking the term should be
'printed size'.
John Hinton
--- End Message ---
--- Begin Message ---
On Thu, March 16, 2006 1:31 pm, John Hinton wrote:
> Simon M. Campden-Main wrote:
>> Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro
>> comes
>> up
>> with PPI (Image - Image information). I have several thousand
>> scanned
>> images
>> with resolution ranging from 72 PPI up to 1200 PPI (As reported by
>> Paint
>> Shop
>> Pro) and want to discard, or more likely tag as rejected, any that
>> suffer a
>> resolution of less than 150 PPI. As you might imagine, I find the
>> thought
>> of
>> doing it manually with Paint Shop Pro repugnant.
>>
>>
> PPI or pixels per inch is a printing term. It has nothing to do with
> viewing on a monitor as a monitor's pixel setting is your set
> resolution, as in 800x600, 1024x768, 1600x1200.. etc. This is a
> constantly debated urban legend. A pixel on a monitor is a pixel...
But there is SOME kind of data embedded in some images providing the
resolution at which they will/should be printed...
Because *SOMETIMES* http://php.net/getimagesize provides a reasonable
"resolution" in its result array.
'Course, sometimes it's full of crap, too...
Thing is, if you go changing those settings, and then save and then
print the two versions, you'll get quite different printer output.
So OBVIOUSLY the files are different, in some way that printers
understand, even if PHP only half-understands it.
'Twould be nice if PHP was as smart as a printer :-) :-) :-)
YMMV
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
tedd wrote:
<snip>
Here's my take -- gif's are no longer supported by the GD library
because of patent problems. So development of how to deal with them has
been moved to png.
</snip>
Untrue. GIF images *are* supported by the GD library. They were
briefly taken out, but the support was re-enabled in v2.0.28 (almost two
years ago). It is being actively developed, and expanded. They've even
added support for animated GIF's.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
tedd wrote:
<snip>
Here's my take -- gif's are no longer supported by the GD library
because of patent problems. So development of how to deal with them
has been moved to png.
</snip>
Untrue. GIF images *are* supported by the GD library. They were
briefly taken out, but the support was re-enabled in v2.0.28 (almost
two years ago). It is being actively developed, and expanded.
They've even added support for animated GIF's.
--
John C. Nichel IV
John:
That's what I get for reading an "out of date" reference, namely "PHP
Graphics" by Allan Kent el at.
Thanks for the correction.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
John Nichel wrote:
tedd wrote:
<snip>
Here's my take -- gif's are no longer supported by the GD library
because of patent problems. So development of how to deal with them
has been moved to png.
</snip>
Untrue. GIF images *are* supported by the GD library. They were
briefly taken out, but the support was re-enabled in v2.0.28 (almost two
years ago). It is being actively developed, and expanded. They've even
added support for animated GIF's.
Yea; but it does work very well. For example, you can resize a GIF in PSP and get a reasonable size file with good
quality.
--- End Message ---
--- Begin Message ---
Does anyone use yahoo webhosting? I have a question about enabling php ftp
module or something like that.
--- End Message ---
--- Begin Message ---
[snip]
Does anyone use yahoo webhosting? I have a question about enabling php
ftp
module or something like that.
[/snip]
No. I have answers about enabling php ftp module or something like that.
--- End Message ---
--- Begin Message ---
dreamhost.com
On 3/16/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> Does anyone use yahoo webhosting? I have a question about enabling php
> ftp
> module or something like that.
> [/snip]
>
> No. I have answers about enabling php ftp module or something like that.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
--- End Message ---
--- Begin Message ---
""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
Does anyone use yahoo webhosting? I have a question about enabling php
ftp
module or something like that.
[/snip]
No. I have answers about enabling php ftp module or something like that.
<smile> could you help me with that. I do apologize for lack of term, just
wasn't sure how to word it.
--- End Message ---
--- Begin Message ---
I have a button. When the button is clicked it performs a JavaScript
function. I need it to perform a PHP function before it performs the
JavaScript function. Is this a case where I do the PHP function and then
output the JavaScript with PHP? My head hurts.
--- End Message ---
--- Begin Message ---
Unless you want to refresh the page, you would have to use Ajax, called from
JavaScript and take the reply and continue processing via JavaScript.
----- Original Message -----
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Thursday, March 16, 2006 8:51 PM
Subject: [PHP] Two functions, one javascript, one php, one on_click event?
I have a button. When the button is clicked it performs a JavaScript
function. I need it to perform a PHP function before it performs the
JavaScript function. Is this a case where I do the PHP function and then
output the JavaScript with PHP? My head hurts.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
[snip]
I have a button. When the button is clicked it performs a JavaScript
function. I need it to perform a PHP function before it performs the
JavaScript function. Is this a case where I do the PHP function and then
output the JavaScript with PHP? My head hurts.
[/snip]
Yes.
--- End Message ---
--- Begin Message ---
Is there a way to intercept and add code at the beginning and end of every
http request - WITHOUT having to put an include at the top and bottom of
every page?
This is something we need to be app specific so don't really want to do it
globally like chanse the php.ini or something.
Thanks!
--- End Message ---
--- Begin Message ---
blackwater dev wrote:
Is there a way to intercept and add code at the beginning and end of every
http request - WITHOUT having to put an include at the top and bottom of
every page?
This is something we need to be app specific so don't really want to do it
globally like chanse the php.ini or something.
stick this:
php_value auto_prepend_file '/path/to/prepend.inc'
php_value auto_append_file '/path/to/append.inc'
in /path/to/your/app/specific/stuff/.htaccess
Thanks!
--- End Message ---
--- Begin Message ---
search in google
php +prepend +htaccess
http://www.codingforums.com/showthread.php?t=78287
bye bye
Claudio
blackwater dev wrote:
Is there a way to intercept and add code at the beginning and end of every
http request - WITHOUT having to put an include at the top and bottom of
every page?
This is something we need to be app specific so don't really want to do it
globally like chanse the php.ini or something.
Thanks!
--- End Message ---
--- Begin Message ---
dreamhost let's you choose php4 or 5, as I'm sure others do as well.
On 3/16/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
> tedd wrote:
> > Hi gang:
> >
> > I asked my host to install the current versions of php 5 and the
> > following was his answer:
> >
> > "Sorry but php has some issues with cpanel."
>
> cpanel has issues with php5 not the other way around :-)
>
> >
> > Anyone heard of any problems or a work-around?
>
> get a different hosting provider. ;-)
>
> in the mean time why not install a cpoy of apache/php5/mysql/etc
> on your local PC and play with that?
>
> >
> > Thanks.
> >
> > tedd
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
--- End Message ---
--- Begin Message ---
At 05:40 PM 3/16/2006, Anthony Ettinger wrote:
dreamhost let's you choose php4 or 5, as I'm sure others do as well.
<snipped all 'dat stuff>
A little more on dreamhost.
PHP5 is installed as CGI, not Apache module.
Does anyone have any experience with Nexcess.net -- advertisers on back
page of PHP | Architect?
At hub.org you can install anything - virtual server.
Cheers - Miles
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006
--- End Message ---
--- Begin Message ---
On 3/16/06, Miles Thompson <[EMAIL PROTECTED]> wrote:
> At 05:40 PM 3/16/2006, Anthony Ettinger wrote:
>
> >dreamhost let's you choose php4 or 5, as I'm sure others do as well.
> <snipped all 'dat stuff>
>
> A little more on dreamhost.
> PHP5 is installed as CGI, not Apache module.
Is there a drawback to running php5 as CGI?
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
--- End Message ---
--- Begin Message ---
At 06:23 PM 3/16/2006, Anthony Ettinger wrote:
On 3/16/06, Miles Thompson <[EMAIL PROTECTED]> wrote:
> At 05:40 PM 3/16/2006, Anthony Ettinger wrote:
>
> >dreamhost let's you choose php4 or 5, as I'm sure others do as well.
> <snipped all 'dat stuff>
>
> A little more on dreamhost.
> PHP5 is installed as CGI, not Apache module.
Is there a drawback to running php5 as CGI?
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
Anthony,
I really don't know, because computers are much faster, so there may not be
the time lags there were 10 years ago.
As I understand CGI, the web server sees that the page is of type .php,
starts up PHP, PHP processes the page, the web server shuts down PHP and
sends out the results. The overhead of starting and stopping PHP (or Perl,
etc.) was the complaint.
When PHP is loaded as an Apache module there is not startup / shutdown
overhead.
If I have this wrong, or if PHP5 as a CGI stays resident and there is no
penalty, will someone please correct me.
Regards - Miles
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006
--- End Message ---
--- Begin Message ---
Hi!
On Thu, 16 Mar 2006 20:45:29 -0400
Miles Thompson <[EMAIL PROTECTED]> wrote:
> At 06:23 PM 3/16/2006, Anthony Ettinger wrote:
>
> >[...]
> >Is there a drawback to running php5 as CGI?
>
> Anthony,
>
> I really don't know, because computers are much faster, so
> there may not be the time lags there were 10 years ago.
>
> As I understand CGI, the web server sees that the page is of
> type .php, starts up PHP, PHP processes the page, the web
> server shuts down PHP and sends out the results. The overhead
> of starting and stopping PHP (or Perl, etc.) was the
> complaint.
>
> When PHP is loaded as an Apache module there is not startup /
> shutdown overhead.
>
> If I have this wrong, or if PHP5 as a CGI stays resident and
> there is no penalty, will someone please correct me.
No, nothing wrong there, I think.
But there are other differences. (Like some functions not
working, etc.) Pros and cons, one might say. Anyway, here
are some results of a quick google search:
http://www.google.com/search?q=php+CGI+module+difference
Hmm.. I just couldn't find it but there should be a page
about it on www.php.net ... (^_-)
> Regards - Miles
HTH,
- Edwin -
--
"Give to a wise person and he will become still wiser.
Impart knowledge to someone righteous
and he will increase in learning." - Proverbs 9:9
--- End Message ---
--- Begin Message ---
Hi,
I created a small bannering program. It works great in Firefox. But I have a
problem with IE.
If I place the banner on a different domain than the bannering program, Ex:
www.bannerserver.com
www.otherserver.com has img tag calling from www.bannerserver.com
I use a session to keep track of the banner that is displayed, have even tried
using cookies directly.
Works great in firefox, problem with IE is first time vising
www.otherserver.com, clicking on the img does not work, apparently, the session
was never start/recorded when retrieving the image. However, if I go back to
www.otherserver.com, it then works fine, I can go anywhere, as long as I don't
close the browser, www.otherserver.com works.
Why would IE not be recording the session info on the first visit? Firefox does
it just fine.
Anyone run into this?
Thanks for any help.
--- End Message ---
--- Begin Message ---
[snip]
I created a small bannering program. It works great in Firefox. But I
have a problem with IE.
If I place the banner on a different domain than the bannering program,
Ex:
www.bannerserver.com
www.otherserver.com has img tag calling from www.bannerserver.com
I use a session to keep track of the banner that is displayed, have even
tried using cookies directly.
Works great in firefox, problem with IE is first time vising
www.otherserver.com, clicking on the img does not work, apparently, the
session was never start/recorded when retrieving the image. However, if
I go back to www.otherserver.com, it then works fine, I can go anywhere,
as long as I don't close the browser, www.otherserver.com works.
Why would IE not be recording the session info on the first visit?
Firefox does it just fine.
Anyone run into this?
[/snip]
>From http://www.php.net/session
[quote]
When using session_start() to begin a session this session will remain
open until the page has finished loading or it is explicitly terminated.
You can lose the session however if the the page contains a reference to
<img src=""> with name and id references (which may be used if the image
is referencing a dynamic image, called by javascript) This seems to
casue IE6 to refresh the page session id and hence loose the session.
[/quote]
--- End Message ---
--- Begin Message ---
Hello,
Does a VxWorks port of the PHP interpreter currently exist? If no, is any
such project in the pipeline?? We'd like to run PHP scripts as CGIs in some
of our embedded devices.
Thanks for the info.
-- Shawn
--- End Message ---
--- Begin Message ---
Hello,
Does a VxWorks port of the PHP interpreter currently exist? If no, is any
such project in the pipeline?? We'd like to run PHP scripts as CGIs in some
of our embedded devices.
Thanks for the info.
-- Shawn
--- End Message ---
--- Begin Message ---
Anyone want to point me to why this isn't working:
$hr_query = "select dp_lname,dp_fname,dp_id
FROM dir_all
WHERE dp_id NOT IN (SELECT sup_id FROM dir_title2)
ORDER BY dp_lname";
There are two tables, dir_all (the main list of everyone) and
dir_title2 (supplemental). If someone is in dir_title2 then the
sup_id is the same as their dp_id. What I am trying to do is get a
list of every person in dir_all that is NOT in dir_title2. Any
thoughts as to what am doing wrong?
--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326
--- End Message ---
--- Begin Message ---
At 08:41 PM 3/16/2006, Kevin Murphy wrote:
Anyone want to point me to why this isn't working:
$hr_query = "select dp_lname,dp_fname,dp_id
FROM dir_all
WHERE dp_id NOT IN (SELECT sup_id FROM dir_title2)
ORDER BY dp_lname";
There are two tables, dir_all (the main list of everyone) and
dir_title2 (supplemental). If someone is in dir_title2 then the
sup_id is the same as their dp_id. What I am trying to do is get a
list of every person in dir_all that is NOT in dir_title2. Any
thoughts as to what am doing wrong?
--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326
Kevin,
Looks like an older version of MySQL.
Check your version: subqueries were not supported until ver 4.1.
The older docs at MySQL give a work around.
Miles
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006
--- End Message ---
--- Begin Message ---
Kevin Murphy wrote:
Anyone want to point me to why this isn't working:
$hr_query = "select dp_lname,dp_fname,dp_id
FROM dir_all
WHERE dp_id NOT IN (SELECT sup_id FROM dir_title2)
ORDER BY dp_lname";
There are two tables, dir_all (the main list of everyone) and
dir_title2 (supplemental). If someone is in dir_title2 then the sup_id
is the same as their dp_id. What I am trying to do is get a list of
every person in dir_all that is NOT in dir_title2. Any thoughts as to
what am doing wrong?
What does mysql_error() say?
--
life is a game... so have fun.
--- End Message ---
--- Begin Message ---
Yup. Thats the problem. I'm running 4.0.21. Thanks.
--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326
On Mar 16, 2006, at 4:48 PM, Miles Thompson wrote:
At 08:41 PM 3/16/2006, Kevin Murphy wrote:
Anyone want to point me to why this isn't working:
$hr_query = "select dp_lname,dp_fname,dp_id
FROM dir_all
WHERE dp_id NOT IN (SELECT sup_id FROM
dir_title2)
ORDER BY dp_lname";
There are two tables, dir_all (the main list of everyone) and
dir_title2 (supplemental). If someone is in dir_title2 then the
sup_id is the same as their dp_id. What I am trying to do is get a
list of every person in dir_all that is NOT in dir_title2. Any
thoughts as to what am doing wrong?
--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326
Kevin,
Looks like an older version of MySQL.
Check your version: subqueries were not supported until ver 4.1.
The older docs at MySQL give a work around.
Miles
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date:
3/10/2006
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
One of my clients has an os commerce install which requires
register_globals to be set to on, for some reason.
It is set up to off in php.ini, as it should, but I'd like to know what
the best fashion would be for me to set it on locally for this domain
only.
Thanks!
--- End Message ---
--- Begin Message ---
Nicolas Verhaeghe wrote:
One of my clients has an os commerce install which requires
register_globals to be set to on, for some reason.
It is set up to off in php.ini, as it should, but I'd like to know what
the best fashion would be for me to set it on locally for this domain
only.
If you need to ask a new question please start a new thread - copy the
email address and hit "new" instead of replying to an existing question.
It makes it so much easier to follow.
See http://www.php.net/manual/en/ini.php#ini.list and
http://www.php.net/manual/en/configuration.changes.php
Basically, in apache virtualhost or .htaccess file:
php_flag register_globals on
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
One of my clients has an os commerce install which requires
register_globals to be set to on, for some reason.
It is set up to off in php.ini, as it should, but I'd like to know what
the best fashion would be for me to set it on locally for this domain
only.
Thanks!
--- End Message ---
--- Begin Message ---
On Thu, Mar 16, 2006 at 08:46:07PM -0700, Nicolas Verhaeghe wrote:
> One of my clients has an os commerce install which requires
> register_globals to be set to on, for some reason.
>
> It is set up to off in php.ini, as it should, but I'd like to know what
> the best fashion would be for me to set it on locally for this domain
> only.
Assuming you have apache as your webserver..
If you must set it, you can set it per any apache directive, like
a <VirtualHost>, <Directory> or the like or even a .htaccess (if
enabled).
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
(Comments inline)
tedd wrote:
[···]
One last question, considering the above code, would the following code
be a suitable replacement?
<?php
$thestyle= htmlentities($_POST['thestyle']);
setcookie ('thestyle', $set, time()+31536000, '/', '', 0);
header("Location: $HTTP_REFERER");
?>
Actually, you receive $set via GET, so you should use $_GET instead of
$_POST. A lot of people use $_REQUEST (wich is a combination of $_POST,
$_GET and $_COOKIE —check the manual), but I read somewhere that this
isn't a good practice, though I don't recall why :p
$set = $_GET['set'];
or even better would be something like
$set = ( isset($_GET['set']) ? $_GET['set'] : $default_value );
I've used htmlentities() before to filter out user's input, but I don't
know if that's sufficient to protect from all types of injections -- is it?
No, it doesn't suffice this way --it does for the script we're talking
about, but that's because you only use the data as part of the HTML
code, so no more harm can be done with it.
A tipical example would be a login script that uses the data as it
arrives, for example:
$login = $_POST['login'];
$passw = $_POST['passw'];
$sql = "SELECT * FROM user\n"
."WHERE( login = '$login' AND passw = '$passw' )";
In this case, what happens if I send something like
login: ' OR '1'='1' OR '0
passw: doesnt care
? (I avoided the ' in the passw, just in case)
Well, we'll end up with an SQL similar to this
SELECT * FROM user
WHERE( login = '' OR '1'='1' OR '0' AND passw = 'doesnt care' )
and because of the priority of the AND / OR, we would have 3 separated
conditions each enough to validate the user, as '1'='1' is true, then we
have a validated user.
Now, if I can do this, I could change the logic a little...
login: admin' AND '1'='1' OR '0
WHERE( login = 'admin' AND '1'='1' OR '0' AND passw = 'doesnt care' )
In this case you should care about ' and " (depending on which one are
you using) Again, I read somewhere that the safest way is to use
(emulated?) "prepared SQL statements", such the "?" SQL-parameters in
ADODB, PEAR-DB and others.
By the way, even causing an SQL error that is displayed to the user
(the whole message or just a part of it) can reveal info that could be
used to bypass your protection.
--
Atentamente,
J. Rafael Salazar Magaña
Innox - Innovación Inteligente
Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE
http://www.innox.com.mx
--- End Message ---
--- Begin Message ---
I searched php.net/session and weberdev website and
implemented session_cache_limiter() and
session_cache_expire() function.but i am not getting
the output what i want.i spend whole day on
searching.any one give the solution for my problem
in windows,if user idle for 1 minute,his desktop
screen is changed to screen saver.i like to implement
the same logic in my project if user is idle for 3
minutes its session will have to automatically
destroy.i am waiting for or response.
__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
--- End Message ---