[PHP] File upload directive: $_FILES['filename']['name'] instead of $_FILES['filename']['tmp_name']

2009-12-22 Thread Andrei Iarus
Hello,
 
On my production & testing servers (production runs on a centrino and testing 
runs on Windows) I can only access the temporary uploaded file using 
ini_get( 'upload_tmp_dir' . '/' . $_FILES['filename']['name'];
while the file $_FILES['filename']['tmp_name'] simply does not exist (checked 
with file_exists() function, and also looking in the temporary folder).
 
Is there a problem with my PHP installations? Is there any directive to change 
this bihaviour?
 
On production: PHP 5.2.10 and on testing: PHP 5.2.8 and 5.3.0
 
Thanks in advance.


  

AW: [PHP] Read Text Content from PDF file

2009-03-30 Thread Andrei Bintintan
Any other ideas?

 

 

Von: Bastien Koert [mailto:phps...@gmail.com] 
Gesendet: 20 March 2009 15:49
An: Andrei Bintintan
Cc: php-general@lists.php.net
Betreff: Re: [PHP] Read Text Content from PDF file

 

 

On Fri, Mar 20, 2009 at 10:23 AM, Andrei Bintintan 
wrote:

Could you be more precise? I'm looking at that class, but I can't see any
function that does that. 

Andy.

 

Von: Bastien Koert [mailto:phps...@gmail.com] 
Gesendet: 20 March 2009 14:57
An: Andrei Bintintan
Cc: php-general@lists.php.net
Betreff: Re: [PHP] Read Text Content from PDF file

 

 

On Fri, Mar 20, 2009 at 9:48 AM, Andrei Bintintan  wrote:

Hi to all,



I have to read the texts from PDF documents with PHP. A solution would be to
use http://www.foolabs.com/xpdf, but it is not installed on the server that
I work with and it is not wanted to be installed. So I have to look for
another solution.



Is there a possibility, PHP library, something with which I can READ the
texts from a PDF document with PHP?



Thanks a lot,

Andy.




http://www.setasign.de/products/pdf-php-solutions/fpdi FPDI makes it
possible. 

-- 

Bastien

Cat, the other other white meat



http://www.setasign.de/support/manuals/fpdi/ 

 

that is what a manual is for


-- 

Bastien

Cat, the other other white meat



AW: [PHP] Read Text Content from PDF file

2009-03-20 Thread Andrei Bintintan
Could you be more precise? I'm looking at that class, but I can't see any
function that does that. 

Andy.

 

Von: Bastien Koert [mailto:phps...@gmail.com] 
Gesendet: 20 March 2009 14:57
An: Andrei Bintintan
Cc: php-general@lists.php.net
Betreff: Re: [PHP] Read Text Content from PDF file

 

 

On Fri, Mar 20, 2009 at 9:48 AM, Andrei Bintintan  wrote:

Hi to all,



I have to read the texts from PDF documents with PHP. A solution would be to
use http://www.foolabs.com/xpdf, but it is not installed on the server that
I work with and it is not wanted to be installed. So I have to look for
another solution.



Is there a possibility, PHP library, something with which I can READ the
texts from a PDF document with PHP?



Thanks a lot,

Andy.





http://www.setasign.de/products/pdf-php-solutions/fpdi FPDI makes it
possible. 

-- 

Bastien

Cat, the other other white meat



[PHP] Read Text Content from PDF file

2009-03-20 Thread Andrei Bintintan
Hi to all, 

 

I have to read the texts from PDF documents with PHP. A solution would be to
use http://www.foolabs.com/xpdf, but it is not installed on the server that
I work with and it is not wanted to be installed. So I have to look for
another solution. 

 

Is there a possibility, PHP library, something with which I can READ the
texts from a PDF document with PHP? 

 

Thanks a lot, 

Andy.

 



php-general@lists.php.net

2007-11-30 Thread Andrei Verovski (aka MacGuru)
Hi !

Anyone knows PHP/AJAX library which allows to get full path of file dropped 
into web browser's window area?

It is required for document archiving system in order to avoid multiple (or to 
be more precise, almost endless) usage of "open file" dialogs from the 
browser.

Library should be compatible with Firefox (Lin, Win, Mac), IE and Safary.


Thanks in advance for any suggestion(s).

Andrei

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



[PHP] Re: Encrypted Mail

2007-07-18 Thread andrei

Please read the attachment to get the message.


 Attachment: No Virus found
 Norman AntiVirus - www.norman.com


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

Re: [PHP] duration of mp3 file

2007-07-11 Thread Andrei

Or you could use ffmpeg executable to get details about the media file.
You will have to parse the response of the executable.
The only thing is that you must have exec function or an execution
function available and ffmpeg installed.
This is for linux machines tho... Don't know if ffmpeg is available for
windows too.

Andy

Steven Macintyre wrote:
> Shyte ... 
>
> The files are VBR ... I will read up and when I find answer - will revert to
> list with it as well..
>
> Ps. 
>
> Everyone is a bunny to me :P
>
> S
>
>   
>> -Original Message-
>> From: Jim Moseby [mailto:[EMAIL PROTECTED]
>> Sent: 11 July 2007 03:55 PM
>> To: 'Steven Macintyre'; php-general@lists.php.net
>> Subject: RE: [PHP] duration of mp3 file
>>
>> 
>>> Allow bunnies ...
>>>
>>> Any takers on this ... I JUST want the duration of the mp3
>>> file - with a
>>> small function if possible ... I honestly don't want to use a
>>> class like
>>> http://www.phpclasses.org/browse/package/112.html
>>>
>>> The coding is terrible and SERIOUSLY over inflated for what I
>>>   
>> want.
>> 
>>> Anyone know of a simple class / function ?
>>>
>>> S
>>>
>>>   
>> Apparently, you can read the header of the file to find the
>> bitrate, then
>> calculate the approximate play duration from that info and the
>> filesize.
>> Here is information on the mp3 file format:
>>
>> http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm
>>
>> ...and here is a discussion thread that provides the calculation
>> and other
>> links:
>>
>> http://www.hydrogenaudio.org/forums/lofiversion/index.php/t46563.ht
>> ml
>>
>> I've never done this, and apparently there is an issue with MP3s
>> that have
>> variable bitrates, but maybe this will get you started in the right
>> direction.
>>
>> HTH - JM <-- not anything like a bunny ;-)
>> 
>
>   


Re: [PHP] how PHP is batter?

2007-07-03 Thread Andrei


Stut wrote:
> Andrei wrote:
>> I saw there is a free version of Studio, but I think it's for
>> students... You cannot go build a corporate project with it I think...
>
> More FUD. Go read the licence before claiming to know what it says!
>
> -Stut
>
I said *I think* didn't know for sure. And anyway I would read the bla
bla for something I don't need.

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



Re: Re: [PHP] how PHP is batter?

2007-07-03 Thread Andrei

Stut wrote:
> Andrei wrote:
>> Muhammad Hassan Samee wrote:
>>> ASP.net VS PHP?
>>>
>>> how PHP is batter?
>>>
>>> .
>>>
>> In short words it's not Micro$oft and you don't need to buy stuff to
>> develop in it.
>
> You have never needed to buy anything to develop ASP.net applications.
>
> And if you feel the need for a nice IDE, Visual Studio Web Developer
> Express Edition is available for free...
>
> http://msdn.microsoft.com/vstudio/express/vwd/
>
> Stop the FUD!
>
> -Stut
>
I saw there is a free version of Studio, but I think it's for
students... You cannot go build a corporate project with it I think...

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



Re: [PHP] task Scheduler driving me crazy!

2007-07-03 Thread Andrei

Jason Pruim wrote:
>
> On Jul 3, 2007, at 9:47 AM, Robert Cummings wrote:
>
>> On Tue, 2007-07-03 at 09:30 -0400, Jason Pruim wrote:
>>> Hi Everyone!
>>>
>>> Here is some of the code:
>>>
>>> $result = mysql_query($sql);
>>> echo "";
>>> echo "";
>>> echo "
>>> ID #
>>> Tickler Name
>>> Tickler Description
>>> Completed
>>>  Day to complete
>>> Reschedule Date
>>> ";
>>>
>>> while($row = mysql_fetch_array($result)) {
>>>
>>>
>>> echo "ID#, $row[0] ";// ID #
>>> echo "TicklerName, $row[1]  ";//
>>> Tickler Name
>>> echo "Instructions, Instructions";// Instructions
>>> echo "DayOfWeekWord, $dowword ";//
>>> Day of week word
>>> echo "DateToReschedule, >> type='text'
>>> name='txtReschedule' value=''>";//Date to reschedule
>>> echo "DateRescheduled, $Date";//Date
>>> stored in timeStamp
>>> //echo ">> href='update.php?taskid=$row[0]
>>> &taskdate=$taskdate'>Click here!";
>>> echo "CheckboxForWhenDone, >> type='checkbox' name='chkDone' value='$row[0]'>";//Check box for when
>>> completed
>>>
>>> }
>>
>> Oh man, blast from the past... BLAST FROM THE PAST!!! Where did you dig
>> up such ancient HTML? I'm taking a walk down nostalgia lane.
>> Unfortunately it's making me nauseous as I remember the original trip. I
>> guess you could call it naustalgia! >:)
>
> But what I'm displaying is tabular data on my internal network :) so I
> can use an old table for it. Once I get it working properly I'll
> probably change the table into div's... Haven't decided yet :)
>
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Anyway you should get rid of echoing everything from php... It really
gets you mad when you want to change things...
Do it like:

