[PHP] Re: force download in IE

2001-08-24 Thread Ralph Deffke

I went through the same problem. the simplest solution with browsers like IE
5.5 is to  click with the right buttom on the link an choose "save this
location". You could mention this on the your page in a "if you have trouble
dwonloading" sentence.

a very stable solution would be to make a selfextracting archive and provige
two download links, one for people having the helper application installed and
want to just view it or those who want to download it.

David Minor schrieb:

> Can anybody tell me why this doesn't work in IE?  I need to force download
> mp3 files instead of IE5.5 trying to apply a helper app.  This code works
> fine for NN.
>
> // detect for MSIE bug
> if (strstr($HTTP_USER_AGENT, "MSIE"))
> $attachment = "";
> else
> $attachment = " attachment;";
>
> // stream file to user
> header("Content-Type: application/octet-stream");
> header("Content-Disposition:$attachment filename=$filename");
> header("Content-Length: ".filesize($tmp_file));
> header("Content-Transfer-Encoding: binary");
> readfile($tmp_file);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: force download in IE

2001-08-24 Thread Ralph Deffke

I went through the same problem. the simplest solution with browsers like IE
5.5 is to  click with the right buttom on the link an choose "save this
location". You could mention this on the your page in a "if you have trouble
dwonloading" sentence.

a very stable solution would be to make a selfextracting archive and provige
two download links, one for people having the helper application installed and
want to just view it or those who want to download it.

David Minor schrieb:

> Can anybody tell me why this doesn't work in IE?  I need to force download
> mp3 files instead of IE5.5 trying to apply a helper app.  This code works
> fine for NN.
>
> // detect for MSIE bug
> if (strstr($HTTP_USER_AGENT, "MSIE"))
> $attachment = "";
> else
> $attachment = " attachment;";
>
> // stream file to user
> header("Content-Type: application/octet-stream");
> header("Content-Disposition:$attachment filename=$filename");
> header("Content-Length: ".filesize($tmp_file));
> header("Content-Transfer-Encoding: binary");
> readfile($tmp_file);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP based authentification -----------

2001-08-24 Thread Ralph Deffke

send an 401 unauthorized header. see php manuall under function header() as an
example

Alex Sofronie schrieb:

> Hi all!
>
> How can I "logout" from a PHP based auth (with PHP_AUTH_USER and PHP_AUTH_PW
> and appropriate headers sent at the beginning)?
> It seems like unset($PHP_AUTH_USER) does not wotk in this case...
>
> Any help would be appreciated!
>
> Alex Sofronie
> [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] how can i cache php scripts enterpretet

2001-08-24 Thread Ralph Deffke

I have developed a web portal for big compamies with a lot of traffic on
their pages. main functions, like member authentication etc. are called
on every page request. it would make sence to have them ready
enterpretet to skip enterpretation on each request. i know that there
are tools arround like Zent Cache. however they require an
recompilation/binding on the server. but this is on such big corporate
servers almost impossible.

Does anybody know a solution for that ?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: IP security

2001-08-26 Thread Ralph Deffke

use the $REMOTE_ADDR variable for the remote address

see php manual chapter 7 Variables - Variables from outside PHP


Nafiseh Saberi schrieb:

> hi.
> how can I control the ip that with ID and password ,all of
> user cant enter to site and if one person want to enetr should
> have special IP that I know it.
>
> thanks.
> nafiseh.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: zlib1.1.3 and ob_gzhandler

2001-08-26 Thread Ralph Deffke

Are you shure u sending the right http header?

your discription sound like the browser receives the wrong header information,
respactively the wrong mime type. if you use the right mouse button and say show
image, all browsers don't care about the mime type and try to evaluate the data
content and find the appropiate helper application. make shure the header is
something like
'octed-stream/JPG' or octed-stream/GIF (i'm not shure if this is the exact
syntax for the mime types, refer to HTTP 1.0 spezification for detaisl)

Martin Helie schrieb:

> Hello everyone,
>
> I'm a newbie here, so please forgive me if this topic has been discussed
> previously (I could find no mention of it).
>
> I recently compiled PHP4.0.6 with gd1.8.4 and zlib 1.1.3 and experienced no
> problems --except! If you use ob_gzhandler as your output handler, you'll
> want to make sure any image functions you use in PHP return valid images for
> Netscape (I tried Netscape Communicator 4.7 on Linux, Irix and Windows and
> got "broken images"). Funny thing is, if you right-clicked on the image and
> did "view image", the browser would show it correctly.
>
> After much frustration, I realized that using _no_ output handler (at least
> not ob_gzhandler) solved the problem.
>
> I assume this is due to a different way of gzipping data in either PHP or
> zlib from previous versions.
>
> I hope someone finds this information useful -- or can provide the "real"
> explanation, maybe even a better solution.
>
> Martin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: relative filename /home/www... in stead of /www/.....

2001-08-26 Thread Ralph Deffke

use $SCRIPT_FILENAME and extract the parts of the path as u need.
or better $PATH_TRANSLATED see also php manual chapter 7 predefined variables.


Chris Hayes schrieb:

> dear group,
>
> I use the $DOCUMENT_ROOT to make a complete file name.
>
> $fpname=$DOCUMENT_ROOT.'/includes/blocks/dynmenu.php';
>
> It does not work on one site: the document root misses the /home/ start. I could
> just hardcode this but i'ld rather have a function that would work everywhere.
>
> What can i do?
>
> Warning: fopen("/www/ecodorp/admin/modules/dynmenu.src","r")
> - No such file or directory in /home/www/ecodorp/php/post/admin/modules/dynmenu.php 
>on line 378
> I cannot open /www/ecodorp/admin/modules/dynmenu.src
> Chris
>
> 
> --  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
> 
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: show number of search results

2001-08-26 Thread Ralph Deffke

make a sql just with your where clause like this

select count(*) from table where your where clause

the relsulting result set will give u the number of records for your where
clause

[EMAIL PROTECTED] schrieb:

> Good day,
>
> I'm trying to figure out how I can show the following on my search results
> page:
>
> SEARCH RESULTS 1 - 10 of 14 total results for books
>
> Currently, I have a limit of 10 results printing on a page using "offset".
> I figured out how to program the pages to know what page of the results its
> viewing (eg: you are on page 4 or 10 pages of results) so programming the
> above statement shouldn't be difficult because the two statements seem quite
> similar.  Nevertheless, I can't figure it out - I have a feeling I'm making
> it harder than it really is.  Any suggestions or leads would be greatly
> appreciated!
>
> Thank you, Shawna


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Program to check for cookies

2001-08-26 Thread Ralph Deffke

see php Manual chapter 18 cookies

Sunil Jagarlamudi schrieb:

> Is there a program which will check for cookies before
> it allows access into the web site ?
>
> I want the user to enter the userid/password on a
> secure web server and pass the cookie information to
> the regular server. I don't want them to access
> regular web server without that cookie being enabled
> through the secure server.
>
> Thank You
>
> Sunil
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: limit 1

2001-08-26 Thread Ralph Deffke

i would try this:

 $sql = "SELECT DISTINCT users.names
FROM  users, selection
Where  users.name = selection.name   and   selection.setting = 'on'
";
because you joining two tables and you get as many results per users.name =
selection.name as entries in bouth tables per user. The DISTINCTROW could solve
the problem. However i don't know the number of records per user excists in the
tables, let assume u have not relaid on relational database rules and users are
not unique in one of the tables the following has to be done

 $sql = "SELECT DISTINCT users.names
FROM  users, selection
Where  users.name = selection.name   and   selection.setting = 'on'
GROUP BY users.name";


Jeremy Morano schrieb:

> Hi,
>
> I wondering if it was possible to use limit on part of a query and not all.
>
> this is my query which works the way it should.
>
> $sql = "SELECT users.names
> FROM  users, selection
> Where  users.name = selection.name   and   setting = 'on' limit 1
> ";
>
> What I would like to do is put a limit of 1 to only this part -> setting
> = 'on' limit 1 <--- and not on the rest.
>
> You see, there are many users.name that have a setting = 'on'I
> want, ALL those names , ONLY once..
>
> How do I do this?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] APC and WIN 32

2001-08-26 Thread Ralph Deffke

does anybody know a resource where i can get apc for windows? or does
anybody have experienced how to compile APC under wimdows and include it
i.e. in Merlin Desktop?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Wide Image Scroller

2001-08-26 Thread Ralph Deffke

but the frameset could be done with php !

Eric Persson schrieb:

> Craig Westerman wrote:
> >
> > I have a very wide panoramic image I want to display on a page. I don't want
> > to side scroll the page, only the image. Is there a way to make a image side
> > scrollable using PHP?
>
> This can not be done with php, it has to be made on the client side,
> with java/javascript/dhtml or something.
> The easy way should be to use a frameset, where one frame contains the
> image with the scroll.
>
> //Eric


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] how to pass variable argument list in a childconstructor to parent constructor, ideas wanted

2009-08-02 Thread Ralph Deffke
problem:

__ construct( $something ... variable argument list ){
parent::__construct( ??? );
}

I tried with func_get_args, but the problem is that it gives an indexed
array back.

lets say the argument list is mixed like this:
( "string", "string", array)

func_get_args will give this
[0] => "string"
[1] => "string"
[2] => array

the parent constructor works also with the func:_get_args function in ordfer
to handle variable argument lists

if u pass the array from func_get_args the parent constructor will reveive
after his func_get_args the following

array( [0] => array( [0] => "string" [1] =>"string" [2] => array( )

ok no problem so far. I thought just strip the key column of the array with
a function like this

function stripFirstColumn( $_fromThisArray ){
$b = "";
$_b = array();
foreach( $_fromThisArray as $value){
  if( !is_array($value) ){
 if( empty( $b )){
   $b = $value;
   //   $_b[$b]="";
 } else {
   $_b[$b]=$value;
   $b = "";
 }
  } else {
 array_push($_b, $value);  or $_b[] = $value;
  }
}
return $_b;
}

BUT this results in an arry like this

array( "string", "string", [0] => array( ...))

HOWEVER u can create a propper array for this purpose by writing this :

$_a = array( "string", "string", Array( "string" => "string",
"string"=>"string"));

but there is no way to create the same construction by code unless I use the
eval() function what limits me to string objects only.

im really a senior coder (since 1982) but this gives me a headace. what do u
think?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Character encoding

2009-08-05 Thread Ralph Deffke
I assume that the comments are collected by a browser form provided by you !
do u use the form attribute "accept-charset" ? I always do and I always use
UTF-8 homogeniously throughout my application I never had that problem.





"Sándor Tamás (HostWare Kft . )"  wrote in message
news:9ac01674e03a4d76a1b49dad39b04...@stgepe...
Hi,

I have a mysql database, which the users can insert comments. As the users
can be from different countries, with different character encoding, the
mysql table can contain various special characters.

How can I be sure to display these comments properly? I've found the
mb_convert_encoding, and for some characters it works okay, but there are
some really special characters which displayed as a '?'.

Does anybody know some workarounds?

Thanks,
SanTa



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Time keeping in DB

2009-08-05 Thread Ralph Deffke
sorry man, but a good data design keeps only data in a table u can not
calculate. in ur case that would be only   and  time.
refernces to user and project/tasks in other tables.

ur time sheet is definately a job for a report. that type of design limits u
to nothing. a user can start ans stop as many times he wants a day or time
range. u can report any number of time bits to any number of project a day
or time range

Ralph

"Shawn McKenzie"  wrote in message
news:5e.47.03459.7ead9...@pb1.pair.com...
> So, obviously not PHP related, but I'm looking for thoughts on the best
> way to record time sheets in a DB.  A time sheet for hours worked per
> day, not like a time clock where you start and stop.
>
> The two possibilities that I have thought of are (these are simplistic,
> of course I'll be storing references to the user, the project code etc.):
>
> 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
> d6, d7) where the dX field holds the hours worked
> 2. One record for each day (date, hours)
>
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Time keeping in DB

2009-08-05 Thread Ralph Deffke
off course, but this is a different subject, means a finished, not changing
time sheet is to store. in that case I would prefere to use a single record
for each sheet holding an id, possibly a date and then a medium text holding
a simple xml notation of the sheet. the benetit of that concept is again
that the timesheet can have unlimited start stop times. here again is the
final rendering of that xml data responsible for the presentation. however
the input AND output application would be a bit more complicated.


"Ben Dunlap"  wrote in message
news:91.81.14714.34ff9...@pb1.pair.com...
> > sorry man, but a good data design keeps only data in a table u can not
> > calculate. in ur case that would be only   and  time.
> > refernces to user and project/tasks in other tables.
> >
> > ur time sheet is definately a job for a report. that type of design
limits u
> > to nothing. a user can start ans stop as many times he wants a day or
time
> > range. u can report any number of time bits to any number of project a
day
> > or time range
>
> I agree (unless the app just doesn't have access to the start/stop data).
>
> Ben



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: dynamically naming PHP vars on the fly?

2009-08-05 Thread Ralph Deffke
u can "dynamical" chosse a variable name with a variable using a "douple" $
charachter eg.

$a = "this is a":
$b = "a";

echo $$b; outputs "this is a"

this is an all open feature to u

have fun
ralph

"Govinda"  wrote in message
news:a215e849-2602-4cb3-9da7-718ff047a...@gmail.com...
> HI all
>
> One thing I have been working around but now would love to just do it
> finally (and save workaround/longer code hassle) is when:
>
> I need to be able to create a variable (name it, and assign it a
> value) whose name is built up from a fixed string concatenated with
> another string which comes from the  value of another (already set)
> variable.
>
> Ie:
>
> I want to do this:
> (I am just assuming it won't work; I haven't even tried it yet)
>
> $var1='apple';
> $Fruit_$var1="organic";
> echo "$Fruit_apple"; // I want this to return "organic"
>
> Or how are you guys dynamically naming PHP vars on the fly?
>
> 
> John Butler (Govinda)
> govinda.webdnat...@gmail.com
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Time keeping in DB

2009-08-05 Thread Ralph Deffke
as I said, the job is to store a time sheet.
u came up with:

1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
d6, d7) where the dX field holds the hours worked
2. One record for each day (date, hours)

it seems that just the first record is fine. in a data design u dont hold
the same data twice. so why to use the second record?

if u want to use two tables, then the d1-d7 fields should not be in that
record.
if u use the second record it could be that there are two records with the
same date, what to do with it?, whichone is valid? date-time field are a bit
complicated and it is not a good idear to do them unique, that is because
internally those field are stored in databases as long unsigned integer
often the passed seconds since 1982 (the birth of the ibm pc) or even
miliseconds. that means there is always internally a big juggling to format
the date.

Ralph


"Shawn McKenzie"  wrote in message
news:e9.66.14714.5b80a...@pb1.pair.com...
> Ben Dunlap wrote:
> >> sorry man, but a good data design keeps only data in a table u can not
> >> calculate. in ur case that would be only   and  time.
> >> refernces to user and project/tasks in other tables.
> >>
> >> ur time sheet is definately a job for a report. that type of design
limits u
> >> to nothing. a user can start ans stop as many times he wants a day or
time
> >> range. u can report any number of time bits to any number of project a
day
> >> or time range
> >
> > I agree (unless the app just doesn't have access to the start/stop
data).
> >
> > Ben
>
> OK, I think I understand most points except the start and stop time.
> Every time sheet I have used, SAP and several other smaller ones, I
> enter a weeks worth of time data like:
>
> Project Sun Mon Tues Wed Thur Fri Sat
> ---
> Grill steaks 8 8 8 8 0
> Vacation 0 0 0 0 8
>
> So why wouldn't I store the dates and the hours instead of start and
> stop times?
>
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: "PHP 6 and MySQL 5 for Dynamic Web Sites" Book

2009-08-05 Thread Ralph Deffke
why do u stick to php 6?

i would recommend www.scribd.com and have a search on PHP. there are books
on beginners for php5 and articles of the difference to php 6.

a very usefull site by the way, made me stopping buying books. loads of
material on IT stuff.

ralph
ralph_def...@yahoo.de

 wrote in message
news:43bda83e-2383-48a8-87ca-4408244fa...@fannullone.us...
> Has anyone read this book by Larry Ullman yet?  If so, what do you
> think about it?  I'm looking for a well-rounded book that covers PHP
> for e-commerce websites and from what little I've been able to find
> online, it looks pretty good.  Or would you recommend another book?
>
> I know that no book has all the answers - I just want something in my
> hands to read.  However, I've bought a few Perl books that were a
> waste of money, so this time, I thought I'd ask first.
>
> Thanks,
> Frank



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP programming strategy

2009-08-06 Thread Ralph Deffke
as it comes to this point I can recomment an O'reilly book "High Performance
Web Sites, essential knowledge for frontend engineers"

if u read that book ur eyes will grow and u will not bother about php
comments,

ralph


"Ashley Sheridan"  wrote in message
news:1249543712.3358.104.ca...@localhost...
> On Thu, 2009-08-06 at 09:24 +1000, Clancy wrote:
> > On Wed, 5 Aug 2009 09:25:20 -0400, phps...@gmail.com (Bastien Koert)
wrote:
> >
> > >On Wed, Aug 5, 2009 at 8:02 AM, Ashley
Sheridan wrote:
> > >> On Wed, 2009-08-05 at 21:49 +1000, Clancy wrote:
> > >>> Thank you to all of you who have commented on this query.
> > >>>
> > >>> On the subject of comments, I feel that Larry Garfield settled this
query by pointing out
> > >>> that halving the size of a particular document gave a barely
noticeable increase in speed.
> > >>> Paul Foster pointed out the problem of maintenance, but if, as I do,
you do your
> > >>> development in-house, and then upload the working copies of the
program, it would be
> > >>> possible to strip out comments when you upload it. If you were
really paranoid, this could
> > >>> have the advantage that if somebody managed to steal your code from
the server it would be
> > >>> that much harder for them to understand. On the other hand the
process of stripping out
> > >>> the comments could potentially introduce new bugs, and I think this
consideration would
> > >>> outweigh anything else.
> > >>>
> > >>> I have recently come to the conclusion that I should never consider
anything completed
> > >>> until I have analysed the HTML code for an actual page. It is
amazing how badly mangled
> > >>> tables and the like can be without producing any visible effect on
the page, and on
> > >>> several occasions I have found PHP error messages which were mixed
up with the HTML in
> > >>> such a way that they were not displayed at all. On at least one
occasion this gave me the
> > >>> clue to an otherwise baffling bug.
> > >>>
> > >>> I have also discovered that the process of analysing the HTML is
made substantially
> > >>> simpler by inserting HTML comments into the output; e.g. instead of
> > >>>
> > >>>   Echo '';
> > >>> write
> > >>> ?>
> > >>> 
> > >>>  > >>>
> > >>> 
> > >>>  > >>>
> > >>> Unfortunately, for HTML readability, it is highly desirable not to
indent the code, and if
> > >>> you are trying to have nicely indented braces, this makes the PHP
code that much harder to
> > >>> interpret.
> > >>>
> > >>> And on the question of functions there is some virtue (primarily
from the point of view of
> > >>> maintenance) in not having individual files too large, so while it
seems to be the general
> > >>> consensus that splitting up functions into groups to give smaller
files will probably slow
> > >>> things down a bit, if they can be grouped into sets which are only
loaded in particular
> > >>> circumstances this would be worth doing.
> > >>>
> > >>>
> > >> Nested tables are the devils playthings!
> >
> > I must be the devil, then.  I enjoy playing with them.  And if they're
done right they
> > seem to work on every system I have tried them on.  Granted Dreamweaver
design mode gets
> > its knickers in a knot if you nest them more than about 4 deep.
> >
> > >>
> > >> Thanks,
> > >> Ash
> > >> http://www.ashleysheridan.co.uk
> > >>
> > >>
> > >> --
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >>
> > >
> > >I would agree there...we have an app that allows users to create forms
> > >dynamically with a left and right panel section along with some full
> > >width plug-in. At a minimum this is built with three nested tables.
> > >Here's the really rotten part, the VP (original dev for the display
> > >code) screwed a table close up somewhere. A bug they found literally
> > >minutes before it when to prod at a client site, instead of giving me
> > >15 minutes to trace it down, they wrapped the entire table structure
> > >in another table to make it look pretty.
> >
> > Clearly he didn't verify the HTML before he released the original
version. ;-)
> > >
> > >Drives me mental as it produces lots a visual screw up when a certain
> > >pattern in the form elements is created
> >
> > That's the joy of HTML errors - often the output will appear normal
until you make some
> > minor, and apparently irrelevant, change, when it all goes haywire.
> >
> >
> That's not the only point. If you're on a slow connection you'll notice
> the issue. Some browsers only start displaying the page once all the
> layout data has been loaded. I've seen some sites with nesting levels of
> 7 tables deep sometimes, and that's just a mess. I'm also unsure how
> text/speech/Braille browsers deal with complex table sites too.
>
> And tables shouldn't be used for layout, use CSS instead!...
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Displaying user data and picture

