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
[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
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
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
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
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?
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
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
[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
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
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 =
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,
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 =
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
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
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
[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
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
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:
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
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 =
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
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
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
[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
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
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...
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
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
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
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
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
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
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;
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
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
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' ) {
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;
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
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
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
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
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
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
44 matches
Mail list logo