while($row = mysql_fetch_array($result))
{
?>
   
ID#, 
TicklerName, 
etc...
   
   http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how PHP is batter?

2007-07-03 Thread Andrei

Muhammad Hassan Samee wrote:
> ASP.net VS PHP?
>
> how PHP is batter?
>
> .
>
In short words it's not Micro$oft and you don't need to buy stuff to
develop in it.

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



Re: [PHP] simple OCR in php

2007-07-03 Thread Andrei
Richard Lynch wrote:
> On Sat, June 30, 2007 12:12 pm, Jay Blanchard wrote:
>   
>> [snip]
>> 
>>> In short PHP cannot perform OCR functions.
>>>   
>> Why? PHP provides all requisite functions/features so if someone was
>> sadistic enough and talented enough there's nothing to stop them
>> writing
>>
>> an OCR app using it.
>> [/snip]
>>
>> Sure, but then the scanning device would have to be connected to the
>> server. I suppose you could open a socket and stream the information
>> to
>> the server and then have PHP read and interpret the stream as it
>> arrives. See how complex this is becoming?
>> 
>
> No, the scanning device could be on a desktop that builds a folder of
> files with names that can be tied back to the documents somehow.
>
> Or, for what the OP asked for, the whole thing could be on a "server"
> which is really a "desktop" where having the scanner connected would
> be pretty normal.
>   
It's better to focus on OCR code which reads and parses an image
file (usually tiff file). Obtaining the image is not that hard (at least
on linux).

   Andy


Re: [PHP] PHP P O K E R...... and JAVA (convert)

2007-06-27 Thread Andrei

So you expect PHP ppl to do your job and test a JAVA class to tell u
if it's worth porting it to php?
Nice thoughts...

   Andy

Ryan A wrote:
> Hey all!
>
> Was looking at trying some stuff with php and p oker (texas hold'em).
>
> After searching the net for some clues as to how i can do this, i came 
> accross the class on the php classes site (but that codes to bruteforce-ish) 
> so continued looking and came accross some valuable suggestions on how to do 
> this... just as i was about to start i found a dude who wrote something like 
> this in Java... which works pretty good according to him ("tried and well 
> tested" to quote him)
>
> Can someone with a java background mind testing his class? and then hopefully 
> help me convert his script to php?
>
> The address to his java class:
>
> http://www.greenbridge.net/index.php/p_handranker.php
>
> What do you think?
>
> Comments, suggestions and links are most welcome!
>
> Cheers!
> R
>
>
> --
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
>  
> -
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
> .
>
>   

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



Re: [PHP] Re: Form Data Filtering

2007-06-15 Thread Andrei

Man you have some issues... :p

Dave Goodchild wrote:
> No, because extra processing is done on the other side - now
>
> fuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuck
>
>
> off
>
> .
>

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



Re: [PHP] PHP5 oop question...

2007-05-28 Thread Andrei

Stut wrote:
> Andrei wrote:
>> Hi list,
>>
>> I have a class which I use to parse simple bbcode inside some
>> comments.
>> I noticed on PHP5 that scope of preg_replace function is changed
>> when function is called inside a class. To the point:
>>
>> [CODE]
>> class PHS_editor
>> {
>> ...
>>
>> function parse_content( $str = null )
>> {
>> $from_arr = array( "@\[B\](.*?)\[\/[EMAIL PROTECTED]",
>> "@\[U\](.*?)\[\/[EMAIL PROTECTED]", "@\[I\](.*?)\[\/[EMAIL PROTECTED]",
>>"@\[URL=([^\]]*)\]([^\[]*?)\[\/[EMAIL PROTECTED]",
>>"@\[IMG=([^\]]*)[EMAIL PROTECTED]",
>>   
>> "@\[QUOTE=([^\]]*)\]([^\[]*?)\[\/[EMAIL PROTECTED]"
>> );
>>
>> $to_arr = array( '\1', '\1', '\1',
>>
>>  '\2',
>>
>>  "'> \*$this->get_image_location*( '\\1' ) ).'\" border=\"0\">'",
>>
>>  "'> cellpadding=\"1\" cellspacing=\"0\" border=\"0\" class=\"form_type\">".
>>   "".
>> "'.stripslashes(
>> \*$this->remove_mytags*( '\\2' ) ).'".
>>  "".
>>  "'"
>>
>>  );
>>
>> if( is_null( $str ) )
>> $str = $this->editor_content;
>>return preg_replace( $from_arr, $to_arr, str_replace(
>> "  ", "
>>  ", nl2br( $str ) ) );
>> }
>>
>> ...
>> }
>> [/CODE]
>>
>> When it gets to parse [IMG] tags I get "Fatal error: Using $this
>> when not in object context in ...". So it seems they changed the scope
>> for preg_replace callback functions. As this function is called inside
>> the method shouldn't it have the scope of the class?
>> Is there a workaround for this? I cannot declare a function
>> get_image_location which will staticly call the method bcuz I use
>> variables from instanced class.
>
> How are you trying to use this class? It sounds like you're trying to
> use the method statically. When a method is called statically it does
> not have a $this.
>
> -Stut
>
Yes, method was called staticly. Strange tho in php 4 it worked.
Thnx for enlighting me with this.

Andy

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



Re: [PHP] problem with string & floats in PHP

2007-05-15 Thread Andrei

If you need precision with floats or doubles you can use BCMath
Arbitrary Precision Mathematics Functions.

http://www.php.net/manual/en/ref.bc.php

Andy

Pablo Luque wrote:
> Hello, Im designing a website in which I have to read some data
> (numbers) from a txt file and then send this data to a function which
> prints a graphic with them. When I read the data I save it in an array
> and the numbers are in this format: 5.812E-08. I have read the php
> documentation about it, and I have use the example given there to
> check which type is the data saved in the array. The response I got is
> $vectorIc[1]== 5.812E-08 type is string
>
> I dont understand why. In the documentation it is clear that this kind
> of data should be considerer float, or thats what I understood. I cant
> continue with my web designing if I dont get to turn the vector
> elements into float numbers, because the function that prints the
> graphic gives errors when recieving strings. I would be very thankful
> if you could help me trying to solve this. In using PHP 4.4.7 and
> Apache 2.0.59.
>
> Thank you very much!
>
> _
> Descubre la descarga digital con MSN Music. Más de un millón de
> canciones. http://music.msn.es/
>

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



Re: [PHP] Re: PHP->FLASH

2007-03-15 Thread Andrei

Mikey wrote:
> To get values such as price=500 then you will need to encode that into
> your URL.  At the moment you are making thePrices=price500, so the
> value you are seeing is correct.
>
> Tf you had price=500 then you would see a variable called price with a
> value of 500.
>
> I suspect you are trying to make an array, so what you should try is:
>
> thePrices[]=500&thePrices[]=400&thePrices[]=350
>
> Etc.
>
> HTH,
>
> Mikey
>

Or just parse the XML file directly in Flash... It's not that
complicated and there r lots of tutorials on this subject you can find
googleing it...

Andy

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



Re: [PHP] 北京超品锐智技术有限责任公司招聘启 示 [AD]

2007-03-15 Thread Andrei
LOL...
Why you even bother to read it?

Tijnema ! wrote:
> On 3/15/07, Faye Wang <[EMAIL PROTECTED]> wrote:
>> 北京超品锐智技术有限责任公司招聘启示
>>
>> 公司简介:
>>
>> 国内专业本地化公司
>>
>> Transpac Technology Inc., which was established on 1996, specializes
>> in Chinese software localization as well as Website and other
>> technical documentation translation. Our working system is consist of
>> popular Wintel and MAC machines.
>>
>> Transpac began its localization career since it was established and
>> it has accomplished more than 600 projects for many companies so far.
>> It has enough capabilities to handle at least 3-4 projects
>> simultaneously and the maximum amount of delivery is 150,000 words
>> per week.
>>
>> 公司网站:http://www.transpac.com.cn
>> 地 址:北京市海淀区学清路 16 号学知轩 607 室
>> 邮政编码:100083
>> 联 系 人:张大雷
>> 电 话:(10)82755645
>> [EMAIL PROTECTED]
>>
>> 招 聘 职 位
>>
>> ** 海外市场推广专员 **
>>
>> 工作地点:北京市
>> 招聘人数:若干
>> 学 历:本科
>> 工作年限:二年以上
>> 薪水范围:面议
>> 外语要求:英语
>> 接受简历语言:中文或英文
>>
>> 职位描述:
>> 1. 熟悉翻译行业本地化的销售流程,具有本行业的相关销售经验,拥有在此行
>> 业中丰富的个人销售业绩,及时完成销售目标;
>> 2. 具有翻译行业的相关背景,能够寻求多种渠道挖掘客户,独立开拓翻译业
>> 务,并且搜集大量的具有翻译需求的有效客户信息;
>> 3. 较强地商务谈判、人际沟通能力,建立并维护良好的客户关系;
>> 4. 熟练使用 OFFICE 等办公软件,优秀的英语听说读写能力,特别是文笔和口
>> 语能力;
>> 5. 具有团队精神、诚信,对工作认真负责;
>> 6. 计算机或英语专业本科以上学历;
>> 7. 有良好的社会资源与客户资源者优先;
>> 8. 最好有照片。
>>
>>
>>
>> ** 高级本地化项目经理 **
>>
>> 工作地点:北京市
>> 招聘人数: 2 名
>> 学 历:本科
>> 工作年限:三年以上
>> 薪水范围:面议
>> 外语要求:英语
>> 接受简历语言:中文或英文
>>
>> 职位描述:
>> 1. 管理完成项目获得客户满意;
>> 2. 扩展客户关系和业务;
>> 3. 进行全方位的项目管理,包括项目范围管理、时间管理、质量管理、成本管
>> 理、沟通管理等;
>>
>> 职位要求:
>> 1. 有实际的本地化项目管理经验,管理的项目超过 50 万字;
>> 2. 有 IT 行业的工作背景,有软件外包项目执行或管理经验;
>> 3. 具有项目管理意识或立志项目管理方向;
>> 4. 优秀的学习能力,热情向上;
>> 5. 责任心强,具有良好的职业素养及团队合作意识;
>> 6. 海外工作经验或者英语水平优异者优先。
>>
>>
>> 请通过电子邮件投递简历。
>>
>> Have a nice day!
>>
>> Dalei Zhang
>>
> I can't read chinese, however when i translate it, it seems one big
> advertisement... (aka SPAM)
>
> Tijnema
>> -- 
>> 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: [!! SPAM] [PHP] Parse

2007-03-14 Thread Andrei
al phillips wrote:
> I keep getting a parse error line x
>   when trying view php info()
>   Can you help please?
>
>  
> -
> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo! Games.
> .
>
>   
Or maybe you should try with phpinfo() ?

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



Re: [PHP] Parse

2007-03-14 Thread Andrei

al phillips wrote:
> I keep getting a parse error line x
>   when trying view php info()
>   Can you help please?
>
>  
> -
> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo! Games.
> .
>
>   

And the code you use would look like? (I mean the whole code)

Andy

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



Re: [PHP] PHP shell_exec

2007-02-27 Thread Andrei

Hi Ade,

Sure you can. You must develop 2 scripts. One that will act as
"server" and one as "client".
So if you want to get details of server B from server A you should
have the "server" into B and "client" into A.
Be sure the communication between these 2 servers is securised
(using a certificate or build you own encryption for communication,
restrict script response depending on server ips etc...) as you want to
pass sensitive data between them.
Communication can be done using curl library or simply with fopen
(if allow_url_fopen allows it). parameters can be passed using XML or
simple parsed plain text.

Andy

h wrote:
> Hi 
>
>
>
> I have been using the shell_exec command to perform several server queries 
> quite succesfully i.e. analysing files systems by gettin ginformation 
> returned by df -kP (shell_exec('df -kP')).  do any of you guts know if it is 
> possible to target a command like this on another server? 
>
>
>
> So from server A where I am running a web app, needs to run the 
> shell_exec('df -kP') on server B, which also has php installed, so that i can 
> display the results in my web app on server A.  Hope that makes sense!
>
>
>
> Also, how would i fopen a file such as /proc/cpuinfo on Server B from Server 
> A.
>
>
>
> Any help greatly appreciated
>
>
>
> Regards
>
>
>
> Ade
>
> .
>
>   

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



Re: [PHP] Storing compiled code on the server

2007-02-21 Thread Andrei Verovski (aka MacGuru)
On Wednesday 21 February 2007 16:52:40 Brian Dunning wrote:
> I have a few scripts that I want to protect from the prying eyes of
> even people with root access to my server. The best suggestion I've
> heard is to store only the compiled version on the server itself. I
> have no idea how to do this or how those scripts would be called. Can
> anyone point me to a good starting place?

Just use PHP Accelerator (formely Turck MM Cache). Search for it on 
sourceforge.net

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



[PHP] Re: [?? Probable Spam] Re: [PHP] Re: How to upload files up to 40MB with a html post form?

2007-02-14 Thread Andrei

Actually there are 3 directives to change:

ini_set("upload_max_filesize","41M");
ini_set("post_max_size","52M");  // alyway bigger than upload_max_filesize
ini_set("memory_limit","64M"); // anyway bigger than post_max_size

Presuming you got over 120 seconds time limitation and this still
doesn't change a thing and you still cannot upload the file it might be
because PHP script is not parsed BEFORE receiving the post data (the
uploaded file) thus using the php.ini file values of
upload_max_filesize, post_max_size and memory_limit.

Andrei


Sergiu Voicu wrote:
> Upload limits can be imposed in 2 ways (maybe more, but I know only 2)
> when it is about Apache+PHP:
> 1. From apache with LimitRequestBody Directive
> 2. From php.ini with upload_max_filesize directive
>
> If you are in the first case (which I doubt), and the provider allows
> the use of .htaccess files, create a .htaccess file in the document
> root and put this line into it:
> LimitRequestBody 42991616
>
> In the second case, and if PHP isn't in safe mode, at the beggining of
> your script place this line
> ini_set("upload_max_filesize","41M");
>
>
> Cheers
> Sergiu
>
> Robert Cummings wrote:
>> On Wed, 2007-02-14 at 16:51 +0200, Andrei wrote:
>>> LOL. You got lost in details...
>>> To answer the question... You cannot upload files bigger than 10Mb
>>> unless your provider changes the values from php.ini (regarding upload
>>> file size, form max size and memory max size) and you cannot upload
>>> even
>>> less than 10Mb files if the time needed to upload it takes longer than
>>> 120 seconds.
>>
>> Which comes back to the original advice (Jay's I think)... get a new
>> provider :B
>>
>> Cheers,
>> Rob.
>

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



Re: [PHP] Re: How to upload files up to 40MB with a html post form?

2007-02-14 Thread Andrei

LOL. You got lost in details...
To answer the question... You cannot upload files bigger than 10Mb
unless your provider changes the values from php.ini (regarding upload
file size, form max size and memory max size) and you cannot upload even
less than 10Mb files if the time needed to upload it takes longer than
120 seconds.

Andrei

Robert Cummings wrote:
> On Wed, 2007-02-14 at 14:22 +, Colin Guthrie wrote:
>   
>> Robert Cummings wrote:
>> 
>>> On Wed, 2007-02-14 at 14:05 +, Colin Guthrie wrote:
>>>   
>>>> Robert Cummings wrote:
>>>> 
>>>>> On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
>>>>>   
>>>>>> -BEGIN PGP SIGNED MESSAGE-
>>>>>> Hash: SHA1
>>>>>>
>>>>>> Hola!
>>>>>>
>>>>>> Mauricio Muriel escribió:
>>>>>>
>>>>>> 
>>>>>>> How can I upload files up to 40MB with a html post form?  (without a ftp
>>>>>>> client)
>>>>>>>
>>>>>>> Please, remember
>>>>>>>
>>>>>>> 1. My hosting provider has up to 120 seconds apache timeout
>>>>>>> 2. My hosting provider has up to 10MB to upload files in php.ini
>>>>>>>
>>>>>>> Any kind of ideas?
>>>>>>>   
>>>>>> Yes, use CGI & Perl.
>>>>>>
>>>>>> Note: I love PHP but also know its limitations :)
>>>>>> 
>>>>> Upload sizes are not a PHP limitation.
>>>>>   
>>>> Erm, what about the max file size limit in php.ini? Is that not a PHP
>>>> limitiation that the provider has turned on?
>>>> 
>>> No, that's a configuration value set my the provider. A PHP limitation
>>> would be if you couldn't change the value.
>>>   
>> That's still a limitation, regardless if it is configurable or not:
>>
>> Limitation: That which limits; a restriction; a qualification; a
>>  restraining condition, defining circumstance, or
>>  qualifying conception; as, limitations of thought.
>>  [1913 Webster]
>> 
>
> There's no argument that it's a limitation. But it's set by the
> provider, thus it's not a PHP limitation. Please try again.
>
> Cheers,
> Rob.
>   


Re: [PHP] Text Editor for Windows?

2007-02-08 Thread Andrei

Lots of ppl would tell u lots of different php editors. I personally
use editplus2 bcuz it's very light and has syntax hightlighting on php
code and html code in same time and other bla bla features. And I use it
on linux too with wine.
But anyway you will have to try them yourself to tell this is the
one for u.

Andy

Stephen wrote:
> I am finding that notepad is lacking when correcting syntax errors in my php 
> code. No line numbers.
>
> What can people recommend for use under Windows?
>
> Thanks
> Stephen
>
> .
>
>   

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



[PHP] CMS Engine(s) with Savant (or other non-compiling template engine)

2007-01-28 Thread Andrei Verovski (aka MacGuru)
Hi !


Anyone knows if there any CMS engine(s) which PHP Savant template engine or 
any similar non-compiling template system ?

Unlike other template systems, Savant by default does not compile your 
templates into PHP; instead, it uses PHP itself as its template language so 
you don't need to learn a new markup system.

Thanks in advance for any suggestion(s)

Andrei

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



Re: [PHP] Parsing an XML return from a POST - resend with a little more information

2007-01-09 Thread Andrei

Hi,
From all XML parsers I tried I loved the most:

www.phpclasses.org/browse/package/1328.html

The advantage is that you don't need any extra addons to php or
anything else. It's pure php.

Andrei

Richard Luckhurst wrote:
> Hi List
>
> I am sending this to the list again with a bit more information in the hope I
> can get some help.
>
> There is a requirement to send a request to a server and I now have that 
> working
> using cURL, thanks to help from this list. I now have the responses coming 
> back
> as an XML response. What I need to do is to parse the XML response and break 
> it
> up into either an array or variables so I can pass the returned responses back
> to a calling process.
>
> I have spent most of last night and today looking at XML parsing and now am
> totally confused. Some testing I have done suggests that SimpleXML is not the
> way to go however I am open to suggestions if it might be an answer.
>
> I have spent ages searching Google and looking at XML parser examples. Now I 
> am
> more confused than ever.
>
> I would appreciate any help or advice on how to parse this XML response and 
> break it up
> into either an array or individual variables. It is important for this
> application to not only get the data contained between beginning and end tags
> but also the attributes as they contain important data returned from the 
> server.
> I am the first to admit that PHP XML Parsing has me lost.
>
> One other question I do have is that all of the examples I have seen, using 
> the
> xml_parser, seem to be designed around a file being read into the parser. Is 
> it
> possible for the XML data to be contained in a variable and then used in the
> parser?
>
> I have included a sample response from the server below. A few points to be
> aware of,
>
> 1) In the fares section there could be any number of fares however each fare
> will have a fareID and then the fareBases child.
> 2) In the tarifs section there could be any number of tarifs however each 
> tarif
> will have a tarifId and then 1 or more fareXrefs.
> 3) In the vcrSummary section there could be 1 or more vcr entries
> 4) The response comes back as one long string and I have formatted this to 
> make
> it a little easier to read.
>
> 
> 
> 
>   
>  depApt="SYD" dstApt="LON" paxType="ADT" vcr="OS" cos="E" yyFare="false" 
> avail="false">
> 
> VLOX2
> VLOX2
> VLOX2
> 
> 
>  depApt="SYD" dstApt="LON" paxType="ADT" vcr="OS" cos="E" yyFare="false" 
> avail="false">
> 
> MLOW2
> MLOW2
> MLOW2
> 
> 
>   
>   
>  chdBuy="675.07" chdSell="675.07" infBuy="675.07" infSell="675.07" 
> topCar="false" topHotel="false">
> 
> 11429927
> 
> 
>  chdBuy="714.83" chdSell="714.83" infBuy="714.83" infSell="714.83" 
> topCar="false" topHotel="false">
> 
> 11429926
> 
> 
>   
>   
> 201.52
>   
>   
>  currency="USD">AA
>  currency="USD">PR
>   
> 
>
>   
> I would certainly appreciate any help I can get. Thanks in advance.
>
>
>
> Regards,
> Richard Luckhurst  
> Product Development
> Exodus Systems - Sydney, Australia.
> [EMAIL PROTECTED]
>
>   

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



Re: [PHP] Highjack?

2006-11-14 Thread Andrei

I usualy use an array with site configuration which I define at top
included file so you cannot overwrite the configuration paths from
outside the scripts.



>From TFM:
"If "URL fopen wrappers" are enabled in PHP (which they are in the
default configuration), you can specify the file to be included using a
URL (via HTTP or other supported wrapper - see Appendix M, List of
Supported Protocols/Wrappers for a list of protocols) instead of a local
pathname. If the target server interprets the target file as PHP code,
variables may be passed to the included file using a URL request string
as used with HTTP GET. This is not strictly speaking the same thing as
including the file and having it inherit the parent file's variable
scope; the script is actually being run on the remote server and the
result is then being included into the local script.

Warning:
Windows versions of PHP prior to PHP 4.3.0 do not support accessing
remote files via this function, even if allow_url_fopen is enabled."

Andy

tedd wrote:
> At 11:57 AM -0800 11/14/06, bruce wrote:
>> hi tedd...
>>
>> for the following url,
>> http://www.example.com/test.php?path=abc?dummy=123
>>
>> if the register_globals is on, a malicious user could potentially
>> invoke,
>> http://www.example.com/badscript.php?path=http://www.badserver.com/badscript
>>
>> .txt?dummy=123, which would cause the 'badscript.txt' to be used in the
>> original script. now, this in and of itself wouldn't cause a file on the
>> http server to be changed. however, if the webapp somehow caused the
>> $path
>> var to be invoked or to be used in an exec() function, then whatever
>> is in
>> the 'badscript.txt' file will be run as if the file is on the local
>> system.
>>
>> at this point, you're pretty much at whim of the malicious user. now,
>> the
>> chance of this happening is pretty slim, unless you're using some open
>> source app that's unsecure, and that a user can reasonably easy find.
>> which
>> is what has happened to some apps in the past.
>>
>> a more potential reason for the index.php files to be changed, is
>> that there
>> was some security hole, either via apache, and/or the OS for the server.
>>
>> hope this helps a little bit more...
>
> Ohhh, so "badscript.php doesn't have to exist and the badscript.txt is
> imported via the url, the script is built using only the
> badscript.txt, and then executed "as-is" -- clever.
>
> Off to try that... :-)
>
> ...
>
> Nope, that didn't work -- I still don't get it.
>
> I realize that one can grab stuff from another server, but I still
> don't see how one can do this.
>
> Sorry, for being so dense.
>
> tedd

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



Re: [PHP] I'm newbie in PHP

2006-10-24 Thread Andrei

Ah sorry, I ment php_mysql.dll, forgot to change the name in copy&paste
(as mine is builtin).
The guy which wrote said:


[QUOTE]
i got this error

*Fatal error*: Call to undefined function mysql_connect() in *
D:\WEB\aplicaciones\TestPHP\testmysql.php* on line *2*
[/QUOTE]

So he's on Window$ (not a real operating system indeed :p).

Andy

Paul Scott wrote:
> On Tue, 2006-10-24 at 14:15 +0300, Andrei wrote:
> 
>> extension=php_crack.dll
>>
>> to be uncommented.
> 
> What does the CrackLib have to do with MySQL??? Surely you meant the
> php_mysql.dll extension? Oh, and if you are on a real operating system,
> you will enable the extension with a .so extension, not a .dll
> 
> --Paul
> 
> 
> 
> 
> 
> All Email originating from UWC is covered by disclaimer 
> http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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



Re: [PHP] I'm newbie in PHP

2006-10-24 Thread Andrei

If you don't have mysql support built in your PHP compilation, check
your php.ini file (you see its location in phpinfo()), go to ;Windows
Extensions part and check the line

extension=php_crack.dll

to be uncommented.

Andy

Hassan Arteaga Rodriguez wrote:
> Hi all:
> 
> Sorry if this question become a very simple but i'm getting errors when i
> try to connect to MySQL Server.
> I setup the PHP correctly..As example I run  from one
> web
> site I have been created.
> Then testing MySQL server with this simple code
> 
>  $link = mysql_connect('myserver', 'myuser', 'mypass');
> if (!$link) {
>die('Could not connect: ' . mysql_error());
> }
> echo 'Connected successfully';
> mysql_close($link);
> ?>
> 
> i got this error
> 
> *Fatal error*: Call to undefined function mysql_connect() in *
> D:\WEB\aplicaciones\TestPHP\testmysql.php* on line *2*
> 
> 
> Any Help please ?
> 
> best regards
> 

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



Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-10 Thread Andrei

Make sure your $dir variable isn't containing the path to your file from
your OS file system. This should be an apache (or whatever) path (an URL).

Andy


[EMAIL PROTECTED] wrote:
> Richard Lynch wrote:
> 
>> On Sun, October 8, 2006 6:53 pm, [EMAIL PROTECTED] wrote:
>>  
>>
>>> How to apply the following function with php ?
>>>  Test 
>>>
>>>
>> If you're new to PHP, be a minimalist, and pull out PHP only when you
>> absolutely have to:
>>
>>  Test 
>>
>> Since $dir is the ONLY part you want to be changing, use PHP only for
>> that part.
>>
>> Switching in/out of PHP like this is very fast/cheap, and leaves you
>> with HTML that mostly looks just like you are used to.
>>
>> YMMV
>>
>>  
>>
> Hello to you,
> 
> php web page ( test.php ) :
> 
> 
> 
> 
> 
>  Test 
> 
> Result : "homepage error"
> 
> Web Server error log :
> 
> [Tue Oct 10 18:07:36 2006] [error] [client 202.108.22.70] File does not
> exist: /home/web/index.htm
> [Tue Oct 10 18:10:12 2006] [error] [client 61.135.145.217] File does not
> exist: /home/web/test2004.htm
> [Tue Oct 10 18:10:14 2006] [error] [client 61.135.145.217] File does not
> exist: /home/web/readme.htm
> 
> Please help, thanks !
> 
> Edward.
> 

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



Re: [PHP] preg_replace (again) [solved]

2006-09-20 Thread Andrei
Well you can use
string strip_tags ( string str [, string allowable_tags] )
function

Andy

Peter Lauri wrote:
> Hi,
> 
> Thanks for you comment. I already changed to .
> 
> About sanitation: Do you know any open source where it checks code if it is
> acceptable or not? Or should I just create a lib that do some preg_match to
> see if any javascript tag is inside (assuming javascript should not be
> allowed).
> 
> This is a private system, so I do not worry so much :)
> 
> /Peter
> 
> -Original Message-
> From: Robert Cummings [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, September 20, 2006 2:13 PM
> To: Peter Lauri
> Cc: 'PHP General'
> Subject: RE: [PHP] preg_replace (again) [solved]
> 
> On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote:
>> Just to share my solution:
> 
> Out of curiosity, why don't you go with the very well known BBCode
> system?
> 
>> preg_replace('/_color:(.*?)_(.*?)_color_/i', '$2',
>> $html);
> 
> Hopefully this is a private system, otherwise someone not very nice
> might do the following:
> 
> 
> This is some _color:pink">  language="javascript">
> document.location = 'http://www.myDoityPr0nCollection.com';
> http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php - mysql query issue

2006-09-15 Thread Andrei
Also you should check if dates.date is a DATE type, not DATETIME. Lost
some time on that when I wanted to select enregs for a specific date,
field was DATETIME and I was querying `date` = '2006-01-01'... :p

Andy

Dave Goodchild wrote:
> On 15/09/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
>>
>> Have you tried echoing out your query to run on the backend itself?
>> Maybe there is some problem with how your join is being constructed...
>> Perhaps a left outer join is called for?  Hard to tell without having
>> knowledge of your table structure and table data...
>>
>> Yep, I've echoed it and it says:
> 
> "...WHERE dates.date = '2006-10-03'..."
> 
> I think you're right on the join stakes, I will investigate further, many
> thanks and have a great weekend.
> 

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



Re: [PHP] Class question

2006-09-15 Thread Andrei

Well in this example it will get to an infinite loop, but anyway like
Thomas said you must check into extending classes.

Andy

Thomas Munz wrote:
> Use 'extends' syntax for sub classes
> 
> class A {
>   var $some_var;
>var $class_B;
>   function A(){
> $this->class_B = new B();
> $this->some_var=2;
>   }
> }
> 
> class B extends A {
>   var $class_C;
>   function B(){
> $this->A();
> $this->class_C = new C();
>//  $this->some_var= some_var_from_class_A; <-- 
> $this->some_var contains the value allready
>   }
> }
> 
> class C extends A {
>   function C(){
> $this->A();
> // $this->some_var= some_var_from_class_A; <-- 
> $this->some_var contains the value allready
>   }
> }
> 

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



Re: [PHP] Affiliate system

2006-09-13 Thread Andrei

I ran into same issue with a site... I solved this problem by saving
information in 2 places (in cookies and in database). So when saving
data once I saved in the cookie then into database. When I wanted to
read the information I first check if cookie exist and if it doesn't I
read from database.

Andy

Peter Lauri wrote:
> Hi guys,
> 
> I am reviewing an affiliate system that I created a while ago. I am using a
> very simple method to do this, but I am curious if there is any better
> system (better I mean less missed affiliate purchases).
> 
> 1. User click on affiliate link http://thedomain.com/?a=1234
> 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
> then set a cookie for that
> 3. At purchase, we check if that cookie still is there, if so, we register
> it as a affiliate purchase and that info is stored in the purchase database
> 
> What should I do if they do not allow cookies? I could amend a=1234 onto
> every url that they pass, but that would not be a "beautiful" solution.
> 
> Maybe I can also create a SESSION that stores the affiliate information so
> that it at least get registered if the purchase is completed within the
> session?
> 
> What do you think is the best way?
> 
> Best regards, 
> Peter Lauri
> 
> www.lauri.se - personal web site
> www.dwsasia.com - company web site
> 

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



Re: [PHP] Espanol en esto lista

2006-08-16 Thread Andrei

Cool now we learn Spanish too. :)

j/k
Andy

Dave Goodchild wrote:
>>
>> I don't speak enough Spanish to understand it all, but tratare according
>> to altavista is "to treat" - not really sure I get it.
>>
>> Sorry, should be 'yo tratare', tratar also means to try - I will try and
>> understand...
>>
> 
> 
> 

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



Re: [PHP] returning to the same page after log in

2006-08-09 Thread Andrei

When u know the user is not logged in and you have to redirect him to
login page, get all variables that are in $_GET and in $_POST (if u have
data that u send in post also) and form a string with them as a return
context string like:

The code that you have to put in the page where you redirect the user to
login page and where user will land back after login.

$return_context = $PHP_SELF."?";
foreach( $_GET as $key => $val )
   $return_context .= "&".$key."=".$val;
foreach( $_POST as $key => $val )
   $return_context .= "&".$key."=".$val;

header( "Location: login.php?back_page=".urlencode( utf8_encode(
$return_context ) ) );

In login page, after you created the session or whatever you do at login
pagrt you do:

if( empty( $back_page ) )
$back_page = $_GET["back_page"];

if( !empty( $back_page ) )
header( "Location: ".utf8_decode( urldecode( $back_page ) ) );
else
header( "Location: somewhere_else.php" );
exit;

The code is not checked. It's only to have an ideea...

Andy

Sjef wrote:
> Hello all!
> This is a bit difficult to explain.
> On a site I am building I sometimes use the GET method to forward values to 
> the next page. There are certain pages that you need to be logged in to to 
> be able to see data. So you arrive at the page, you realize that you are not 
> logged in, so you type your username/password and hit 'log in'. Then the 
> page gets severely messed up as the GET data are not forwarded (at least, I 
> think that's the problem). Any ideas how to solve this?
> I tried to send a header("location: ...") with the document_root and 
> request_uri as the location, but that doesn't do the trick. 
> 

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



Re: [PHP] Declaring variables from the url

2006-08-07 Thread Andrei
Also check in php.ini register_globals to be On if you want to have vars
directly available in the script...

Andy

Jay Blanchard wrote:
> [snip]
> http://www.domain.com/index.php?var=1
> 
> And then, to use the variable, all I have to do is use it in the script,
> 
> like so:
> 
> echo "This is the value of the variable: " . $var;
> [/snip]
> 
> echo $_GET['var'];
> 

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



Re: [PHP] saving and retrieving an array from a database

2006-08-07 Thread Andrei
Well it seems like u made a mess there with arrays...



>From definition of first I understand it's an array of arrays with
element on position 0 (ZERO) set to an array of apple, pear, banana
elements.
If u serialize it and unserialize it you will obtain same thing...

so at the end of the script you should

echo $third[0];

Andy

[EMAIL PROTECTED] wrote:
> ok this seem to work but how do I bring it back? This is what I have so
> far.
> 
>  $first[] = array('appple', 'pear', 'banana');
> $second = serialize($first);
> $third[]= unserialize($second);
> 
> echo $second; //outputs serialized data
> echo $third[1];
> 
> ?>
> - Original Message - From: "Peter Lauri" <[EMAIL PROTECTED]>
> To: "'Ross'" <[EMAIL PROTECTED]>; 
> Sent: Monday, August 07, 2006 8:23 AM
> Subject: RE: [PHP] saving and retrieving an array from a database
> 
> 
>> http://se2.php.net/serialize
>>
>> /Peter
>>
>> -Original Message-
>> From: Ross [mailto:[EMAIL PROTECTED]
>> Sent: Monday, August 07, 2006 7:19 PM
>> To: php-general@lists.php.net
>> Subject: [PHP] saving and retrieving an array from a database
>>
>> Hi,
>>
>> I have an array of values. I want to save them with php to a single
>> field in
>>
>> my database and then retrieve them to an array.
>>
>>
>> What is the simplest way to achive this?
>>
>>
>> Ross
>>
>> -- 
>> 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] AES client side

2006-07-31 Thread Andrei

Then get a SSL certificate and let the browser do the job. If you do it
with JavaScript or open-code language why shouldn't I just take your
code and sniff the data you/the browser sends and decrypt it.

Andy

Andrew Senyshyn wrote:
> Andrei wrote:
>> Encrypting/decriptying data at client side (in javascript or whatever
>> script which sends the code to the client) is useless. It's like having
>> the data "in clear" at client side. I use JavaScript only to make the
>> interface "interactive".
>>
>> Andy
>>
>> Andrew Senyshyn wrote:
>>  
>>> Hi all,
>>>
>>> I need to implement AES decryption algorythm on client side (in
>>> browser).
>>> I tried javascript but it is too slow.
>>> Does anybody have others ideas how to decrypt data transfered by from
>>> server to client in browser?
>>>
>>> 
>>
>>   
> Ok. But when you propose to decrypt data?
> I have text in DB encrypted with AES. Get that text from DB with php. If
> I decrypt it in php, it will send text 'in clear' to client.
> I need encrypted data between server and client. only on client it must
> be decrypted.
> 
> 
> 

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



Re: [PHP] AES client side

2006-07-31 Thread Andrei

Encrypting/decriptying data at client side (in javascript or whatever
script which sends the code to the client) is useless. It's like having
the data "in clear" at client side. I use JavaScript only to make the
interface "interactive".

Andy

Andrew Senyshyn wrote:
> Hi all,
> 
> I need to implement AES decryption algorythm on client side (in browser).
> I tried javascript but it is too slow.
> Does anybody have others ideas how to decrypt data transfered by from
> server to client in browser?
> 

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



Re: [PHP] pop up "save dialog" box

2006-07-26 Thread Andrei

This is only an example and threat it as example. Take care about
security too. So don't copy and paste :)

You could do like this:

weetat wrote:
> Hi all,
> 
>  I have code below which save MYSQL to csv file. I am using ADODB
> library to do this.
> 
>  The saving MYSQL to csv file is ok .
>  However i need to allow the the user to enter file name for csv file.
> 
>  Anybody have any ideas how to do this? Thanks
> 
 
> $sql = $_SESSION['CSV_SQL'];
> $_logger = new Log4jLogger();
> $_logger->logdebug('sql:', $sql);
> 
   if( !isset( $filename ) )
   $filename = $_GET["filename"];

   if( empty( $filename ) )
   {
  ?>
  
  
  
   if (!isset($_REQUEST['maintainall'])) {

 //$filename = 'tbl_chassis.csv';

> CSVUtil::UploadTbtoCSV($sql, $filename);
> unset($_SESSION['CSV_SQL']);
> header('Location: ../maintain.php?csv');
> exit;
> } else {
> //$sql = 'SELECT * from tbl_card';

 //$filename = 'tbl_card.csv';

> CSVUtil::UploadTbtoCSV($sql, $filename);
> unset($_SESSION['CSV_SQL']);
> header('Location: ../maintainall.php?csv');
> exit;
> }

}

> 
> function UploadTbtoCSV($sqltext,$filename)
> {
> $_logger = new Log4jLogger();
> $_logger->logdebug("starting.. upload tb to csv");
> 
> $rs = dbQuery($sqltext);
> $rs->MoveFirst();
> $_logger->logdebug("UploadTbtoCSV csvpath:",CSV_PATH);
> 
> $fp = fopen(CSV_PATH."/".$filename, "w");
> 
> if ($fp) {
> rs2csvfile($rs, $fp);
> fclose($fp);
> $_logger->logdebug("starting upload tb to csv done");
> }
> 
> 
> 
> }
> 

?>

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



Re: [PHP] convert byte to MB

2006-07-25 Thread Andrei

So what u'r trying to say is that we should use KiB and not KB for
kilobytes? That's funny!

Andrei

Andrew Brampton wrote:
> Divide by 1024 and you get KiB
> Divide by 1000 and you get KB
> 
> Read: http://physics.nist.gov/cuu/Units/binary.html
> 
> Andrew
> 
> - Original Message - From: "André Medeiros" <[EMAIL PROTECTED]>
> To: "weetat" <[EMAIL PROTECTED]>
> Cc: 
> Sent: Tuesday, July 25, 2006 12:41 PM
> Subject: Re: [PHP] convert byte to MB
> 
> 
>> divide by 1024, and you'll get KB
>>
>> divide again by 1024 and you'll get MB
>>
>> same for GB, TB, etc
>>
>> On 7/25/06, weetat <[EMAIL PROTECTED]> wrote:
>>> Hi all ,
>>>
>>>   I have data which have value in bytes for example ,
>>>
>>> $bytes = 33554432;
>>>
>>>How to convert this to MB ?
>>>
>>> THanks
>>>
>>>   - weetat (PHP Novice)
>>>
>>> -- 
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
> 

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread Andrei

I think you should make up your mind what u display to user... image
or text...

Andrei

BBC wrote:
> 
>> On 7/9/06, BBC <[EMAIL PROTECTED]> wrote:
>>> I don't know why every time the script run the syntax which uses GD, the 
>>> page turned
>>> becomes source code view. So when we need that page in normal view, we had
>>> to push the 'back button' twice.
>> I guess we would need to see some code samples to get things going,
>> preferrably the GD part which seems to be the issue :-)
> 
> Here are the Codes I used :
> 
> $tumbsize = 150;
> $imgfile = $some_where;
> $imgdst = $where_to;
> header('Content-type: image/jpeg');
> list($width,$height) = getimagesize($imgfile);
> $imgratio = $width/$height;
> if($imgratio>1)
> {
>  $newwidth = $tumbsize;
>  $newheight = (int)($tumbsize / $imgratio);
> }else{
>  $newheight = $tumbsize;
>  $newwidth = (int)($tumbsize * $imgratio);
> }
> $tumb = ImageCreateTrueColor($newwidth,$newheight);
> $source = ImageCreateFromJpeg($imgfile);
> $hai = 
> ImageCopyResized($tumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
> ImageJpeg($tumb,$imgdst,100);
> if ($hai)
> {

Well either you display an image (which you should do bcuz you set
already the header) or you display a text...

> echo "Resizing is successful ";
> }else{
> copy($some_where,$where_to);
> }
> 
> And thank for your input..
> 

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



Re: [PHP] page redirecting

2006-06-28 Thread Andrei

Anyway if the content should be *secret* you should think about storing
them on server-side.

Andy

Stut wrote:
> kristianto adi widiatmoko wrote:
>> HI folks,
>>
>> i need to redirecting page, it could be done by using header function
>> like this
>>
>> header("Location : page2.php?var1=foo");
>>
>> but i need to hide variable from being displayed by browser since the
>> content of variable is secret.
>>
>> I guess i need POST method instead of GET for redirecting that page.
>>
>> Does any one have an idea??
>>   
> 
> Stick it in then session - that's what it's there for.
> 
> -Stut
> 

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



Re: [PHP] detect user click "stop" button in browser

2006-06-22 Thread Andrei
Check int connection_aborted ( ) in the PHP manual

Andy

weetat wrote:
> Hi all,
> 
>   Can we detected if user have clicked the "X" button in browser or
> close browser ?
>   I have tested in my php program ,when i click "X" in IE6 , the
> execution did not stop , it still running .
>  Any ways to stop the program execution when user click the "X" button
> or close browser ?
> 
> Thanks
> - weetat
> 

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



[PHP] Re: [?? Probable Spam] [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT

2006-06-20 Thread Andrei

As you didn't mentioned what you use your queries for, maybe read the
manual?

   Andy

Juanjo Pascual wrote:
> How can i know which of both is better to use each time?
> 

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



Re: [PHP] Paging Help

2006-06-20 Thread Andrei
Juanjo Pascual wrote:
>  // Num of records each time
> $NUM_RECORDS = 10;
> 
> if ($_GET["pag"] == "") {
>$ini = 0;
>$pag = 1;
> }
> else {
>$ini = ($pag - 1) * $NUM_RECORDS;
> }
> 
> // Query to show
> $query_rsData = "SELECT * FROM table LIMIT " . $ini . ", " . $NUM_RECORDS;
> $rsData = mysql_query($query_rsData, $DB_CONECTION);
> 
> // Total records
> $query_rsData2 = "SELECT * FROM table";
> $rsData2 = mysql_query($query_rsData2, $DB_CONECTION);
> $num_total_records = mysql_num_rows($rsData2);
> 

Since you query all enregs from table why not query all first and
the do mysql_data_seek on result?

 // Query to show
 $query_rsData = "SELECT * FROM {table} ORDER BY {Whatever field}";
 $rsData = mysql_query($query_rsData, $DB_CONECTION);
 $num_total_records = mysql_num_rows( $rsData );

 $total_pag = ceil($num_total_records / $NUM_RECORDS);

 if( $pag < 1 )
 $pag = 1;
 elseif( $pag > $total_pag )
 $pag = $total_pag;

 $start_enreg = ($pag-1) * $NUM_RECORDS;

 @mysql_data_seek( $rsData, $start_enreg );

 while( ($result = mysql_fetch_object( $rsData )) )
 {
// display data...
 }

> // Total pages
> $total_pag = ceil($num_total_records / $NUM_RECORDS);
> 
> $previous_page = $pag - 1;
> $next_page = $pag + 1;
> ?>
> 
> Links for the pages
> ---
> 
> First page: this_page.php?pag=1
> Previous page: this_page?pag=
> Next page: this_page?pag=
> Last page: this_page?pag=
> 
> 
> Rodrigo de Oliveira Costa escribió:
>> I have the following problem, I need to make a paging system to show
>> results from search on a  Mysql database. I found a class that
>> should do the job but couldn't figure it out how to use it. Does
>> anybody has an Idea of hos to do this? I thank in advance for any help
>> you guys can provide me.
>> Rodrigo
>>
> 

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



Re: [PHP] Seeking recommendations for use of include()

2006-06-13 Thread Andrei


	Anyway when you include files by script (not scpecifying the order in 
which u include them) check out class inheritage and class usage in 
files you include. Classes that are inherited must be included first.


Andy


At 7:22 PM +0900 6/13/06, Dave M G wrote:

PHP List,

Up until now, in order to get all the functions and classes I need in my scripts, I have 
always made a file called "includes.php" that contains a series of include() 
statements for all of the files that I want to include. Then I just include that one file 
at the top of all my PHP scripts.

This system works okay, but I thought it would be better to have a consistent 
naming standard, and use some kind wild card or loop to include all the files I 
want. That way I can change, add, and remove files a little easier.

All the files I want to include end with either ".class", or with "_fns.php". ("fns" 
stands for "functions".)

It seems that wildcard characters are not supported in the include() function. 
Some experiments and a search on the web seem to confirm this.

So then I thought what I need to do is use the readdir() function somehow, and make an array of all 
files ending in ".class" or "_fns.php", and then make a while or foreach loop 
to include every required file.

I couldn't quite figure out how to do that, but in any case I wondered if 
running this loop at the start of every single PHP script might be unnecessary 
overhead. After all, the list of included files will only change when I work on 
the system. It's not going to vary at all based on any kind of user input or in 
standard usage of my web site.

What would be the recommended way of including files that will change as I work 
on the system? Do most people create a function to detect the included files, 
or do most people make a static list that they edit by hand?

--
Dave M G



Dave:

I group my includes per functionality, such as all dB operations 
(config, open, close, etc.) go into a db include folder (db_inc) and so 
on. I don't make large files, but rather small files limited to a 
specific operations. That works for me -- but, only you can figure out 
what works for you.


As for your code, try this:

		if(eregi("(\.pdf|\.html|\.htm|\.php|\.txt)$", $file))	// check the 
files extension:

{
$html[] = $file;
}
}

closedir($the_dir);

if($html == null)
{
die("No files in this directory!");
}

sort($html);
foreach($html as $html => $value)
{
echo (" $value");
}
?>


hth's

tedd

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



Re: [PHP] popup window from php page

2006-06-08 Thread Andrei


	What PHP does is it outputs HTML code as result. Any other 
functionality regarding browser commands (such as opening popups) are 
done using javascript.


Andy

William Stokes wrote:

Hello,

How do I open a popup window from php code when a web page is loaded? Does 
it require javascript usage?


Thanks
-Will 



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



Re: [PHP] pop-up window in php???

2006-05-29 Thread Andrei


	Not related to PHP, but u hava javascript confirm function or prompt 
(if you need input also).


Andy

[EMAIL PROTECTED] wrote:

Hi all,

Is there anyway to have a pop-up window to ask "are you sure? yes / no" in php?
I know you can do it in Javascript, but I'm not sure what's the best way to
implement it in php. I want the page to do nothing if "no" is pressed.

any help would be appreciated.

thanks,
Siavash



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



Re: [PHP] Serialize

2006-05-24 Thread Andrei


	It's not safe... if the array contains strings which contain ' or " 
might screw your query... it's safe to escape the string result from 
serialize...


Andy

[EMAIL PROTECTED] wrote:

Hi,

Is a serialized array a "safe" string to insert into a mysql text field? Or is a
function such as mysql_real_escape_string always needed?

regards
Simon.



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



Re: [PHP] SQL result

2006-04-18 Thread Andrei

I think you need mysql_fetch_assoc() or mysql_fetch_array().

You also can have a look into php's manual and simple find your functions...

http://www.php.net/download-docs.php

Andy

Mohsen Pahlevanzadeh wrote:

Dear all,
I remember that i use a func that it return an array what it consist of 
result of my sql query.

Please name me that.
Yours,Mohsen



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



[Fwd: Re: [PHP] redirect using php]

2006-04-05 Thread Andrei


Andrei wrote:


It works with document.location = '...'; too. I use only this method and 
it worked on all browsers...




Assuming the end user has JS turned on.  JS and Meta Refreshes are not
acceptable when you need to be sure the redirect works.

Depends on your user target...
I generally suppose the users using my code enabled JS on their 
browsers. If they didn't too bad. I can't code everything judging there 
are ppl that do restrictions on their browsers.


Andy

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



Re: [PHP] redirect using php

2006-04-05 Thread Andrei


It works with document.location = '...'; too. I use only this method and 
it worked on all browsers...


Andy

Barry wrote:

Andrei wrote:

   document.location =
'http://where.to.go.com/example.php?param1=';


Wasn't it -> document.location.href ='www.example.com';
o_O ?

Barry


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



Re: [PHP] redirect using php

2006-04-05 Thread Andrei



Or with javascript:






PS: Sorry Mark...

   Andy

Mark Kelly wrote:

On Tuesday 04 April 2006 22:27, Brady Mitchell wrote:

-Original Message-
In JSP I have access to a function called sendRedirect() to
send a user
from one page to another, usually after some processing completed. Is
there a similar function in PHP?

Take a look at the header() function.
http://php.net/header

To redirect you can use:  header("Location: http://www.example.com/";);


You can also use something like: 


echo "";

depending on your needs.

Mark



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



[PHP] Re: PHP AJAX Framework - Suggestions Please

2006-04-03 Thread Andrei Verovski (aka MacGuru)
Hi,

Many thanks for everyone who have replied. Its seems Manuel's suggestion 
regarding iFrame sounds really good. BTW, I am using Savant as template 
engine, and integrate it with Manuel Forms Generation and Validation would be 
a good idea (there is a Smarty plugin for this class, but I am using Savant). 

Basically, I have a problem porting my own FileMaker database with many 
multi-page forms (plus large tables and big drop-down lists, displaying 
thousands of items). Things made quickly with native GUI tools often very 
difficult to port to Web-based GUI.


On Monday 03 April 2006 16:13, you wrote:
> Hello,
>
> on 04/01/2006 12:00 PM Andrei Verovski (aka MacGuru) said the following:
> > Anyone can suggest me which PHP AJAX framework you are using, for what
> > reason(s), what are pros and cons of your particular choice.
> >
> > I found many, and now facing difficult choice.
> >
> > BTW, how do you pass session id between calls to PHP from JavaScript
> > (cookies or explicit foo.php?PHPSESSSIONID=blahblahblah)?
> >
> > Thanks in advance for any suggestion(s).
>
> Regardless of the framework you choose, note that AJAX solutions based
> on XMLHttpRequest objects are problematic for reasons listed in this
> blog post below. Despite it is an older technology, for most purposes
> people want to use AJAX, IFrame based solutions are more capable and
> reliable.
>
> * Browser compatibility
>
> * Browser security constraints
>
> * Single JavaScript base code
>
> * Response speed
>
> * File form upload
>
>
> http://www.phpclasses.org/blog/post/51-PHPClasses-20-Beta-AJAX-XMLHttpReque
>st-x-IFrame.html
>
>
> As for AJAX solutions, I use this forms generation class also mentioned
> in the post, which has a plug-in form submiting and processing forms in
> the background using IFrame based AJAX requests.
>
> http://www.phpclasses.org/formsgeneration

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



[PHP] PHP AJAX Framework - Suggestions Please

2006-04-01 Thread Andrei Verovski (aka MacGuru)
Hi,

Anyone can suggest me which PHP AJAX framework you are using, for what 
reason(s), what are pros and cons of your particular choice.

I found many, and now facing difficult choice.

BTW, how do you pass session id between calls to PHP from JavaScript (cookies 
or explicit foo.php?PHPSESSSIONID=blahblahblah)?

Thanks in advance for any suggestion(s).

Andrei

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



Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-21 Thread Andrei
Really I think it would be loosing time documenting that you can put a 
new line after ?>!

I mean it's obvious that what's outside php tags will be printed rite?

Andy

Rostislav Krasny wrote:

On Mon, 20 Mar 2006 17:51:32 -0600 (CST)
[EMAIL PROTECTED] ("Richard Lynch") wrote:


On Sat, March 18, 2006 12:36 pm, Rostislav Krasny wrote:

 Hello World
 
 Hello World
Why there is no newline afer " Hello World" ?
Is it a PHP bug or the tutorial should be updated?

The tutorial is imprecise, and glosses over this detail.

For very good reasons, ?>[newline] ignores the trailing [newline]
character.

If you want the newline, you should do:

Hello World\n";
?>


Thanks for replying. You're suggesting an obvious but not so handy
workaround of this feature. Jim Lucas, in his reply, pointed me out to
much easier one. He suggested just to add a space after the "?>". I'm
wondering why this trivial thing isn't known to all and wasn't well
documented.



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



Re: [PHP] About date & time...

2006-02-28 Thread Andrei
I don't understand! Why don't u use date function and just format it as 
u want?


Andy

Gustav Wiberg wrote:

Hi

Thanx for your input about date & time...

Here's some functions that worked for me after some searching...


function currenttime() {

$today = getdate();

$ithours = $today["hours"];
if (intval($ithours)<10) {
 $ithours = "0" . $ithours;
}

$itminutes = $today["minutes"];
if (intval($ithours)<10) {
 $ithours = "0" . $ithours;
}

$itseconds = $today["seconds"];
if (intval($itseconds)<10) {
 $itseconds = "0" . $itseconds;
}


$it = $ithours . ":" . $itminutes . ":" . $itseconds;
return $it;
}

function currentdate() {

$today = getdate();

$idyear = $today["year"];
if (intval($idyear)<10) {
 $idyear = "0" . $idyear;
}

$idmonthnr = $today["mon"];
if (intval($idmonthnr )<10) {
 $idmonthnr  = "0" . $idmonthnr ;
}

$idmonthday = $today["mday"];
if (intval($idmonthday)<10) {
 $idmonthday = "0" . $idmonthday;
}


$id = $idyear . "-" . $idmonthnr . "-" . $idmonthday;
return $id;

}

$insertTime = currenttime();
$insertDate = currentdate();



/G



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



Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Andrei


	A static defined variable used in a function will keep it's value each 
time the function is called, but this function is available only for 
function's scope.
	A global defined variable used in a function will keep it's values (as 
long as this value is not changed in "body" of the script or in other 
functions), and the variable is available for script scope.