2009-08-06 Thread Ralph Deffke
hi there,

u want help? break down ur question to the point, none is going to downlod
unknown zips searching for the spot.

its fun to help, but its for free, so make it easier for us to help u

u r lucky that i'm sick at the moment and a bit bored, but anyway i'm not
downloading a zip.

however, the most common error for newbies on that issue is, that thex don't
pay attention to the fact that a browser treats a picture as a separate file
to download. u can store pictures in a databas, and a blob field in mysql is
the right thing, however u have to have a little php scrip, however with a
.png extention to get the browser displaying the picture.

u have to tell apache that a .png (or jpeg, gif etc) extention is to be
parsed by the php interpreter where u then can place ur database retrival of
the picture. in that script u then have to make shure ur are sending the
right header out.

to give u all the details is worth some time and time is money. the amount
of documentation to figure out the details is not small. start with some w3c
and rfc standard to get the clue.

regards
ralph
ralph_def...@yahoo.de


"nashrul"  wrote in message
news:24839092.p...@talk.nabble.com...
>
> I am new to php...
> I try to make a php page that displays form submitted data and image.
There
> are 3 php files,
> tampil_tamu_admin.php, edit_tamu.php and display_img.php.
> The user lists are displayed in the tampil_tamu_admin.php, and when the
user
> clicks one record, it shows edit page (edit_tamu.php) that display user
data
> and picture. (edit_tamu.php file includes img tag that calls
display_img.php
> with user id)
> The problem is the user data is displayed but the image is not
displayed...
> How can I display this image ?
>
> The codes are attached
>
> Thanks http://www.nabble.com/file/p24839092/guest-book.rar guest-book.rar
> http://www.nabble.com/file/p24839092/guest-book.zip guest-book.zip
> -- 
> View this message in context:
http://www.nabble.com/Displaying-user-data-and-picture-tp24839092p24839092.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] "PHP 6 and MySQL 5 for Dynamic Web Sites" Book

2009-08-06 Thread Ralph Deffke
because this is to start with the baby figuring out about a family
:-)

ralph_def...@yahoo.de

"Eddie Drapkin"  wrote in message
news:68de37340908060841x129a9096w6c0907f85614c...@mail.gmail.com...
On Thu, Aug 6, 2009 at 11:32 AM, tedd wrote:
> At 5:34 PM -0700 8/5/09, sono...@fannullone.us wrote:
>>
>> Has anyone read this book by Larry Ullman yet? If so, what do you
>> think about it? I'm looking for a well-rounded book that covers PHP for
>> e-commerce websites and from what little I've been able to find online,
it
>> looks pretty good. Or would you recommend another book?
>>
>> I know that no book has all the answers - I just want something in
>> my hands to read. However, I've bought a few Perl books that were a waste
>> of money, so this time, I thought I'd ask first.
>>
>> Thanks,
>> Frank
>
> I found that all of Larry Ullman books are good.
>
> From a beginners point of view, you might want to buy some of his earlier
> books -- you should get a better price for a used version. That way you
can
> work your way up to php 6.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Does no one see the inherent issues in buying a book about a
not-feature-complete version of the language?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: [PHP] Displaying user data and picture

2009-08-06 Thread Ralph Deffke
I did mean, if u want to store a image in the database it would be a blob 
field, a blob field is a indifidual file in the database anyway,

I mean if i would do that type of design i would store the path to the image 
file in the database and give the browser the path to it for download.

however there are some reasonable reasons to store a image in the database.
1. if u have no access to write files to the disk this is the case in most free 
hosting services they give u php and mysql and thats it
2. if u want some access control to the image, e.g. login controlled. server 
admins dont like u playing arround with the htaccess file
3. its easy in those and other cases
4. image directores are public, and apear in search engines





Von: Michael A. Peters 
An: Ralph Deffke 
CC: php-general@lists.php.net
Gesendet: Donnerstag, den 6. August 2009, 23:02:55 Uhr
Betreff: Re: [PHP] Displaying user data and picture

Ralph Deffke wrote:
>  and a blob field in mysql is
> the right thing, however u have to have a little php scrip, however with a
> .png extention to get the browser displaying the picture.

What is the advantage to storing an image in the database opposed to as a flat 
file?

It seems to me it would require an extra database call, which could be cached 
but the cache would then grow to a monster size for sites with a lot of images.

Flat file involves a filesystem call, the disk arm has to move, but files on 
the server that have recently been read are still in the servers memory cache 
(at least with Linux) and do not require disk arm movement. Database calls that 
are not cached also require disk arm movement.

I ask not to criticize the procedure, but to find out if it is really worth it.

My web app does not store images in the web root so php already is invoked to 
open the file, read it, sometimes manipulate it (add a server side watermark), 
and then send it. It reads the data from flat file.

I don't have any data blobs in my database - which makes incremental backups 
easier - I use rsync for files and do a nightly mysql dump. Except for the 
first of the month, the diff of that nights backup compared to first of month 
is saved to flat file for rsync. Binary blobs in the database would likely mean 
I have to change my backup protocol, but if it really is advantageous, I'd do 
it.

I do store information about the images in the database, but that's rather 
small and easily cached by APC w/o needing to allocate too much memory to APC. 
Add data blobs and the cache would explode in size.



  

[PHP] Re: Pattern Matching

2009-08-06 Thread Ralph Deffke
this side for shure is for help, lets u play arround with regex
http://gskinner.com/RegExr/

ralph
ralph_def...@yahoo.de

"Floyd Resler"  wrote in message
news:50fc5ab0-ee8b-4ac2-b982-9262a3977...@adex-intl.com...
> I need some assistance in pattern matching.  I want allow the admin
> user to enter a pattern to be matched in my order form editor.  When
> someone then places an order I want to do a match based on that
> pattern.  Some of the examples I thought for the patterns are:
>  - must be numeric and 8 digits
> AA - must be alpha and 6 characters
> #A? - must be alphanumeric any length
> ##-A#A - must have two numbers, a dash, a letter, a number, and a letter
>
> I'm sure regular expressions are the answers but I am not well-versed
> in those at all and I'm not sure how to make the above patterns work
> in or even they are the best examples to use.  Any help would be
> greatly appreciated.
>
> Thanks!
> Floyd
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: "PHP 6 and MySQL 5 for Dynamic Web Sites" Book

2009-08-07 Thread Ralph Deffke
Hi Larry,

nice to have a comment from the editor, and I want to say thanks for writing
this book.

however this discussion was initiated by a newbie asking what book he should
use to learn php. ur book is important to the community of php freaks ! it
saved my time to see where the path is going through ! without reading and
surving on the web about the php6 branch. i do have ur book on 4 and 5 as
well and the new book i could just use to overfly the php6 related parts and
i was in the picture what COULD happen.
thanks for ur work.

however, for a newbie ? he would wonder why his production server tells him
about parse errors of unknown construction, because its 5,x

as I said earlier, "learning a family starting with a baby", however if you
are familiar with the family, you should get to know the new baby.

ralph_def...@yahoo.de

"Larry Ullman"  wrote in message
news:0c4de4e7-8169-4477-8d70-25cca96eb...@dmcinsights.com...
> Thanks to the OP for the interest in the book and to everyone else for
> their input. So here's what happened, from the writer/horse's mouth:
> It was time to write an update to the book because the second edition
> had been out for 3+ years or so, I think. It wasn't a money-making
> effort (i.e., get people to buy another copy) but rather a touch-up to
> make sure it's current enough. I had to make some decisions about what
> versions to support; the previous edition supported both PHP 4 and 5.
> PHP 6 was more than 50% complete at the time I started writing it and
> I thought the Unicode support was a pretty big deal, this being an
> ever-increasing global web...marketplace...blah...blah...blah. So I
> wanted to start thinking along those lines and as I didn't know when
> the fourth edition of the book would be written, I thought I'd get an
> early jump on PHP 6. Yes, PHP 6 wasn't nearly finalized at the time
> and no hosting companies were using it, but many hosting companies are
> still using PHP 4 and PHP 6 *is* available for playing around with. So
> that was my reasoning. In the end, only a bit more than one chapter
> _requires_ PHP 6 and I do like looking a bit into the future of Web
> development and PHP. Also, as I don't discuss OOP in this book (gasp!,
> I leave that to my more advanced PHP book because a decent discussion
> of OOP requires at least 150 pages and I'd need to cut out more
> important topics to include it in this book), some of the features
> being discussed in PHP 6 weren't problematic for the book one way or
> the other (like namespaces, which ended up on PHP 5.3). Again, the
> Unicode support was my main thinking.
>
> Two years later, had I known PHP 6 still wouldn't be out, I probably
> wouldn't have touched it at all and I do feel a bit sheepish about
> having a book out there on PHP 6 when PHP 6 isn't out there (for
> production purposes), but these things do happen to books,
> particularly with open-source projects that have no need to adhere to
> deadlines. Still, I would like to think that at worst, 10% of the
> material isn't usable today on production servers but still has a
> philosophical benefit. To atone for my prematurity, I do try to
> support the book as much as possible, I try to talk about all this
> versioning stuff in publish ways (like on the Amazon page for the
> book), and I don't think there's anything wrong with someone buying
> the second edition if they're a bit concerned about the PHP 6 thing.
> (In theory, I guess someone could, um, buy another writer's book, but
> I prefer to plead ignorance of such outcomes.) We--the publisher and
> I--also did consciously change the title of the book from "PHP and
> MySQL for Dynamic..." to "PHP 6 and MySQL 5 for Dynamic..." to
> indicate the distinctions being made.
>
> Sorry for the length, but I hope that helps. And thanks again.
> Larry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Buffered Logging?

2009-08-07 Thread Ralph Deffke
I did some very complete logging for two major german companies on their
intranet pages. an application with something like 23000 registered users
and more then 5 hits a day. I did none of any kind of buffering, just
raw table inserts. it never gave any problem on performance HOWEVER we did a
DAILY backup AND reset of the logging tables. so the tables where never much
bigger then 5 records. so if u use mySQL and the buffer technices
mentioned earlier I would go with it because of the benefit not to maintain
another different tool.

ralph


"Waynn Lue"  wrote in message
news:d29bea5e0908071825k73920480g598af559383ff...@mail.gmail.com...
> >
> > Hey PHPers,
> >>
> >> We've been doing sampled logging to the database in our application for
> >> awhile, and now I'm hoping eventually to blow that out to a larger
scale.
> >> I'm worried about the performance implications of logging to our
database
> >> on
> >> ...
> >>
> >>
> > If you are using mysql and MyISAM tables, you can try using "insert
DELAYED
> > " method.
> >
> > http://dev.mysql.com/doc/refman/5.1/en/insert-delayed.html
> >
> > This will bulk all your inserts for writes.
> >
>
> Thanks for the suggestions!  Those both look great for what I was going to
> do.  One other thought I had after reading those suggestions, if we're
doing
> web server logging, we can also parse the logs using webalizer or awstats.
> I know apache provides file size and the URL that's being hit, but what if
I
> want to do custom referral tracking?  We append ref=foo to our links to
> track where people are coming from, should I look at building my own
> solution for that, or do existing tools like awstats suffice for that as
> well?
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: str_replace

2009-08-08 Thread Ralph Deffke
looks good,
u r searching for $bible_verse_ref in $text_message_template to be replaced
by the string "bible_verse_ref".

if that makes sence to u, yes its right.

ralph
ralph_def...@yahoo.de

""Ron Piggott""  wrote in message
news:83745b9e385a4402888ba5924c296...@computera1afe9...
Am I understanding str_replace correctly?  Do I have this correct or are '
needed?

$bible_verse_ref is what I want to change to (AKA replace)
bible_verse_ref is what I change to change from (AKA search)
$text_message_template is the string I want to manipulate

$text_message = str_replace( $bible_verse_ref, 'bible_verse_ref',
$text_message_template );

Ron



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dynamically naming PHP vars on the fly?

2009-08-08 Thread Ralph Deffke
of course u can do this by sql.

see this
SELECT *
FROM `sometable`
LIMIT 0 , 30

gives u max 30 records if existstarting at record 0

on the next request u could say
SELECT *
FROM `sometable`
LIMIT 30 , 30

giving u max 30 recotds starting at record 30

ralph
ralph_def...@yahoo.de

"Nisse Engström"  wrote in message
news:eb.35.03345.5f47d...@pb1.pair.com...
> On Thu, 6 Aug 2009 12:42:49 -0600, Govinda wrote:
>
> >> Others have mentioned variable variables. While I have
> >> used those, I tend to prefer arrays:
> >
> > ah, yes, I see that too, now.  Thanks for reminding me about arrays.
> >   (You must be quite adept at arrays. )
>
> I don't know, but I often stuff things into array,
> such as the following snippet:
>
> ...   while ($r = mysql_fetch_row ($res)) {
> $news_paged[$page][$r[0]]['short_desc'] = $r[1];
> if (isset ($r[2]))
>   $news_paged[$page][$r[0]]['long_desc'] = $r[2];
> ...
>
>
> I wonder if there's a noticable difference in performance
> between variable variables and arrays... I'm guessing it's
> small enough to be of no concern.
>
> > (And to give you credit Nisse, I ended up going with your solution
> > ('knock on wood'.. it is not all done yet) from the other php-db list
> > (building an array from data returned from the 3 union all selects-
> > query).)
>
> I'm a total newbie when it comes to SQL beyond simple SELECTs.
> If there's a noticable gain to be made from limiting the number
> of rows returned from the database, then that is probably worth
> persuing. Otherwise, I'd do it in PHP.
>
>
> /Nisse



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dynamically naming PHP vars on the fly?

2009-08-08 Thread Ralph Deffke
but then ur byond simple select, man, I do hate unions and try to avoid
those.

"Nisse Engström"  wrote in message
news:8b.50.40613.c518d...@pb1.pair.com...
> On Sat, 8 Aug 2009 15:01:42 +0200, "Ralph Deffke" wrote:
>
> > of course u can do this by sql.
> >
> > see this
> > SELECT *
> > FROM `sometable`
> > LIMIT 0 , 30
> >
> > gives u max 30 records if existstarting at record 0
> >
> > on the next request u could say
> > SELECT *
> > FROM `sometable`
> > LIMIT 30 , 30
> >
> > giving u max 30 recotds starting at record 30
>
> Yup. I do that a lot. But the original problem was
> about a UNION of three tables. That's when my head
> go dizzy. (And that's not because of the bottle of
> Guinness I just had for lunch).
>
>
> /Nisse



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Question: what are frameworks?

2009-08-09 Thread Ralph Deffke
good question !! I think the word "framework" is modern fashion term in the
first case. in former days we used to say "library" C comes with a standard
library, in modern words C comes with a standard framework. I use my own
framework, means I reuse my code written for similar things before, so I use
my "framework". its like a painter, he uses a ready made frame to paint what
ever he wants,

u can use the yahoo UI framework to "paint" ur page. A operating system is a
"framework" unifieing the underlaying hardware.

as in former days u said "library" u say more modern "framework" in both
cases its a bunch of functions doing some stuff the user of the framework
hasn't to take care about by using the framework.

hope that helps

ralph
ralph_def...@yahoo.de
""Parham Doustdar""  wrote in message
news:5c.b0.05105.f18be...@pb1.pair.com...
Hi there,
I've heard of frameworks, but I don't quite know what they are used for.
I've done a little search on the internet, but even though I've been able to
find different PHP frameworks, I'm not quite sure what they offer, or in
what they differ, or why I shouldn't just use PHP as it is.
Can someone give a little bit of explaination?
Thanks!

-- 
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Ralph Deffke
Hi all,

I'm facing the fact that it seems that auto_increment fields in a table not
start at 1 like it was in earlier versions even if I install mySQL brand new
creating all tables new. it seems to me that auto_increments handling has
changed to older version. is somebody out there who can give me a quick
background about auto_increment and how and if I can control the behavior of
mySQL about them.

ralph_def...@yahoo.de



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Ralph Deffke
no this is not the point ! if I do this, the next auto_increment is still
10720
i can do what I want however the is defined long unsigned unique
auto_increment, what happens is in t1 the value is set to 10720 in t2 the
next value ist set to 10721 while the next record in t1 gets 10721.

it seems like the values in this field are unique OVER the whole database.

very strange to me...
ralph_def...@yahoo.de


"Jerry Wilborn"  wrote in message
news:3f4628f60908091202s67205256o222f22a0bfb61...@mail.gmail.com...
> ALTER TABLE T1 AUTO_INCREMENT=1;
> It's likely that you dropped every record and expected the auto_increment
to
> reset.
>
> Jerry Wilborn
> jerrywilb...@gmail.com
>
>
> On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke 
wrote:
>
> > Hi all,
> >
> > I'm facing the fact that it seems that auto_increment fields in a table
not
> > start at 1 like it was in earlier versions even if I install mySQL brand
> > new
> > creating all tables new. it seems to me that auto_increments handling
has
> > changed to older version. is somebody out there who can give me a quick
> > background about auto_increment and how and if I can control the
behavior
> > of
> > mySQL about them.
> >
> > ralph_def...@yahoo.de
> >
> >
> >
> > --
> > 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



Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Ralph Deffke

 no this is not the point ! if I do this, the next auto_increment is still
 10720
 i can do what I want however the field is defined "long unsigned unique
 auto_increment", what happens is in t1 the value is set to 10720 in t2 the
 next value ist set to 10721 while the next record in t1 gets 10722.

it seems like the values in this field are unique OVER the whole database.

very strange to me...
ralph_def...@yahoo.de


> "Jerry Wilborn"  wrote in message
> news:3f4628f60908091202s67205256o222f22a0bfb61...@mail.gmail.com...
> > ALTER TABLE T1 AUTO_INCREMENT=1;
> > It's likely that you dropped every record and expected the
auto_increment
> to
> > reset.
> >
> > Jerry Wilborn
> > jerrywilb...@gmail.com
> >
> >
> > On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke 
> wrote:
> >
> > > Hi all,
> > >
> > > I'm facing the fact that it seems that auto_increment fields in a
table
> not
> > > start at 1 like it was in earlier versions even if I install mySQL
brand
> > > new
> > > creating all tables new. it seems to me that auto_increments handling
> has
> > > changed to older version. is somebody out there who can give me a
quick
> > > background about auto_increment and how and if I can control the
> behavior
> > > of
> > > mySQL about them.
> > >
> > > ralph_def...@yahoo.de
> > >
> > >
> > >
> > > --
> > > 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



Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Ralph Deffke
I would like to have a KNOWN status of my database after a NEW installation
of the application, because the further installation relais on information
stored in record 1 of each table.

"tedd"  wrote in message
news:p06240801c6a4fe331...@[192.168.1.100]...
> At 8:17 PM +0200 8/9/09, Ralph Deffke wrote:
> >Hi all,
> >
> >I'm facing the fact that it seems that auto_increment fields in a table
not
> >start at 1 like it was in earlier versions even if I install mySQL brand
new
> >creating all tables new. it seems to me that auto_increments handling has
> >changed to older version. is somebody out there who can give me a quick
> >background about auto_increment and how and if I can control the behavior
of
> >mySQL about them.
> >
> >ralph_def...@yahoo.de
>
>
> Why be concerned about it? What difference does it make?
>
> Cheers,
>
> tedd
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Ralph Deffke
this is a very good startup for the issue. now the question is where does it
get the value if there is no max(ai) or when I do an insert in an empty
table with the ai field set to 1 where does the innoDB get the next ai value
10720 ?

I assume that the SELECT MAX(ai_col) FROM t FOR UPDATE; return is
incremented by 1 so how does this end up with 10720?

anyway, ur statement shows that there has changed somethimg definately. but
what?
maid be there is some flag telling the kernel that ai fields should be
unique throughout the database? some left behind of the cluster version of
mySQL?


"Nisse Engström"  wrote in message
news:91.f7.55947.dc74f...@pb1.pair.com...
> On Sun, 9 Aug 2009 20:17:15 +0200, "Ralph Deffke" wrote:
>
> > I'm facing the fact that it seems that auto_increment fields in a table
not
> > start at 1 like it was in earlier versions even if I install mySQL brand
new
> > creating all tables new. it seems to me that auto_increments handling
has
> > changed to older version. is somebody out there who can give me a quick
> > background about auto_increment and how and if I can control the
behavior of
> > mySQL about them.
>
> Did you Google for it? I found the following page that
> might be relevant:
>
>
<http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html>
>
>"Beginning with MySQL 5.1.22, InnoDB provides a locking
> strategy that significantly improves scalability and
> performance of SQL statements that add rows to tables
> with AUTO_INCREMENT columns.
> ...
> InnoDB uses the following algorithm to initialize the
> auto-increment counter for a table t that contains an
> AUTO_INCREMENT column named ai_col: After a server
> startup, for the first insert into a table t, InnoDB
> executes the equivalent of this statement:
>
>   SELECT MAX(ai_col) FROM t FOR UPDATE;
>
> InnoDB increments by one the value retrieved by the
> statement and assigns it to the column and to the
> auto-increment counter for the table."
>
>
> /Nisse



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Ralph Deffke
I should mention that I use MyISAM as storage engine what makes it even more
wiered.

"Nisse Engström"  wrote in message
news:91.f7.55947.dc74f...@pb1.pair.com...
> On Sun, 9 Aug 2009 20:17:15 +0200, "Ralph Deffke" wrote:
>
> > I'm facing the fact that it seems that auto_increment fields in a table
not
> > start at 1 like it was in earlier versions even if I install mySQL brand
new
> > creating all tables new. it seems to me that auto_increments handling
has
> > changed to older version. is somebody out there who can give me a quick
> > background about auto_increment and how and if I can control the
behavior of
> > mySQL about them.
>
> Did you Google for it? I found the following page that
> might be relevant:
>
>
<http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html>
>
>"Beginning with MySQL 5.1.22, InnoDB provides a locking
> strategy that significantly improves scalability and
> performance of SQL statements that add rows to tables
> with AUTO_INCREMENT columns.
> ...
> InnoDB uses the following algorithm to initialize the
> auto-increment counter for a table t that contains an
> AUTO_INCREMENT column named ai_col: After a server
> startup, for the first insert into a table t, InnoDB
> executes the equivalent of this statement:
>
>   SELECT MAX(ai_col) FROM t FOR UPDATE;
>
> InnoDB increments by one the value retrieved by the
> statement and assigns it to the column and to the
> auto-increment counter for the table."
>
>
> /Nisse



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] reason for a "Notice:.." on one site but not another? (Same code.)

