Re: [PHP] displaying certain number of character

2005-08-31 Thread Shafiq Rehman
Hey Philip you can use this function function cuttext($text, $maxChars = 20, $tail = '') { $arrWords = explode( , $text); $temp = ; for ($i=0; $icount($arrWords); $i++) { $temp = ($i == 0 ? $arrWords[$i] : . $arrWords[$i] ); if (strlen($temp) $maxChars) { $returnStr = $temp; } else { return

[PHP] Re: security while building online store

2005-08-31 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: kat Dzesi momak ;) I think you know PHP enough to make your code secure. Just take care (as Christian wrote)about sql-injections and register_globals. The biggest problem could be Linux/Apache/MySQL server security threat... --- avast! Antivirus: Outbound

Re: [PHP] Re: security while building online store

2005-08-31 Thread Shafiq Rehman
You must read the articles by shiflet http://www.phpgurru.com/index.php?acion=pagingchid=www.shiflett.orgoffset=10 On 8/31/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: kat Dzesi momak ;) I think you know PHP enough to make your code secure. Just take care

[PHP] Re: (Yet another) I'm blind ... post

2005-08-31 Thread Mark Rees
Martin S [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In this code, I'm not getting the value of $list passed to the Mailman page. I've checked this umpteen times by now, but fail to see the error. I've $list is not to be found in this code sample. $lista is though. beaten

RE: [PHP] (Yet another) I'm blind ... post

2005-08-31 Thread Murray @ PlanetThoughtful
In this code, I'm not getting the value of $list passed to the Mailman page. I've checked this umpteen times by now, but fail to see the error. I've beaten myself suitably with a steel ruler -- but it didn't help. Nor does the cold I'm coming down with I suppose. Anyone see the error, and

[PHP] Mktime strange

2005-08-31 Thread Hal 9001 Consulting
Hello, I've got a problem with mktime. It's a very strange behaviour, I don't know if is a bug: echo date (M-d-Y, mktime (0,0,0,07,07,2005)); - Jul-07-2005 (right) echo date (M-d-Y, mktime (0,0,0,08,07,2005)); - Dec-07-2004 (?) Can anyone help me to solve this question? Is it a bug?

Re: [PHP] Mktime strange

2005-08-31 Thread Robin Vickery
On 8/31/05, Hal 9001 Consulting [EMAIL PROTECTED] wrote: Hello, I've got a problem with mktime. It's a very strange behaviour, I don't know if is a bug: echo date (M-d-Y, mktime (0,0,0,07,07,2005)); - Jul-07-2005 (right) echo date (M-d-Y, mktime (0,0,0,08,07,2005)); - Dec-07-2004

[PHP] stupid (HTML) question

2005-08-31 Thread William Stokes
Embarrassed to ask but how to vertically align a table to a middle of a page? Forgot... ...didn't even find it with even Dreamweaver... :-0 -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] stupid (HTML) question

2005-08-31 Thread Jay Blanchard
[snip] Embarrassed to ask but how to vertically align a table to a middle of a page? [/snip] Use CSS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] stupid (HTML) question

2005-08-31 Thread François-Xavier LACROIX
I don't think you can do a vertical centering. but you can specify a margin-top value to your table... fx Embarrassed to ask but how to vertically align a table to a middle of a page? Forgot... ...didn't even find it with even Dreamweaver... :-0 -Will -- François-Xavier LACROIX

[PHP] String format problem

2005-08-31 Thread Ahmed Abdel-Aliem
hi i have a problem when i am formating a string the problem is it converts the \n in the string to a new line here is the code ? $Text = D:\AppServ\www\intranet\admin\store\nodirectory\sub; $Replace = D:\AppServ\www\intranet\admin\store; $with = http://localhost/bank/admin/store;; //$doc =

[PHP] time zone problem

2005-08-31 Thread Sergey
Hi! I some problem: I have visitor's IP, country and city. I need to define his GMT offset. Have you such database GMT's offsets. I found many such list in Google but many countries has different GMT's (Russia - 7!). Any idea? -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] String format problem

2005-08-31 Thread Robin Vickery
On 8/31/05, Ahmed Abdel-Aliem [EMAIL PROTECTED] wrote: hi i have a problem when i am formating a string the problem is it converts the \n in the string to a new line here is the code ? $Text = D:\AppServ\www\intranet\admin\store\nodirectory\sub; $Replace =

Re: [PHP] (Yet another) I'm blind ... post

2005-08-31 Thread John Nichel
Martin S wrote: In this code, I'm not getting the value of $list passed to the Mailman page. I've checked this umpteen times by now, but fail to see the error. I've beaten myself suitably with a steel ruler -- but it didn't help. Nor does the cold I'm coming down with I suppose. Anyone see the

Re: [PHP] stupid (HTML) question

2005-08-31 Thread Jesper Gran
An easy way to center a table, is to put it in another table: table border=1 width=100% height=100% tr td align=center valign=middle table border=1trtdHello/tdtdworld/td/tr/table /td /tr /table /Jesper -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: SPL Countable count() not being called

2005-08-31 Thread Justin Francis
Justin Francis wrote: I have not been able to get count() to be called when I pass my Countable class to the count function. I am using PHP 5.1 Release Candidate 1. I am not sure if it is a bug, so I am posting here to see if anyone can help. -- class Collection

RE: [PHP] Re: SPL Countable count() not being called

2005-08-31 Thread Jay Blanchard
[snip] This code prints 1 out with no errors, when it should print out 200. Any ideas? In case anyone was wondering, I downloaded the latest cvs snapshot, and this bug has been fixed. [/snip] Bug? There is no bug. You counted 1 (one) item, not 200. -- PHP

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] RE: [suspicious - maybe spam] PHP/MySQL/XmlHTTPRequest

2005-08-31 Thread Miguel Guirao
there is a book coming out in October I guess, do a search on amazon under AJAX. Also, at www.phparch.com the August issue deals with AJAX between other things. You can buy a digital copy (PDF) for only 3.45 dlls. Regards, Chicolinux -Original Message- From: Death Gauge [mailto:[EMAIL

Re: [PHP] stupid (HTML) question

2005-08-31 Thread Raz
Will As suggested by Monsieur Jay, a bit of CSS... style type=text/css .centerTable { text-align: center; } .centerTable table { position: absolute; top: 50%; left: 50%; width: tableWidth; height: tableHeight; margin-left:

[PHP] Writing to a text file

2005-08-31 Thread JesterXL
I have 2 servers; one running *nix w/ PHP4, and one running Windows 2k w/ PHP5; neither of which give me read permissions to write/create text files. Apparently, the *nix server has PHP in Power Mode, but I'm still getting no love from fopen, and chmod via PHP doesn't work. Any adivce? Code

Re: [PHP] String format problem

2005-08-31 Thread Philip Hallstrom
hi i have a problem when i am formating a string the problem is it converts the \n in the string to a new line here is the code ? $Text = D:\AppServ\www\intranet\admin\store\nodirectory\sub; $Replace = D:\AppServ\www\intranet\admin\store; $with = http://localhost/bank/admin/store;; //$doc =

Re: [PHP] String format problem

2005-08-31 Thread tg-php
To elaborate on Philip's response (which is correct)... Anything in double quotes ( ) will be interpreted by PHP before figuring out what the actual value is. Items like \n, \t, etc are therefore converted to a newline (\n) or a tab (\t) before assigning to the variable. Variables within

[PHP] running process in the background

2005-08-31 Thread Georgi Ivanov
Hi, I'm experiencing strange behavior when trying to run background process in PHP. Code : //Run_check.php foreach ($_POST as $kid){ `php run.php param1 param2 /dev/null `; } In this case PHP waits all the instances of the process to complete. I don't understand why. I have a workaround

Re: [PHP] upload file - clients path to file?

2005-08-31 Thread cron
Interaction to write to a input file type is denied in browsers not to read the value so you can can get the full path using JavaScript like any other input in the form(document.formname.inputname.value) and pass it to other input field lets say input fullpath using something like

Re: [PHP] String format problem

2005-08-31 Thread Satyam
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] To elaborate on Philip's response (which is correct)... [] I've read never use double quotes unless you have to because it could potentially speed up PHP a little because it won't be trying to interpret every string. I once

[PHP] weird results from imagettfbbox()

2005-08-31 Thread Aaron Todd
I have an array of strings in which I am passing to imagettfbbox() in order to calculate the height of the text box for each string. I am then subtracting the height from the y position in order to deviate the pivot point form the top left corner to the bottom left corner when I used

Re: [PHP] running process in the background

2005-08-31 Thread Jordan Miller
Oh wait... you are not specifying your $_POST variable. you need to use the key for $_POST. just do a print_r($_POST) to find the key from the $_POST array that you are looking for. also, i would not pass a $_POST variable directly to your shell without escaping it somehow, first...

[PHP] Re: time zone problem

2005-08-31 Thread Satyam
Go to: http://www.timeanddate.com/worldclock/custom.html?cities=51,31,1038,224,179 The numbers at the end are my personal selection of cities I care about, but you can change it and the cities database is a long one. It is updated for daylight savings when applicable. Satyam Sergey [EMAIL

[PHP] Making Text [not the background] transparent

2005-08-31 Thread Graham Anderson
How do I make the text transparent over the background ? In my web app, I want to to put a layer BEHIND the image to control the color of the php-created text So, the layer color in the web app shows thru the text php creates Would like to use alpha transparency so the color looks clean

Re: [PHP] weird results from imagettfbbox()

2005-08-31 Thread Philip Hallstrom
I have an array of strings in which I am passing to imagettfbbox() in order to calculate the height of the text box for each string. I am then subtracting the height from the y position in order to deviate the pivot point form the top left corner to the bottom left corner when I used

RE: [PHP] String format problem

2005-08-31 Thread Jim Moseby
hi i have a problem when i am formating a string the problem is it converts the \n in the string to a new line here is the code ? $Text = D:\AppServ\www\intranet\admin\store\nodirectory\sub; $Replace = D:\AppServ\www\intranet\admin\store; $with = http://localhost/bank/admin/store;; Use

[PHP] Nested IFs Problem

2005-08-31 Thread Albert Padley
I have the following nested ifs: if ($row['date'] '2005-10-02') { if ($row['time'] '12:00') { if ($row['field'] == 'P5' ) { echo td class=\tabletextbluebg\Success; } } } else { echo td class=\tabletextred\Failed; } /td Whenever the 3

Re: [PHP] Nested IFs Problem

2005-08-31 Thread Jordan Miller
why not rewrite it to be more concise... i can't see a problem at the moment. are you sure you can do a comparison operator on the '12:00' and '2005-10-02' string?? Maybe if you are using 24 hr format you could just get rid of the : on both sides of the operator to have the properly

RE: [PHP] Nested IFs Problem

2005-08-31 Thread Jim Moseby
I have the following nested ifs: if ($row['date'] '2005-10-02') { if ($row['time'] '12:00') { if ($row['field'] == 'P5' ) { echo td class=\tabletextbluebg\Success; } } } else { echo td class=\tabletextred\Failed;

[PHP] Re: [SPAM] - [PHP] Nested IFs Problem - Bayesian Filter detected spam

2005-08-31 Thread Justin Francis
Albert Padley wrote: I have the following nested ifs: if ($row['date'] '2005-10-02') { if ($row['time'] '12:00') { if ($row['field'] == 'P5' ) { echo td class=\tabletextbluebg\Success; } } } else { echo td

Re: [PHP] Nested IFs Problem

2005-08-31 Thread Eric Gorr
Albert Padley wrote: Whenever the 3 if statements are true, I always get the correct Success to echo. However, if any or all of the if statements are false, I never get Failed to echo. I know it's something simple, but I just can't see it at the moment. The code is doing exactly what you

[PHP] Re: [SPAM] - [PHP] Nested IFs Problem - Bayesian Filter detected spam

2005-08-31 Thread Albert Padley
Justin Jordan, Thanks. The was what I needed. Albert Padley On Aug 31, 2005, at 2:27 PM, Justin Francis wrote: Albert Padley wrote: I have the following nested ifs: if ($row['date'] '2005-10-02') { if ($row['time'] '12:00') { if ($row['field'] == 'P5' ) {

Re: [PHP] Nested IFs Problem

2005-08-31 Thread Satyam
Jim Moseby [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have the following nested ifs: if ($row['date'] '2005-10-02') { if ($row['time'] '12:00') { if ($row['field'] == 'P5' ) { echo td class=\tabletextbluebg\Success;

[PHP] ID based on position?

2005-08-31 Thread Gustav Wiberg
Hi there! Is there any function in PHP that gives an ID from a MySQL-db based on which position the record has in the table? Let's say, there's a table like this: 1. Record1 ID 33 2. Record2 ID 76 3. Record3 ID 100 If I know position 2, I want to get ID 76. Is the only way to loop through

Re: [PHP] ID based on position?

2005-08-31 Thread Jasper Bryant-Greene
Gustav Wiberg wrote: Hi there! Is there any function in PHP that gives an ID from a MySQL-db based on which position the record has in the table? Let's say, there's a table like this: 1. Record1 ID 33 2. Record2 ID 76 3. Record3 ID 100 If I know position 2, I want to get ID 76. Is the only

Re: [PHP] ID based on position?

2005-08-31 Thread Jason Davidson
You could LIMIT your query to the record number you are looking for, and grab the last element in the array from your result set. But this is a serious hack, and I am really wondering why you need to do what your asking, it seems (without knowing more) that you are tackling the problem in the

Re: [PHP] ZCE Reccommendations

2005-08-31 Thread hitek
Chris Shiflett wrote: hitek wrote: I'm taking my ZCE exam soon and would like general advice on what to study up on. This is a good resource: http://zend.com/store/education/certification/zend-php-certification-objectives.php You picked a good month to take the exam, since it's $125

Re: [PHP] ID based on position?

2005-08-31 Thread Miles Thompson
Auugh!! Why would you want to do this? You're flying in the face of relational database theory and practice. Position of a record in the table is, or should be irrelevant. What if you have twenty thousand records, or two hundred, and the 45th record in the table is deleted? Fetching an ID

Re: [PHP] ZCE Reccommendations

2005-08-31 Thread Greg Donald
On 8/31/05, hitek [EMAIL PROTECTED] wrote: For the record, I passed :) Congrats. -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php