Andy

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



Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Andrei


What's the use of global static variables?

Andy

Miguel Guirao wrote:


Hello list!!

Can I have a variable that is static and global at the same time within a
function?
Let's say I have:

$data = "";

function newdata() {
  static global $data;
  $data [$i] = $newdatatobestored_inthearray;
}

Best Regards,

---
Miguel Guirao Aguilera
Logistica R8 TELCEL
Tel. (999) 960.7994




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



Re: [PHP] Is my user system bad?

2006-02-09 Thread Andrei

Hi Peter,

	I use about same system, but instead putting ids of tables into session 
variable (which is easy to guess) I use a md5( uniqid( rand(), true ) ) 
string and I create an enreg into online tables (similar to your session 
table) with this string as primary key. I also add into session a hashed 
variable with host. When I receive a request I check session variable 
($_SESSION['session_id'] in your case) and also the hashed string.
	For session timeout I delete the enreg from table online (session in 
your case). For this I have a function which is called at a request of 
any script at a resonable interval (like once 10 mins) and remove from 
table online every session that passed a number of seconds (which I 
defined). When a request comes with a session id, and I don't find it in 
online table I say that session is expired.


I'm not saying this is the best, this is what I use.

Regards,
Andy

Peter Lauri wrote:

Hi,

I would like to get some comments about my user system.

1. A user logs in, the username and password is checked against the database
2. If correct it adds a row in my database "session" with member_id.
$_SESSION['session_id'] will be set to the mysql_insert_id().
3. To verify if someone is logged on or not, I have a function isLoggedOn()
that checks if there is $_SESSION['session_id'] and it returns the
member_id. If not logged in, the isLoggedOn() returns FALSE.
4. I user the member_id to retrive specific member information
5. To logout, I just unset $_SESSION['session_id']

Is this an ok system to continue to work on? Or is this a very weak system
that is easy to break in to?

I am thinking about setting an new variable $_SESSION['member_id'] so that I
do not need to o a query every time to get the member_id.

Thank you very much!



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



Re: [PHP] LIMIT?

2006-02-06 Thread Andrei


You can use SELECT fields FROM table WHERE condition LIMIT 15, -1 and it 
will select all from 15...


Andy

William Stokes wrote:

Hello

I have a news page which is getting quite long now and I would like to split 
the news to two pages. Now I have one SQL query for all the rows and I think 
I could use LIMIT to limit the results but how to limit the results for 
example to 15 rows for page one and from 16 to the last on second page? 
Number of rows increase daily.


One page one there's headline and short summary and the second page should 
be "archive" with only the headline so all remaining rows can be printed to 
one page.


Something like: "SELECT *  FROM `x_news` LIMIT 0 , 15" but how to do the 
archive page SELECT * FROM `x_news` LIMIT 16 , xx?


Thanks
-Will
 



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



Re: [PHP] PHP 4.2.2 Float->Mysql addition problem

2006-02-03 Thread Andrei


	Actually we'r talking about diffrent things... What I wanted to 
highlight is that results that should be normally seen as 0 or false for 
logic comparations when using bc functions are not processed as 0 or 
false actually and you should take care when using constructs like


if( $var )
{
   ...
}

when working with variables that are a result of bc functions.

Andy

Ford, Mike wrote:

On 03 February 2006 13:14, Andrei wrote:


Welcome,
Please note that using bc function variables will be of type string.
So a code working with numeric values like:

$a = 1;
if( $a )
{
 ...
}

it's ok but with bc functions:

$a = 14.5;
$b = -14.5;
$c = bcadd( $a, $b );
if( $c )
{
...
}