2009-08-10 Thread Ralph Deffke
this is not "intelligence" its just pure math. the '&&' says if BOTH
expressions are true then the whole expression is true.

so if the first one is false, the whole is false, why checking the next one
in the underlaying C it would be something like this
{
if ( expression == false ) return false;
if ( expression == false) return false;
return true;
}

ralph
ralph_def...@yahoo.de

"John Butler"  wrote in message
news:9ada6df4-649c-4790-b51b-cc9cc0505...@gmail.com...
> >>
> > If you switch it around you'll get a notice because the IF evaluates
> > from left to right.  So you just want to make sure you check isset()
> > first.
> >
> > This would throw a notice:
> >
> > if($_POST['UserWishesDateRange']  == 'T' &&
> > isset($_POST['UserWishesDateRange'])) {
>
> Aha!  That must be what I tried and was still getting the notice!
> Interesting that it works (without notice) if we check against the
> isset () one first.   It makes if() look more intelligent that I would
> think... as if it saying, "good now that we've established that the
> var isset, now is it also equal to '___'., as opposed to just, "is var
> set, and is var equal to "___'.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: [PHP] reason for a "Notice:.." on one site but not another? (Same code.)

2009-08-10 Thread Ralph Deffke
the single & is a logical AND so a() NOR b() is evaluatet ! its usually used on 
binary integer.
e.g. 0x0001 & 0x0001 = 0x0001 equlals TRUE while 0x0002 & 0x0001 equals FALSE 

so something like $a & $b guides to some very interisting results depending of 
their values
but nothing u expect.

while && tells 'evaluate' the expressions on both sites and combine its results 
in an AND operation.

thats why compilers and interpreters do have a definition what value TRUE has.
its very likely that TRUE is 1 and false is 0

lets say 
$a = 1
$b = 1

then 
$a & $b is 1 or true and it would give the same like
$a && $b in that case

at that point its also to mention that an empty string in PHP is NOT == FALSE

this gives the following result on an empty string:
$a = "";
isset( $a ) == TRUE

while
$a = null;
isset( $a ) == FALSE;

for the same story there are the
==
===
and
!=
!===
operators





____
Von: Martin Scotta 
An: Andrew Ballard 
CC: Ralph Deffke ; php-gene...@lists..php.net
Gesendet: Montag, den 10. August 2009, 20:40:19 Uhr
Betreff: Re: [PHP] reason for a "Notice:.." on one site but not another? (Same  
code.)

This "intelligence" is given by the laziness of the && operator.

$res = a() && b(); # if a() is false then b() does not evaluate
$res = a() & b(); # b() evaluates no matter a()'s result

so, order matters.


On Mon, Aug 10, 2009 at 3:29 PM, Andrew Ballard  wrote:

On Mon, Aug 10, 2009 at 1:50 PM, Ralph Deffke wrote:
>>> this is not "intelligence" its just pure math. the '&&' says if BOTH
>>> expressions are true then the whole expression is true.
>>>
>>> so if the first one is false, the whole is false, why checking the next one
>>> in the underlaying C it would be something like this
>>> {
>>> if ( expression == false ) return false;
>>> if ( expression == false) return false;
>>> return true;
>>> }
>>>
>>> ralph
>>> ralph_def...@yahoo.de
>
>That's logically correct, and while PHP does implement this
>>"short-circuit" logic, not all languages do. In that regard, I
>>appreciate what John meant by saying it makes it look "more
>>intelligent." Some languages evaluate each of the conditions to their
>>respective boolean results before evaluating the logical operators.
>
>>Andrew
>
>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Martin Scotta



  

[PHP] Re: how to say "inverse your value" (to a boolean)?

2009-08-10 Thread Ralph Deffke
with XOR

try this
$a = 0;
echo $a ^ 1;
$a = 1;
echo $a ^ 1;

hope that helps

ralph
ralph_def...@yahoo.de

"John Butler"  wrote in message
news:52842d6f-dd45-44a6-ae06-2e58ef8f6...@gmail.com...
> quick Q:
> I have this inside a foreach{}  that I want to alternate between on
> and off so I can alternate the background-color of my 's.
>
> $tableRowBGcolorBoolCounter != $tableRowBGcolorBoolCounter; //-boolean
> on and off
>
> I am looking thru' docs and books, but can't remember (nor find now)
> in PHP how to say "inverse your value" (to a boolean).
> ?
>
> TIA! -G
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: how to say "inverse your value" (to a boolean)?

2009-08-10 Thread Ralph Deffke
u...
try
echo "";
for( $i=0 ; $i<10; $i++){
  echo "something " . (($a = $a^1) ? "red\n" : "green\n");
}
echo "";

watchout the brackets !

cheers
ralph_def...@yahoo.de

"John Butler"  wrote in message
news:52842d6f-dd45-44a6-ae06-2e58ef8f6...@gmail.com...
> quick Q:
> I have this inside a foreach{}  that I want to alternate between on
> and off so I can alternate the background-color of my 's.
>
> $tableRowBGcolorBoolCounter != $tableRowBGcolorBoolCounter; //-boolean
> on and off
>
> I am looking thru' docs and books, but can't remember (nor find now)
> in PHP how to say "inverse your value" (to a boolean).
> ?
>
> TIA! -G
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Synchronizing autonumber fields

2009-08-11 Thread Ralph Deffke
hi there,

this is typical app for db repliction mechanism. it depnds of the size off
your project.

have a look here:
http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html

if this is oversized for u do a dump of each table without the
auto_increment fields. if u read in these tables the main database then does
use its own record id.
to identifie these records use a subsidairy finegerprint field.

another way would be not to use a ai field for identifying the record, use a
timestamp field to have an unique index on the tables. it is very unlikeley
that two records are written at the same time in the various subsidaries. a
timestamp field is a breakdown to the milisecond. however there is still a
chance of 1 to some billion, that two records have the same key.

just some possibilities

cheers
ralph
ralph_def...@yahoo.de


""Leidago !Noabeb""  wrote in message
news:5bcf496e0908110004w94d29c2j4b01806822ca0...@mail.gmail.com...
> Hi
>
> I have the following tables setup in MYSQL:
>
> Region 1 Region 2
> HQ
> Tbl1 with autonumbered (PK) Tbl1 with autonumbered (PK)
> Tbl1 autonumbered-PK
>
> To explain the above. Basically there are two regions that collect
> information and then at the end of each month they have to send the
> information to HQ. This is fine, but the problem comes when the
> information (the data in the tables) is submitted to HQ. All three
> tables have the same names and the same structure. We want to
> synchronize the information sent by the regions into one table at HQ.
> How can we do this without having the duplicate number problem?
>
> Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-11 Thread Ralph Deffke
seems they changing idears on the fly? could it be that the designer is a
smal ugly person while u a a good looking ladykiller ?

on that background I would design a function where u can change ti what ever
u want on the fly something like this

var $a;
function alternate(  $a, $_b=array( "red", "red" ,"green" ,... ) {
if( count( $_b ) > $a ) {
return $_b[ $a++ ] ;
}
$a=0;
return $_b[ $a++ ] ;
}

so now u can do what ever anybody wants on just putting the right values
into the array

cheers

ralph
ralph_def...@yahoo.de

"David Otton"  wrote in message
news:193d27170908110328p43b4722fkc46b0bcda97fc...@mail.gmail.com...
2009/8/11 Daevid Vincent :

> NO! For the love of God and all that is holy, don't do that accumulator /
> mod "hack".
> That's so 1980's. And why make the CPU do all that math for every
row...
>
> Just do this. It's quick and simple:
>
> CSS:
> .dataRow1 { background-color: #DFDFDF; }
> .dataRow2 { background-color: #FF; }
>
> foreach ($foo_array as $foo) {
> ?>"> ?> }

A change request just came in - the interaction designer wants every
third line to have a grey background, instead of every second line.

> No need to initialize $dr as by default PHP will make it a boolean
"false",
> then each itteration, it will toggle true/false and substitute the CSS
class

Um. No. Just no.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is select_db necessary?

2009-08-12 Thread Ralph Deffke
here a basic background to this question.

all databases are build from various module bases. one module is the
database itself prosessing eg. the sql's another module is the database
connectivity. e.g. mySQL has a ability to connect thru ADO, .NET and an
server via IP.

MySQL supports unlimited databases comtaining tables. so from the point of
the database u have always to selct the database and then to the table.

however, if u study the various Database extensions u will find functions
(eg. mysql_db_query() ) where u point the database in the function call
while others don't (eg. mysql_query() ) on those u have to do a db select
first because the function itself doesn't do it, while mysql_db_connect()
does.

so if we know that now, we are coming to the question, why are database
extensions do have those two types of processing a sql statement?

the answer is: speed ! while those commands with a pointing out the database
do internally a select of the database they do it every time on each call.

if u have a application which does a lot of stuff at the same time other
then just select statement, this comes into consideration. it saves time to
do one select_db first and then 50 just raw sql's to that database.

now after dumping that much stuff on u, it depends on ur design if u need a
select_db first or not.

hope that helps
Ralph
ralph_def...@yahoo.de

"Allen McCabe"  wrote in message
news:657acef20908112023y222de6f4q63e64cd1e2785...@mail.gmail.com...
> I have seen different scripts for working with SQL, and most follow the
same
> method with on difference.
>
> Variables are defined (host, password, etc.)
> mysql_connect command
>
> //then, the difference
>
> mysql_select_db command
>
> //back to common
>
> $sql = "SELECT ... "
> $result = mysql_query($ql)
>
> Is the database selection necessary, or is that implied with a SELECT or
> other SQL command?
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Is select_db necessary?

2009-08-12 Thread Ralph Deffke
I agree totally, are we not dicussing speed issues all the time? and then we
recommend a code doing an unessesary job on every call?

an ANSI selct db in the sql forces any database to run the internal select
db because there would be no check if the databse is the current one.
because, databasedevelopers can espext some smartness of us, the
programmers. its a lot off stuff to do for the database to select a
database. for shure, the database leafs that IN OUR hand to avoid to force
time consuming server resources.

ralph
ralph_def...@yahoo.de

"Colin Guthrie"  wrote in message
news:h5ug1h$tj...@ger.gmane.org...
> 'Twas brillig, and Jay Blanchard at 12/08/09 13:53 did gyre and gimble:
> > Jay Blanchard wrote:
> >> SELECT a.foo, a.bar
> >> FROM myDatabase.myTable a
> >> WHERE you set other conditions here
> >>
> >> All that is required is that you establish a connection to a server.
> >
> > If I recall correctly, this will cause issues with replication in
> > MySQL... insofar as you perform amodifying query.
> > [/snip]
> >
> > You're correct with regards to queries that modify on replicated
> > systems. If all you're doing is gathering data then this will work just
> > fine, is somewhat self-documenting (especially in lengthier code
> > containers), and very flexible. It also leaves the selection in the
> > database's hands, and as we almost always say, "let the database do the
> > work when it can".
>
> I'm interested to know why you consider this to be very flexible and how
> this leaves the selection in the database's hands?
>
> If I were to implement this and they try some destructive testing/demo
> on a sacrificial database, I'd have to use a whole other server instance
> (as all the queries would hardcode in the db name).
>
> Is it not more flexible if you omit the table name in every single query
> and specify it once in your bootstrap/connection code? Thus doing tests
> on other dbs etc. is a pretty simple switch of the connection code.
>
> Also telling the db engine what database you want to use in every query
> is not, IMO, leaving the selection in the the database's hands.
>
> Just curious as to the rationale here :)
>
> Col
>
>
>
>
> -- 
>
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
>
> Day Job:
>Tribalogic Limited [http://www.tribalogic.net/]
> Open Source:
>Mandriva Linux Contributor [http://www.mandriva.com/]
>PulseAudio Hacker [http://www.pulseaudio.org/]
>Trac Hacker [http://trac.edgewall.org/]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Ralph Deffke
as i said earlier: on db level there is always al select db done, doing this
on higer level layers (the database extension) consumes time. or why do
extension have the two ways of functions? to make our live more difficult?

on a ANSI sql the sql interpreter time is increased! unnessarylie

ralph_def...@yahoo.de


"Martin Scotta"  wrote in message
news:6445d94e0908120718g6c5bf368tacf8bbad127b5...@mail.gmail.com...
> Wed, Aug 12, 2009 at 10:37 AM, Ralph Deffke  wrote:
>
> > I agree totally, are we not dicussing speed issues all the time? and
then
> > we
> > recommend a code doing an unessesary job on every call?
> >
> > an ANSI selct db in the sql forces any database to run the internal
select
> > db because there would be no check if the databse is the current one.
> > because, databasedevelopers can espext some smartness of us, the
> > programmers. its a lot off stuff to do for the database to select a
> > database. for shure, the database leafs that IN OUR hand to avoid to
force
> > time consuming server resources.
> >
> > ralph
> > ralph_def...@yahoo.de
> >
> > "Colin Guthrie"  wrote in message
> > news:h5ug1h$tj...@ger.gmane.org...
> > > 'Twas brillig, and Jay Blanchard at 12/08/09 13:53 did gyre and
gimble:
> > > > Jay Blanchard wrote:
> > > >> SELECT a.foo, a.bar
> > > >> FROM myDatabase.myTable a
> > > >> WHERE you set other conditions here
> > > >>
> > > >> All that is required is that you establish a connection to a
server.
> > > >
> > > > If I recall correctly, this will cause issues with replication in
> > > > MySQL... insofar as you perform amodifying query.
> > > > [/snip]
> > > >
> > > > You're correct with regards to queries that modify on replicated
> > > > systems. If all you're doing is gathering data then this will work
just
> > > > fine, is somewhat self-documenting (especially in lengthier code
> > > > containers), and very flexible. It also leaves the selection in the
> > > > database's hands, and as we almost always say, "let the database do
the
> > > > work when it can".
> > >
> > > I'm interested to know why you consider this to be very flexible and
how
> > > this leaves the selection in the database's hands?
> > >
> > > If I were to implement this and they try some destructive testing/demo
> > > on a sacrificial database, I'd have to use a whole other server
instance
> > > (as all the queries would hardcode in the db name).
> > >
> > > Is it not more flexible if you omit the table name in every single
query
> > > and specify it once in your bootstrap/connection code? Thus doing
tests
> > > on other dbs etc. is a pretty simple switch of the connection code.
> > >
> > > Also telling the db engine what database you want to use in every
query
> > > is not, IMO, leaving the selection in the the database's hands.
> > >
> > > Just curious as to the rationale here :)
> > >
> > > Col
> > >
> > >
> > >
> > >
> > > --
> > >
> > > Colin Guthrie
> > > gmane(at)colin.guthr.ie
> > > http://colin.guthr.ie/
> > >
> > > Day Job:
> > >Tribalogic Limited [http://www.tribalogic.net/]
> > > Open Source:
> > >Mandriva Linux Contributor [http://www.mandriva.com/]
> > >PulseAudio Hacker [http://www.pulseaudio.org/]
> > >Trac Hacker [http://trac.edgewall.org/]
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> 
> $link = mysql_connect( /* settings */);
> mysql_select_db( 'database', $link);
> $result = mysql_query( 'SELECT * FROM ', $link );
>
> What SQL was sent to the database?
>
> Looking at bin logs I've found this.
>
> 1. use database => mysql_select_db
> 2. use database: SELECT * FROM  => mysql_query
>
> The DB is usually a common bottle-neck for most applications.
> You can have several webservers, but can't do that with the DB... of
course,
> you can have multiples slaves but just 1 master.
>
> is this the best way to send queries?
> What's the better and faster way?
>
> -- 
> Martin Scotta
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Ralph Deffke
what are telling the logs on that code?

', $link );
$result = mysql_query( 'SELECT * FROM ', $link );
$result = mysql_query( 'SELECT * FROM ', $link );
$result = mysql_query( 'SELECT * FROM ', $link );
$result = mysql_query( 'SELECT * FROM ', $link );
$result = mysql_query( 'SELECT * FROM ', $link );

would be interesting to see.

I personaly woudn't spend the time on logs, a computer is logical, I try to be 
logical, and I would
try to create code which is logical speedy. I expect the database kernel 
programmer the same.

I think then we are on the secure side.

ralph_def...@yahoo.de





________
Von: Martin Scotta 
An: Ralph Deffke 
CC: php-general@lists.php.net
Gesendet: Mittwoch, den 12. August 2009, 16:18:01 Uhr
Betreff: Re: [PHP] Re: Is select_db necessary?


Wed, Aug 12, 2009 at 10:37 AM, Ralph Deffke  wrote:

>I agree totally, are we not dicussing speed issues all the time? and then we
>>recommend a code doing an unessesary job on every call?
>
>>an ANSI selct db in the sql forces any database to run the internal select
>>db because there would be no check if the databse is the current one.
>>because, databasedevelopers can espext some smartness of us, the
>>programmers. its a lot off stuff to do for the database to select a
>>database. for shure, the database leafs that IN OUR hand to avoid to force
>>time consuming server resources.
>
>>ralph
>ralph_def...@yahoo.de
>
>>"Colin Guthrie"  wrote in message
>>news:h5ug1h$tj...@ger.gmane.org...
>
>> 'Twas brillig, and Jay Blanchard at 12/08/09 13:53 did gyre and gimble:
>>> > Jay Blanchard wrote:
>>> >> SELECT a.foo, a.bar
>>> >> FROM myDatabase.myTable a
>>> >> WHERE you set other conditions here
>>> >>
>>> >> All that is required is that you establish a connection to a server.
>>> >
>>> > If I recall correctly, this will cause issues with replication in
>>> > MySQL... insofar as you perform amodifying query.
>>> > [/snip]
>>> >
>>> > You're correct with regards to queries that modify on replicated
>>> > systems. If all you're doing is gathering data then this will work just
>>> > fine, is somewhat self-documenting (especially in lengthier code
>>> > containers), and very flexible. It also leaves the selection in the
>>> > database's hands, and as we almost always say, "let the database do the
>>> > work when it can".
>>>
>>> I'm interested to know why you consider this to be very flexible and how
>>> this leaves the selection in the database's hands?
>>>
>>> If I were to implement this and they try some destructive testing/demo
>>> on a sacrificial database, I'd have to use a whole other server instance
>>> (as all the queries would hardcode in the db name).
>>>
>>> Is it not more flexible if you omit the table name in every single query
>>> and specify it once in your bootstrap/connection code? Thus doing tests
>>> on other dbs etc. is a pretty simple switch of the connection code.
>>>
>>> Also telling the db engine what database you want to use in every query
>>> is not, IMO, leaving the selection in the the database's hands.
>>>
>>> Just curious as to the rationale here :)
>>>
>>> Col
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Colin Guthrie
>>> gmane(at)colin.guthr.ie
>>> http://colin.guthr.ie/
>>>
>>> Day Job:
>>>Tribalogic Limited [http://www.tribalogic.net/]
>>> Open Source:
>>>Mandriva Linux Contributor [http://www.mandriva.com/]
>>>PulseAudio Hacker [http://www.pulseaudio.org/]
>>>Trac Hacker [http://trac.edgewall.org/]
>>>
>
>
>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>

', $link );

What SQL was sent to the database?

Looking at bin logs I've found this.

1. use database => mysql_select_db
2. use database: SELECT * FROM   => mysql_query

The DB is usually a common bottle-neck for most applications. 
You can have several webservers, but can't do that with the DB... of course, 
you can have multiples slaves but just 1 master.

is this the best way to send queries?
What's the better and faster way?

-- 
Martin Scotta



  

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-12 Thread Ralph Deffke
thats why I decided years ago to write myself a little bunch of classes for
the html tags which gives me the ability to have PHP only code, very nice,
no errors and my outputs dont even need Tidy pure XHTML

i find these idear of mixing html and php as spagetty, using divs for tables
as something what facirs do,

no problems with unexpected header outputs, no small fat grafic designer can
make my live difficult, I can change evrything on the fly.

pure OOP

one final echo $page->toHtml();

put a candle for the invention of OOP ...
better as sex
makes the nights fun

consider this guys

ralph_def...@yahoo.de


"tedd"  wrote in message
news:p06240800c6a892b12...@[192.168.1.100]...
> At 8:33 AM -0700 8/12/09, Jim Lucas wrote:
> >Daevid Vincent wrote:
>
>
> -snip-
>
> I side with Jim on this. I never use short tags and write similar crap.
>
> Jim said:
>
> >I have found, in a number of cases, that using only the  tag
> >doesn't work all the time.
>
> It should work ALL the time, but sometimes inheritance overrides what
> you think is happening. In such cases, try adding !important to the
> rule and I think you'll see what you expect.
>
> Cheers,
>
> tedd
>
>
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Include Paths

2009-08-12 Thread Ralph Deffke
a rap song hihi haha
best comment I've ever read on a mailing list. reminds me that live is fun

thanks for making my day
thanks sheridan for ur shakespear like abbilities
thanks bastien for ur humor

GREAT



"Bastien Koert"  wrote in message
news:d7b6cab70908120909u593cbd6v692f34ae6ddea...@mail.gmail.com...
> On Wed, Aug 12, 2009 at 12:06 PM, Ashley
> Sheridan wrote:
> > On Wed, 2009-08-12 at 12:03 -0400, Rick Duval wrote:
> >> SORRY BUT
> >> I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS LIST, I CAN'T GET OFF
THIS LIST
> >> I'VE TRIED. NO RESPONSE. IS THERE AN ADMIN OUT THERE? PLEASE GET ME
> >> OFF THIS LIST!
> >>
> >> 
> >> This message has been scanned for
> >> viruses and dangerous content by
> >> Accurate Anti-Spam Technologies.
> >> www.AccurateAntiSpam.com
> >>
> >>
> >>
> >> On Wed, Aug 12, 2009 at 11:08 AM, Adam Shannon wrote:
> >> > On Wed, Aug 12, 2009 at 10:02 AM, Julian Muscat Doublesin <
> >> > opensourc...@gmail.com> wrote:
> >> >
> >> >> I had a problem with the include and require paths when using AJAX.
This I
> >> >> have solved by using the document root. However since doing so I am
> >> >> experiencing performance issues. Loading 20 records has suddenly
turned
> >> >> into
> >> >> something of a matter of a minute rather then seconds.
> >> >>
> >> >> Has anyone ever experienced such an issue?
> >> >>
> >> >> Can anyone please advise?
> >> >>
> >> >> Thanks
> >> >
> >> >
> >> > I wonder if loading the script/page with an absolute path would fix
the
> >> > problem.
> >> >
> >> >
> >> >
> >> > --
> >> > - Adam Shannon ( http://ashannon.us )
> >> >
> >> > -
> >> > This message has been scanned for
> >> > viruses and dangerous content by
> >> > Accurate Anti-Spam Technologies.
> >> > www.AccurateAntiSpam.com
> >> >
> >> >
> >>
> > Wow!
> >
> > First off, have you followed the unsubscription details on the website?
> >
> > Failing that, have you tried emailing the unsubscribe email address?
> > It's found in all the email headers that are part of the mailing list.
> >
> > And don't shout!
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> Thought it was a rap song to the tune of You Can't Touch This
>
> -- 
>
> Bastien
>
> Cat, the other other white meat



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Form Validation

2009-08-12 Thread Ralph Deffke
this is a PHP mailing list, may be u ask this on a js mailinglist

ralph_def...@yahoo.de


""Micheleh Davis""  wrote in message
news:002901ca1b68$fc6b0020$f54100...@com...
> Please help.  My form validation worked fine until I added the terms check
> at the bottom.  Any ideas?
>
>
>
> //form validation step one
>
> function validateStep1(myForm){
>
> // list of required fields
>
> with (myForm) {
>
> var requiredFields = new Array (
>
> firstName,
>
> lastName,
>
> phone,
>
> email,
>
> terms)
>
> }
>
> // check for missing required fields
>
> for (var i = 0; i < requiredFields.length; i++){
>
> if (requiredFields[i].value == ""){
>
> alert ("You left a
required
> field blank. Please enter the required information.");
>
> requiredFields[i].focus();
>
> return false;
>
> }
>
> }
>
> // check for valid email address format
>
> var eaddress= myForm.email.value;
>
> var validaddress=
> /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})$/;
>
> //var validaddress= /^((\w+).?(\w+))+...@\w+/i;
>
> var result= eaddress.match(validaddress);
>
> if (result == null) {
>
> alert ("Please enter your complete email
> address.");
>
> myForm.email.focus();
>
> return false;
>
> }
>
> // check for valid phone format
>
> var check= myForm.phone.value;
>
> check= check.replace(/[^0-9]/g,"");
>
> if (check.length < 10) {
>
>alert ("please enter your complete phone number.");
>
>return false;
>
> }//end if
>
>
>
> return true;
>
>
>
> //begin terms and conditions check
>
> var termsCheck= myForm.terms.value;
>
> if (bcForm1.checked == false)
>
> {
>
> alert ('Please read and select I Agree to
> the Terms and Conditions of Service.');
>
> return false;
>
> }
>
> else
>
> {
>
> return true;
>
> }
>
>//end terms check
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Form Validation

2009-08-12 Thread Ralph Deffke
may I ask what JS list u are using?

""Micheleh Davis""  wrote in message
news:003901ca1b6b$dd103d00$9730b7...@com...
> Yep, I'm sorry, sent to the wrong one.  Thanks all!
>
>
> -----Original Message-
> From: Ralph Deffke [mailto:ralph_def...@yahoo.de]
> Sent: Wednesday, August 12, 2009 12:29 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: Form Validation
>
> this is a PHP mailing list, may be u ask this on a js mailinglist
>
> ralph_def...@yahoo.de
>
>
> ""Micheleh Davis""  wrote in message
> news:002901ca1b68$fc6b0020$f54100...@com...
> > Please help.  My form validation worked fine until I added the terms
check
> > at the bottom.  Any ideas?
> >
> >
> >
> > //form validation step one
> >
> > function validateStep1(myForm){
> >
> > // list of required fields
> >
> > with (myForm) {
> >
> > var requiredFields = new Array (
> >
> > firstName,
> >
> > lastName,
> >
> > phone,
> >
> > email,
> >
> > terms)
> >
> > }
> >
> > // check for missing required fields
> >
> > for (var i = 0; i < requiredFields.length; i++){
> >
> > if (requiredFields[i].value == ""){
> >
> > alert ("You left a
> required
> > field blank. Please enter the required information.");
> >
> >
requiredFields[i].focus();
> >
> > return false;
> >
> > }
> >
> > }
> >
> > // check for valid email address format
> >
> > var eaddress= myForm.email.value;
> >
> > var validaddress=
> > /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})$/;
> >
> > //var validaddress= /^((\w+).?(\w+))+...@\w+/i;
> >
> > var result= eaddress.match(validaddress);
> >
> > if (result == null) {
> >
> > alert ("Please enter your complete email
> > address.");
> >
> > myForm.email.focus();
> >
> > return false;
> >
> > }
> >
> > // check for valid phone format
> >
> > var check= myForm.phone.value;
> >
> > check= check.replace(/[^0-9]/g,"");
> >
> > if (check.length < 10) {
> >
> >alert ("please enter your complete phone number.");
> >
> >return false;
> >
> > }//end if
> >
> >
> >
> > return true;
> >
> >
> >
> > //begin terms and conditions check
> >
> > var termsCheck= myForm.terms.value;
> >
> > if (bcForm1.checked == false)
> >
> > {
> >
> > alert ('Please read and select I Agree
to
> > the Terms and Conditions of Service.');
> >
> > return false;
> >
> > }
> >
> > else
> >
> > {
> >
> > return true;
> >
> > }
> >
> >//end terms check
> >
> >
> >
> >
>
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Design Patterns

2009-08-12 Thread Ralph Deffke
it would help if u would tell us what u want to accomplish with this ativity

cheers
ralph_def...@yahoo.de

"Martin Scotta"  wrote in message
news:6445d94e0908121323x721254c4ja389978d67bc0...@mail.gmail.com...
> Hi all!
>
> I've written a little Design Patterns Catalog in PHP.
> The patterns where taken from GoF: *Design Patterns: Elements of Reusable
> Object-Oriented Software* (ISBN
>
0-201-63361-2)
>
>
> This catalog includes (for each pattern):
>
>1. general description
>2. class responsibilities
>3. UML
>4. structural source
>5. documentation
>6. implementation example
>
>
> Also I've upload the documentation into my site for online purposes.
> http://martinscotta.com.ar/DesignPatterns/
>
>
> I don't know if I can send files attached through this list... so, if you
> want a copy just reply to this message.
>
> Any bug, comment, or anything you like to say is welcome!
>
> -- 
> Martin Scotta
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Design Patterns

2009-08-12 Thread Ralph Deffke
I wrote this message after spending 1/2 hour at your documentation. I'm
sorry, may be I don't have the ability to understand your goal. thats thats
why I ask you what is this for.

I'm an application programmer with an industrial process control
background. A peace of code ment to do something for me.

may I ask again what do u want to accomplish?

ralph_def...@yahoo.de

"Martin Scotta"  wrote in message
news:6445d94e0908121526r7280c680v22742e8418e6b...@mail.gmail.com...
> On Wed, Aug 12, 2009 at 6:27 PM, Ralph Deffke 
wrote:
>
> > it would help if u would tell us what u want to accomplish with this
> > ativity
> >
> > cheers
> > ralph_def...@yahoo.de
> >
> > "Martin Scotta"  wrote in message
> > news:6445d94e0908121323x721254c4ja389978d67bc0...@mail.gmail.com...
> > > Hi all!
> > >
> > > I've written a little Design Patterns Catalog in PHP.
> > > The patterns where taken from GoF: *Design Patterns: Elements of
Reusable
> > > Object-Oriented Software* (ISBN
> > >
> >
0-201-63361-2<http://en.wikipedia.org/wiki/Special:BookSources/0201633612
> > >)
> > >
> > >
> > > This catalog includes (for each pattern):
> > >
> > >1. general description
> > >2. class responsibilities
> > >3. UML
> > >4. structural source
> > >5. documentation
> > >6. implementation example
> > >
> > >
> > > Also I've upload the documentation into my site for online purposes.
> > > http://martinscotta.com.ar/DesignPatterns/
> > >
> > >
> > > I don't know if I can send files attached through this list... so, if
you
> > > want a copy just reply to this message.
> > >
> > > Any bug, comment, or anything you like to say is welcome!
> > >
> > > --
> > > Martin Scotta
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> I have uploaded the files into mi site.
> http://martinscotta.com.ar/DesignPatterns/
>
> -- 
> Martin Scotta
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Ralph Deffke
Thanks Jaime,

very nice, but I'm a programmer since 1982 and into OOP since 1988 with the
outcome if IBM's C++ compiler on the OS2 platform.

Don't u think it could be reasonable to ask if such an overhead IN PHP is
necessary?

does anybody agree that PHP might be the wrong language to accomplish such a
designpattern. Specialy if I find classes about interpreting things.

Don't u think to blow up a servers memonry just to have a nice little
framework could be ask?

Don't u think it makes sence to remember that PHP is just to output a simple
text file?

Has inbedween all the OOP ability everybody forgotten that this is the
simple purpose?

Are there anybody who understands that PHP is an INTERPRETING language and
has anybody an idear what is the amount of code running to do a simple

$something = new object();

versus echo $something

Design pattern are very good, standarizing even better. but would u agree
that, out of Martins presented work, u can not see the how AND how fast the
code is created to output the header the head and body and all other tags.

What I can see, the result will be a lot of code, lots of includes for a
view bytes.

For me, wrong language with unneccesary overhead.

as i can see there must be some more folks out there thinking  a bit
similar, or why is the feetback so relatively poor.

and at least u create design pattern for a PURPOSE.

so again for what pupose are this overhead in PHP
As long as nobody tells me for what benefit this work is done I would say
the design pattern should be done in other packages ready made for that with
an PHP output.

this would not affect any server resources.

now after more then 25 years behind the keyboard I got possibly a bit thumb.
lets open the discussion.

ralph_def...@yahoo.de


"Jaime Jose Perera Merino"  wrote in message
news:62f65ec80908130320t70078242y65308d2ef0288...@mail.gmail.com...
> Hi Ralph.
>
> If u want to understand the Martin's job u need to read about
> design patterns. A good place to start? Wikipedia (
> http://en.wikipedia.org/wiki/Design_Patterns).
>
> The use of Design patterns is an advanced programming method.
> It helps us to improve our object oriented programation.
>
> I hope this helps you,
>
>  Jaime
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: literal strings vs variable strings

2009-08-13 Thread Ralph Deffke
I dont think so, because PHP is an interpreter, the string 'something' has
to be extracted and then be put in memory after that the code will compare
the two memory locations. doesnt give me any benefit.

however, comparing strings with the '==' does involve case sensitivity and
also leading or trailing spaces will guide to not equal. thats why I prefere
the comparison functions anyway

"Martin Scotta"  wrote in message
news:6445d94e0908130702v4c2e5b77xe4b891546cc85...@mail.gmail.com...
> Hi all.
>
> Is this going to save me anything?
>
>  foreach($items as $item)
>if( 'something' == $item->something() )
>  return true;
>
>  $something = 'something';
> foreach($items as $item)
>if( $something == $item->something() )
>  return true;
>
> -- 
> Martin Scotta
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Ralph Deffke
funny then that I see here serious people discussing the benefit of
shortening code and cutting out commends.

maby thats a general problem of our society that everybody think higher
cheaper faster. this will have a limit guys !!! u can not go smaler then an
atom.

funny as well that I make my main money in optimizing code to speed and low
server resources. Im one of the old guys who can do both hardware and
software and I'm telling u this is suspect to me. I still can build a
computer from board and powersupply upward.

looks like that u joung guys got a little dream implementet by ur profs. Did
u know that the industry is complaining that the engeneers coming from the
universities are useless for business? a big complain! the real world is
different. Hosting companies will always try to keep a server machine as
long as they can, because a paid server DOES MAKE MONEY. so where is then
the cheap and fast server. how many servers out there still running on PHP4?
have u thouhgt about?

again, design pattern make sence, but on a companies policy base or on a
medium upwards sized project. but there will be more languages be involved
in one company it would be much better to use a language independent tool.

again this is chasing mice with an elephant

ralph_def...@yahoo.de


"Nathan Nobbe"  wrote in message
news:7dd2dc0b0908130809p456de5e7g35641de69af14...@mail.gmail.com...
> On Thu, Aug 13, 2009 at 8:09 AM, Ralph Deffke 
wrote:
>
> > Thanks Jaime,
> >
> > very nice, but I'm a programmer since 1982 and into OOP since 1988 with
the
> > outcome if IBM's C++ compiler on the OS2 platform.
> >
> > Don't u think it could be reasonable to ask if such an overhead IN PHP
is
> > necessary?
> >
> > does anybody agree that PHP might be the wrong language to accomplish
such
> > a
> > designpattern. Specialy if I find classes about interpreting things.
> >
> > Don't u think to blow up a servers memonry just to have a nice little
> > framework could be ask?
> >
> > Don't u think it makes sence to remember that PHP is just to output a
> > simple
> > text file?
> >
> > Has inbedween all the OOP ability everybody forgotten that this is the
> > simple purpose?
> >
> > Are there anybody who understands that PHP is an INTERPRETING language
and
> > has anybody an idear what is the amount of code running to do a simple
> >
> > $something = new object();
> >
> > versus echo $something
> >
> > Design pattern are very good, standarizing even better. but would u
agree
> > that, out of Martins presented work, u can not see the how AND how fast
the
> > code is created to output the header the head and body and all other
tags.
> >
> > What I can see, the result will be a lot of code, lots of includes for a
> > view bytes.
> >
> > For me, wrong language with unneccesary overhead.
> >
> > as i can see there must be some more folks out there thinking  a bit
> > similar, or why is the feetback so relatively poor.
> >
> > and at least u create design pattern for a PURPOSE.
> >
> > so again for what pupose are this overhead in PHP
> > As long as nobody tells me for what benefit this work is done I would
say
> > the design pattern should be done in other packages ready made for that
> > with
> > an PHP output.
> >
> > this would not affect any server resources.
> >
> > now after more then 25 years behind the keyboard I got possibly a bit
> > thumb.
> > lets open the discussion.
>
>
> since the 1980's, another advent has come about, called cheap memory, and
> fast
> cpu's.  so the answer is no, nobody cares about how many cycles it
> takes to instantiate a new class in php.  for those who do, they can
> go off and code apps based on sets of global functions or straight
> proceedural code, as php supports them all.
>
> if you're writing an app in todays world of fast cheap hardware, where
> you're concerned about the number of cycles it takes to instantiate an
> object being too high; i suppose you should be considering something
> like C++ for said app.
>
> also, it stands to reason that since nobody cares about the object
creation
> overhead, that the very next thing the community will do after getting
> classes in their language is reach out to design patterns.  just as GoF
and
> you did back in the day, w/ the advent of objc/C++ coming out after having
> lived through years of C.
>
> -nathan
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Ralph Deffke
NO NO NO

OOP is the best ever inventet !

see my comments on this list, I will also come up with an pure oop
opensource OMS very soon.

I just think a dam big pattern catalog like this one is like an elephant
chacing mice. I mean I can think of customers asking for a documentation of
course of the page u created for them calling the next day asking wher the
hell are the code for the page are documented in the 1000 pages of
documentation u had to give them.

I can think of two of my largest customers with their intranet application
with 23000 members and more then 5 hits during working hours where I
startet sweating while figting for every 1ms.

I'm thinking of people with even more hits a day, they even dont start using
PHP
so I dont know if thats the right way to blow up with includes  and
thousands of classes.

Im complaining on the deepnes and breakdown of the single pattern I miss the
orientation on the real problem - outputting marup text

cheers
ralph_def...@yahoo.de



"Jaime Jose Perera Merino"  wrote in message
news:62f65ec80908130817x3edc8ffav4153b7c1a44a2...@mail.gmail.com...
Hi Ralph,

Sorry, I haven't understand your question.

Do you  think OOP isn't usefull for PHP? The PHP
task is just to output a text file but the process might involve
a lot of work: database access, communication with web services, etc.

Do you think duplicate code is better than use more memory?
What is your proposal?

I'm very interested in more opinions.



2009/8/13 Ralph Deffke 

> Thanks Jaime,
>
> very nice, but I'm a programmer since 1982 and into OOP since 1988 with
the
> outcome if IBM's C++ compiler on the OS2 platform.
>
> Don't u think it could be reasonable to ask if such an overhead IN PHP is
> necessary?
>
> does anybody agree that PHP might be the wrong language to accomplish such
> a
> designpattern. Specialy if I find classes about interpreting things.
>
> Don't u think to blow up a servers memonry just to have a nice little
> framework could be ask?
>
> Don't u think it makes sence to remember that PHP is just to output a
> simple
> text file?
>
> Has inbedween all the OOP ability everybody forgotten that this is the
> simple purpose?
>
> Are there anybody who understands that PHP is an INTERPRETING language and
> has anybody an idear what is the amount of code running to do a simple
>
> $something = new object();
>
> versus echo $something
>
> Design pattern are very good, standarizing even better. but would u agree
> that, out of Martins presented work, u can not see the how AND how fast
the
> code is created to output the header the head and body and all other tags.
>
> What I can see, the result will be a lot of code, lots of includes for a
> view bytes.
>
> For me, wrong language with unneccesary overhead.
>
> as i can see there must be some more folks out there thinking  a bit
> similar, or why is the feetback so relatively poor.
>
> and at least u create design pattern for a PURPOSE.
>
> so again for what pupose are this overhead in PHP
> As long as nobody tells me for what benefit this work is done I would say
> the design pattern should be done in other packages ready made for that
> with
> an PHP output.
>
> this would not affect any server resources.
>
> now after more then 25 years behind the keyboard I got possibly a bit
> thumb.
> lets open the discussion.
>
> ralph_def...@yahoo.de
>
>
> "Jaime Jose Perera Merino"  wrote in message
> news:62f65ec80908130320t70078242y65308d2ef0288...@mail.gmail.com...
> > Hi Ralph.
> >
> > If u want to understand the Martin's job u need to read about
> > design patterns. A good place to start? Wikipedia (
> > http://en.wikipedia.org/wiki/Design_Patterns).
> >
> > The use of Design patterns is an advanced programming method.
> > It helps us to improve our object oriented programation.
> >
> > I hope this helps you,
> >
> >  Jaime
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Jaime J. Perera Merino
Aplicaciones Informáticas. Desarrollo y Formación
jaimejper...@gmail.com - 655460979



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Ralph Deffke
but what Im asking is that the reality?

go and talk to accountant and tell them after spending soansomuch for the
new site hes has to buy a new server ! what will acountant say, what u
think.

another more important point is in reality u take a project on on a specific
hardware base. lets say it a pretty new server fast a mercedes 500 but not a
ferrari V1.
because of ur great reusable code u do an extra ordinary competitive price
bacause u are ready made that fast, u put it on the server and ? womm
because of thausand of includes and stuff the customer is not happy with the
speed.
what u think who is going to pay the new hardware? or better who is going to
cut down the code.

well its me, because as senior consultant i'm taking over the projects from
young programmers who went out of business because the postulations of the
closed contract put them bankrupt.

THATS THE REALITY so guys tell me on a design pattern frame work what
requirements the server should fullfill that I can astimate if the customers
situation will not put me out of business?


"Robert Cummings"  wrote in message
news:4a84400a.9090...@interjinn.com...
>
>
> Ralph Deffke wrote:
> > funny then that I see here serious people discussing the benefit of
> > shortening code and cutting out commends.
> >
> > maby thats a general problem of our society that everybody think higher
> > cheaper faster. this will have a limit guys !!! u can not go smaler then
an
> > atom.
> >
> > funny as well that I make my main money in optimizing code to speed and
low
> > server resources. Im one of the old guys who can do both hardware and
> > software and I'm telling u this is suspect to me. I still can build a
> > computer from board and powersupply upward.
> >
> > looks like that u joung guys got a little dream implementet by ur profs.
Did
> > u know that the industry is complaining that the engeneers coming from
the
> > universities are useless for business? a big complain! the real world is
> > different. Hosting companies will always try to keep a server machine as
> > long as they can, because a paid server DOES MAKE MONEY. so where is
then
> > the cheap and fast server. how many servers out there still running on
PHP4?
> > have u thouhgt about?
> >
> > again, design pattern make sence, but on a companies policy base or on a
> > medium upwards sized project. but there will be more languages be
involved
> > in one company it would be much better to use a language independent
tool.
> >
> > again this is chasing mice with an elephant
>
> Except for incompetent algorithms, it is almost always cheaper to throw
> money at a new server than to have a coder micro optimize his/her code.
> Similarly, it is usually cheaper to throw more hardware at a well
> programmed solution that uses modern programming concepts than to have a
> programmer use the most rudimentary of programming techniques to save on
> cycles.
>
> With respect to why you see "shortening of code and cutting out
> comments", perhaps you are referring to the recent Calendar thread,
> where a bunch of us were just having some good old optimization fun. I
> for one enjoy the occasional diversion of optimizing some code just for
> the sake of optimizing it. Sometimes even, the optimization is even the
> cleanest/most readable solution.
>
> Cheers,
> Rob.
> -- 
> http://www.interjinn.com
> Application and Templating Framework for PHP



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Ralph Deffke
Greg I completly aggree, but dont miss the point that I'M adigted to OOP

WHY NOT A FRAMEWORK CLOSER TO THE REAL POINT  CALLED DOM
design pattern for HTML XHTML XML SVG Database conection and retrieving.

WHY CLASSES FOR CALLERS AND RECEIVERS AND INTERPRETERS.

a  is it a caller? a receiver?

why there a only dom classes? why not forgetting about the tag shit and a
bunch of classes for it?

well wait I will come up with it if I find ever the time and stop learning
from this list.

I also believe that u can force a good "design patter" by supplying a some
good very well design base classes. I mean talk to an JAVA freak, I dont
think they will come up with that type of framework.

as we just talking about that when can we expect PHP to extend unlimited
classes in one class.

for the newbies following the bullheaded experts fight:
something like this

class wow extents database, users, accessright implements HTML {
}

WHEN

"Greg Beaver"  wrote in message
news:4a84460d.3080...@chiaraquartet.net...
> Robert Cummings wrote:
> >
> >
> > Martin Zvarík wrote:
> >> Ralph Deffke napsal(a):
> >>> NO NO NO
> >>>
> >>> OOP is the best ever inventet !
> >>>
> >>> see my comments on this list, I will also come up with an pure oop
> >>> opensource OMS very soon.
> >>>
> >>> I just think a dam big pattern catalog like this one is like an
elephant
> >>> chacing mice. I mean I can think of customers asking for a
> >>> documentation of
> >>> course of the page u created for them calling the next day asking
> >>> wher the
> >>> hell are the code for the page are documented in the 1000 pages of
> >>> documentation u had to give them.
> >>>
> >>> I can think of two of my largest customers with their intranet
> >>> application
> >>> with 23000 members and more then 5 hits during working hours where
I
> >>> startet sweating while figting for every 1ms.
> >>>
> >>> I'm thinking of people with even more hits a day, they even dont
> >>> start using
> >>> PHP
> >>> so I dont know if thats the right way to blow up with includes  and
> >>> thousands of classes.
> >>
> >> I deeply and completely agree.
> >
> > Yes, certainly optimize on an as-needed basis. But well written PHP code
> > should certainly scale quite well horizontally. Extremely traffic laden
> > websites are quite likely to see a bottleneck at the database before a
> > bottleneck in the code.
>
> Hi,
>
> You all should understand that on high traffic sites, C or C++ is far
> more frequently used and called "PHP" because they use a whole lot of
> custom extensions to speed things up.  In addition, memcached speeds up
> database access so much that the speed of PHP starts to matter.  This is
> why PHP 5.3.0 is somewhere around 30% faster than any previous PHP
> version when running common applications, because the core developers
> realized that the base efficiency begins to matter and spent
> considerable effort improving basic language performance.
>
> There are a lot of ways to improve PHP's efficiency, and arguing over
> whether to use design patterns is not a particularly effective one.
> Profiling early and often to understand the slowest portions of your
> code is an effective method.  There are many, many talks/videos/etc.
> that can be found via google.com which discuss these principles, but
> suffice to say that xdebug, APC, and most importantly siege and apache
> benchmark are your friends in this endeavor.
>
> For Ralph: it might help you to know that facebook.com improved their
> performance by splitting up things into lots and lots of classes, and
> using autoload.  I don't have specific details because I don't work
> there, but the programmer who coded this solution was telling me the
> generalities at php|tek 2 years ago.  The pages that saw improvement
> were ones with a large number of possible execution branches in
> different requests.  autoload simply reduced the number of needed files
> to the bare minimum from a wide variety of choices.
>
> This surprised me, because the prevailing opinion at the time was that
> autoload always reduces performance.  The point to take from this story
> is that what you think to be true doesn't matter, the only thing is
> really understanding where your bottlenecks are by profiling
> aggressively, and even more important, why its slow, so you can fix it.
>
> Greg



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: [PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Ralph Deffke
for those of u not being a physician

semiconductors are of pretty big atoms, but this is not the main problem, 
the problem is that u have to cut out structures off these semiconductors
in order to build faster computers this matters.

many physicians believe that we are pretty close to a ultimate limit 
if we dont procees with the *biological* chips we facing a limit soon.

the other point is the cost, faster chips wount be any cheaper in the future
due to very expencive production processes.

So we should start thinking in optimization realy. at least some bewareness
it will not be endless

ralph_def...@yahoo.de





Von: Jay Blanchard 
An: Ralph Deffke ; php-general@lists.php.net
Gesendet: Donnerstag, den 13. August 2009, 20:15:31 Uhr
Betreff: RE: [PHP] Re: Re: Re: Design Patterns

[snip]
u can not go smaler then an atom.
[/snip]

Neutrons, electrons, gluons, protons  particles all smaller than an
atom. There are others if you want to get into a discussion of quantum
physics and mechanics, but we should probably take that discussion
offline.

Many folks here are building enterprise capable applications with PHP,
its OOP capabilities and the afore mentioned design patterns.. This level
of application, especially when combined with other technologies (like
the bits that make up AJAX), are much better served by using design
patterns so that consistency, readability and code-ability are enhanced.


You're correct in that the end result is just a text file...but look at
the format of that file output! When those files are handled by the
proper container, such as a web browser or relational database system
they become powerful tools and information.


  

[PHP] design pattern

2009-08-13 Thread Ralph Deffke
so guys

why u don't discuss Martins outcome?
is there no advice, idears?
isn't there a need for it?
nobody want to use it?

I WANT TO LEARN

ralph_def...@yahoo.de



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] design pattern

2009-08-13 Thread Ralph Deffke
well u got to know me personal, however may be u mix it with sarcasm?
may be I can't express that as good as I want in english.

if u follow the posts didn't some put me in the stupid corner?
I think its legal to ask why the question of Martin are not discussed.

and I still think, my question what he want to accomplish still is legal and
reasonable.

Many posts said, code done with design pattern framework are easy to
maintain and understand.

I ask u; is Martins work easy to understand? he put a lot of effort, but
with even design pattern it comes to the point of a good presentation. not
all people are the top smartest.

as u may have realised, he changed the presentation already and is coming up
with a more overview like documentation.

he is realy working hard, and I can't wait to see what benefit I could have
from his work what size of project it is worth for.

he deserves that design pattern experts comment his work.

ralph_def...@yahoo.de


"Robert Cummings"  wrote in message
news:4a846ea7.5010...@interjinn.com...
> Ralph Deffke wrote:
> > so guys
> >
> > why u don't discuss Martins outcome?
> > is there no advice, idears?
> > isn't there a need for it?
> > nobody want to use it?
> >
> > I WANT TO LEARN
>
> Maybe it's your grasp of the English language, maybe not. But I detect
> an air of aggression to your posts.
>
> ARE YOU JUST TROLLING?
>
> Cheers,
> Rob.
> -- 
> http://www.interjinn.com
> Application and Templating Framework for PHP



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] design pattern

2009-08-13 Thread Ralph Deffke
Hi Martin,

thanks for ur efforts, this is a lot of good work.

for my opinion the start is a bit too much theoretical and valid for all
type of application. In simple words, u are too close to the book.

I would love to have something closer to the purpose of PHP
and its applications.

if u have a look at the SMARTY documentation u have good explanation (and a
bad example by the way concerned oop) what are the real world problem.

When it comes to the final u find the most spagetti code in putting the page
grafic designer toghether with the business logic.

It would be great if this could be put in good oop patterns. As I can not
see that with the little amount of time I have got, p l e a s e tell me what
will come up on this edge?

ralph_def...@yahoo.de


"Martin Scotta"  wrote in message
news:6445d94e0908131322w722a37bbi24983ae143c5d...@mail.gmail.com...
> On Thu, Aug 13, 2009 at 4:04 PM, Ralph Deffke 
wrote:
>
> > so guys
> >
> > why u don't discuss Martins outcome?
> > is there no advice, idears?
> > isn't there a need for it?
> > nobody want to use it?
> >
> > I WANT TO LEARN
> >
> > ralph_def...@yahoo.de
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> I was following the entirely conversation, I must admit I wasn't expecting
> such thread.
>
> It is not common to see design patterns applied to PHP applications and,
is
> more common to don't see PHP applications. They are just scripts. Many
> scripts in a simple folder puts together to do the dirty work.
>
> Of course there are many kicking-ass PHP Applications, but they are a
> minimum portion compared to old-fashioned scripts.
>
> So, how do we start writing good quality PHP Applications? That's a very
> good question, and I don't know the answer, but I think by talking about
> design patterns we are in a good way.
>
> It's true that using design patterns the code will run slower, but it'll
be
> flexible, maintable, and the most important: simple.
> After all that's what we are looking for, something really simple that
make
> our life as developers happier every day. How do you explain the crescent
> number of php frameworks for rapid development?
>
> PHP core team has taken OOP seriously.
> Do you note the new SPL objects? The core team creates those objects using
> many designs patterns.
> By example the RecursiveDirectoryIterator and it's family use the
decorator
> pattern.
> Also features such as "late static binding" were added because a design
> pattern.
>
> I think there will be some "separation" in the community, those who will
> stay using scripts and those who will use heavily OOP. I do not know who
the
> "dark side" will be, xD
>
>
> -- 
> Martin Scotta
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] session variables - help

2009-08-14 Thread Ralph Deffke
I'm realy sorry for u, but the reason for no answers is ur concept.

may be some rules will help u and I recommend u to think to spend the time
to rewrite the whole code. Im shure u will solve the problem then:
first  dont use the global arrays directly. pick the values u need and put
them in reasonable types of variables.
build the business logic on these variables and if u feel like put the
results in well readable new ones
then populate the presentation in the required htmls
this will give u an more structured code, easier to debug and more fun for
the group to help u

I still dont understand why u use the $_SESSION variable. user often leave
forms open for hours and then submit them. u can not expect a user to end a
job in the livecycle of the session. thats what hidden form fields are made
for.

the $_session is for member like things and applications with security
issues where u can expect the user to finish things in a certain time or u
restart the whole.

"Allen McCabe"  wrote in message
news:657acef20908132257x630719e1g4ecddcdff9492...@mail.gmail.com...
> Ben,
>
> First of all, I thank you for your time and help.
>
> My ai with using unset($var) in update_order.php is to set the SESSION
> variable for an item to ' ' (empty) so that it would not show up on the
> order summary (because my writeResultRow() function will only write a row
if
> that variable is greater than 0).
>
> I just can't figure out what I'm missing here. Before I received your
> response, I made a few changes to my code, which helped streamline the
> calculating parts (grabbing values from SESSION instead of POST, and now
> when I update order_summary, the values will remain because it pulls them
> from the SESSION).
>
> I want to edit the values in the SESSION, so that when update_order.php
> redirects to order_process.php, the values are changed, and if applicable,
> an item is removed from the html table (if the quantity is less than 1).
>
> Here is some more complete code:
>
> [code = order_process.php]
>
>  session_start();
> // POST ALL $_POST VALUES, CREATE AS VARIABLES IN SESSION
> foreach($_POST as $k=>$v) {
>  $_SESSION[$k]=$v;
> }
>
> $thisPage="AFY";  //NAVIGATION PURPOSES
> include("afyshows.php"); //CONTAINS ARRAYS FOR SHOW ENTITIES; POPULATES
> ORDER FORM
> ?>
>
> . . .
>
> 
>  
>  
>  
>  
>  
>  
>  
>  
>  
>   />
>  
> . . .
>
> 
> function findTotalCost($b, $c) {
>  $total = $b * $c;
>  return $total;
> }
>
> function writeResultRow($a, $b, $c, $d, $e, $f) {
>  if($a != '') {
>   echo "\n\n\t";
>   echo "".$b."".$c."".$d."";
>   echo "".$e."  name='".$a."' id='".$a."' size='2' />=\$".$f."";
>   echo "";
>  }
> }
>
> //SETS $Total_show_01 to PRICE * QUANTITY
> //FORMATS TOTAL
> //IF A QUANTITY IS ENTERED, WRITES THE ROW WITH CURRENT VARIABLES
> $Total_show_01 = findTotalCost($shows['show_01']['price'],
> $_SESSION['show_01_qty']);
> $Total_show_01_fmtd = number_format($Total_show_01, 2, '.', '');
> writeResultRow($_SESSION['show_01_qty'], $shows['show_01']['title'],
> $shows['show_01']['date'], $shows['show_01']['time'],
> $shows['show_01']['price'],$Total_show_01_fmtd);
>
> //ABOVE LINES REPEATED FOR ALL 38 ENTITIES (show_01 to show_38)
>
> ?>
> . . .
>
> 
>
> [/code]
>
> Now, here is the update_order.php code in entirety:
>
> [code]
>
>  session_start();
> foreach ($_SESSION as $var => $val) {
>  if ($val == "0") {
>   unset($_SESSION[$var]);
>  } elseif ($val == '') {
>   unset($_SESSION[$var]);
>  } else {
>   $val = $_SESSION[$var];
>
>  }
> }
> header("Location: order_process.php");
>
> //NOTICE I FIXED THE LOCATION OF THE header() FUNCTION
> //BUT IT STILL DOES NOT UPDATE
>
> ?>
>
> [/code]
>
> If you're still with me, I thank you. I removed all the styling elements
> from the html to make it easier for you (and me) to see what it says. I
have
> invested many hours into this, and have generated many many lines of code,
> but I hope what I gave you is sufficient, while not being overwhelming at
> this hour.
>
> Thank you very much for your help thus far, anything else would be greatly
> appreciated.
>
>
> On Thu, Aug 13, 2009 at 5:56 PM, Ben Dunlap
wrote:
>
> >
> >
> >> I have the following code for order_update.php:
> >>
> >> [code]
> >>
> >> session_start();
> >> extract($_POST);
> >> foreach ($_POST as $var => $val) {
> >>  if ($val > 0) {
> >>  $_SESSION[$var] = $val;
> >>  } else {
> >>  unset($var);
> >>
> >>  }
> >>  header("Location: order_process.php");
> >> }
> >>
> >> [/code]
> >>
> >> This is not working, however, and it just loads order_process.php with
no
> >> values for the varaibles, as if I just refreshed the page with no
> >> sessions.
> >
> >
> > Maybe you left it out but I didn't see any place where you used
$_SESSION
> > in order_process.php. Also, your redirect in order_update.php appears to
be
> > inside your foreach loop, which would definitely mess things right up -- 
but
> > maybe that was just a typo in your email?
> >
> > Otherwise the logic in order_update.php looks OK, but th

Re: [PHP] session variables - help

2009-08-14 Thread Ralph Deffke
well thanks good they are far away then, but the problem is ur client, i
didnt find anybody giving me the permission to beat his customers

"Ashley Sheridan"  wrote in message
news:1250236989.2344.10.ca...@localhost...
> On Fri, 2009-08-14 at 09:55 +0200, Ralph Deffke wrote:
> > user often leave
> > forms open for hours and then submit them
>
> These users should be taken out and beaten over the head with their
> keyboards!
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Using fopen on a site with popups

2009-08-14 Thread Ralph Deffke
have u tried?

I did not, but as far as I understand u getting the stream including the
html causing the browser to open an popup.

so what is ur real problem then?

"James Colannino"  wrote in message
news:4a851d14.2010...@colannino.org...
> Hey everyone!  I have a question.  I know that you can use fopen to open
> not just local files, but also files via HTTP.  My question is, assuming
> you're attempting to open a page that has popups, is there anyway to get
> at the actual content underneath the popup?
>
> Thanks!
>
> James



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Using fopen on a site with popups

2009-08-14 Thread Ralph Deffke
well included in a html 

[PHP] PHP Byte Code Compiler

2009-08-14 Thread Ralph Deffke
quite a while I'm thinking for what could that be used. also in the
documentation there are no posts, has anybody ever played arround with if?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: File or directory?

2009-08-15 Thread Ralph Deffke
can u upload ur own files ?
can u create a directory ?
are u using a ftp client ?

try

ralph_def...@yahoo.de

"Clancy"  wrote in message
news:kjhc85hpub7drihgappifphcboolt9u...@4ax.com...
> I have just got access to a new server, and am playing with
upload/download procedures. I
> looked in the root directory, and see several objects which I assume to be
directories.
> However I was surprised to find there does not appear to be any command to
determine if an
> object is a file or directory, either in PHP FTP or plain FTP.  I could
try to change to
> them, or download them, but this seems overkill.  Am I overlooking
something obvious?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Issue with the huge import script

2009-08-15 Thread Ralph Deffke
Hi,

this sounds huge, and cries for a sql version of the import.
Are both databases the same? MySQL?

I give u a draft for MySQL
u export the data u have, then u got a textfile with 10+ sql statments

in the php script u open the file and iterate over it by line (carefull it
could be also ";" in case its a Unix created file on a windows platform)

line == one SQL insert in table bla bla...

in the loop then just mysq_query with this line

if the the someid is an unique index the insert will fail, so only those
records are inserted beeing not already in the database.

but I think as of the amount off records it doesn't sound like a every 10
minutes job, if it is a rara job, just do it with phpMyAdmin

sorry not pulling out the code, but was a long day behind the keyboard, need
some sleep

ralph_def...@yahoo.de




"Devendra Jadhav"  wrote in message
news:be4b00cf0908151815r1c7430d2j8a6cb0da1f10a...@mail.gmail.com...
> Hi,
>
> I have to import data from one database to another, I have to import
around
> 10(1Lac) records.
> First I need to check if the record is already imported or not and import
> only those records which are not imported.
>
> Here is my logic
>
> $already_imported = get_already_imported_records();
> format of the $already_imported is $already_imported[someid] = 'imported';
>
> Now i take all records from another db and iterating through it.
>
> if (!key_exists($already_imported[$new_id])){
> import_function($new_id)
> }else{
> echo 'allready imported'.$already_imported[$new_id];
> }
>
> Now my script is importing same records for more than one time. I am not
> able to get through this issue
>
> Is it because of the size of the records or something else...?
>
> Please suggest me some solution which is faster, safe and easy to code :D
>
> Thanks in advance
>
> -- 
> Devendra Jadhav
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How do I extract link text from anchor tag as well as the URL from the "href" attribute

2009-08-16 Thread Ralph Deffke

try

$link->nodeValue()

or

$link->getContent()

im not shure which one works on an image link which is indeed a child of  wrote in message
news:88827b190908160033n226b370bqe2ab70732811...@mail.gmail.com...
> I have the following code to extract the URLs from the anchor tags of an
> HTML page:
>
> $html = new DOMDocument();
> $htmlpage->loadHtmlFile($location);
> $xpath = new DOMXPath($htmlpage);
> $links = $xpath->query( '//a' );
> foreach ($links as $link)
> { $int_url_list[$i++] = $link->getAttribute( 'href' ) . "\n"; }
>
> If I have a link http://X.com";>, how do I extract the
> corresponding  which is displayed to the user as the text of the link
> (if it's an image tag, I would like a DOMElement for that).
> Thanks
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Issue with the huge import script

2009-08-16 Thread Ralph Deffke
because I assume always that a requester got some intelligence, so in that
case there must be a reasonsble reason why he wants to do it in PHP

im not like u assuming everybody is a thumb

ralph

"Ashley Sheridan"  wrote in message
news:1250413427.2344.51.ca...@localhost...
> On Sun, 2009-08-16 at 04:06 +0200, Ralph Deffke wrote:
> > Hi,
> >
> > this sounds huge, and cries for a sql version of the import.
> > Are both databases the same? MySQL?
> >
> > I give u a draft for MySQL
> > u export the data u have, then u got a textfile with 10+ sql
statments
> >
> > in the php script u open the file and iterate over it by line (carefull
it
> > could be also ";" in case its a Unix created file on a windows platform)
> >
> > line == one SQL insert in table bla bla...
> >
> > in the loop then just mysq_query with this line
> >
> > if the the someid is an unique index the insert will fail, so only those
> > records are inserted beeing not already in the database.
> >
> > but I think as of the amount off records it doesn't sound like a every
10
> > minutes job, if it is a rara job, just do it with phpMyAdmin
> >
> > sorry not pulling out the code, but was a long day behind the keyboard,
need
> > some sleep
> >
> > ralph_def...@yahoo.de
> >
> >
> >
> >
> > "Devendra Jadhav"  wrote in message
> > news:be4b00cf0908151815r1c7430d2j8a6cb0da1f10a...@mail.gmail.com...
> > > Hi,
> > >
> > > I have to import data from one database to another, I have to import
> > around
> > > 10(1Lac) records.
> > > First I need to check if the record is already imported or not and
import
> > > only those records which are not imported.
> > >
> > > Here is my logic
> > >
> > > $already_imported = get_already_imported_records();
> > > format of the $already_imported is $already_imported[someid] =
'imported';
> > >
> > > Now i take all records from another db and iterating through it.
> > >
> > > if (!key_exists($already_imported[$new_id])){
> > > import_function($new_id)
> > > }else{
> > > echo 'allready imported'.$already_imported[$new_id];
> > > }
> > >
> > > Now my script is importing same records for more than one time. I am
not
> > > able to get through this issue
> > >
> > > Is it because of the size of the records or something else...?
> > >
> > > Please suggest me some solution which is faster, safe and easy to code
:D
> > >
> > > Thanks in advance
> > >
> > > -- 
> > > Devendra Jadhav
> > >
> >
> >
> >
> You cry for a MySQL version and then revert back to PHP?! Why not just
> keep the whole thing in MySQL? You can use SQL statements to check
> whether a record exists before attempting to shove it in the database
> using a WHERE clause in the INSERT statement or by making one field
> unique and hiding notices about inserts that are attempting to overwrite
> that.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Issue with the huge import script

2009-08-16 Thread Ralph Deffke
so then tell me tell me what my first sentence means

"this sounds huge, and cries for a sql version of the import."

it looks like u have no experience in working as consultant  hotlines Ash
first the folk is asking for a sulotion of HIS php implying a general
solution in PHP with a hint to the prof solution

I think thats what I did


"Ashley Sheridan"  wrote in message
news:1250414284.2344.55.ca...@localhost...
> On Sun, 2009-08-16 at 11:05 +0200, Ralph Deffke wrote:
> > because I assume always that a requester got some intelligence, so in
that
> > case there must be a reasonsble reason why he wants to do it in PHP
> >
> > im not like u assuming everybody is a thumb
> >
> > ralph
> >
> > "Ashley Sheridan"  wrote in message
> > news:1250413427.2344.51.ca...@localhost...
> > > On Sun, 2009-08-16 at 04:06 +0200, Ralph Deffke wrote:
> > > > Hi,
> > > >
> > > > this sounds huge, and cries for a sql version of the import.
> > > > Are both databases the same? MySQL?
> > > >
> > > > I give u a draft for MySQL
> > > > u export the data u have, then u got a textfile with 10+ sql
> > statments
> > > >
> > > > in the php script u open the file and iterate over it by line
(carefull
> > it
> > > > could be also ";" in case its a Unix created file on a windows
platform)
> > > >
> > > > line == one SQL insert in table bla bla...
> > > >
> > > > in the loop then just mysq_query with this line
> > > >
> > > > if the the someid is an unique index the insert will fail, so only
those
> > > > records are inserted beeing not already in the database.
> > > >
> > > > but I think as of the amount off records it doesn't sound like a
every
> > 10
> > > > minutes job, if it is a rara job, just do it with phpMyAdmin
> > > >
> > > > sorry not pulling out the code, but was a long day behind the
keyboard,
> > need
> > > > some sleep
> > > >
> > > > ralph_def...@yahoo.de
> > > >
> > > >
> > > >
> > > >
> > > > "Devendra Jadhav"  wrote in message
> > > > news:be4b00cf0908151815r1c7430d2j8a6cb0da1f10a...@mail.gmail.com...
> > > > > Hi,
> > > > >
> > > > > I have to import data from one database to another, I have to
import
> > > > around
> > > > > 10(1Lac) records.
> > > > > First I need to check if the record is already imported or not and
> > import
> > > > > only those records which are not imported.
> > > > >
> > > > > Here is my logic
> > > > >
> > > > > $already_imported = get_already_imported_records();
> > > > > format of the $already_imported is $already_imported[someid] =
> > 'imported';
> > > > >
> > > > > Now i take all records from another db and iterating through it.
> > > > >
> > > > > if (!key_exists($already_imported[$new_id])){
> > > > > import_function($new_id)
> > > > > }else{
> > > > > echo 'allready imported'.$already_imported[$new_id];
> > > > > }
> > > > >
> > > > > Now my script is importing same records for more than one time. I
am
> > not
> > > > > able to get through this issue
> > > > >
> > > > > Is it because of the size of the records or something else...?
> > > > >
> > > > > Please suggest me some solution which is faster, safe and easy to
code
> > :D
> > > > >
> > > > > Thanks in advance
> > > > >
> > > > > -- 
> > > > > Devendra Jadhav
> > > > >
> > > >
> > > >
> > > >
> > > You cry for a MySQL version and then revert back to PHP?! Why not just
> > > keep the whole thing in MySQL? You can use SQL statements to check
> > > whether a record exists before attempting to shove it in the database
> > > using a WHERE clause in the INSERT statement or by making one field
> > > unique and hiding notices about inserts that are attempting to
overwrite
> > > that.
> > >
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > >
> >
> >
> >
> There are rare occasions on this list where the best answer is not PHP,
> and I believe this is one of them.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Issue with the huge import script

2009-08-16 Thread Ralph Deffke
better consider if u r insulting I've seen a view posts of u falling into
that category i w'ld recomment respect posters first approaches even if they
r stupid and incorporate the respect in the way u answer

the comment "you r crying ..." is an insult.

"Ashley Sheridan"  wrote in message
news:1250417781.2344.58.ca...@localhost...
> On Sun, 2009-08-16 at 11:25 +0200, Ralph Deffke wrote:
> > so then tell me tell me what my first sentence means
> >
> > "this sounds huge, and cries for a sql version of the import."
> >
> > it looks like u have no experience in working as consultant  hotlines
Ash
> > first the folk is asking for a sulotion of HIS php implying a general
> > solution in PHP with a hint to the prof solution
> >
> > I think thats what I did
> >
> >
> > "Ashley Sheridan"  wrote in message
> > news:1250414284.2344.55.ca...@localhost...
> > > On Sun, 2009-08-16 at 11:05 +0200, Ralph Deffke wrote:
> > > > because I assume always that a requester got some intelligence, so
in
> > that
> > > > case there must be a reasonsble reason why he wants to do it in PHP
> > > >
> > > > im not like u assuming everybody is a thumb
> > > >
> > > > ralph
> > > >
> > > > "Ashley Sheridan"  wrote in message
> > > > news:1250413427.2344.51.ca...@localhost...
> > > > > On Sun, 2009-08-16 at 04:06 +0200, Ralph Deffke wrote:
> > > > > > Hi,
> > > > > >
> > > > > > this sounds huge, and cries for a sql version of the import.
> > > > > > Are both databases the same? MySQL?
> > > > > >
> > > > > > I give u a draft for MySQL
> > > > > > u export the data u have, then u got a textfile with 10+ sql
> > > > statments
> > > > > >
> > > > > > in the php script u open the file and iterate over it by line
> > (carefull
> > > > it
> > > > > > could be also ";" in case its a Unix created file on a windows
> > platform)
> > > > > >
> > > > > > line == one SQL insert in table bla bla...
> > > > > >
> > > > > > in the loop then just mysq_query with this line
> > > > > >
> > > > > > if the the someid is an unique index the insert will fail, so
only
> > those
> > > > > > records are inserted beeing not already in the database.
> > > > > >
> > > > > > but I think as of the amount off records it doesn't sound like a
> > every
> > > > 10
> > > > > > minutes job, if it is a rara job, just do it with phpMyAdmin
> > > > > >
> > > > > > sorry not pulling out the code, but was a long day behind the
> > keyboard,
> > > > need
> > > > > > some sleep
> > > > > >
> > > > > > ralph_def...@yahoo.de
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Devendra Jadhav"  wrote in message
> > > > > >
news:be4b00cf0908151815r1c7430d2j8a6cb0da1f10a...@mail.gmail.com...
> > > > > > > Hi,
> > > > > > >
> > > > > > > I have to import data from one database to another, I have to
> > import
> > > > > > around
> > > > > > > 10(1Lac) records.
> > > > > > > First I need to check if the record is already imported or not
and
> > > > import
> > > > > > > only those records which are not imported.
> > > > > > >
> > > > > > > Here is my logic
> > > > > > >
> > > > > > > $already_imported = get_already_imported_records();
> > > > > > > format of the $already_imported is $already_imported[someid] =
> > > > 'imported';
> > > > > > >
> > > > > > > Now i take all records from another db and iterating through
it.
> > > > > > >
> > > > > > > if (!key_exists($already_imported[$new_id])){
> > > > > > > import_function($new_id)
> > > > > > > }else{
> > > > > > > echo 'allready imported'.$already_imported[$new_id];
> > > > > > > }
> > > > > > >
> 

[PHP] Re: How do I extract link text from anchor tag as well as the URL from the "href" attribute

2009-08-16 Thread Ralph Deffke
did u try it something like this

foreach ($links as $link) {
$int_url_list[$i]["href"] = $link->getAttribute( 'href' );
$int_url_list[$i++]["linkText"] = $link->getContent(  ); // nodeValue();
}
that should work

send ur code then please
ralph_def...@yahoo,de


"chrysanhy"  wrote in message
news:88827b190908160033n226b370bqe2ab70732811...@mail.gmail.com...
> I have the following code to extract the URLs from the anchor tags of an
> HTML page:
>
> $html = new DOMDocument();
> $htmlpage->loadHtmlFile($location);
> $xpath = new DOMXPath($htmlpage);
> $links = $xpath->query( '//a' );
> foreach ($links as $link)
> { $int_url_list[$i++] = $link->getAttribute( 'href' ) . "\n"; }
>
> If I have a link http://X.com";>, how do I extract the
> corresponding  which is displayed to the user as the text of the link
> (if it's an image tag, I would like a DOMElement for that).
> Thanks
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the "href" attribute

2009-08-16 Thread Ralph Deffke
I found this iteration over the item collection
for ($i = 0; $i < $items->length; $i++) {
echo $items->item($i)->nodeValue . "\n";
}

check here as well
http://us.php.net/manual/en/domnodelist.item.php

doesn't seem a simple foreach dos it

ralph_def...@yahoo.de

"chrysanhy"  wrote in message
news:88827b190908160659jada3a61ke43035e27f9a5...@mail.gmail.com...
> It did not work. Both gave me a "Call to undefined method" fatal error.
>
> On Sun, Aug 16, 2009 at 1:43 AM, Ralph Deffke 
wrote:
>
> >
> > try
> >
> > $link->nodeValue()
> >
> > or
> >
> > $link->getContent()
> >
> > im not shure which one works on an image link which is indeed a child of
 > so u could also check if the node has a child, if so its an image with,
in
> > good practice. an alt attribute to use
> >
> > haven't tried but should work. let me know pls
> >
> > ralph_def...@yahoo.de
> >
> >
> > "chrysanhy"  wrote in message
> > news:88827b190908160033n226b370bqe2ab70732811...@mail.gmail.com...
> > > I have the following code to extract the URLs from the anchor tags of
an
> > > HTML page:
> > >
> > > $html = new DOMDocument();
> > > $htmlpage->loadHtmlFile($location);
> > > $xpath = new DOMXPath($htmlpage);
> > > $links = $xpath->query( '//a' );
> > > foreach ($links as $link)
> > > { $int_url_list[$i++] = $link->getAttribute( 'href' ) . "\n"; }
> > >
> > > If I have a link http://X.com";>, how do I extract the
> > > corresponding  which is displayed to the user as the text of the
link
> > > (if it's an image tag, I would like a DOMElement for that).
> > > Thanks
> > >
> >
> >
> >
> > --
> > 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



Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the "href" attribute

2009-08-16 Thread Ralph Deffke
well the immage goes inside the   

on ur html the node a has no value however u should not get a error

this is pergect jtml link


ralph

"chrysanhy"  wrote in message
news:88827b190908160943t2254137fve43771c7e4f8c...@mail.gmail.com...
> WHile waiting for suggestions for extracting the link text from the DOM, I
> tried a brute force approach using the URLs I had found with
getAttribute(),
> but found myself baffled by my results. I boiled down my issue with this
> approach to the following snippet.
>
> $htmldata =<<
http://www.protools.com/users/user_story.cfm?story_id=1162&lang=1";>"Creating
>
> Surround Mixes with Tim Weidner"  src="new.gif" width="28">
> - Magnification engineer talks about mixing the album
at
> the
> ProTools site, by Jim Batchco
> http://www.beyondmusic.com/MediaPlayer/Yes/DontGo.html";>"Don't
> Go" Videohttp://fi.soneraplaza.net/kaista/musiq/kaistatv/0,8883,201392,00.html";>
>  - Presented by
Beyond
> Music
> (http://www.apple.com/quicktime/download/";>QuickTime
>
> Required)
> EOB;
> $url = 'http://www.beyondmusic.com/MediaPlayer/Yes/DontGo.html';
> $posn = strpos($url, $htmldata);
> echo "URL |$url| position is |$posn|";
>
> Running this gives me:
>
> URL |http://www.beyondmusic.com/MediaPlayer/Yes/DontGo.html| position is
||
>
> I've tried lots of functions, and even regular expressions, but I cannot
get
> the code to find the URL in the HTML. While I still hope for a DOM
solution
> to getting this link text, WHY can't the code find the URL in the HTML
> snippet?
>
> On Sun, Aug 16, 2009 at 9:29 AM, chrysanhy
wrote:
>
> > I pasted the code exactly as you have it, and I got the following:
> >
> > *Fatal error*: Call to undefined method DOMElement::getContent()
> >
> > I got the same thing with nodeValue().
> >
> >
> > On Sun, Aug 16, 2009 at 7:35 AM, Ralph Deffke
wrote:
> >
> >> did u try it something like this
> >>
> >> foreach ($links as $link) {
> >>$int_url_list[$i]["href"] = $link->getAttribute( 'href' );
> >>$int_url_list[$i++]["linkText"] = $link->getContent(  ); //
> >> nodeValue();
> >> }
> >> that should work
> >>
> >> send ur code then please
> >> ralph_def...@yahoo,de
> >>
> >>
> >> "chrysanhy"  wrote in message
> >> news:88827b190908160033n226b370bqe2ab70732811...@mail.gmail.com...
> >> > I have the following code to extract the URLs from the anchor tags of
an
> >> > HTML page:
> >> >
> >> > $html = new DOMDocument();
> >> > $htmlpage->loadHtmlFile($location);
> >> > $xpath = new DOMXPath($htmlpage);
> >> > $links = $xpath->query( '//a' );
> >> > foreach ($links as $link)
> >> > { $int_url_list[$i++] = $link->getAttribute( 'href' ) . "\n"; }
> >> >
> >> > If I have a link http://X.com";>, how do I extract
the
> >> > corresponding  which is displayed to the user as the text of the
> >> link
> >> > (if it's an image tag, I would like a DOMElement for that).
> >> > Thanks
> >> >
> >>
> >>
> >>
> >> --
> >> 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



Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the "href" attribute

2009-08-16 Thread Ralph Deffke
this worked here:
loadHtmlFile("testHtml.html");
$links = $html->getElementsByTagName('a');
echo "";

foreach ($links as $item) {
  echo $item->getAttribute( 'href' ). "\n";
  echo "---" . $item->nodeValue . "\n";
}

echo "";

?>

Im sending u the 2 files directly in a minute. it came out, as I thought
earlier that u have to check if the  tags has got children to extract
image links.

ralph_def...@yahoo.de


"chrysanhy"  wrote in message
news:88827b190908160943t2254137fve43771c7e4f8c...@mail.gmail.com...
> WHile waiting for suggestions for extracting the link text from the DOM, I
> tried a brute force approach using the URLs I had found with
getAttribute(),
> but found myself baffled by my results. I boiled down my issue with this
> approach to the following snippet.
>
> $htmldata =<<
http://www.protools.com/users/user_story.cfm?story_id=1162&lang=1";>"Creating
>
> Surround Mixes with Tim Weidner"  src="new.gif" width="28">
> - Magnification engineer talks about mixing the album
at
> the
> ProTools site, by Jim Batchco
> http://www.beyondmusic.com/MediaPlayer/Yes/DontGo.html";>"Don't
> Go" Videohttp://fi.soneraplaza.net/kaista/musiq/kaistatv/0,8883,201392,00.html";>
>  - Presented by
Beyond
> Music
> (http://www.apple.com/quicktime/download/";>QuickTime
>
> Required)
> EOB;
> $url = 'http://www.beyondmusic.com/MediaPlayer/Yes/DontGo.html';
> $posn = strpos($url, $htmldata);
> echo "URL |$url| position is |$posn|";
>
> Running this gives me:
>
> URL |http://www.beyondmusic.com/MediaPlayer/Yes/DontGo.html| position is
||
>
> I've tried lots of functions, and even regular expressions, but I cannot
get
> the code to find the URL in the HTML. While I still hope for a DOM
solution
> to getting this link text, WHY can't the code find the URL in the HTML
> snippet?
>
> On Sun, Aug 16, 2009 at 9:29 AM, chrysanhy
wrote:
>
> > I pasted the code exactly as you have it, and I got the following:
> >
> > *Fatal error*: Call to undefined method DOMElement::getContent()
> >
> > I got the same thing with nodeValue().
> >
> >
> > On Sun, Aug 16, 2009 at 7:35 AM, Ralph Deffke
wrote:
> >
> >> did u try it something like this
> >>
> >> foreach ($links as $link) {
> >>$int_url_list[$i]["href"] = $link->getAttribute( 'href' );
> >>$int_url_list[$i++]["linkText"] = $link->getContent(  ); //
> >> nodeValue();
> >> }
> >> that should work
> >>
> >> send ur code then please
> >> ralph_def...@yahoo,de
> >>
> >>
> >> "chrysanhy"  wrote in message
> >> news:88827b190908160033n226b370bqe2ab70732811...@mail.gmail.com...
> >> > I have the following code to extract the URLs from the anchor tags of
an
> >> > HTML page:
> >> >
> >> > $html = new DOMDocument();
> >> > $htmlpage->loadHtmlFile($location);
> >> > $xpath = new DOMXPath($htmlpage);
> >> > $links = $xpath->query( '//a' );
> >> > foreach ($links as $link)
> >> > { $int_url_list[$i++] = $link->getAttribute( 'href' ) . "\n"; }
> >> >
> >> > If I have a link http://X.com";>, how do I extract
the
> >> > corresponding  which is displayed to the user as the text of the
> >> link
> >> > (if it's an image tag, I would like a DOMElement for that).
> >> > Thanks
> >> >
> >>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] brainstorm/samples on _autoload() needed

2009-08-16 Thread Ralph Deffke
anybody out there with a ultimate solution, speed optimzed?

im going now for an ultimate solution, this repeating problem sucks

ralph_def...@yahoo.de



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Another date exercise

2009-08-16 Thread Ralph Deffke
i agree on date pickers and js is  well

use individual fields for day month and year, make month and year as drop
down and u have no problem at all

make live easier

ralph

"Paul M Foster"  wrote in message
news:20090816202217.gs2...@quillandmouse.com...
> On Sun, Aug 16, 2009 at 08:36:17AM +0100, Lester Caine wrote:
>
> > tedd wrote:
> >> Hi gang:
> >>
> >> Here's another exercise to consider.
> >>
> >> This is a date entry problem where the user can enter a date in various
> >> forms, but the return will be in a consistent format.
> >>
> >> For example, a user might enter a date in the form of:
> >>
> >> August 5, 2009
> >> Aug 05 2009
> >> Aug 5, 9
> >> 08/05/09
> >> 8-5-9
> >> 8 05 2009
> >> 8,5,9
> >>
> >> Or any combination thereof.
> >>
> >> However, the resultant date will be standardized to: Aug 5, 2009.
> >>
> >> Extra points for solving this for Euro as well as US date formats
(i.e.,
> >> 5 Aug, 2009 vs Aug 5, 2009).  And, extra extra points for accommodating
> >> month brevity, such as "A" for August and "Mar" for March and so on.
> >
> > But the real problem here is 05/08/09 is still August 5 2009 .
> > So teaching customers to use 2009.08.05 removes the hassle of needing to
> > know
> > where your target site is based!
> >
> > But as has been said, the real solution is a date picker.
>
> I *hate* date pickers. They slow down input. I can type 082309
> faster than I can ever do it with a date picker. The date class knows
> I'm in America and since it's a six-digit date, it must be mmddyy. (Yes,
> for those of you *not* in America, I agree our dates are goofy. I think
> we all ought to be on the metic system, too, but America and the UK seem
> intent on sticking to Imperial measure.)
>
> Paul
>
>
> -- 
> Paul M. Foster



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ralph Deffke
If u need a solution to know where the request comes from on a certain
secure level u can use cookies.

u might also have run into pages on the web giving u hard readable images u
have to put into a form field. toghether with cookies these design gives u
1000% from where the form data come.

depends what security level u whant to implement

regards
ralph_def...@yahoo.de


"nashrul"  wrote in message
news:25003587.p...@talk.nabble.com...
>
> This is a newbie question...
> Let's say there are 3 php files, page1.php, page2.php and page3.php. Form
> submission from page1.php or page2.php will take user to page3.php.
> I know that we can use parameter that is appended in the action attribute
of
> the form (e.g )
> But I think, appending this parameter is transparent to the user, since
it's
> visible in the url.
> And I think we can also use the hidden field or (form name ??.).
> So which one is most secured and better ??
> Thanks..
> -- 
> View this message in context:
http://www.nabble.com/is-there-a-better-way-to-know-from-which-php-file-the-request-comes-fromtp25003587p25003587.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ralph Deffke
I was reviewing ur post, and thinking u might talk about a pretty common
application like in a sequence of order form u want first the billing data
then the shipping data. for both u need just the same form u then process on
script3.

in such a case it doesn't matter if u use hidden fields or url parameter,
GET or POST to run different code for each form data in sript 3 neither can
I see a security issue here. u processing only the variables u defined. and
what does it matter if you have an hidden field like stepp=1 or stepp=2 and
a bored user put just for fun stepp=99 to piek ur ass. just take care in ur
code for it and display something (e.g. "hang on , big brother is watching
u")

this is good practice and common all over. any PHPer got his own way to do
it, and I think u r in the process to find urs. just try what u like best.

if you have a real security issue come back with more details about the
SECURITY issue and I m shure the group will have a good brainstorm going
again.

have fun
ralph_def...@yahoo.de

"nashrul"  wrote in message
news:25003587.p...@talk.nabble.com...
>
> This is a newbie question...
> Let's say there are 3 php files, page1.php, page2.php and page3.php. Form
> submission from page1.php or page2.php will take user to page3.php.
> I know that we can use parameter that is appended in the action attribute
of
> the form (e.g )
> But I think, appending this parameter is transparent to the user, since
it's
> visible in the url.
> And I think we can also use the hidden field or (form name ??.).
> So which one is most secured and better ??
> Thanks..
> -- 
> View this message in context:
http://www.nabble.com/is-there-a-better-way-to-know-from-which-php-file-the-request-comes-fromtp25003587p25003587.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: DB Question | A hotel reservation scenario

2009-08-18 Thread Ralph Deffke
to answer this is in fact not possible on the base of information u give.

I dont think there is a general db outlay for hotels. it depends how the
"booking" tables are designed.

does the application excist or u are doing a new one?

if it excist, have a look how the availability of a room is calculated and
then go from there. it would be the same calculation, just with backwards
dates.

hope that helps

ralph_def...@yahoo.de



"Behzad"  wrote in message
news:470fa6660908180745i6bb6a442xd53d2c02fac7b...@mail.gmail.com...
> Dear list,
> e-Greetings!
>
> I'm faced with an interesting and challenging problem.
>
> Consider a database, designed for a hotel.
> At any given time, each room has a different status: It's Busy or
Reserved,
> or Free.
>
> It's easy to retrieve number of Free rooms at the current time.
> But how can I count the number of rooms that were busy during the last
week
> ?
>
> I would appreciate if you take a brief moment of your time and share your
> opinion.
>
> Thank you in advance,
> -b
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Undefined Offset Error with Pagination and Sessions

2009-08-18 Thread Ralph Deffke
by having a quick look on it, u have to work on a session base? otherwise it
could be done by the post data only. I'm trying to avoid to work on the
session, because it makes live a bit easier. if u can try.

I'm telling this, because as u metioned to unset the session stuff is wierd
and I wouldn't trust the session vars any more anyway.

ralph_def...@yahoo.de


""Miller, Terion""  wrote in message
news:c6b04cb6.49e1%kmille...@springfi.gannett.com...
Formatted as PHP
http://pastebin.ca/1534058


and a note before I get chewed about the weird setting and unsetting at the
top with the sessions...because believe I see it...but if you take the
unset() out..nothing works, I can't figure that out and maybe that is a
blatent thing I'm missing (prob) but I know that checking if a sesion is set
then immediately unsetting it is not logical, and I tried putting it like if
isset else unset but same results, nothing work all variables error'd  out
as undefined.



On 8/18/09 11:49 AM, "Miller, Terion"  wrote:

Hi Folks, after days of trying lots of different things, I'm must grovel to
the list and post my problem...which is I am unable to get my pagination to
work, it seems to not carry the session to the next page and I get the
"undefined offset error"

The page code is posted here since my email client seems to mess up the code
formatting: http://pastebin.ca/1534024

Thanks to any and all who have a look.
Terion


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Form Spam

2009-08-20 Thread Ralph Deffke
may be a better afvice could be given if we would know more about the
application. However u mentioend that these little amonut is HUMAN driven.
then its very much dependent on the application itself and can not be done
with putting some retrictions which would be against the internationality of
the web.

However a common practice is thst u give a human only readable image that
shows hard readable character stuff to put in a input field for verification
on the server.

however human driven spam is almost not avoidable, bots yes.

The problem is that people in the third world work for 2 bugs a day. I would
wonder if u don't talk about the "nigeria conection" by the way.

hope it helps
ralph_def...@yahoo.de

""Gary""  wrote in message
news:e8.c5.10097.1ab4d...@pb1.pair.com...
> I have a client with a form on his site and he is getting spammed.  It
> appears not to be from bots but human generated.  While they are coming
from
> India, they do not all have the same IP address, but they all have gmail
> addresses, New York  addresses are used in the input field and they all
> offer SEO services.  It is not overwhleming, but about 5 a month.
>
> What is the best way to stop this.
>
> Thanks
>
> Gary
>
>
>
> __ Information from ESET Smart Security, version of virus
signature database 4351 (20090820) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP 5.x magic mathods quick question

2009-08-21 Thread Ralph Deffke
do I understand the doc right, that magic methods do exist in any object?
creating one (like __set() ) ovewrites the standard one?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] array() returns something weird

2009-08-22 Thread Ralph Deffke
well, when I saw ur post I got immediately the thought I would bed it has to
do with some stuff of $this or self.

I did play arround a bit with class creation the last days and yes, with
using self parent and $this I did put the HTTPPD in unstable and sometimes
it died without beeing able to send any error.

well this doesn't help very mutch.

I have two point:

(1)ur code is ( sorry ) lazy written, invest the brackets !! ur code writing
is predestinated for that type of error. shooting variable types arround by
pulling out of foreach loops,  if's,  is typical.

(2) using static variables are known for type missmatch errors just anything
has acces to them even if the containing class is not instantinated. many
dirty things can happen unless of corse they are not private.

further sugestions: check if you work on ur arrays with functions returning
array on success but false on fail or something like that. also a typical
source for that type of error

are u using magic __set ? I ran into a type change as well with it

good luck

ralph_def...@yahoo.de


"Szczepan Holyszewski"  wrote in message
news:200908222152.55846.webmas...@strefarytmu.pl...
> > What it looks like to me is that something is causing $foo to be a
> > string before the '$foo[] = "bar";' line is encountered. What do you
> > get if you put a gettype($foo); just before that line?
> >
> > >$foo=null;
> > >$foo[]="bar";  // <-- $foo simply becomes an array
>
> NULL. That is the problem. I _did_ put a gettype($foo) before the actual
line.
>
> OK, here are exact four lines of my code:
>
> $ret=array();
> foreach(self::$_allowed as $r => $a)
> if ($a)
> $ret[]=$r;
>
> As you can see, there is not a shred of a chance for $ret to become
something
> other than empty array between initialization and the last line in the
above
> snippet which causes the fatal errror. There's no __staticGet in 5.2.9, so
> self::$_allowed cannot have side effects.
>
> Secondly, the above code starts failing after it has executed successfully
> dozens of times (and yes, the last line _does_ get executed; in fact
self::
> $_allowed contains configuration information that doesn't change at
runtime).
>
> Thirdly...
>
> > > The problem is not limited to one place in code, and indeed before the
> > > fatal caused by append-assignment I get several warnings like
> > > "array_diff_key(): Argument #1 is not an array", where the offending
> > > argument receives a result of array().
> >
> > This would appear to support my suspicion, but try inserting the
> > gettype($foo) (or better, var_export($foo);) just before one of the
> > lines which triggers the error, and post the results.
>
> No, I don't think it supports your suspicion. Conversely, it indicates
that
> once array() returns a strangelet, it starts returning strangelets all
over
> the place. Initially it only triggers warnings but eventually one of the
> returned strangelets is used in a way that triggers a fatal error.
>
> As per your request:
>
> //at the beginning of the script:
>
> $GLOBALS['offending_line_execution_count']=0;
>
> // /srv/home/[munged]/public_html/scripts/common.php line 161 and on
> // instrumented as per your request:
>
> public static function GetAllowed() {
>
> if (debug_mode()) echo
++$GLOBALS['offending_line_execution_count']."";
> $ret=array();
> if (debug_mode()) echo var_export($ret)."";
> foreach(self::$_allowed as $r => $a)
> if ($a)
> $ret[]=$r;
>
> if (self::$_allowEmpty) $ret[]="";
> return $ret;
> }
>
> Output tail:
> ---
> 28
> array ( )
> 29
> array ( )
> 30
> array ( )
> 31
> array ( )
> 32
> array ( )
>
> Warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an
array
> in /srv/home/u80959ue/public_html/v3/scripts/SimpliciText.php on line 350
>
> Warning: Invalid argument supplied for foreach() in
> /srv/home/u80959ue/public_html/v3/scripts/SimpliciText.php on line 351
>
> Warning: array_merge() [function.array-merge]: Argument #2 is not an array
in
> /srv/home/u80959ue/public_html/v3/scripts/SimpliciText.php on line 357
>
> Warning: Invalid argument supplied for foreach() in
> /srv/home/u80959ue/public_html/scripts/common.php on line 28
>
> Warning: Invalid argument supplied for foreach() in
> /srv/home/u80959ue/public_html/scripts/common.php on line 28
>
> Warning: Invalid argument supplied for foreach() in
> /srv/home/u80959ue/public_html/scripts/common.php on line 28
> 33
> NULL
>
> Fatal error: [] operator not supported for strings in
> /srv/home/u80959ue/public_html/scripts/common.php on line 168
> --
>
> The warnings come from other uses of array().
>
> But wait! There is this invocation of debug_mode() between initialization
of
> $ret var_export. Let's factor it out to be safe:
>
> $debugmode=debug_mode();
> if ($debugmode) echo ++$GLOBALS['offending_line_execution_count']."";
> $ret=array();
> if ($debugmode) echo var_export($ret)."";
>
> And now

[PHP] wierd behavior on parsing css with no php included

2009-08-23 Thread Ralph Deffke
Hi folks, i did post this also on the Wamp page but maybe someone out there
had to solve that problem as well.

systems involved

Firefox 3.0.13
Firefox 3.5.2
IE 6

Wamp:
apache 2.2.11
PHP 5.2.9 & php 5.3

I do parse css files through php

Problem: css files are loaded into the browsers but not interpreted or used
on RAW HTML files no php included. The html files are produced with
phpDocumentor 1.4.2. IE6 uses parts of the css files loaded to display the
page, Firefox NOT AT ALL.

I think it might be possible that wamp throughs some wierd characters into
the css files or is the header type a problem? It looks like parsing the css
through the php engine changes the header of the css to text/html. this
would explain why IE6 can use them. on the other hand firebug shows the
loaded css, indicates however that no css is available.

as an reverse check I did load the html files direktly from the disk with
file:/// ... and the css are interpreted perfectly. so the source of the
problem is wamp.

it seems that the @importcsss does the biggest problem.it creates a 404
error "file not found"

it seems creating dynamic css files got some secrets involved with the wamp.
I'm using this concept since ages on linux with no problem.

on the @includecss it seems that the search for files are changing to the
php include path or something.

any idear what to check?

is important for my work to create css dynamicly

ralph_def...@yahoo.de



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] wierd behavior on parsing css with no php included

2009-08-23 Thread Ralph Deffke
Hi folks, i did post this also on the Wamp page but maybe someone out there
had to solve that problem as well.

systems involved

Firefox 3.0.13
Firefox 3.5.2
IE 6

Wamp:
apache 2.2.11
PHP 5.2.9 & php 5.3

I do parse css files through php

Problem: css files are loaded into the browsers but not interpreted or used
on RAW HTML files no php included. The html files are produced with
phpDocumentor 1.4.2. IE6 uses parts of the css files loaded to display the
page, Firefox NOT AT ALL.

I think it might be possible that wamp throughs some wierd characters into
the css files or is the header type a problem? It looks like parsing the css
through the php engine changes the header of the css to text/html. this
would explain why IE6 can use them. on the other hand firebug shows the
loaded css, indicates however that no css is available.

as an reverse check I did load the html files direktly from the disk with
file:/// ... and the css are interpreted perfectly. so the source of the
problem is wamp.

it seems that the @importcsss does the biggest problem.it creates a 404
error "file not found"

it seems creating dynamic css files got some secrets involved with the wamp.
I'm using this concept since ages on linux with no problem.

on the @includecss it seems that the search for files are changing to the
php include path or something.

any idear what to check?

is important for my work to create css dynamicly

ralph_def...@yahoo.de




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: wierd behavior on parsing css with no php included

2009-08-23 Thread Ralph Deffke
Yes, pasring .css is the problem, is there a way to tell php to send
different headers based on the file extention of the file parsed ? should
be, it worked on linux.

ralph_def...@yahoo.de


""Ralph Deffke""  wrote in message
news:67.4f.03363.a1e21...@pb1.pair.com...
> Hi folks, i did post this also on the Wamp page but maybe someone out
there
> had to solve that problem as well.
>
> systems involved
>
> Firefox 3.0.13
> Firefox 3.5.2
> IE 6
>
> Wamp:
> apache 2.2.11
> PHP 5.2.9 & php 5.3
>
> I do parse css files through php
>
> Problem: css files are loaded into the browsers but not interpreted or
used
> on RAW HTML files no php included. The html files are produced with
> phpDocumentor 1.4.2. IE6 uses parts of the css files loaded to display the
> page, Firefox NOT AT ALL.
>
> I think it might be possible that wamp throughs some wierd characters into
> the css files or is the header type a problem? It looks like parsing the
css
> through the php engine changes the header of the css to text/html. this
> would explain why IE6 can use them. on the other hand firebug shows the
> loaded css, indicates however that no css is available.
>
> as an reverse check I did load the html files direktly from the disk with
> file:/// ... and the css are interpreted perfectly. so the source of the
> problem is wamp.
>
> it seems that the @importcsss does the biggest problem.it creates a 404
> error "file not found"
>
> it seems creating dynamic css files got some secrets involved with the
wamp.
> I'm using this concept since ages on linux with no problem.
>
> on the @includecss it seems that the search for files are changing to the
> php include path or something.
>
> any idear what to check?
>
> is important for my work to create css dynamicly
>
> ralph_def...@yahoo.de
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: wierd behavior on parsing css with no php included

2009-08-23 Thread Ralph Deffke
before you come up with how to send a header in php

I'm TALKING ABOUT .CSS FILES NOT INCLUDING ANY PHP

if you put this in httpconf
AddType application/x-httpd-php .css
the problem is caused


""Ralph Deffke""  wrote in message
news:67.4f.03363.a1e21...@pb1.pair.com...
> Hi folks, i did post this also on the Wamp page but maybe someone out
there
> had to solve that problem as well.
>
> systems involved
>
> Firefox 3.0.13
> Firefox 3.5.2
> IE 6
>
> Wamp:
> apache 2.2.11
> PHP 5.2.9 & php 5.3
>
> I do parse css files through php
>
> Problem: css files are loaded into the browsers but not interpreted or
used
> on RAW HTML files no php included. The html files are produced with
> phpDocumentor 1.4.2. IE6 uses parts of the css files loaded to display the
> page, Firefox NOT AT ALL.
>
> I think it might be possible that wamp throughs some wierd characters into
> the css files or is the header type a problem? It looks like parsing the
css
> through the php engine changes the header of the css to text/html. this
> would explain why IE6 can use them. on the other hand firebug shows the
> loaded css, indicates however that no css is available.
>
> as an reverse check I did load the html files direktly from the disk with
> file:/// ... and the css are interpreted perfectly. so the source of the
> problem is wamp.
>
> it seems that the @importcsss does the biggest problem.it creates a 404
> error "file not found"
>
> it seems creating dynamic css files got some secrets involved with the
wamp.
> I'm using this concept since ages on linux with no problem.
>
> on the @includecss it seems that the search for files are changing to the
> php include path or something.
>
> any idear what to check?
>
> is important for my work to create css dynamicly
>
> ralph_def...@yahoo.de
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
but it should? shouldn't it how can I destroy a class instance invocing
__detruct() of the class ?!?!?






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] wierd behavior on parsing css with no php included

2009-08-24 Thread Ralph Deffke
perfect, thats what I was looking for, great thanks

ralph

"Jim Lucas"  wrote in message
news:4a923946.3020...@cmsws.com...
> Ralph Deffke wrote:
> > Hi folks, i did post this also on the Wamp page but maybe someone out
there
> > had to solve that problem as well.
> >
> > systems involved
> >
> > Firefox 3.0.13
> > Firefox 3.5.2
> > IE 6
> >
> > Wamp:
> > apache 2.2.11
> > PHP 5.2.9 & php 5.3
> >
> > I do parse css files through php
> >
>
> If you state that they have not PHP to parse, then why parse them?  It is
a waist!
>
> > Problem: css files are loaded into the browsers but not interpreted or
used
> > on RAW HTML files no php included. The html files are produced with
> > phpDocumentor 1.4.2. IE6 uses parts of the css files loaded to display
the
> > page, Firefox NOT AT ALL.
> >
> > I think it might be possible that wamp throughs some wierd characters
into
> > the css files or is the header type a problem? It looks like parsing the
css
> > through the php engine changes the header of the css to text/html. this
> > would explain why IE6 can use them. on the other hand firebug shows the
> > loaded css, indicates however that no css is available.
> >
> > as an reverse check I did load the html files direktly from the disk
with
> > file:/// ... and the css are interpreted perfectly. so the source of the
> > problem is wamp.
> >
> > it seems that the @importcsss does the biggest problem.it creates a 404
> > error "file not found"
> >
> > it seems creating dynamic css files got some secrets involved with the
wamp.
> > I'm using this concept since ages on linux with no problem.
> >
> > on the @includecss it seems that the search for files are changing to
the
> > php include path or something.
> >
> > any idear what to check?
> >
> > is important for my work to create css dynamicly
> >
>
> My suggestion would be to have php run a script using the
auto_prepend_file ini option
>
> ; Automatically add files before or after any PHP document.
> auto_prepend_file = fix_headers.php
> auto_append_file =
>
> Then, in a script called fix_headers.php, somewhere in your path I hope,
you have this.
>
> 
> # The following regex is completely untested.  It is meant to
> $ext = strtolower(preg_replace('|^.*\.([^.]+)$|',
$_SERVER['SCRIPT_NAME']));
>
> if ( 'css' === $ext ) {
> header('Content-Type: text/css');
> }
>
> ?>
>
> Another way to get around it is to have apache instruct PHP to change, and
output, the correct
> content type.
>
> http://httpd.apache.org/docs/1.3/mod/core.html#files
> http://us2.php.net/manual/en/ini.core.php#ini.sect.data-handling
> http://us2.php.net/manual/en/ini.core.php#ini.default-mimetype
>
> 
> php_value default_mimetype "text/css"
> 
>
> Hope this helps
>
> Jim Lucas
>
> > ralph_def...@yahoo.de
> >
> >
> >
>
>
> -- 
> Jim Lucas
>
> "Some men are born to greatness, some achieve greatness,
> and some have greatness thrust upon them."
>
> Twelfth Night, Act II, Scene V
>  by William Shakespeare



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
that is correct and that is the problem, and even that is not all !!!

try this
";
  }
  public function __detruct(){
echo "destructing";
  }
}

class b extends a{

}
$c = new b();
unset( $c );
?>

the constructor is inherited, the destructor not !!

PHP 5.2.9-1 and
PHP 5.3.0 behave the same

las trampas de la vida



ralph_def...@yahoo.de



"Stuart"  wrote in message
news:a5f019de0908240606x5fdca70bkb31dd32b072e5...@mail.gmail.com...
> 2009/8/24 kranthi :
> > unset($obj) always calls the __destruct() function of the class.
> >
> > in your case clearly you are missing something else. Probably
> > unset($anobject) is not being called at all ?
>
> That's not entirely correct. PHP uses reference counting, so if
> unsetting a variable did not cause the object to be destructed then
> it's highly likely that there is another variable somewhere that is
> holding a reference to that object.
>
> -Stuart
>
> -- 
> http://stut.net/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
typing error sorry

forget my last post

is there a was to destroy an object if there is hold a reference somewhere?

"Stuart"  wrote in message
news:a5f019de0908240606x5fdca70bkb31dd32b072e5...@mail.gmail.com...
> 2009/8/24 kranthi :
> > unset($obj) always calls the __destruct() function of the class.
> >
> > in your case clearly you are missing something else. Probably
> > unset($anobject) is not being called at all ?
>
> That's not entirely correct. PHP uses reference counting, so if
> unsetting a variable did not cause the object to be destructed then
> it's highly likely that there is another variable somewhere that is
> holding a reference to that object.
>
> -Stuart
>
> -- 
> http://stut.net/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
this is also not the full truth try this and it works
what are the circumstances that is causing this problem then, yes I do have
distributed references over my script and there are clearly references still
set, however after running the snipped script I can not see what I do
special in my script causing the problem. I even tried with public and
private static in other objects. it works. however the manual indicates the
refernce counter has to be 0.

";
  }
  public function __destruct(){
echo "destructing";
  }
}

class b extends a{

}

$c = new b();

$d = $c ;   // works
$f[] = $c ; // works

class e {
  private $m;

  public function setM( $m ){
$this->m = $m;
  }
}

$o = new e();
$o->setM( $c ); // works


unset( $c );


?>
"Lupus Michaelis"  wrote in message
news:41.f9.03363.01192...@pb1.pair.com...
> kranthi wrote:
> > unset($obj) always calls the __destruct() function of the class.
>
>Never calls the dtor. The dtor will be called only when the reference
> count reaches 0.
>
> class c { function __destruct() { echo 'dying !' ; } }
> $v1 = new c ;
> $v2 = $v1 ;
>
> unset($v1) ; // don't call the dtor
> unset($v2) ; // call the dtor
>
> -- 
> Mickaël Wolff aka Lupus Michaelis
> http://lupusmic.org



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
I dont agree, and as u see in my snipped code it works fine.

in an abstract class u can define an implementation to define some basic
things a overwriting function in an extending class has to take care of as
well.

this includes specialy magic functions.

thats what they are made for. may be you talk about interfaces ?

"hack988 hack988"  wrote in message
news:4d03254c0908241122r5b6d1c3csc06ec475a0797...@mail.gmail.com...
> see http://cn.php.net/manual/en/language.oop5.abstract.php
> PHP 5 introduces abstract classes and methods. It is not allowed to
> create an instance of a class that has been defined as abstract. Any
> class that contains at least one abstract method must also be
> abstract. Methods defined as abstract simply declare the method's
> signature they cannot define the implementation.
>
> You make misconception understand for abstract class,:(, correct code is:
> abstract class a {
>abstract public function __construct(){
>
>   }
>   abstract public function __destruct(){
>
>   }
>  }
>
>  class b extends a{
>public function __construct(){
> echo "constructing";
>   }
>   public function __destruct(){
> echo "destructing";
>   }
>  }
>
>  $c = new b();
> unset($c);
>
> if you want to make it work correctly that you want,plase change code to
follow
> class c {
>public function __construct(){
> echo "constructing";
>   }
>   public function __destruct(){
> echo "destructing";
>   }
> }
>
>  class d extends c{
>
>  }
>   $e = new d();
>   unset($e);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
Stuart, u are right, the refcount in php 5 doesn't matter, where something
left behind in my memory from earlier days, However i do have the effect
that unsetting an object does NOT call __dectruct() ! but when the script
ends it is called. this can be easily tested by putting a echo in destruct.

my objects affected are pretty much the sheme I send. however I'm doing some
reflection stuff in my classes. may be thats the reason. I will do some
further investigation about that.


"Stuart"  wrote in message
news:a5f019de0908240749l8fa749s825cfa0e475f7...@mail.gmail.com...
2009/8/24 Ralph Deffke :
> this is also not the full truth try this and it works
> what are the circumstances that is causing this problem then, yes I do
have
> distributed references over my script and there are clearly references
still
> set, however after running the snipped script I can not see what I do
> special in my script causing the problem. I even tried with public and
> private static in other objects. it works. however the manual indicates
the
> refernce counter has to be 0.

Assuming you're using PHP 5...

> 
>
> abstract class a {
> public function __construct(){
> echo "constructing";
> }
> public function __destruct(){
> echo "destructing";
> }
> }
>
> class b extends a{
>
> }
>
> $c = new b();

refcount = 1

> $d = $c ; // works

refcount = 2

> $f[] = $c ; // works

refcount = 3

> class e {
> private $m;
>
> public function setM( $m ){
> $this->m = $m;
> }
> }
>
> $o = new e();
> $o->setM( $c ); // works

refcount = 4 (due to assignment in setM)

> unset( $c );

refcount = 3

In PHP 5 all objects are passed by reference unless explicitly cloned.
This means that assigning an object variable to another variable does
nothing more than assign a reference and increment the referece count.

What exactly in the manual leads you to believe that after the unset
the refcount should be 0?

-Stuart

-- 
http://stut.net/

> "Lupus Michaelis"  wrote in message
> news:41.f9.03363.01192...@pb1.pair.com...
>> kranthi wrote:
>> > unset($obj) always calls the __destruct() function of the class.
>>
>> Never calls the dtor. The dtor will be called only when the reference
>> count reaches 0.
>>
>> class c { function __destruct() { echo 'dying !' ; } }
>> $v1 = new c ;
>> $v2 = $v1 ;
>>
>> unset($v1) ; // don't call the dtor
>> unset($v2) ; // call the dtor
>>
>> --
>> Mickaël Wolff aka Lupus Michaelis
>> http://lupusmic.org
>
>
>
> --
> 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



Re: [PHP] php move_uploaded_file() filesize problem

2009-08-24 Thread Ralph Deffke
I would also be shure that u run into the srcipt time out time. of course
there is one limit u can be a little bit under or a little bit above.

measure the time with microtime() and compare it with the script time out
settings and u will have the answer

ralph_def...@yahoo.de

""Thomas Gabrielsen""  wrote in message
news:df.aa.03363.30213...@pb1.pair.com...
>
> "Ryan Cavicchioni"  wrote in message
> news:20090824205810.gc32...@mail.confabulator.net...
> > On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote:
> >> Hi
> >>
> >> I have a problem with uploading files that are bigger than the Master
> >> Value allow me to, which is 32 MB. I've set the max_upload_filesize and
> >> max_post_size in a .htaccess file and the phpinfo() reports the new
local
> >> value (128 MB) according to the .htaccess, but the script fails
silently
> >> with no errors every time I try to upload a file greater than 32 MB.
Have
> >> any of you had the same problem?
> >
> > I stumbled across this blog post:
> > http://www.gen-x-design.com/archives/uploading-large-files-with-php/
> >
> > He suggests also looking at the script timeout and the
> > 'max_input_time' ini setting.
> >
> > Regards,
> >  --Ryan Cavicchioni
>
> Hi Ryan, and thanks for your reply:
>
> I've allready set that, but I forgot to mention it in the first post. This
> is what my .htaccess looks like:
> php_value upload_max_filesize 64M
> php_value max_execution_time 800
> php_value post_max_size 64M
> php_value max_input_time 100
> php_value memory_limit 120M
>
> I'm very sure that it has something to do with the upload_max_filesize
> because I generated two files, one just a little greater than 32MB, and
one
> just a little bit smaller. The latter file is uploaded fine, but the
bigger
> one is not.
>
> Thanks!
> Thomas Gabrielsen
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: unset() something that doesn't exist

2009-08-24 Thread Ralph Deffke
causes an error
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in
C:\wamp\www\TinyCreator\testCrapp6.php on line 42

"Tom Worster"  wrote in message
news:c6b87877.11463%...@thefsb.org...
> is it the case that unset() does not trigger an error or throw an
exception
> if it's argument was never set?
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] __destruct() not called ! we shot us in the foot try the script

2009-08-24 Thread Ralph Deffke

well I would call this an error in the first view , and some of u where
right! and the stuff with the refernce counter seems to be right as well.

however I can't see a reason for it as 5.x works through refernces. so
unsetting a REFERENCE to the object does not destroy it.

How to destroy the object then?

";
  }
  public function __destruct(){
echo "destructing";
  }
}

class b extends a{

  public function doSomething(){
echo "I'm doing ...but the reference c to the object is unset()";
  }

}

$c = new b();

$d = $c ;   // works
$f[] = $c ; // works

class e {
  public static $m;

  public static function setM( $m ){
self::$m = $m;
  }
}

$o = new e();
e::setM( $c ); // works

echo "unsetting ...";
unset( $c );

$d->doSomething();

echo "script ending now ...";

?>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >