|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Fri Feb 15 2008 - 03:13:15 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 15 Feb 2008 09:13:15 -0000 Issue 5294
Topics (messages 269320 through 269360):
Re: open source PHP/MySQL image viewing application
269320 by: Richard Lynch
Re: mysql question #2
269321 by: Richard Lynch
269323 by: Richard Heyes
Re: mysql question
269322 by: Richard Lynch
Re: Gzipped output
269324 by: Richard Lynch
269325 by: Richard Lynch
group by on mssql_query
269326 by: admin.buskirkgraphics.com
269327 by: Daniel Brown
269328 by: admin.buskirkgraphics.com
269329 by: admin.buskirkgraphics.com
269333 by: Andrew Ballard
Re: Session and Multi Server Architecture
269330 by: mike
Re: strtotime
269331 by: Richard Lynch
Create collections of objects
269332 by: Emilio Astarita
Re: Better DB Class MySQL
269334 by: Richard Lynch
269353 by: Paul Scott
Re: Order directory output
269335 by: Richard Lynch
Re: Static variable in a class method
269336 by: Stut
269340 by: Richard Lynch
269342 by: Stut
269345 by: Richard Lynch
Uploading PDF
269337 by: Pastor Steve
269346 by: David Robley
269358 by: Aleksandar Vojnovic
Re: fgets???
269338 by: Richard Lynch
Re: Trouble with PHP server script
269339 by: Stut
Re: PHP Source code protection
269341 by: Richard Lynch
Re: date() and wrong timezone (or time)
269343 by: Richard Lynch
Re: database design tool
269344 by: Dax Solomon Umaming
Unable to run my sample application from CakePHP
269347 by: Nirmalya Lahiri
269348 by: Stut
question about database field-types and special characters
269349 by: Rob Gould
269351 by: Robert Cummings
269352 by: Robert Cummings
Re: php+mail+TLS/SSL
269350 by: Manuel Lemos
Re: XSLTProcessor without validation
269354 by: Siegfried Gipp
269355 by: Siegfried Gipp
269359 by: Zoltán Németh
269360 by: Peter Ford
Sending XML to MSIE7
269356 by: Brian Dunning
269357 by: Per Jessen
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:
Did you Google for "PHP MySQL photo album" or "PHP MySQL slideshow"???
On Thu, February 14, 2008 2:12 pm, Bruce Gilbert wrote:
> can anyone reccomend an open source PHP/MySQL based image viewing
> application. I am looking to store the images in MySQL and have a
> viewer on the page with the option to click to the next image and
> back, possibly with the display of an enlarged image as well as the
> option to click on thumbnails below.
>
> this may also be somehting I could look into creating from scratch,
> but I dodn't want to re-invent the wheel if I don't have to...
>
> --
> ::Bruce::
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Sun, February 10, 2008 12:12 pm, nihilism machine wrote:
> public function select_one($sql) {
> if ($this->auto_slashes) {
> return stripslashes($ret);
If you have to call stripslashes() on data coming FROM MySQL, then you
have really messed up...
You've put in data that was escaped TWICE, probably with Magic Quotes
"ON" followed by addslashes (or mysql_real_escape_string).
At any rate, just seeing this tells me that you've got a real mess on
your hands...
> } else {
> return $ret;
> }
> }
>
> how can i get the contents of a column in the returned row say for
> something called "Email" as the column name. here is my code now:
Since it's only returning ONE piece of data, how confused can it be?
$this->whatever['Email'] = $result;
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
> At any rate, just seeing this tells me that you've got a real mess on
> your hands...
Or you could say, "You're going to have some fun cleaning that".
--
Richard Heyes
http://www.websupportsolutions.co.uk
Knowledge Base and Helpdesk software hosted for you - no
installation, no maintenance, new features automatic and free
** New Helpdesk demo now available **
attached mail follows:
On Sun, February 10, 2008 11:52 am, Per Jessen wrote:
> nihilism machine wrote:
>
>> $ret = mysql_result($r, 0);
>> mysql_free_result($r);
>> if ($this->auto_slashes) return stripslashes($ret);
>> else return $ret;
>> }
>>
>>
>> what is $ret, an array?
>
> No, it's a mysql result object.
No, it's a single field value from the database.
$r is the result object.
http://php.net/mysql_result
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Sun, February 10, 2008 7:45 am, Jakub wrote:
> is it possible to make something like "gzipped echo"?.
> My idea was:
> $gzOut = gzopen('php://output','w');
> but it fails with an error: <b>Warning</b>: gzopen(php://output) [<a
> href='function.gzopen'>function.gzopen</a>]: could not make seekable -
> php://output
>
> That script generates a large text file to download, so I thought I
> can
> gzip it somehow to make the downloads faster. The buffered way (to
> load
> all the output to some $buffer and then echo gzencode($buffer,6);)
> consumes too much memory.
> Can anyone help me with this?
Shove a bezoar down his throat and be done with it.
Oh, wait, wrong list...
Configure Apache to use gzip and be done with it. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Mon, February 11, 2008 9:59 am, Eric Butera wrote:
> On Feb 11, 2008 10:44 AM, Per Jessen <per
computer.org> wrote:
>> Eric Butera wrote:
>>
>> >> I like it from a coding point of view (it's neat and elegant),
>> but I
>> >> don't think it achieves anything else than my initial suggestion
>> of
>> >> using exec(gzip -c).
>> >>
>> >
>> > Except for that little thing where you shouldn't be using execs in
>> > public facing code.
>>
>> Why not?
>
> You should never use exec & friends when there is another way around
> the problem. It is a security concern.
The only security concern I am aware of is if you pass in user
supplied data to the exec() arg...
And if you filter it properly, it is no more risky than anything else.
If you don't filter properly, then you're in trouble no matter what
external lib you are using...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
$ford = mssql_query("SELECT name FROM Table GROUP BY name");
while($mustang = mssql_fetch_array($ford))
{
echo $mustang['name'] . "/n";
}
OS 2003 Server
PHP 5.2.5
Apache 2.2.8
SQL 2000
For some reason it is NOT clicking what I am missing here.
Second set of eyes please....
attached mail follows:
On Thu, Feb 14, 2008 at 4:00 PM, <admin
buskirkgraphics.com> wrote:
> $ford = mssql_query("SELECT name FROM Table GROUP BY name");
What do you see when you replace the above line with this?
$ford = mssql_query("SELECT name FROM Table GROUP BY name") or
die(mssql_get_last_message());
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Column 'location_city.dst' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Not fimilar with MSSQL to be honest.
On Thu, Feb 14, 2008 at 4:00 PM, <admin
buskirkgraphics.com> wrote:
> $ford = mssql_query("SELECT name FROM Table GROUP BY name");
What do you see when you replace the above line with this?
$ford = mssql_query("SELECT name FROM Table GROUP BY name") or
die(mssql_get_last_message());
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Sweet Mother it just clicked.
I got it thank you dan.
On Thu, Feb 14, 2008 at 4:00 PM, <admin
buskirkgraphics.com> wrote:
> $ford = mssql_query("SELECT name FROM Table GROUP BY name");
What do you see when you replace the above line with this?
$ford = mssql_query("SELECT name FROM Table GROUP BY name") or
die(mssql_get_last_message());
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
On Thu, Feb 14, 2008 at 4:13 PM, <admin
buskirkgraphics.com> wrote:
> Column 'location_city.dst' is invalid in the select list because it is not
> contained in either an aggregate function or the GROUP BY clause.
>
> Not fimilar with MSSQL to be honest.
>
>
Yes, MS SQL is strict and will not allow you to return columns as part of an
aggregate query unless they are either part of the GROUP BY clause or
aggregated with either a built-in aggregate function such as COUNT, SUM,
AVG, MAX, MIN, etc., or else a user-defined function or subquery (as the
error message indicates). If you're used to MySQL, it isn't so strict (but
IMO should be).
Andrew
attached mail follows:
On 2/14/08, Richard Lynch <ceo
l-i-e.com> wrote:
> There is some kinda signal you can send to Apache to GRACEFULLY die out.
>
> New connections are refused, but old ones are finished and then the
> child exits.
>
> http://apache.org/
>
> There is a "graceful" restart for sure. Perhaps it's just "apachectl
> graceful stop"???
That assumes I am using Apache :)
The issue that I'm having isn't me manually stopping the webservers
though. This is a system issue somewhere so it is unpredictable and
not planned.
attached mail follows:
I would use date and mktime, personally, as strtotime often does
things I consider "strange"
On Sun, February 10, 2008 5:46 am, Ron Piggott wrote:
>
> I am trying to calculate what was the date 18 months ago. When I give
> the command:
>
> $18_months_ago = strtotime("-18 months");
>
> It comes back with:
>
> Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE
>
> How would you calculate 18 months ago from today?
>
> Ron
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Hi people,
I want a class that allows create objects that get the information
consulting the DB. So, I am thinking to do something like this:
class element {
public __construct($id,$type = 'id') {
switch($type) {
case 'id':
$where = sprintf(" id = %d ",$id);
break;
case 'name':
$where = sprintf(" name = %s ",escape($id));
break;
//...
// get the row and call setName($row['name'])...
}
}
}
This works fine, but also I want a good way (efficient) of getting a
collection of these objects. I can't figure a convenient way. A static
function its a good posibility? I have some ideas but they imply public
setters of the class `element'.
Thanks for any help.
--
Emilio Astarita <emilio.astarita
gmail.com>
Gnus
http://gnus.org/
<http://www.gnu.org/philosophy/free-sw.html>
attached mail follows:
On Sun, February 10, 2008 9:31 am, Jochem Maas wrote:
> Larry Garfield schreef:
>> http://www.php.net/pdo
>>
>> All the cool kids are doing it.
>
> not true - some of them use firebird ;-)
And some have figured out that PDO does not quite live up to its
promise (yet) and needs some more work...
Particularly for the commercial DBs, as I understand it...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Thu, 2008-02-14 at 16:17 -0600, Richard Lynch wrote:
> And some have figured out that PDO does not quite live up to its
> promise (yet) and needs some more work...
>
I am finding this out the hard way, but just with MySQL and PostgreSQL
support (including MySQLi).
Portable, kinda, stable, not so much.
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
attached mail follows:
opendir/readdir does not promise to deliver the files in any
particular order, no matter what it seems to do on any given day...
Put them in an array and sort() if it's a small list of files.
Or use exec and "ls -als" or somesuch for a large list of files.
Or...
glob *might* be documented to do things in a certain order, but I
doubt it.
On Fri, February 8, 2008 4:44 pm, Pastor Steve wrote:
> Hi, thanks for all your help today.
>
> I have the following code and I am trying to order the output.
> Currently it
> seems really random. Can anyone point me in the right direction?
>
> <?php
>
> $dir = "content/current/breaking_news/";
>
> // set pattern
> $pattern = ".txt*|.TXT*";
>
> // open directory and parse file list
> if (is_dir($dir))
> {
> if ($dh = opendir($dir))
> {
>
> //This is the div that contains the wrap around for the breaking news
> section.
> echo "
> <div class=\"spstory\" style=\"font-family: Times New Roman,
> Times,
> serif; font-size: 12px; width: 290px;\">
> <div style=\"width: 285px; background-color: #FFFFCC; padding:
> 3px;\">
> <span class=\"NormalHeadRed\">Breaking News</span>
> <br />Please check here often for breaking news stories.
> </div>
> <p />
> <span class=\"NomalText\">
>
> <ul>";
>
> // iterate over file list
> while (($filename = readdir($dh)) !== false)
>
> {
>
> // if filename matches search pattern, print it
> if (ereg($pattern, $filename))
> if(strpos($filename,'.')>0)
>
> {
> $fh = fopen("$dir" . "$filename", "r");
>
> $filehead = fgets($fh);
>
> fclose($fh);
> echo "
> <li class=\"bn_bullet\">
> <a href=\"/breaking_news/$filename\">$filehead</a>
> </li>";
> }
> }
> echo "
> </ul><p />
> </span>
> </div>";
>
> // close directory
> closedir($dh);
> }
> }
>
> ?>
>
> Thank you,
>
> --
> Steve Marquez
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch wrote:
> If a website is complicated enough to need a class hierarchy, then
> something is wrong in your Design. :-) :-) :-)
I don't think anything ever *needs* a class heirarchy, but I wouldn't
say using one indicates a design flaw.
Classes themselves are an invaluable tool for creating a logical modular
system with reusable components, and IMHO not using them indicates an
engineer stuck in the dark ages of software development.
But each to their own.
-Stut
--
http://stut.net/
attached mail follows:
On Thu, February 14, 2008 4:28 pm, Stut wrote:
> Richard Lynch wrote:
>> If a website is complicated enough to need a class hierarchy, then
>> something is wrong in your Design. :-) :-) :-)
>
> I don't think anything ever *needs* a class heirarchy, but I wouldn't
> say using one indicates a design flaw.
>
> Classes themselves are an invaluable tool for creating a logical
> modular
> system with reusable components, and IMHO not using them indicates an
> engineer stuck in the dark ages of software development.
>
> But each to their own.
I used classes in Lisp a whole whole whole lot building AI research
applications, so I don't think I qualify as stuck in the dark ages...
:-)
Perhaps it's just that I don't like to work on websites
big/complicated enough to need giant class hierarchies...
Or that I would rather simplify such a site to the point where it
doesn't need said large hierarchy...
Or that anything that's supposed to spit out a web page in a
splintered second shouldn't be that complicated to start with...
Or...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch wrote:
> On Thu, February 14, 2008 4:28 pm, Stut wrote:
>> Richard Lynch wrote:
>>> If a website is complicated enough to need a class hierarchy, then
>>> something is wrong in your Design. :-) :-) :-)
>> I don't think anything ever *needs* a class heirarchy, but I wouldn't
>> say using one indicates a design flaw.
>>
>> Classes themselves are an invaluable tool for creating a logical
>> modular
>> system with reusable components, and IMHO not using them indicates an
>> engineer stuck in the dark ages of software development.
>>
>> But each to their own.
>
> I used classes in Lisp a whole whole whole lot building AI research
> applications, so I don't think I qualify as stuck in the dark ages...
> :-)
>
> Perhaps it's just that I don't like to work on websites
> big/complicated enough to need giant class hierarchies...
>
> Or that I would rather simplify such a site to the point where it
> doesn't need said large hierarchy...
>
> Or that anything that's supposed to spit out a web page in a
> splintered second shouldn't be that complicated to start with...
>
> Or...
I'm only guessing, but instead of classes I would expect you to have a
fair few files that contain lots of functions, correct? Given that
non-heirarchical class libraries are effectively the same but with one
extra organisational layer (plus access control) I really can't see why
you think an application that uses classes would be any more complicated
than one that doesn't.
From where I'm sitting an application built using classes is likely to
be (although not necessarily) better structured than one built without them.
-Stut
--
http://stut.net/
attached mail follows:
On Thu, February 14, 2008 5:14 pm, Stut wrote:
> I'm only guessing, but instead of classes I would expect you to have a
> fair few files that contain lots of functions, correct?
No, just one file with a handful to a dozen functions, really...
If the site is designed correctly, each page is doing something
different enough that you'd only use the function in one place, and
there's no point to using a function if it's only called/used in one
place. :-)
That's a bit of an exaggeration, but close enough for rock n roll.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Greetings,
I am getting an error when I am trying to upload a PDF file through a
script.
When I do a print_r($_FILES) I get the following:
Array
(
[userfile] => Array
(
[name] => document.pdf
[type] =>
[tmp_name] =>
[error] => 2
[size] => 0
)
)
Docs and html will both upload. Anybody have an idea why?
Here is the script that I am using:
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
instead
// of $_FILES.
$uploaddir = '../cms/documents/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
$filename = $_FILES['userfile']['name'];
echo "<b>File is valid, and was successfully uploaded.</b>\n
<br />Select and copy the link below to reference this file.<p />
<pre><a href=\"documents/$filename\">$filename</a></pre><p
/>
<b>WARNING:</b> This link will not be available anywhere else.
";
} else {
echo "Possible file upload attack!\n";
}
echo '<pre>';
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
Thanks,
--
Steve M.
attached mail follows:
Pastor Steve wrote:
> Greetings,
>
> I am getting an error when I am trying to upload a PDF file through a
> script.
>
> When I do a print_r($_FILES) I get the following:
>
> Array
> (
> [userfile] => Array
> (
> [name] => document.pdf
> [type] =>
> [tmp_name] =>
> [error] => 2
> [size] => 0
> )
>
> )
>
> Docs and html will both upload. Anybody have an idea why?
>
> Here is the script that I am using:
>
> <?php
> // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
> instead
> // of $_FILES.
>
> $uploaddir = '../cms/documents/';
> $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
>
> if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
> $filename = $_FILES['userfile']['name'];
>
> echo "<b>File is valid, and was successfully uploaded.</b>\n
> <br />Select and copy the link below to reference this file.<p />
> <pre><a href=\"documents/$filename\">$filename</a></pre><p
> />
> <b>WARNING:</b> This link will not be available anywhere else.
>
> ";
>
> } else {
> echo "Possible file upload attack!\n";
> }
>
> echo '<pre>';
>
> echo 'Here is some more debugging info:';
> print_r($_FILES);
>
> print "</pre>";
>
> ?>
>
> Thanks,
>
The error number tells you what is happening - check the values at
http://php.net/manual/en/features.file-upload.errors.php
Essentially, the file is bigger than the MAX_FILE_SIZE directive that was
specified in the HTML form
Cheers
--
David Robley
Couldn't myself have better it said.
Today is Sweetmorn, the 46th day of Chaos in the YOLD 3174.
attached mail follows:
Upload error 2 occurs when the file size exceeds the maximum allowed
upload size.
Aleksander
David Robley wrote:
> Pastor Steve wrote:
>
>
>> Greetings,
>>
>> I am getting an error when I am trying to upload a PDF file through a
>> script.
>>
>> When I do a print_r($_FILES) I get the following:
>>
>> Array
>> (
>> [userfile] => Array
>> (
>> [name] => document.pdf
>> [type] =>
>> [tmp_name] =>
>> [error] => 2
>> [size] => 0
>> )
>>
>> )
>>
>> Docs and html will both upload. Anybody have an idea why?
>>
>> Here is the script that I am using:
>>
>> <?php
>> // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
>> instead
>> // of $_FILES.
>>
>> $uploaddir = '../cms/documents/';
>> $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
>>
>> if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
>> $filename = $_FILES['userfile']['name'];
>>
>> echo "<b>File is valid, and was successfully uploaded.</b>\n
>> <br />Select and copy the link below to reference this file.<p />
>> <pre><a href=\"documents/$filename\">$filename</a></pre><p
>> />
>> <b>WARNING:</b> This link will not be available anywhere else.
>>
>> ";
>>
>> } else {
>> echo "Possible file upload attack!\n";
>> }
>>
>> echo '<pre>';
>>
>> echo 'Here is some more debugging info:';
>> print_r($_FILES);
>>
>> print "</pre>";
>>
>> ?>
>>
>> Thanks,
>>
>>
>
> The error number tells you what is happening - check the values at
> http://php.net/manual/en/features.file-upload.errors.php
>
> Essentially, the file is bigger than the MAX_FILE_SIZE directive that was
> specified in the HTML form
>
>
>
> Cheers
>
attached mail follows:
On Fri, February 8, 2008 11:54 am, Zoltán Németh wrote:
> 2008. 02. 8, péntek keltezéssel 12.46-kor Daniel Brown ezt Ãrta:
>> On Feb 8, 2008 12:35 PM, Richard Lynch <ceo
l-i-e.com> wrote:
>>
>> I knew it. After silence, Lynch comes back with a vengeance
>> three hours before the week's stats come out.
>>
>> And not only that.... he top-posts. ;-P
>
> Wait, this might not be the real Lynch, but his new AI instead, not
> programmed yet for bottom posting :)
I top post when:
The ordering is already so screwed up as to be pointless to not top
post, or
I'm in a super hurry and have only a tiny thing to add to a rather
long post, or
.
.
.
I've had much longer silences on this list.
And even longer stretches of posting WAY too much on a daily basis.
ymmv
ianal
naiaa
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch wrote:
>
> On Sun, February 10, 2008 9:09 pm, Robert Cox wrote:
>> Is it possible to use the "$_SERVER['PHP_AUTH_USER'];" construct in a
>> URL
>> forwarded site? I am trying to find the authorised user id so that I
>> can
>> access an SQL database with it. Anyone got some ideas?
>
> If you do a Location: with a FULL URL then the browser will forward
> POST and I think AUTH data.
Auth info is not "passed on" as such. HTTP authentication details are
applied to all URLs where the browser already knows them (i.e. on the
same domain where they have already authenticated). The redirect does
not have anything to do with this.
And I don't know where you're getting the idea that POST data is
persisted when redirecting with the location header. This is certainly
not the case in all browsers I've ever worked with. If it was then a
fair number of scripts I've written over the years would not work correctly.
One security note for the OP: it's generally a bad idea for the user
credentials for your website to be the same as those used to access the
database. I can think of few ideas where it would make the slightest bit
of logical sense and most of those involve web-based DB admin such as
phpMyAdmin. You might want to rethink your design from a security point
of view.
-Stut
--
http://stut.net/
attached mail follows:
On Thu, February 7, 2008 8:35 pm, Andrés Robinet wrote:
> 1 - I believe the fact that we don't "encode" (read "compile") our
> scripts is
> tightly related to the fact that we don't have a bytecode interpreter
> (say JIT
> compiler or something?) bundled into PHP.
Errrrr.
PHP has a bytecode interpreter in the Zend Engine...
That's kinda what it *does*
It's not a JIT, however, at this time, though there's always talk on
internals
about making it more and more JIT-like.
The various caching mechanisms (Zend Cache Accelerator, APC, etc) all
store the bytecode version of the PHP script, not the original source.
This provides a TINY performance benefit, which is completely dwarfed
by not hitting the hard disk to read the PHP script, and costs almost
nothing since it's basically the difference between this psuedo C
code:
.
.
.
script = fread(fp, 1000000000);
cache(script);
bytecode = parse(script);
.
.
.
and this:
.
.
.
script = fread(fp, 1000000000);
bytecode = parse(script);
cache(bytecode);
.
.
.
You can rely on the bytecode interpreter being there, as that's what
the Zend Engine *is*.
This does not necessarily make your other points invalid -- but they
cannot be based around the [incorrect] facts you stated. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Wed, February 6, 2008 11:13 am, Martin Marques wrote:
> Nathan Nobbe escribió:
>> On Feb 6, 2008 6:13 AM, Martin Marques <martin
marquesminen.com.ar>
>> wrote:
>>
>>> I got an update from tzdata on a Debian server due to a daylight
>>> saving
>>> change here in Argentina.
>>>
>>> The problem is that, even when the system sees the correct time,
>>> php
>>> keeps giving me the *old* hour.
>>>
>>> $ date
>>> mié feb 6 09:03:57 ARST 2008
>>> $ echo "<?php echo date('H:i') . \"\n\"; ?>"|php5
>>> 08:04
>>>
>>> What can my problem be?
>>
>>
>> see what you have as the value for the date.timezone ini setting.
>
> I've already checked that, and it's not set.
>
> Anyway, I found out that PHP uses an internal tz database (very bad
> IMHO) and it might be out of date.
There was a thread on internals
recently explaining why it has the
internal tz database -- mainly that it runs on platforms which have no
tz database at all...
Also, many admins aren't updating their tz database as religiously as
you, so it ends up being better in the opinion of the PHP Dev Team to
embed the tz database.
At least, this is my recollection of the thread.
ymmv, and obviously does...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
> On Feb 12, 2008 7:46 PM, Shawn McKenzie <nospam
mckenzies.net> wrote:
>> Can anyone recommend a preferably visual DB design tool? I normally use
>> mysql, but one that covered several types wood be cool. I'm on Linux,
>> so the new mysql workbench is a dud. I used it in an alpha or prior
>> version and it looked promising but crashed frequently. They say a
>> Linux version in 2008, but I'm not holding my breath.
Try DBDesigner4[1], MySQL based their workbench from DBDesigner. However,
it won't allow you to connect to MySQL5 and sync your changes, but hey,
you're looking for a graphical designer - and this tool is great for
designing your DBs.
You can install from source and tweak it a bit or you can install the
win32 binary and let it run via wine (which works really well).
[1] fabforce.net/dbdesigner4/
--
Dax Solomon Umaming
http://knightlust.com/
GPG: 0x715C3547
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQBHtM5I6Hw0ZHFcNUcRAtJpAJ9D67PK6qhWh7ultM8tYMCnQs/ELACfftnO
cYd21b5LClaPCsEJz8Gsxrg=
=QPLg
-----END PGP SIGNATURE-----
attached mail follows:
Hi all,
CakePHP is a new tool for me, I never worked on any framework
before..! To learn about CakePHP I already read
http://manual.cakephp.org pages and copy the code sample from that
manual. I installed cake in /var/www/html directory. In my Apache
server webroot is /var/www/html. Now my question is how can run my
application(What will be the URL to access my application? In one
point I am sure that the database configuration is OK, because when I
through the URL http://127.0.0.1/cake to the server, the server
returns a CakePHP introductory page with a status....
"Your database configuration file is present.
Cake is able to connect to the database."
---------------
Controller page name: users_controller.php having class name
UsersControllers with member function login().
view page name: login.thtml
model page name: user.php
---------------
Please help me...
---
Nirmalya Lahiri
[+91-9433113536]
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
attached mail follows:
Nirmalya Lahiri wrote:
> CakePHP is a new tool for me, I never worked on any framework
> before..! To learn about CakePHP I already read
> http://manual.cakephp.org pages and copy the code sample from that
> manual. I installed cake in /var/www/html directory. In my Apache
> server webroot is /var/www/html. Now my question is how can run my
> application(What will be the URL to access my application? In one
> point I am sure that the database configuration is OK, because when I
> through the URL http://127.0.0.1/cake to the server, the server
> returns a CakePHP introductory page with a status....
>
> "Your database configuration file is present.
> Cake is able to connect to the database."
>
> ---------------
> Controller page name: users_controller.php having class name
> UsersControllers with member function login().
>
> view page name: login.thtml
>
> model page name: user.php
> ---------------
>
> Please help me...
Questions regarding specific frameworks should be directed towards the
support resources for that framework. Check the Cake homepage for
support details.
-Stut
--
http://stut.net/
attached mail follows:
I've got a PHP application that pulls in data from a mySQL database. The data is a series of wine producers, and many of them have special foreign characters over the a's and o's.
When I go and view the data from my database using myPHPAdmin, the characters look fine, but when I pull the data into my web-page the special characters get messed up.
For whatever reason, when I first set up the database, someone told me to preserve special characters by setting my collation for the wine-producer field to "latin1_swedish_ci". The data seems to be in there ok, so at least that works.
Should I have used utf-8 instead? Can I set something in the doctype or header of my web-page to make it so that my website displays latin1_swedish_ci-based characters properly, or should I change my database field-type to be something different? My main fear is messing up the database (I'll back up first if I have to chance the field collation)
attached mail follows:
On Thu, 2008-02-14 at 18:47 -0800, Rob Gould wrote:
> I've got a PHP application that pulls in data from a mySQL database. The data is a series of wine producers, and many of them have special foreign characters over the a's and o's.
>
> When I go and view the data from my database using myPHPAdmin, the characters look fine, but when I pull the data into my web-page the special characters get messed up.
>
> For whatever reason, when I first set up the database, someone told me to preserve special characters by setting my collation for the wine-producer field to "latin1_swedish_ci". The data seems to be in there ok, so at least that works.
>
> Should I have used utf-8 instead? Can I set something in the doctype or header of my web-page to make it so that my website displays latin1_swedish_ci-based characters properly, or should I change my database field-type to be something different? My main fear is messing up the database (I'll back up first if I have to chance the field collation)
SOunds like your website is UTF8 and your DB as you say is latin1. You
have a few choices. You can set the php.ini config value:
default_charset = "iso-8859-1"
You can also set the meta tag (probably best to set the PHP config and
the meta tag):
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
Or, and this is what I would do, convetr your database to UTF-8. That
way you're prepared for the rest of the world. In this day and age I
would creat a site with anything but UTF-8.
Here's some reading for you:
http://www.joelonsoftware.com/articles/Unicode.html
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
On Thu, 2008-02-14 at 23:59 -0500, Robert Cummings wrote:
> On Thu, 2008-02-14 at 18:47 -0800, Rob Gould wrote:
> > I've got a PHP application that pulls in data from a mySQL database. The data is a series of wine producers, and many of them have special foreign characters over the a's and o's.
> >
> > When I go and view the data from my database using myPHPAdmin, the characters look fine, but when I pull the data into my web-page the special characters get messed up.
> >
> > For whatever reason, when I first set up the database, someone told me to preserve special characters by setting my collation for the wine-producer field to "latin1_swedish_ci". The data seems to be in there ok, so at least that works.
> >
> > Should I have used utf-8 instead? Can I set something in the doctype or header of my web-page to make it so that my website displays latin1_swedish_ci-based characters properly, or should I change my database field-type to be something different? My main fear is messing up the database (I'll back up first if I have to chance the field collation)
>
> SOunds like your website is UTF8 and your DB as you say is latin1. You
> have a few choices. You can set the php.ini config value:
>
> default_charset = "iso-8859-1"
>
> You can also set the meta tag (probably best to set the PHP config and
> the meta tag):
>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
>
> Or, and this is what I would do, convetr your database to UTF-8. That
> way you're prepared for the rest of the world. In this day and age I
> would creat a site with anything but UTF-8.
Wouldn't create a site with anything but UTF-8.
^^^^^^^^
:)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Hello,
on 02/14/2008 12:34 PM julian said the following:
> I am using phpmailer currently to send email from my applications. My
> ISP is restricting the usage of email without SSL/TLS and my SMTP
> connections have started to fail...
>
> Any hints on the best approach to send email from php appplciations ?, I
> wish I could use my standard gmail/yahoo accounts.... like my desktop
> email program...
I am not sure if you can or cannot use SMTP with TLS.
In any case, you may use this popular MIME message composing and sending
class that comes with several alternative delivery methods. It supports
SMTP deliveries with TLS enabled as required by Gmail and also mail()
function/sendmail deliveries. Just use the appropriate sub-class that
fit in your restrictions.
http://www.phpclasses.org/mimemessage
If you need to deliver via SMTP/TLS to Gmail, you also need these two
classes in conjunction. mail() function/sendmail deliveries do not
require additional classes:
http://www.phpclasses.org/smtpclass
http://www.phpclasses.org/sasl
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Am Donnerstag, 14. Februar 2008 21:01:42 schrieb Richard Lynch:
> You may want to try using http://php.net/exec to run your command line
> tool and ignore the PHP one, if it won't let you turn off validation.
Yes, that's what i'm going to do for now. But that won't help if an internet
provider does not have this or does not allow executing this.
> You could also consider filing a "Feature Request" in
> http://bugs.php.net/
Thanks for that link. I'll try.
Regards
Siegfried
attached mail follows:
Am Donnerstag, 14. Februar 2008 21:01:42 schrieb Richard Lynch:
> You could also consider filing a "Feature Request" in
> http://bugs.php.net/
Well, the bug reporting page has a bug. A graphical captcha is needed, but
there is no such captcha. Repetitive loading does not change this.
From an accessibility point of view graphical captchas are a bad idea. Not
existing, but required graphical captchas are an even worse idea. This way
the bug report mechanism is essentially 100% inaccessible :)
Regards
Siegfried
attached mail follows:
2008. 02. 15, péntek keltezéssel 07.54-kor Siegfried Gipp ezt Ãrta:
> Am Donnerstag, 14. Februar 2008 21:01:42 schrieb Richard Lynch:
>
> > You could also consider filing a "Feature Request" in
> > http://bugs.php.net/
> Well, the bug reporting page has a bug. A graphical captcha is needed, but
> there is no such captcha. Repetitive loading does not change this.
>
> From an accessibility point of view graphical captchas are a bad idea. Not
> existing, but required graphical captchas are an even worse idea. This way
> the bug report mechanism is essentially 100% inaccessible :)
you mean this page?
http://bugs.php.net/report.php
the captcha is clearly there for me (firefox, ubuntu linux)... however
if it is not there in every browser that's a bug which should be
reported :)
greets
Zoltán Németh
>
> Regards
> Siegfried
>
attached mail follows:
Siegfried Gipp wrote:
> Hi,
>
> i still got no answer. Maybe i did not see it, altough i'm trying to read any
> single post. But may be i overlooked it due to high traffic. So now i have
> set up a filter (hopefully) copying answers to another folder.
>
> Here is the question: Is it possible to disable validation when using
> XSLTProcessor? If yes, how?
>
> When i use xsltproc, the command line tool for the libxslt, i can use the
> switch --novalid to subpress validation. This makes a huge difference in
> speed. Without validation it is fast enough. With validation it takes far too
> long to be acceptable. So how do i use XSLTProcessor from within PHP to
> achieve the same result as if using xsltproc --novalid?
>
> Regards
> Siegfried
What if you don't have a DTD in the XML to validate it with?
I haven't tested it but it was something that worked in the Java XML processing
stuff. No DTD, no validation: simple!
So have you tried stripping the DOCTYPE declaration before XSLTing the XML?
attached mail follows:
Does anyone know if there's a way to send XML to MSIE7 and avoid
having MSIE mangle the XML with CSS to display it pleasantly as HTML?
I'm building a PHP web service that returns XML to a desktop app that
uses the MSIE7 toolbox, and so it is not able to interpret the XML due
to this Windows "convenience".
attached mail follows:
Brian Dunning wrote:
> Does anyone know if there's a way to send XML to MSIE7 and avoid
> having MSIE mangle the XML with CSS to display it pleasantly as HTML?
>
Isn't it enough to send it with Content-Type: application/octet-stream ?
/Per Jessen, Zürich
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]