will not work as expected ( if( "0" ) is interpreted like a string
that is not null and so condition is interpreted as true.


Er - nope.  The string "0" is explicitly equivalent to FALSE -- see 
http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 



To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



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



Re: [PHP] PHP 4.2.2 Float->Mysql addition problem

2006-02-03 Thread Andrei

Er - yes.
If you do conversion type you are correct. but in the example I showed I 
didn't...

If you run the code bellow you will see...

bcscale( 10 );
$a = 14.5;
$b = -14.5;
$c = bcadd( $a, $b );
if( $c )
{
echo "true: c = ".$c."";
} else
{
echo "false: c = ".$c."";
}

var_dump((bool) "0");

It's a common use to do if( $var ) and not if( (bool)$var )...

    Andy

Ford, Mike wrote:

On 03 February 2006 13:14, Andrei wrote:


Welcome,
Please note that using bc function variables will be of type string.
So a code working with numeric values like:

$a = 1;
if( $a )
{
 ...
}

it's ok but with bc functions:

$a = 14.5;
$b = -14.5;
$c = bcadd( $a, $b );
if( $c )
{
...
}

will not work as expected ( if( "0" ) is interpreted like a string
that is not null and so condition is interpreted as true.


Er - nope.  The string "0" is explicitly equivalent to FALSE -- see 
http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 



To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



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



Re: [PHP] PHP 4.2.2 Float->Mysql addition problem

2006-02-03 Thread Andrei

Welcome,
Please note that using bc function variables will be of type string. So 
a code working with numeric values like:


$a = 1;
if( $a )
{
...
}

it's ok but with bc functions:

$a = 14.5;
$b = -14.5;
$c = bcadd( $a, $b );
if( $c )
{
   ...
}

will not work as expected ( if( "0" ) is interpreted like a string that 
is not null and so condition is interpreted as true.


Andy

Barry wrote:

Barry wrote:

Andrei wrote:

When working with floats with php/mysql I had problems too... 
When summing amounts I had errors so my solution was using decimal 
(20, 10) type into mysql for storing amounts and when using sums in 
php I used bc functions. This way u get exact calculations (depending 
on bcscale() parameter.




Thanks Andy sounds great.
Changed DB to decimal 10.2

Tried it, but using bcadd i get a value of 0.00.

If you have som sample code lying around somewhere that would be 
great, or do you know what happened?


Barry
No problem anymore. solved it. but parsing it to an other function it 
doesnt work.

oh well, at least it's calculating ^-^

Thanks for help :)

Barry



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



Re: [PHP] PHP 4.2.2 Float->Mysql addition problem

2006-02-03 Thread Andrei
	When working with floats with php/mysql I had problems too... When 
summing amounts I had errors so my solution was using decimal (20, 10) 
type into mysql for storing amounts and when using sums in php I used bc 
functions. This way u get exact calculations (depending on bcscale() 
parameter.


Andy

Barry wrote:

Hi List ^_^

PHP 4.2.2
Redhat 7.3
Mysql 3.23.54

Ok here is the problem:
I try to summary float values from my database (mysql) in PHP.

code:

$sql = "SELECT * FROM somwehere WHERE 1";
$result = mysql_query($sql);
while ($assoc = mysql_fetch_assoc($result))
  {
//adding values
$sum = $sum + $assoc["floatval"];
  }
echo $sum; // echoes an INTEGER VALUE O_o

echoing the mysql value it is float like "123.45"

The type of the mysql value is "string"
setting the type to float doesnt help (settype())

Any ideas?

Greets
Barry



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



Re: [PHP] Re: Question about C++ like macros on PHP

2006-02-01 Thread Andrei
Thnx for the tip. I wanted debug features only for this function. So 
working with debug_backtrace() was what I needed.


Thnx again,
Andrei

Richard Lynch wrote:

On Tue, January 31, 2006 6:40 am, Andrei wrote:

Well I know, I wanted to know if any1 did find a workaround...


To be more clear, since obviously several other posters aren't aware
of it...

http://php.net/set_error_handler allows you to write a function to be
called when an error occurs and that function accepts optional
arguments of $file and $line which PHP will fill with the __FILE__ and
__LINE__ values of the offending code.

Which is precisely what you need.



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



Re: [PHP] Class constructor

2006-01-31 Thread Andrei

You could try with phpversion().

Georgi Ivanov wrote:

Hi,
I'm writing a simple class. In order to be compatible with php4 and php5 I've 
done this :


class test{
function Test(){
//This will be called in PHP4
}
function __construct(){
//This will be called in PHP5
$this->Test();
}
}

Is this a solution ? Is there a better way ?

Thanks.



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



Re: [PHP] Question about C++ like macros on PHP

2006-01-31 Thread Andrei

Thank you very much David

Andrei

David Grant wrote:

Andrei,

http://php.net/manual/en/function.debug-backtrace.php

David

Andrei wrote:

Hi list,

For debugging purposes I want to send to a function the line and
file where it is called. The problem is that I want these parameters to
be added to function as default parameters (changing all function calls
would not be an option for me)

function my_func( $param, $line = __LINE__, $file = __FILE__ )
{
   ...
}

won't work as it always gets the file and line where function is defined.
Also I don't want to change all function calls to put __LINE__ and
__FILE__ parameters.
I looked into assert too, but I have to change again all function calls
to be assert( "my_func(...)" ); which again will be a pain in the a...
as this function is often called in every scripts...

Any1 has any ideea about it?

Thnx,
Andrei






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



Re: [PHP] Re: Question about C++ like macros on PHP

2006-01-31 Thread Andrei

Well I know, I wanted to know if any1 did find a workaround...

Barry wrote:

Andrei wrote:


Hi list,

For debugging purposes I want to send to a function the line and 
file where it is called. The problem is that I want these parameters 
to be added to function as default parameters (changing all function 
calls would not be an option for me)


function my_func( $param, $line = __LINE__, $file = __FILE__ )
{
   ...
}

won't work as it always gets the file and line where function is defined.
Also I don't want to change all function calls to put __LINE__ and 
__FILE__ parameters.
I looked into assert too, but I have to change again all function 
calls to be assert( "my_func(...)" ); which again will be a pain in 
the a... as this function is often called in every scripts...


Any1 has any ideea about it?

Thnx,
Andrei


Not possible.
__FILE__ and __LINE__ refers always to the line and File where the 
parser is at.




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



[PHP] Question about C++ like macros on PHP

2006-01-31 Thread Andrei


Hi list,

	For debugging purposes I want to send to a function the line and file 
where it is called. The problem is that I want these parameters to be 
added to function as default parameters (changing all function calls 
would not be an option for me)


function my_func( $param, $line = __LINE__, $file = __FILE__ )
{
   ...
}

won't work as it always gets the file and line where function is defined.
	Also I don't want to change all function calls to put __LINE__ and 
__FILE__ parameters.
I looked into assert too, but I have to change again all function calls 
to be assert( "my_func(...)" ); which again will be a pain in the a... 
as this function is often called in every scripts...


Any1 has any ideea about it?

Thnx,
Andrei

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



[PHP] Benchmarking SPL Iterators vs for / foreach ???

2005-11-26 Thread Andrei Verovski (aka MacGuru)
Hi,

Someone have benchmarked SPL iterators vs for / foreach loops? What is the 
performance penalty?

SPL is ¨interpreted wrapper¨ on the top of C++ STL (correct me if I am wrong), 
and I am sure it uses STL callbacks. But unlike C++, PHP scripts are 
interpreted, so pointer arithmetic will work only through Zend engine which for 
sure  adds extra performance penalty.

Thanks in advance for any suggestion(s)



***   with best regards 
***   Andrei Verovski (aka MacGuru)
***   Mac, Linux, DTP, Programming Web Site
***
***   http://snow.prohosting.com/guru4mac/


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



[PHP] PHP5 and SuSE 10 Problem - Help Please

2005-10-15 Thread Andrei Verovski (aka MacGuru)
Hi,

After having numerous problems after upgrade from 9.3 to 10.0 (i.e. dead USB), 
I simply reformatted my HD and installed SuSE 10 from scratch. Everything is 
almost fine except PHP5.04 - none of PHP program is working.

I have configured Apache2 with YaST2 http module, enabled PHP5 and disabled 
php4 module. I simply cannot figure out what have happened. Looks like PHP 
interpreter cannot find any include even if it is located in the same dir as 
running script.

Anyone have an idea what went wrong? On SuSE 9.3 the same setup worked without 
any problem.

[client 127.0.0.1] PHP Warning:  main(./libraries/lib.inc.php) [function.main]: failed to open stream: No such file or 
directory in /srv/www/htdocs/phpPgAdmin/index.php on line 10
[client 127.0.0.1] PHP Warning:  main() [function.include]: Failed opening 
'./libraries/lib.inc.php' for inclusion (include_path='/usr/share/php5') in 
/srv/www/htdocs/phpPgAdmin/index.php on line 10
[client 127.0.0.1] PHP Notice:  Undefined variable: misc in 
/srv/www/htdocs/phpPgAdmin/index.php on line 11
[client 127.0.0.1] PHP Fatal error:  Call to a member function printHeader() on 
a non-object in /srv/www/htdocs/phpPgAdmin/index.php on line 11
[client 127.0.0.1] PHP Warning:  main(./libraries/lib.inc.php) [function.main]: failed to open stream: No such file or 
directory in /srv/www/htdocs/phpPgAdmin/index.php on line 10
[client 127.0.0.1] PHP Warning:  main() [function.include]: Failed opening 
'./libraries/lib.inc.php' for inclusion (include_path='/usr/share/php5') in 
/srv/www/htdocs/phpPgAdmin/index.php on line 10

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



[PHP] Re: hello

2005-10-04 Thread andrei
Your document is attached.


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

[PHP] Moving PEAR installation (for self-contained class library)

2005-05-27 Thread Andrei Verovski (aka MacGuru)
Hi,

I have a PEAR-related question. My class library using some PEAR 
packages, and I would like to make it self-contained, i.e. to be able 
to move it to a server (for example MacOS X) which do not have (and 
will not require) installation of any PEAR package(s).

What I would like to do is just to copy whole PEAR directory from 
the /usr/share/php5 in the corresponding subdir of my class library. 
The question is - how to make this work transparently. What global 
php_ini variables need to be changed? Just ¨include_path¨ or anything 
else?

Thanks in advance for any suggestion(s).



***   with best regards 
***   Andrei Verovski (aka MacGuru)
***   Mac, Linux, DTP, Programming Web Site
***
***   http://snow.prohosting.com/guru4mac/


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



[PHP] processing email

2005-04-15 Thread Florin Andrei
I want to write an application that's almost like a webmail, but not
quite. It must receive emails from several mailing lists, store them in
a database, allow making annotations, provide some kind of accounts with
passwords, etc. It's quite specialized, it cannot be used as a webmail
proper, nor a webmail can be used instead (and that's why i'm writing
it).

But i do not want to reinvent the wheel. Are there any PHP libraries or
something to process email? E.g., for things like "here's the message,
separate the headers from the body and do something different with each
other item" or "find a discussion thread in these emails if i give you
the headers of each message". Things like that.

BTW, i will use PHP-4.3

-- 
Florin Andrei

http://florin.myip.org/

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



Re: [PHP] PHP IDE for OS X

2004-09-04 Thread Andrei Verovski (aka MacGuru)
Hi, Jastin,

Just try Eclipse (www.eclipse.org) and PHP plugin called phpeclipse (available 
at sourceforge.net). Works great on ALL platforms, including Linux, OSX and 
Win.

On Saturday 04 September 2004 05:26 pm, Justin French wrote:
> Can anyone suggest a PHP editor/IDE for OS X other than:
>
> - BBEdit (already using it)
> - Zend Studio (it's Java, not OS X native)
>
> What I'm hoping for is:
> - some form of auto-complete text for functions/constants/etc,
> - integrated testing/debugging
> - integration with local install of PHP
> - anything else that will make my life easier without 'getting in the
> way'.
>
> My guess is it doesn't exist, but it's worth a shot.
>
> PLEASE, no "On Windows I use..." or "I just use 'Text Editor X'" -- I'm
> looking for something more than a basic text editor, and it has to be
> OS X native (not some ugly, sluggish Java thing).


***   with best regards 
***   Andrei Verovski (aka MacGuru)
***   Mac, Linux, DTP, Programming Web Site
***
***   http://snow.prohosting.com/guru4mac/


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



Re: [PHP] PHPEclipse?

2004-07-12 Thread Andrei Verovski (aka MacGuru)
On Monday 12 July 2004 11:27 pm, Dan Joseph wrote:
> How did you get it installed?  Did you just extract the zip into the
> plugins directory?

Yes.

-- 


***   with best regards 
***   Andrei Verovski (aka MacGuru)
***   Mac, Linux, DTP, Programming Web Site
***
***   http://snow.prohosting.com/guru4mac/


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



Re: [PHP] PHPEclipse?

2004-07-12 Thread Andrei Verovski (aka MacGuru)
Hi,

I am currently using Eclipse 3.0 with latest build of PHPEclipse on Linux. 
Just great. Did not tried debugger, however. 


On Monday 12 July 2004 09:39 pm, Dan Joseph wrote:
> Hi,
>
>   I was wondering, is anyone running Eclipse 3.0 w/PHPEclipse 1.1.0?
> I'm having trouble getting it working.  I downloaded the July .ZIP file and
> unzipped it into the plugins directory.  Its not recognizing it.  Anyone
> have this working?
>
> -Dan Joseph

-- 


***   with best regards 
***   Andrei Verovski (aka MacGuru)
***   Mac, Linux, DTP, Programming Web Site
***
***   http://snow.prohosting.com/guru4mac/


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



[PHP] disguise as static content

2004-06-28 Thread Florin Andrei
My personal website (see signature below) is almost entirely built with
PHP, based on a rudimentary templating engine that i wrote. With the
exception of a few well-defined sections (pictures gallery, blog, etc.)
the most of it is static, i.e. it changes very rarely.

Some Web applications (including but not limited to search engines) seem
to treat differently the static content proper ("true" HTML pages) and
pseudo-static content generated by dynamic pages (such as PHP pages that
change rarely).

I would like to continue to use PHP for my website, but somehow "fool"
the Web clients into believing they're seeing "true" static content.
Since the content changes rarely (like once every other month), there is
no harm in pretending it's "true" static content.

I suspect there are quite a few things that can be done to achieve that
goal:
1. change extensions to .html even though they're PHP files (i know how
to trick Apache into doing that)
2. don't send HTTP headers that indicate dynamic content

I don't know how to achieve #2. I also don't know if there are other
things to care about in order to totally "disguise" the dynamic nature
of the pages.

I'm open to suggestions. Thank you in advance.

-- 
Florin Andrei

http://florin.myip.org/

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



Re: [PHP] How to obtain MAC address of server where PHP is running

2004-05-29 Thread Andrei Verovski (aka MacGuru)
Hi, Gerard,

Thanks a lot !

On Saturday 29 May 2004 08:09 pm, Gerard Samuel wrote:
> On Saturday 29 May 2004 12:35 pm, Andrei Verovski (aka MacGuru) wrote:
> > Hi, Gerard,
> >
> > Can you please be so kind to post your code snippet you have described
> > below?
>
> 
> ob_start();
>
> passthru('/sbin/ifconfig | grep ether');
> $dump = ob_get_contents();
> preg_match('/[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:
> [A-F0-9]{2}/i', $dump, $mac);
> $mac_address = $mac[0];
>
> ob_end_clean();
>
> ?>

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



Re: [PHP] How to obtain MAC address of server where PHP is running

2004-05-29 Thread Andrei Verovski (aka MacGuru)
Hi, Gerard,

Can you please be so kind to post your code snippet you have described below?

Thanks.

On Saturday 29 May 2004 05:36 pm, Gerard Samuel wrote:
> On Saturday 29 May 2004 10:21 am, Andrei Verovski (aka MacGuru) wrote:
> > Hi,
> >
> > Anyone knows ho to obtain MAC address of server where PHP is running
> > (with PHP function, of course)?
> >
> > Thanks in advance for any suggestion(s)
>
> I use passthru() to execute shell commands, and use preg_match() to get the
> MAC address.
> Unfortunately, this would only work if passthru() isn't disabled, and
> safe_mode is off...

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



[PHP] How to obtain MAC address of server where PHP is running

2004-05-29 Thread Andrei Verovski (aka MacGuru)
Hi,

Anyone knows ho to obtain MAC address of server where PHP is running (with PHP 
function, of course)?

Thanks in advance for any suggestion(s)

Andrei

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



[PHP] Problem - Turckmmcache, Apache2 and SuSE 9.1

2004-05-19 Thread Andrei Verovski (aka MacGuru)
Hi,

I have compiled and installed (precisely following instruction) turck-mmcache 
2.4.6 for Apache2-2.0.49-23/php4-4.3.4-43.3 on SuSE 9.1.

Unfortunately, I cannot start Apapche2 anymore, I am getting this error 
message:

/usr/sbin/httpd2-prefork: error while loading shared 
libraries: /usr/lib/php/extensions/mmcache.so: undefined symbol: 
php_session_register_module
[Tue May 18 22:11:01 2004] [notice] suEXEC mechanism enabled 
(wrapper: /usr/sbin/suexec2)
[Tue May 18 22:11:01 2004] [warn] Init: Session Cache is not configured [hint: 
SSLSessionCache]
[Tue May 18 22:11:01 2004] [notice] Digest: generating secret for digest 
authentication ...
[Tue May 18 22:11:01 2004] [notice] Digest: done
/usr/sbin/httpd2-prefork: error while loading shared 
libraries: /usr/lib/php/extensions/mmcache.so: undefined symbol: 
php_session_register_module

Anyone have an idea how to fix this?

Thanks in advance

Andrei

-

Here is what I have added to php.ini at the bottom:

  extension="mmcache.so"
  mmcache.shm_size="16"
  mmcache.cache_dir="/tmp/mmcache"
  mmcache.enable="1"
  mmcache.optimizer="1"
  mmcache.check_mtime="1"
  mmcache.debug="0"
  mmcache.filter=""
  mmcache.shm_max="0"
  mmcache.shm_ttl="0"
  mmcache.shm_prune_period="0"
  mmcache.shm_only="0"
  mmcache.compress="1"

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



[PHP] Problem - Turckmmcache, Apache2 and SuSE 9.1

2004-05-18 Thread Andrei Verovski (aka MacGuru)
Hi,

I have compiled and installed (precisely following instruction) turck-mmcache 
2.4.6 for Apache2-2.0.49-23/php4-4.3.4-43.3 on SuSE 9.1.

Unfortunately, I cannot start Apapche2 anymore, I am getting this error 
message:

/usr/sbin/httpd2-prefork: error while loading shared 
libraries: /usr/lib/php/extensions/mmcache.so: undefined symbol: 
php_session_register_module
[Tue May 18 22:11:01 2004] [notice] suEXEC mechanism enabled 
(wrapper: /usr/sbin/suexec2)
[Tue May 18 22:11:01 2004] [warn] Init: Session Cache is not configured [hint: 
SSLSessionCache]
[Tue May 18 22:11:01 2004] [notice] Digest: generating secret for digest 
authentication ...
[Tue May 18 22:11:01 2004] [notice] Digest: done
/usr/sbin/httpd2-prefork: error while loading shared 
libraries: /usr/lib/php/extensions/mmcache.so: undefined symbol: 
php_session_register_module

Anyone have an idea how to fix this?

Thanks in advance

Andrei

-

Here is what I have added to php.ini at the bottom:

  extension="mmcache.so"
  mmcache.shm_size="16"
  mmcache.cache_dir="/tmp/mmcache"
  mmcache.enable="1"
  mmcache.optimizer="1"
  mmcache.check_mtime="1"
  mmcache.debug="0"
  mmcache.filter=""
  mmcache.shm_max="0"
  mmcache.shm_ttl="0"
  mmcache.shm_prune_period="0"
  mmcache.shm_only="0"
  mmcache.compress="1"

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



[PHP] PHP5 RC1 rpms for Mandrake 10

2004-04-23 Thread Andrei Verovski (aka MacGuru)
Hi,

Anyone can suggest me where I can get PHP5 RC1 rpms (with possible max# of 
extensions) for Mandrake 10? I have tried to make them myself, but run into 
numerous problems.

Thanks in advance for any suggestion(s)

Andrei Verovski (aka MacGuru)

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



[PHP] PHP5 RC1 rpms for Mandrake 10

2004-04-11 Thread Andrei Verovski (aka MacGuru)
Hi,

Anyone can suggest me where I can get PHP5 RC1 rpms (with possible max# of 
extensions) for Mandrake 10? I have tried to make them myself, but run into 
numerous problems.

Thanks in advance for any suggestion(s)

Andrei Verovski (aka MacGuru)

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



Re: [PHP] Recommendation on PHP encoder please

2004-02-05 Thread Andrei Reinus
So double-encoding it (using a PHP encoder) will make life finally very hard for said cracker.
No its not ...
if I would badly need to get this encrypted page and have access to 
files ...

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


Re: [PHP] What do you say to someone who says...

2003-12-05 Thread Andrei Reinus
http://www.zend.com/customers.php

Do all these companies think that
"PHP is just a kiddie language"?
just my 0.02$

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


Re: [PHP] Evaluating a page in a different order

2003-12-03 Thread Andrei Reinus
[EMAIL PROTECTED] wrote:
Hey all,
 
I have a php page class that i use as a template for my website. Every page in my website creates an instance of the class and passes values like title and meta tag keywords. The class includes the layout from different files e.g. title.lay contains the title and logo.
 
In the top right hand corner of my page i have a login status, which displays if the user is logged in or not. This is included as loginstatus.lay by the class.
 
If the page performs a php scripting function, it is included in the main content area. This main content area comes after the loginstatus.lay, so is evaluated afterwards.
 
My problem is when creating a logout page. The loginstatus is displayed as logged in, but the main content area logouts out the user.
 
The reason i designed the class and page layout like this is because i wanted to seperate the design and code as much as possible. As a temporary solution i have added some code to loginstatus.lay, but this is edging towards including code in the layout files which i dont want.
 
If i havent confused you too much, is there anything else you can suggest?
 
you can look at the page layout at http://www.pickledshark.co.uk/EdgeDB/login.php
 
Thanks for reading
Carey
Off topic:
Please, Please and 100 times again Please.
Secure your web page

Please.

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


Re: [PHP] whaw

2003-11-24 Thread Andrei Reinus
pete M wrote:

Even the pros systems crash sometimes

http://www.php.net/
// Highlight PHP code
function highlight_php($code, $return = FALSE)
{
   // Using OB, as highlight_string() only supports
   // returning the result from 4.2.0
   ob_start();
   highlight_string($code);
   $highlighted = ob_get_contents();
   ob_end_clean();
   
   // Fix output to use CSS classes and wrap well
   $highlighted = '' . str_replace(
   array(
   ' ' *<--- insert coma ?!?!?*
   '',
   '
   '  '
   ),
   array(
   ' ',
   "\n",
   '
   '  '
   ),
   $highlighted
   ) . '';
   
   if ($return) { return $highlighted; }
   else { echo $highlighted; }
}



Re: [PHP] whaw

2003-11-24 Thread Andrei Reinus
pete M wrote:

Even the pros systems crash sometimes

http://www.php.net/

Dr. Evil-Parse-Error strikes again! :)

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


[PHP] parsing ini files

2003-10-15 Thread Andrei Popovici
I have a script which reads his configuration from an ini file. For reading
that file I use the parse_ini function. When the ini is written incorectly
the php displays a message that he has encountered a parse error in that
ini. How can I catch that error and display a message of my own?

Andrei.

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



Re: [PHP] FTP resumepos

2003-10-14 Thread Andrei Popovici
So, resumepos is the number of bytes from wich the ftp_get will start
reading the 'remote_file' and writing to the 'local-file'?

Andrei.

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Andrei Popovici ([EMAIL PROTECTED]):
> > Can anyone help me understand how the parameter resumepos from ftp_get
> > function can be used?
>
> ftp_get will  first seek the value  'resumepos' within the
> 'remote_file', before it starts to write to 'local_file'.
>
> Curt
> --
> "My PHP key is worn out"
>
>   PHP List stats since 1997:
>   http://zirzow.dyndns.org/html/mlists/

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



[PHP] FTP resumepos

2003-10-13 Thread Andrei Popovici
Can anyone help me understand how the parameter resumepos from ftp_get
function can be used?

Thanks.

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



Re: [PHP] need help with MySQL full text searching!!!!

2003-07-22 Thread Andrei BEJENARU

> I think you need to make a second index that just consists of the one
column
>
> ALTER TABLE biblio ADD FULLTEXT (title)
>
> if you want to search on just that one column.
>
> ---John Holmes...

Exactly!
If you want to do a fultext search on a single column you must have a
fulltext index on that column.
If your query searches in more than one column, you have to add a
multicolumn index on all those columns.
And also, the string (word) you are matching must be over 4 characters
(maybe not on MySQL 4.x, but surely on MySQL 3)

Regards,


-- 
Andrei BEJENARU - Developer
InterAKT Online
http://www.interakt.ro/
Tel: +4021 312.53.12
Tel/Fax:  +4021 312.51.91



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



[PHP] New PCRE features

2003-06-28 Thread Andrei Zmievski
Some news on PCRE front:

1. I've upgraded the bundled PCRE library to version 4.3 which has some
   interesting new features. 

2. I added new parameter to preg_match* functions that can be used to
   specify the starting offset of the subject string to start matching
   from. The offset can be positive or negative, like for substr().

3. Also implemented support for named subpatterns (introduced with PCRE
   4.3). This means you can do something like:

   \.\d+)?!', 'ab 55.5 bb', $match);
   var_dump($match);
   ?>

   With the result being:

array(4) {
  [0]=>
  string(4) "55.5"
  [1]=>
  string(2) "55"
  ["ahh"]=>
  string(2) ".5"
  [2]=>
  string(2) ".5"
}

   Note that the named subpattern is also available under a positional
   numeric key, as before. What this means for backwards compatibility
   is that you should not do count($match) anymore to obtain the number
   of captured subpatterns or number of matches. For latter, use the
   return value of preg_match* functions, and for former, you should
   already know how many subpatterns you have from your regexp.

4. You can use \Q..\E to ignore regexp metacharacters in the pattern.
   For example:

!\w+\Q.$.\E$!

Will match one or more word characters, followed by literals .$. and
anchored at the end of the string.

5. You can use possesive quantifiers, similar to Java's regexps. These
   are:

?+, *+, ++, and {,}+

   See PCRE docs or Java docs for more information.

6. There is now support for recursive calls to individual subpatterns.
   That is, instead of using (?R) you can use (?1), (?2) and so on. Or
   use named subpatterns: (?P>foo) will refer recursively to named
   subpattern 'foo'. Once again see PCRE docs for more info.

7. There is a new feature by the name of "callouts", but there is not
   interface to it yet. Basically, it allows user to receive control at
   a specified matching point in the pattern and inspect, continue, or
   interrupt the matching. I'm not sure how useful this would be for PHP
   users as the information provided is fairly low-level. See
   'pcrecallout' PCRE man page for more info. If there are enough
   interested people, I will add support for it.

That's about it for now.

-Andrei

"What's a polar bear?"
"A rectangular bear after a coordinate transform."
-- Bill White ([EMAIL PROTECTED])

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



[PHP] Re: template engine

2003-06-19 Thread Andrei BEJENARU
You must use
$template = preg_replace("!{for loops=(.*)}(.*){/for}!U", code('\\1','\\2'),
$template);
since the references are of the form \\n

Andrei BEJENARU

"Niels Uhlendorf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Since I don't want to continue with Smarty I started with an own
> (little) template engine. In this first try it should only replace
> {for loops=INTEGER} ... {/for} through a trivial FOR-loop which runs
> INTEGER times.
>
> This mission was sent to the function "loop" in this file:
> http://www.offucia.org/pages/template-engine/source.php?file=engine.php
>
> In this file I try to work with it
> http://www.offucia.org/pages/template-engine/source.php?file=test.php
>
> But the file loop() cannot be found and theres this mistake error:
> Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or
> '$' in /www/htdocs/v035923/pages/template-engine/engine.php on line 26
>
> Line 26 is this one:
> $template = preg_replace("!{for loops=(.*)} (.*)
> {/for}!U",code($1,$2),$template);
>
>
>
> Many thx 4 help
> Niels Uhlendorf
>



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



  1   2   3   >