[PHP] Re: List items in table with a hypertext link

2003-01-16 Thread Al
This may be a bit more than you are looking for.

http://sourceforge.net/projects/phpmyedit/



Mike Tuller wrote:

I have been looking for an example of how to create a listing of items 
in a table where you have the first item in the list have a link so that 
when you click on it, it will open a page for editing the contents of 
that item. So for instance you have a list of employees, and you want to 
change their phone number you could go to the list and click on the 
employee id number and it would open a page where you can edit the 
employee information.

I haven't been able to find a good example of this, so if anyone knows 
where I could find one, please let me know.

Mike



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




[PHP] Re: problems with include()

2003-01-30 Thread Al
Looks like you are only backing up 2 levels when you need 3.

Why not try something like:

$root= "the absolute path to your root folder";

Then simply:

include ($root . "mainfile.php");

etc.


Daniel Negron/Kbe wrote:

I have this code :



which works great from the root dir where  these files are stored. [all
content is showing properly]

If I move the file to its final destination, let say ...
http://root_dir/intranet/training/final_folder

I change the code to match



ALL I get is the Converted HTML printed on the screen.  I have tried many
variations of traversing the directories, but this does not seem to be
working.  Can anyone help ?


Thank you,

**DAN**




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




[PHP] How can I... force some HTML tags for all links to jpg files.

2003-01-31 Thread Al
I've got a folder with about 100 jpg files and a menu which a link to 
each one.

Works fine but looks crude.  Obviously, the image shows as a default on 
a white background, located in the upper left.

I'd like to spiffy up the appearance with a background color and 
centering the image. [e.g. with a simple html file or whatever]

I would prefer to not to redo the menu file or the jpgs.

Was hoping there would be a way to do this similar to the Apache
HeaderName directive for folder listings.

I tried in the htaccess file:

IndexOptions +FancyIndexing
AddDescription "test text" *.jpg

But this doesn't even show the the test text.

Thanks




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



[PHP] Question about $DOCUMENT_ROOT and include

2003-02-05 Thread Al
Why does the absolute path work and not document_root?

include ("$DOCUMENT_ROOT/root_functionsT.php");
//error message says function undefined

include ("/www/r/myID/htdocs/root_functions.php");
// Works just fine

echo "$DOCUMENT_ROOT/root_functionsT.php";
// shows /www/r/myID/htdocs/root_functionsT.php

php 4.2.3 apache

Actually, I'm trying to get away from using the full absolute path for 
includes but have not been able to get the htaccess declaration to work.

php_value include_dir ".:/www/r/myID/htdocs/" [I've tried every syntax 
variation I can find and think of]

many thanks.


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



Re: [PHP] Question about $DOCUMENT_ROOT and include

2003-02-05 Thread Al
Thanks for the feedback

That works if I leave off the quotes from around DOCUMENT_ROOT.  Simply
$_SERVER[DOCUMENT_ROOT]

I'd really like to get this working in the htaccess file.

php_value include_dir ".:/www/r/myID/htdocs/"

I redoing a site with several php files in assorted directories and 
would like be certain things will work if we move the site to a new host.

Several references I've found suggest staying away from using 
$DOCUMENT_ROOT since it can be different on virtual hosts.



Chris Shiflett wrote:
--- Al <[EMAIL PROTECTED]> wrote:


Why does the absolute path work and not document_root?

include ("$DOCUMENT_ROOT/root_functionsT.php");
//error message says function undefined

include ("/www/r/myID/htdocs/root_functions.php");
// Works just fine



Try $_SERVER['DOCUMENT_ROOT'] and see if that works.

Chris



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




[PHP] Re: setcookie() in various browsers..

2003-02-07 Thread Al
cookies work just fine with NS4x.

Here's one I use:
setcookie ("LastVisit", time(), time()+7776000);


Chad Day wrote:

This is with PHP 4.2 and register_globals off.

I am setting cookies and starting a session in the following fashion:

setcookie("EMAILADDR", $row[EMAIL], time()+2592000, '/', ".$dn");

where $dn = mydomain.com

I want the cookies accessible sitewide .. at www.mydomain.com, mydomain.com,
forums.mydomain.com, etc.

in IE 6.0, and NS 7.0, it seems this is being accomplished correctly.

In NS 4.8, the cookies are never even getting set.  Can anyone tell me as to
why?  I've been prodding around cookie docs and trying to find something
that works in all browsers, and a lot of people seem to have the same
question..

Thanks!
Chad





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




[PHP] What happened to phpEdit???

2003-02-16 Thread Al
Their site no longer responds.

Surely, we haven't lost one of the best php editors.


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




Re: [PHP] What happened to phpEdit???

2003-02-17 Thread Al
Did you try the URL you posted?

I tried that one and several others listed for phpEdit.

All say the site is not responding.

Bryan Lipscy wrote:

Did you check google?
http://ozu.arecom-sa.com/~marms/phpedit.net/

-Original Message-
From: Al [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 16, 2003 8:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] What happened to phpEdit???


Their site no longer responds.

Surely, we haven't lost one of the best php editors.




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




Re: [PHP] What happened to phpEdit???

2003-02-19 Thread Al
Are you guys it works for in Europe, or outside the USA?

I can traceroute to their site just fine, both phpEdit.com and 
phpEdit.net.  And, I can use the IP 212.43.196.19; but it won't open the 
 page.

Is it technically feasible to block visitors from a specific country?

John Nichel wrote:
It works fine for me.  So does www.phpedit.net

Al wrote:


Did you try the URL you posted?

I tried that one and several others listed for phpEdit.

All say the site is not responding.

Bryan Lipscy wrote:


Did you check google?
http://ozu.arecom-sa.com/~marms/phpedit.net/

-Original Message-
From: Al [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 16, 2003 
8:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] What happened to phpEdit???


Their site no longer responds.

Surely, we haven't lost one of the best php editors.










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




Re: [PHP] What happened to phpEdit???

2003-02-19 Thread Al
Tried both of your suggestions with IE6 and Moz.  Nothing worked.

I did get though via a link from a site in France.

I sent an email to [EMAIL PROTECTED] using their message popup.

I also mentioned that i had intended to make a contribution; but, that 
it would be pointless if I couldn't reach their site.

We'll see.

Mirek Novak wrote:
Al wrote:


Are you guys it works for in Europe, or outside the USA?

I can traceroute to their site just fine, both phpEdit.com and 
phpEdit.net.  And, I can use the IP 212.43.196.19; but it won't open the 


... and what about so called 'transparent proxy-cache' ? Ask your ISP.
Or try http://www.php.net?blabla=huhu (if it is caching it can help)

HTH



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




[PHP] Question about str_replace()

2003-02-22 Thread Al
I have a simple str_replace function that obviously has a syntax 
problem.  The [p] in the $find array ignores the brackets.  Every "p" in 
my text is replaced by a .  Just for the heck of it, I've tried " 
instead of ', and preg_replace(), etc.

$find= array('& ','W&OD', '"&"', chr(146), '[p]');
$replace= array("& ","W&OD", '"&"', "'", '');
$words= str_replace ($find, $replace, $text);

Thanks.

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


[PHP] Question about replacing \r\n with

2003-02-22 Thread Al
I can't find a way to replace \r\n codes with  in a text file.

I'm reading a text file that was prepared with windows notepad
The hex code shows OD OA for CR/LF as I expect.
I'd like to replace the OD/LF with s.

I spent hours trying every User Notes in the PHP Manual for this simple 
operation.  e.g.,

$txt= preg_replace("\r\n", "", $words);

and this version
 $txt = preg_replace("/(\015\012)|(\015)|(\012)/","", $txt);
I can substitute other characters and dec equivalents and the 
substations just won't work for \r\n [or just \r or just \n] or "\015" 
or "\15".

And, I've tried using "10" and "010" and "13" and "013".

And nl2br doesn't work either.

Can anyone help?

Thanks

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


[PHP] Re: Question about str_replace()

2003-02-23 Thread Al
That's what's blowing my mind.  It is so simple it should work. The 
php/apache [Zend] on my virtual host just seems to ignore the the 
brackets.

Hans Prins wrote:
Assuming that you do want to replace "[p]" with "", the code you posted
worked for me. The following printed: "leadingtexttrailingtext" to the
screen
');
$text = "leadingtext[p]trailingtext";
$words = str_replace ($find, $replace, $text);
print $words;
?>
"Al" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
I have a simple str_replace function that obviously has a syntax
problem.  The [p] in the $find array ignores the brackets.  Every "p" in
my text is replaced by a .  Just for the heck of it, I've tried "
instead of ', and preg_replace(), etc.
$find= array('& ','W&OD', '"&"', chr(146), '[p]');
$replace= array("& ","W&OD", '"&"', "'", '');
$words= str_replace ($find, $replace, $text);

Thanks.






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


[PHP] Question about Include_once

2003-07-19 Thread Al
Does file called by "Include_once"  stay with the client's session or 
just for operations in the page where it is stated?

For example, assume I have one file that contains several functions, 
then if use "include_once('functions.php')" on several pages, does the 
server reload the file for every page, or does it know to save it for 
all pages used in the session?

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


[PHP] Re: Freeze Pane

2003-07-25 Thread Al
Inline frames http://www.cs.tut.fi/~jkorpela/html/iframe.html

Jason Martyn wrote:

This is probably under the category of javascript, however I would like ot know if it is possible to be done with php.

Let's say I have a table that is 30 columns wide and so the entire table doesn't fit on the screen. Is it possible (with php) to "freeze columns" while scrolling across so you don't lose the original 2 columns?

And since it probably isn't, can someone suggest a language that would cover this subject?

Thanks,
Jay
 



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


[PHP] File uploads...

2003-03-24 Thread Al
Trying to do what should be rather simple and I have done before.
Maybe I am just overlooking the obvious but this is the error I get...
Warning: Unable to open 'Array' for reading: No such file or directory 
in /var/www/html/nepso_noah/NEPSO/includes/reporters/update_profile.inc 
on line 33

This 'Array' is just the value of the name from the form field for the 
file upload...
Here are the pieces of the form that seem to matter...





Now when I call to the submitted data

copy($photonew, "images/reporters/$user_id/$photonew_name");

And for error checking I echo the following

$photonew -- This results as Array <-- though this should be the tmp path???
$photonew_name -- This gives me the file name
etc...
I looked over previous scripts used and they appear to work on other 
machines just not this one.

The php.ini is as follows for the file upload area...


; File Uploads ;

; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default 
if not
; specified).
upload_tmp_dir = /tmp

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
Any ideas what settings I need to change to make this simple process happen?

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


[PHP] Help with procmail script...

2003-03-28 Thread Al
The past problem was solved via this group with in minutes and I just 
want to say thanks on that.
The latest problem is a script that takes incoming emails to a certain 
address and puts them in the database.  I included the script below 
called 'Gateway.php'.
This worked great on my local machine with the settings in the 
/etc/aliase also included below.
But now that the host has me using the procamil.rc (also included)
I get the subject line in the body.
The only good thing so far from all of this is that I think I an use 
procmail to my advantage to strip the To: From: Subject: and Body: of 
the email and leave the rest(attachments etc) for /dev/null.
This would help alot since Outlook Exp. has some extra header info in 
the email.
So below are the scripts, any help would be appreciated.
Again all of this works perfect on my machine but they are not allowing 
me the use of the aliase file for sendmail.  Though using procmail to 
strip the above info my be better in the long run?
Thanks,
--Al

Gateway.php
#!/usr/local/bin/php -q

/*  $Id: gateway.php,v 1.11 2002/10/28 15:52:27 root Exp $
 *  Copyright (C) 2002 Justin Mazzi <[EMAIL PROTECTED]>
 *  This program is free software; you can redistribute it and/or 
modify
 *  it under the terms of the GNU General Public License as 
published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
02111-1307  USA
 *
 *  Dont forget to come by linuxgroup.net ;-)
 */

/* Setup some vars */
$stdin = fopen("php://stdin", "r");
/* Fill the values in with your info */
$sqlhost = "localhost";
$sqluser = "";
$sqlpass = "";
$sqldb = "";
/* This is used for bounced emails. */
$support_email = "[EMAIL PROTECTED]";
$support_name = "Al Nutile";
/* make the mysql connection */
mysql_connect($sqlhost, $sqluser, $sqlpass);
mysql_select_db($sqldb);
/* read in the pipe from stdin */
while (!feof($stdin)) {
$buffer = fgets($stdin, 4096);
$message[] .= $buffer;
}
/* Get the email headers */
foreach($message as $header_build) {
if (preg_match("/^$/", $header_build)) break;
$header_build = preg_replace("/:\s/", ":", $header_build);
if (preg_match("/:/", $header_build)) {
$vars = preg_split("/:/", $header_build, 2);
if ($vars[1]) {
chop($header[$vars[0]] = $vars[1]);
}
}
}
/* Error out if there's an attachment */
if (preg_grep("/oundary=/", array_values($message))) {
$attachment = 1;
$email_body = "Hi,\n\tSorry, your message contained one or more 
attatchments. ";
$email_body .= "Our email system does not currently accept ";
$email_body .= "attachments. Please attempt to resend the email ";
$email_body .= "without an attachment.\n\n -$support_name\n";
$email_body .= "$support_email";
$subject = "Re:$header[Subject]";
$from = "From:<$support_name>$support_email";
$to = $header['From'];
mail($to, "$subject", "$email_body", $from);
//exit("Message had an attachment");
}

/* strip out Re:'s in subject */
if ($header['Subject']) {
$header['Subject'] = preg_replace("/\s*Re:\s*/", "", 
$header['Subject']);

}

/* initialize To: header */
$string = $header['To'];
  	$separat = "@";
  	$to = substr($string, 0, strlen($string)-strlen (strstr 
($string,$separat)));
$sql = "select sport_id from sports where email = '$to'";
$result = mysql_query($sql);
	while ($row = mysql_fetch_array($result))
 		{
$sport_id = "{$row["sport_id"]}";
}

/* Turn from into an ID */

$from = $header['From'];
$string = preg_match("/
		if (!$string)
	{
  $from = $from;
  } else {
			$from = substr(strrchr($from, "<"), 1);
  $from = str_replace(">", "", &q

[PHP] Removing a string from one area to another...

2003-03-29 Thread Al
Could use some help on trying to remove mime from an incoming email.
The emails (netscape or outlook) seem to clearly define...
Netscape
boundary="070304040709010903030405"
Outlook
boundary="=_NextPart_000_0015_01C2F52F.777F61A0"
Then remove the first occurence to the next.

--070304040709010903030405
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
*TEST*

--070304040709010903030405

This would remove the mime from netscape or outlook...

Would be the part I would want to remove from the inforamtion

So maybe with a preg_match on the boundary and then strip from that 
value until the next time you see the value??

Though now to put this in a language php understands??
Thanks
--Al
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Anyone know of a php script to extract files from a zip file.

2003-05-27 Thread Al
I doing a little photos album application and I'd like my, non-techie, 
users to be able to zip together their photos and upload them to a 
folder on the site.  I've got everything going nicely except the unzipper. 

I would not like to teach them to use ftp, even with a browser. 

I'm on a virtual host that doesn't have the ZZIPLIB. 

Thanks

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


Re: [PHP] Anyone know of a php script to extract files from a zipfile.

2003-05-27 Thread Al
Does appear to be promising.  I'll try it.  His description is a bit 
vague about what zip formats it handles. 

Evan Nemerson wrote:

http://dev.maxg.info/projets/projet.ziplib.en.maxg maybe??? haven't tried it

On Tuesday 27 May 2003 12:16 pm, Al wrote:
 

I doing a little photos album application and I'd like my, non-techie,
users to be able to zip together their photos and upload them to a
folder on the site.  I've got everything going nicely except the unzipper.
I would not like to teach them to use ftp, even with a browser.

I'm on a virtual host that doesn't have the ZZIPLIB.

Thanks
   

 



[PHP] Re: corrupt images

2003-05-29 Thread Al
Check that you are using the correct MIME type.

There is a note on this in the User Contributed Notes under the function definition.  



Jason Jacobs wrote:

Hi all.  I've been struggling with getting images to upload cleanly.  I'm using php 4.2.2.  When I look at the uploaded file info, it gives me no errors and the file size is fine.  But the picture is all messed up.  I'm using the move_uploaded_file function.  The max size is 8mb in php.ini, and I set the MAX_FILE_SIZE in the form to 100k.  None of the images I'm testing have been over 30k.

I've seen that some people have had this problem, but a solution hasn't been consistent.  Some said to use copy() and some said it's a bug in PHP.  If anyone knows what's going on I'd appreciate some advice.  Thanks!

-jason
 



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


[PHP] Sendmail "return-path" from my virtual webhost

2002-07-29 Thread Al

Emails sent from my php scripts, using sendmail, all have a goofy 
"return-path" variable in the header.

Is there a way I can correct this, or does it require a change to the 
sendmail config file that I can't get to?

Thanks...


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




[PHP] Re: Sendmail "return-path" from my virtual webhost

2002-07-30 Thread Al

I was hoping there was a way to fix it without having to modify my php 
scripts [e.g., phpBB2, postlister, etc.]



Manuel Lemos wrote:
> Hello,
> 
> On 07/29/2002 01:54 PM, Al wrote:
> 
>> Emails sent from my php scripts, using sendmail, all have a goofy 
>> "return-path" variable in the header.
>>
>> Is there a way I can correct this, or does it require a change to the 
>> sendmail config file that I can't get to?
> 
> 
> Yes, you can use mail() 5th argument or call sendmail directly with the 
> popen using -f switch.
> 
> Take a look at these classes to learn how to do it in case you have doubts:
> 
> http://www.phpclasses.org/mimemessage
> 
> 


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




[PHP] Newbie question about UNIX command-line directives

2002-08-10 Thread Al

I'm on a virtual host without a shell account and need execute a UNIX 
command.

ln -s ../afile.php index.php

Is there some way to do this [e.g., with a htaccess file]?

What happens when you execute UNIX commands like the one above?  Does it 
make a file, change the config?


Thanks





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




Re: [PHP] Newbie question about UNIX command-line directives

2002-08-11 Thread Al

Appreciate the feedback, but.

The .htaccess approach appears to fit my situation best; but, I've not 
been able to get it to work.

I have a folder with a php script and that folder has several 
sub-folders each with a small configuration script.  I'd like the entry 
point to be a subfolder and main script [in the parent folder] to be 
"symbolically" executed.

I'm familiar with the DirectorIndex and use it often, but only for 
defining the default file for the particular folder.

Could I be doing something wrong? Or is there another htaccess directive 
  that may work?

Thanks.

Analysis & Solutions wrote:
> On Sat, Aug 10, 2002 at 01:12:38PM -0400, Al wrote:
> 
>>I'm on a virtual host without a shell account and need execute a UNIX 
>>command.
>>
>>ln -s ../afile.php index.php
> 
> 
> In a PHP script, you can do this -- if permissions are favorable:
> 
>exec('ln -s ../afile.php index.php');
> 
> 
> 
>>Is there some way to do this [e.g., with a htaccess file]?
> 
> 
> In an .htaccess file, you can put this
> 
> DirectoryIndex afile.php
> 
> 
> 
>>What happens when you execute UNIX commands like the one above?  Does it 
>>make a file, change the config?
> 
> 
> It makes a link in the file system.  -s makes the link symbolic.
> http://www.tac.eu.org/cgi-bin/man-cgi?ln++NetBSD-current
> 
> --Dan
> 


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




Re: [PHP] Newbie question about UNIX command-line directives

2002-08-11 Thread Al

The problem may be due to the fact that my environment is Apache Unix.

I spent about two hours today pouring over the php on-line manual 
"include" spec and trying dozens of combinations. 
http://www.php.net/manual/en/function.include.php

There must be at least 20 user contributed notes at the bottom.

It is incredible that such a basic php function should be so obtuse and 
ill defined.

I'm going to give your other suggestion a try tomorrow.

Thanks again

Analysis & Solutions wrote:
> On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote:
> 
>>The .htaccess approach appears to fit my situation best; but, I've not 
>>been able to get it to work.
> 
> 
> I wondered about the DirectoryIndex directive's ability to utilize files 
> in other directories, so did a little test, which is what you indicated 
> you tried in your initial email:
> 
>DirectoryIndex ../index.htm
> 
> Worked fine.  Apache 1.3.26.  Windows NT.
> 
> So, your problem could be a web server configuration thing, as Rasmus 
> hinted at.
> 
> Beyond the things already discussed, I'm at a loss.
> 
> Good luck,
> 
> --Dan
> 


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




Re: [PHP] Newbie question about UNIX command-line directives

2002-08-12 Thread Al

I wasn't clear before.  The problem I'm having, and most of the others 
folks who commented, with include is really with "include_path".

A good bit of the problem seems to be my virtual host's environment. 
Most things I've tried with directives in an htaccess don't work and the 
  error log says "not allowed" etc.

I appreciate your help.

Rasmus Lerdorf wrote:
> What does include have to do with DirectoryIndex?  And what exactly is
> your problem with include?  The only trick is setting the include_path
> which doesn't seem all that obtuse to me.
> 
> -Rasmus
> 
> On Sun, 11 Aug 2002, Al wrote:
> 
> 
>>The problem may be due to the fact that my environment is Apache Unix.
>>
>>I spent about two hours today pouring over the php on-line manual
>>"include" spec and trying dozens of combinations.
>>http://www.php.net/manual/en/function.include.php
>>
>>There must be at least 20 user contributed notes at the bottom.
>>
>>It is incredible that such a basic php function should be so obtuse and
>>ill defined.
>>
>>I'm going to give your other suggestion a try tomorrow.
>>
>>Thanks again
>>
>>Analysis & Solutions wrote:
>>
>>>On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote:
>>>
>>>
>>>>The .htaccess approach appears to fit my situation best; but, I've not
>>>>been able to get it to work.
>>>
>>>
>>>I wondered about the DirectoryIndex directive's ability to utilize files
>>>in other directories, so did a little test, which is what you indicated
>>>you tried in your initial email:
>>>
>>>   DirectoryIndex ../index.htm
>>>
>>>Worked fine.  Apache 1.3.26.  Windows NT.
>>>
>>>So, your problem could be a web server configuration thing, as Rasmus
>>>hinted at.
>>>
>>>Beyond the things already discussed, I'm at a loss.
>>>
>>>Good luck,
>>>
>>>--Dan
>>>
>>
>>
>>--
>>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] Imagemangick, can I install on a virtual host?

2002-09-01 Thread Al

I'd like to use some of the Imagemagick functions; but my virtual host 
doesn't include it and won't bother to install it.

Is it practical to install Imagemagick php on a virtual host?

Has php.  It's not a shell account.  FTP is the only basic access.


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




[PHP] Question about Mail function time out

2002-06-07 Thread Al

Sorry if this shows twice.  I originally posted it with Mozilla and forgot
that this newsgroup server seems to ignore postings from it.  This one is
posted from IE.

I've got a mail function script that occasionally terminates midway while
sending out about 600 emails.

The symptoms point to the "max_execution_time" [set for 30].

Two questions:

Are their typically any other settings that I need to check.
[e.g.,
session.cache_limiter
session.cache_expire]

What's the best approach to resolving the problem?
Should I get the web host techs to change the php.ini settings?
Or, should I modify my script with "set_time_limit()" ?


Thanks..





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




Re: [PHP] Question about Mail function time out

2002-06-07 Thread Al

Opps, hit the reply rather than the reply group.  I normally use Moz.

I'm subscribed to 8 newsgroup servers.  All work perfect except news.php.

I replied to you message with Moz; but it doesn't show.

This one is with IE


"Chris Hewitt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Al,
>
> Interesting. I use Mozilla and I've never had any emails rejected or
> heard of anyone else have it happening. Have you some more information
> or is this an urban legend?
>
> Regards
>
> Chris
>
> Al wrote:
>
> >Sorry if this shows twice.  I originally posted it with Mozilla and
forgot
> >that this newsgroup server seems to ignore postings from it.  This one is
> >posted from IE.
> >
>
>



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




[PHP] Question about set_time_limit and max_execution_time

2002-06-07 Thread Al

I've got a mail function script that occasionally terminates midway 
while sending out about 600 emails.

The symptoms point to the "max_execution_time", which is set for 30 
seconds.

The question is how to best handle it.

set_time_limit only seems to apply to the script that contains it. Yet 
there are several scripts involved in the application.  Must every one 
of them contain the set_time_limit also?

Or, would the "max_execution_time" function be a better way to handle it?

Can the php cgi versions honor the "max_execution_time"?  I can't think 
of a way to determine if it sets the config file.

Thanks


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




[PHP] What are pros and cons of the Apache module verses cgi version?

2002-06-08 Thread Al

I notice that some webhosts offer the apache module and some the cgi.

On the surface, the cgi version appears to be a lot of extra hassle.

Thanks


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




[PHP] Newbie needs some help picking a php editor.

2002-06-11 Thread Al

I spent a good bit of time looking at editors to help me prepare and 
modify php scripts.  I've found it very time consuming to evaluate them.

In general, I've found you have to download, install and play with them 
some just to determine if they fit your needs.  And I know from 
experience, often programs only show their deficiencies after you've 
used them a bit.

And, I've found many that claim "php" editing; but they really aren't 
anything but a simple plain text editor.

My needs are modest.  I'm well versed with HTML, css, etc.  And have 
done a bit of customizing scripts.

For now, I mostly need an editor that will:
  Help me keep the syntax correct.
  Provide a list of functions, etc. to pick from.
  Upload my script files via ftp.
  Have the usual search/replace across files

Would be nice if it:
  Had a project feature
  Could run a script I'm working on locally with its includes, etc. on 
my remote host.

Right now I'm looking at "php Coder Pro"; "phpEdit" and "UltraEdit".

Can anyone comment on these?  And please suggest any others.

Thanks.


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




[PHP] Re: Table format needs php correction

2003-08-30 Thread Al
There are too many problems with your code for anyone to spend the time 
going thru them all.

I'd suggest, first constructing a regular html table that looks like you 
want it to.  Hint, IE6 requires something in TDs [e.g.,  ] for 
borders to show. 

When the table looks the way you want it to, validate the code at 
http://validator.w3.org/

Then work on your php code to generate the exact same html.

Gloria L. McMillan wrote:

Hi!

This is a problem of the table formatting on a form in MySQL and PHP.
It may be in the HTML table code.
The problem is one that must be frequent.  I have a mixture of one character
and long fill-in text items.
My table now looks awkward. Somebody gave me a complex table that puts colors as 
backgrounds
behind the headers.  Could that be the problem?  -Gloria
Here is the URL to view PHP HTML table as it appears on screen:
http://DakotaCom.net/~glomc/forms/CAT.php
Here is the mysql create table structure file:

#
# Table structure for table 'CAT'
#
CREATE TABLE CAT (
  id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  added datetime DEFAULT '-00-00 00:00:00' NOT NULL,
  name varchar(50) NOT NULL,
  course varchar(50) NOT NULL,
  unit varchar(50) NOT NULL,
  q1 text NOT NULL,
  q2 text NOT NULL,
  q3 text NOT NULL,
  q4 text NOT NULL,
  q5 varchar(10) NOT NULL,
  q6 varchar(10) NOT NULL,
  q7 varchar(10) NOT NULL,
  PRIMARY KEY (id)
);
Here is the table HTML part of the PHP file:

print "\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t\n";
foreach ($line as $col_value) {
 print "\t\t$col_value\n";
}
print "\t\n";
}
print "\n";
*/
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("


DateNameCourseUnit\n
%s%s%s%s\n

 Q1 \n
%s\n
 Q2 \n
%s\n
 Q3 \n
%s\n
 Q4 \n
%s\n
Q5Q6Q7\n

%s%s%s\n

\n",
  $row['added'],
  $row['name'],
  $row['course'],
  $row['unit'],
  $row['q1'],
  $row['q2'],
  $row['q3'],
  $row['q4'],
  $row['q5'],
  $row['q6'],
  $row['q7']);
}

/* Free resultset */
mysql_free_result($result);
/* Close the database connection */
mysql_close($link);
?>


 

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


[PHP] str_replace question

2003-09-09 Thread Al
I've got a simple expression " where "xx" is a number from 0 to 99.

I want to replace it with simply .  That is, I want to remove the 
numbers.

Will "str_replace" do it, or must I use ereg_replace?

I haven't figured out from reading the php manual on regular expression 
how to do this simple thing. 

Thanks

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


[PHP] Re: Echo $PHP_SELF not working

2003-10-10 Thread Al
Put a ";" [no quotes] after  such as:   echo $PHP_SELF;   

Jeff McKeon wrote:

I've just published a new website and something is wrong.  I suspect the
PHP.ini on the server but I can't seem to find anything.
The line:



Doesn't seem to work.  If I look at the "view source" from the web
browser I see this..


On the development server I see this...



On the dev server "ECHO $PHP_SELF" seems to work but not on the
production one.  Any ideas what I've missed?
Thanks,

Jeff
 

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


[PHP] Newbie question about Class

2003-10-15 Thread Al
My question seems fundamental.  I want to set a variable in one function 
in a class and then want to use the value in a second function.  
However, the functions are called a html page with two passes.  Submit 
reloads the page and an if(...) calls the second function in the class.

If I declare on the first run:
   $get_data = new edit_tag_file();
   $edit_args= $get_data-> edit_prep();
The on the second pass, I'm stuck.  I can't declare a new instance of 
"edit_tag_data".
And, it appears the object is gone after I leave the page. 

Will the class structure do this for me or must I save the values in 
$GLOBAL or something?

Thanks

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


Re: [PHP] Newbie question about Class

2003-10-15 Thread Al
I was afraid that was the case. 

Tom Rogers wrote:

Hi,

Thursday, October 16, 2003, 3:35:56 AM, you wrote:
A> My question seems fundamental.  I want to set a variable in one function 
A> in a class and then want to use the value in a second function.  
A> However, the functions are called a html page with two passes.  Submit 
A> reloads the page and an if(...) calls the second function in the class.

A> If I declare on the first run:
A> $get_data = new edit_tag_file();
A> $edit_args= $get_data-> edit_prep();
A> The on the second pass, I'm stuck.  I can't declare a new instance of 
A> "edit_tag_data".
A> And, it appears the object is gone after I leave the page. 

A> Will the class structure do this for me or must I save the values in 
A> $GLOBAL or something?

A> Thanks

You need to pass the values to the next page or save them in a session

 

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


[PHP] Re: Recommendation for Unique URL

2003-10-26 Thread Al
> What is the best approach to the unique page ID? I thought I would store
the
> dept. mgrs. email address and the session ID in a db, and use the session
ID in
> the URL. Do I even need the mgr's email address? Is another approach
better?
> What have you used?

I'd concatenate the employee's email and manager's email, and then use an
MD5 hash of it as the unique string. i.e:

$unique_id = md5 ( $employee_email . $manager_email );

For more info on what MD5 is, see
http://us2.php.net/manual/en/function.md5.php

Cheers,

Al

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



[PHP] Idea for new operator

2003-10-26 Thread Al
Afternoon all,

Is it just me, or would everybody else like to see a case-insensitive string
comparison operator introduced into PHP? It is a type of comparison that I
use a lot, and having to strtolower() everything before comparison can
impact code readability, not to mention the angst, pain and trauma of having
to repeatedly type 'strtolower()'.

Assuming this new operator is something like '=*', the following two lines
of code would be functionally identical.

if (strtolower($a) == strtolower($b)) echo "The same!";
if ($a =* $b) echo "The same!";

Of course creating a new operator is only justified if the vast majority of
PHP users do these comparisons as much as I do, and are as averse to work as
I am ... :).

Thoughts?

Al

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



[PHP] Re: problem in 2 dimensional Array

2003-10-26 Thread Al
> i have 2 problems in 2 dimensional array
>
> 1. how to declare global 2 dimensional array in php
> 2. how to pass 2 dimensional array in function as an
> arrgument

In the context of your questions, 2-Dimensional arrays are no different to
1-dimensional arrays.

All global vairables in PHP are stored in the predefined $GLOBALS
associative array, which is automatically global in scope. Each key of the
$GLOBALS array is a name of a global variable. For example, the following
code will print "Hello World":



Passing an array to a function is no different passing a scalar variable:



Cheers,

Al

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



[PHP] Re: Object Undefinded index

2003-10-29 Thread Al
> foreach ($cart as $product_id => $quantity)
> {
> echo $product_id . "" . $quantity;
> }

The way you are accessing the array is incorrect. The $items array is a
property of the Cart object. Since the Cart object may have many different
array properties, the foreach statement above has to be sepcific about which
array you want to iterate through.

So the correct code would be:

foreach ($cart->items as $product_id => $quantity)
{
echo $product_id . "" . $quantity;
}

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



[PHP] Re: Object Undefinded index

2003-10-29 Thread Al
> I am just learning to use objects. I am messing around with a shopping
cart
> object, but am having confusing problems. I am getting an undefined index
> error when trying to assign a key value pair to an array variable within
an
> object. I am confused becuase I believe this is how you assign array
> variables outside an object. It acts like the variable is undefined.
Thanks
> for the help.

My last post didn't actually address the error you mentioned though, so I
might as well do that now... :)

>From your example, the warning you received is cause by the add_item( )
method because it's attempting to add 1 to the value of $cart->items['10'].
The only problem is that $cart->items['10'] hasn't been defined yet.

Now PHP is smart enough to realise that if $cart->items['10'] doesn't exist,
it should simply create the key and assign it a blank value (i.e. 0) and
*then* add 1. So any subsequent calls to $cart->add_item("10", 1) won't
generate an warning.

It's also important to note that you only received a warning, not an error,
and that code finished executing properly. You only received the warning
because you had rerror reporting set to strict, which is normally a very
good idea to help keep your code clean and bug free. The reason the code
didn't work as expected was because of the bug addressed in my last post.

To code the add_item( ) method in a way that won't trigger this warning, you
can change it to:

function add_item ($product_id, $quantity = 1)
{
if (!isset($this->items[$product_id]))
{
$this->items[$product_id] = 0;
}
$this->items[$product_id] += $quantity;
}

You can see that the code checks to see if the the key exists, and if it
doesn't sets it to 0, before attempting to add to it's value. This is
essentially replicating what PHP was doing anyway.

Cheers,

Al

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



[PHP] Re: Oh, for a "sureset()" (orthogonal to isset())

2003-10-30 Thread Al
> function sureset($var) {
>
> if(!isset($var) || empty($var))
> return '';
> else
> return $var;
> }
>
> Of course, when you've got strict checking on, the above doesn't
> work, because if the variable is unset you get caught on the fact
> before the function call happens.

One change will make your code work: just pass the $var argument by
reference, ie. function sureset (&$var) { ...code... }

I wrote a similar function a while ago, with a little added functionality:

function get_if_set ( &$testVar, $falseValue = NULL)
{
if ( isset( $testVar ) )
{
return $testVar;
}
else
{
return $falseValue;
}
}



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



[PHP] Re: PPTs and thumbnails

2003-10-30 Thread Al
"Vijaya_manda" <[EMAIL PROTECTED]> wrote:
> Is it possible to retrieve the first slide from a presentation and display
> it as a thumbnail on my site. Users will upload ppt's which should be
> displayed in form of thumbnails on my site. On clicking a particular
> thumbnail the presentation (.ppt or .pps) file should be displayed.

In short: not with PHP. You're going to need a program that can read and
render PHP files, and save them as a static image (i.e. gif, jpg, etc).
You can run this program (if you find one) using PHP, and then use PHP to
resize and manipulate the output image, but PHP cannot natively manipulate
PPT files, nor are there any PEAR packages for that purpose.

Good luck,

Al

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



[PHP] Re: PPTs and thumbnails

2003-10-30 Thread Al
> In short: not with PHP. You're going to need a program that can read and
> render PHP files, and save them as a static image (i.e. gif, jpg, etc).
> Al

Apologies, the 2nd sentence should read "You're going to need a program that
can read and render PPT files ..."

Arrrgh, I hate tpyos! :)

Al

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



[PHP] Re: whois api's

2003-11-11 Thread Al
There is a PEAR Project that does exactly what you want:

http://pear.php.net/package/Net_Whois

Al

"Rolf Brusletto" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey all -
>
> I'm currently working on a project which requires domain name
> information. Has anybody used, or can anybody suggest php tools to get
> whois information regarding any domain name? I'm trying to check out all
> options before having to register as a registrar for get access to a
> paid api.
>
> Rolf Brusletto
>

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



[PHP] Re: Good php WebMail Clients thru apache

2003-11-16 Thread Al
"Jerry Alan Braga" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Any suggestions ?

The best I've seen (by a long shot) is IMP, which is part of the open source
Horde project. Product homepage is at: http://www.horde.org/imp/

Hope it helps,

Al

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



[PHP] Re: Get value between 2 strings

2003-11-17 Thread Al
Here's what I use:

/**
* get_text()
*
* $t The total text string
* $s starting text string [e.g. ]
* $e ending text string [e.g. 
*
* @return the extracted text string. [e.g., returns string between 
start and end texts.
*/
function get_text($text, $s, $e) // Get string out of text
{
   $sp = strpos($text, $s, 0) + strlen($s);
   $ep = strpos($text, $e, 0);
   return substr($text, $sp, $ep - $sp);
}



Matt Palermo wrote:

Hello.  I was wondering if anyone knew of a function to get the value
between 2 strings.  For example, lets say I have the following line:
$line = "I want the value between word ONE and word TWO.  Please return
it...";
Now, I want to get everything between "ONE" and "TWO".  In this example it
should return the value " and word ".  Is there some sort of function I
could use to easily do this?  Please let me know if you have any ideas.
Thanks,

Matt
 

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


[PHP] Re: User/Pwd Management Package?

2003-11-23 Thread Al
There are a number of open-source PEAR packages that can help you manage
usernames, passwords, and user preferences.

Check out: http://pear.php.net/packages.php?catpid=1&catname=Authentication

Hope it helps,

Al

"Jonathan Rosenberg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Friends,
>
> I'm interesting in finding a PHP package that implements functions for
> managing user names & passwords & controlling access to specific parts of
a
> site.
>
> Of course, free is best.  But cheap is good.  And, even not-so-cheap is
> fine, as long as it provides good functionality.
>
> Any pointers appreciated.
>
> --
> Jonathan Rosenberg
> President & Founder, Tabby's Place
> http://www.tabbysplace.org/
>

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



[PHP] Re: String Manip. - Chop Equivalent

2003-11-23 Thread Al
>From the PHP Manual notes (http://us2.php.net/manual/en/function.chop.php):

$string = substr("$string", 0, -1);


Al

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does PHP have an equivalent to PERL's chop - that is, a way to get rid of
> the last character in a string?
>
> "Hello World" to "Hello Worl"
>
> Thanks in advance.

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



[PHP] Re: PHP to get mail headers

2003-11-23 Thread Al
"Scott St. John" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> A search did not yield much in what I am trying to do:
> 1)Open the mailbox and extract the Received, From and Subject headers.
> 2)Drop those into a database that I can manage from the browser.

There are two PEAR packages that can help you with this:
1) Mail_Mbox will parse and manipulate mbox files so you can traverse your
mail file and pull out individual messages.
http://pear.php.net/package/Mail_Mbox
2) Mail_Mime contains classes for decoding and parsing individual messages.
http://pear.php.net/package/Mail_Mime

Hope it helps.

Al

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



[PHP] Re: Count online users question

2003-11-26 Thread Al
> I am trying to figure an accurate way to calculate how many users are
> viewing a site, at any particular time. This task is very simple except
for
> one part - How do you determine when a person has left the site...apache
> hasn't served anymore requests from a particular ip for xx minutes ??

Hi Mike,

There is no surefire way to measure the exact time a user leaves your site.
The most accurate way I can think of would be to use a hidden frame on all
your pages that refreshes itself every X seconds. When a user has not
requested that special tracking page for more than X seconds, you can assume
they have 'left' the site.

However this solution seems like overkill for most purposes: you'll be
wasitng server resources and slowing down your users' experience on your
site.

In response to your proposed method, most advertising associations
(including the US-based Internet Advertising Bureau) and web analytics
companies (such as Red Sherrif, Nielsens and Hitwise) define the end of a
user session on a website when there is 30 minutes without a further request
for a page from the site.

And while you may be tempted to track only IP numbers, remember that many
users are behind shared IP numbers (e.g. firewalls) which may skew your
stats. You would be better off using cookies on user's machines to identify
them and log their accesses to a DB.

Hope that helps,

Al

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



[PHP] Re: Export data

2003-12-01 Thread Al
> Is it possible to export some data to MSOffice format ( .doc and .xls ) ,
> OOffice ( .sxw and sxc ) or .rtf format with PHP

The answer is sort of..

To write Excel files, you can use the Spreadsheet Excel Writer package
available under the PEAR module. The module's site is at:
http://pear.php.net/package/Spreadsheet_Excel_Writer

The only RTF file generator for PHP that I know of is (appropriately) called
RTF Generator, but it costs around $50. The website is:
http://www.paggard.com/projects/rtf.generator/

Another commonly suggested method of creating RTF files with PHP, especially
if your file format is not likely to change much, is to create the document
in Word and format it as you like, using unique words as placeholders. Then
open the file with a text editor find the placeholder words, and use PHP to
substitute your data for the placeholder words.

Yet another work around is to create your documents in HTML but then name
them "filname.doc" When your users open the document, Word will launch and
auto-convert the file, giving your users the option to save it as a normal
Word document.

You can also use this tactic with Excel, creative CSV file easily in PHP,
and then serving them to your users as XLS files.

Good luck,

Al

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



[PHP] Re: html stripping

2003-12-04 Thread Al
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> No this is not some shaddy game or strip poker knock-off.  My question has
to
> do with a person project I have started.  I have a script that grabs names
and
> ids from a database, puts them in an array and then based on that grabs a
URL
> and parses that URL for this name, drops all the html crap, and takes the
> information/stats and insert or updates the stats table.  Problem is on
> certain names the page that it is parsing is different, and so I get loads
and
> loads of extra HTML, and one name in particular doesnt return all the
stats.

In essence what you're trying to do is spider / trawl web pages that do not
have consistent HTML formatting with inflexible functions like substr( ) and
str_replace( ) that are incapable of adapting to inconsistent search text.

You'd be much better off extracting the relevant data from HTML using
functions such as preg_match( ) and preg_replace( ) which let you search
over text using Perl-style regular expressions (aka regexes). Function
documentation can be found at:
http://au3.php.net/manual/en/function.preg-match.php and
http://au3.php.net/manual/en/function.preg-replace.php

If you have no idea what a regex is, think of it as powerful, wildcard-based
searching. It allows you to write search expressions that are very tolerant
of changing search text and can still extract the data you need.

Regexes can be confusing when you start out. Try looking at this tutorial
for some starters: http://www.phpfreaks.com/tutorials/52/0.php

Good luck.

Al

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



[PHP] Re: Sort Array by date

2003-12-04 Thread Al
> I have a bunch of dates in the form: MM-DD- in an array and I want to
> sort them and display them in descending order.  I have tried the usort()
> function below and it's not working.  Can anyone help me out here?

Your sorting function uses strtotime, which doesn't recognise data in the
MM-DD- fomat.

Generally speaking, dates are best stored in the ISO standard format
-MM-DD so that they can be sorted easily with functions like strcmp.
This format is also recognised by strtotime( ). Look in the code below to
learn how to convert your date format to the ISO standard.

If you can't change the date format, you can also modify your sorting
function as following:

// Note this is untested pseudo-code:
function date_file_sort($a, $b)
{
list ($aMonth, $aDay, $aYear) = explode('-', $a);
$aIsoDate = sprintf("%04d-%02d-%02d", $aYear, $aMonth, $aDay);
list ($bMonth, $bDay, $bYear) = explode('-', $b);
$bIsoDate = sprintf("%04d-%02d-%02d", $bYear, $bMonth, $bDay);
    return strcmp($aIsoDate, $bIsoDate);
}

Good luck with it,

Al

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



[PHP] Re: Write on image in faint color

2003-12-09 Thread Al
There's a command line, open-source utility called ImageMagick
(http://www.imagemagick.org/) available for all major platforms that allows
you to do lots of powerful image manipulation on one file, or one thousand.
You crop, scale, rotate, colour, draw on, place text over, compose,
transform and create montages of images using this program.

It has quite a steep learning curve, but the results are worth it!

You can run this using PHP shell_exec() function if you want to execute the
program from a web page, although be careful of the obvious security
consideration involved in doing this.

Hope it helps,

Al


"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> This was asked some time ago but cant find it in the archive, anybody
> remember how it was solved please write and tell me.
>
> Requirment:
> Write domain name in faint color on picture (a kind of "watermark")
>
> Reason:
> I have 3 directories full of images that are original to our site and I
> spent a crapload of time scanning them and putting them up, I dont want
> others to just "borrow" the images and use them without giving us some
type
> of credit...
>
> I found a package on google after searching that you just throw all the
> images in a folder and it generates the thumbs for you in a folder called
> "thumbs", can i do the same for this too?
> ie.
> throw all the images in a folder, run the program and get www.sitename.com
> written on all the images?
>
> Any help and reminders appreciated.
>
> Cheers,
> -Ryan

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



Re: [PHP] Re: Write on image in faint color

2003-12-10 Thread Al
>4) I'd love to see a PEAR IM module a la PerlMagick (but I haven't even
>looked yet, so please don't flame me for missing something obvious).  One
>of these days I'll have The Great Rewrite and that will go in then.  I'd
>love to be rid of the system() calls to convert and mogrify.

The closest thing out there at the moment (that I know of) is a PHP
extension available through PECL, the PHP extension library. According to
the docs, it "provides a wrapper to the ImageMagick/GraphicsMagick library."
You can find it and download it at http://pecl.php.net/package/imagick.

Hope that helps.

Al

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



[PHP] Re: passing arrays?

2003-12-11 Thread Al
> $level = '$level_' . $_SESSION['user']['level'];
> //Where $_SESSION['user']['level'] can equal "1" or "2"
>
> $level_1 = array("PN", "GALUP", "VP", "PUBUP", "STATS", "MCI", "CONLIST",
> "CP", "OAFS", "LO");
> $level_2 = array("PN", "GALUP", "VP", "PUBUP", "MCI", "CONLIST", "CP",
> "OAFS", "LO");

I can see two problems with your code:

1) The syntax for assigning to $level is wrong.
Rather than:
$level = '$level_' . $_SESSION['user']['level'];
your code should read:
$level = ${'level_' . $_SESSION['user']['level']};
For more information on this syntax, see:
http://us2.php.net/manual/en/language.variables.variable.php

2) You are assigning $level_1 or $level_2 (depending on the value of
$_SESSION['user']['level']) to $level *before* you have assigned $level_1 or
$level_2 any values. There's no point making $level = $level_1 if $level_1
hasn't been defined yet.

Working code would be:

$level_1 = array("PN", "GALUP", "VP", "PUBUP", "STATS", "MCI", "CONLIST",
"CP", "OAFS", "LO");
$level_2 = array("PN", "GALUP", "VP", "PUBUP", "MCI", "CONLIST", "CP",
"OAFS", "LO");
$level = ${'level_' . $_SESSION['user']['level']};

Hope it helps,

Al

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



[PHP] Re: How could I count the elements of each dimension of an array?

2003-12-14 Thread Al
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>How could I count the elements of each dimension of an array?
>I have this script, but it failed, thanks for any help
>$ojpp[0] = "1";
>$ojpp[1] = "2";
>$ojpp[2] = "3";
>$ojpp[3] = "4";
>$ojpp[0][1] = "1";
>$ojpp[0][2] = "2";
>$ojpp[0][3] = "3";
>$ojpp[0][0][1] = "1";
>$ojpp[0][0][2] = "2";
>$test1 = count($ojpp); // first dimension
>$test2 = count($ojpp[0]); // second dimension
>$test3 = count($ojpp[0][0]); // third dimension
>echo $test1;
>echo $test2;
>echo $test3;
>echo "";
>print_r($ojpp);
>echo "";

The problem with the code above isn't with how you count the dimensions of
the array, but how you assign values to the second and third dimensions.

Ordinarily, the code $ojpp[0][1] = "1" will create an array at $ojpp[0] and
set it's second element to be "1". On the first line of your code, however
you have *already* assigned the string value "1" to $ojpp[0].

So when PHP sees the code $ojpp[0][1] = "1" it thinks you're trying to use
the 'curly braces' syntax for accessing single characters of a string. This
syntax is not widely known, but essentially means you can access characters
in a string like elements of an array, by using curly braces. For example, will print the third character in $string. For reasons
unknown to me, PHP will also let you use square brackets on a string to
perform the same action ... eg  although this
alternate syntax is being phased out. ( For more info see:
http://us2.php.net/manual/en/language.types.string.php ).

So essentially PHP intereperets $ojpp[0][1] = "1" as being an attempt to
assign "1" as the second character to the string already assigned to
$ojpp[0]. Which begs the question: why assign "1" to $ojpp in the first line
of your code when you seem to want to reaplce it with an array on lines 5 -
8?

This kind of coding bug is a by-product of a type-juggling, permissive
languge that doesn't require you to pre-declare variables. To fix your code,
change the first line of your code to read:

$ojpp[0] = array();

Hope that helps,

Al

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



[PHP] Re: Operation in an Array

2003-12-14 Thread Al
"Harry.De" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How can i make an operation like adding variables in an array for example
> $array[$a+$b];

You'll have to be more specific. What exactly do you want to do? Add values
of an array together? Their keys?

Al

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



[PHP] Re: Trying to check for a valid URL String.

2003-12-14 Thread Al
"Philip J. Newman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> so far i got ...
> if (!ereg("^http:\/\/([_\.0-9a-zA-Z-]+\.)+[a-zA-Z]/i",$websiteUrl) {

On a quick glance, three things stand out:

1) You allow underscores in the website domain, but these are not valid
characters for domain names.
2) You allow dashes in the first pattern, but do not escape the dash
character.
3) You have not provided a quantifier to the top-level domain pattern:
[a-zA-Z], so it is only looking for one character fits the class [a-zA-Z].

Hope that helps,

Al

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



Re: [PHP] PHP IDE?

2003-12-15 Thread Al
I searched for weeks and tried about 8 php editors and settled on 
http://www.phpedit.net/products/PHPEdit/

Code hints and completion, and highlighting, etc. are superb. 

Has a few minor bugs, but they are not serious. 

The automatic documenter [they call it help, which it really isn't] is 
super. 

Has built-in debugger. 

Daniel Hahler wrote:

on Sat, 13 Dec 2003 09:06:56 -0800 (PST) Jough Jeaux wrote:

JJ> Was wondering what everyone's favortie IDE is for
JJ> coding in PHP.  I've got a big PHP project in the
JJ> works.  I'll be doing alot with it and am looking for
JJ> ways to boost my productivity.
Used to use UltraEdit some time, but now I'm with jEdit.

It's an OpenSource Java editor and supports plugins.. so you can
manage Projects and a lot more.
It's main target (from the number of plugins) is Java development, but
it's great for PHP/HTML also.
http://www.jedit.org/

 

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


[PHP] Re: Where and how do i use $_post etc

2003-12-26 Thread Al
"Piet" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> I am trying to find examples of how and where to use $_POST, $_GET etc. I
> searched a lot of places, but cant seem to find decent examples or a
> tutorial or something.

$_POST and $_GET are associative arrays containing the form data sent by a
user to a page. Whether your user's submitted form data is in $_POST or
$_GET depends on what method attribute you've specified in the  tag in
your HTML code. Take a look at the following HTML example:







Now in the file script.php you can access the submitted form values in the
$_GET array, using the form field names as array keys. e.g:



If you had set the  in your HTML, then you could have
accessed the form values from the $_POST array within PHP.

Hope that helps,

Al

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



[PHP] Re: HELP! -- Problem with imagejpeg()

2003-12-27 Thread Al
Here is a complete function I wrote a few months ago.  It should do it 
for you or give you hints for fixing your problem. 

René fournier wrote:

Hello,

I have a function that is meant to check if an image is greater than
a certain width and height, and if it is, downsample it. The checking
part works fine. Downsampling is not happening though. Here's what 
I've  got
(btw, $file = "/somedirectory/photo.jpg"):

$src_img=imagecreatefromJPEG($file);   
$dst_img=imagecreatetruecolor($new_width,$new_height);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_width,$new_height,$siz 
e[0],$size[1]);
imagejpeg($dst_img,$file,$img_quality);

Any ideas?

Thanks.

...Rene

 100, "new_width" => 200, "quality" =>100, "backup_org" => "no");
 * 
 *   quality = percent [e.g. "quality" => 90] meaning 90%
 *   width = pixels [e.g., "new_width" => 200] i.e., 200 pixels.
 *   backup_org [original file] "yes" or "no".  "no" is the default
 * 
 * Use this to fetch $resize_stats:
 * 		foreach($resize_stats as $key => $value)
 * {
 * echo $key . " = " . $value;
 * }
 */


function resize_width($file_location, $resize_args, $auto)
{
global $DOCUMENT_ROOT;

if (empty($resize_args)) die("Code error, argument(s) in \$resize_arg missing in resize_width.  ");

	if($auto== "yes"){

		if ($_FILES['username']['error'] == 0) {
	
			$name = key($_FILES); 			//could use the register variables, but this is safer.
			
	$org_img = $_FILES[$name]['name'];
	
	$org_img = filename_fixer($org_img);
			
			$org_img = $file_location . $org_img;
		}
	}
	else{$org_img = $file_location;}
	
if ($resize_args['backup_org'] == "yes") {
file_backup($org_img);
} 

$org_img = $DOCUMENT_ROOT . $org_img;
	
	if (!file_exists($org_img))die("Code error, $org_img missing or incorrect file name in resize_width() ");

$new_width = $resize_args['new_width'];
$quality = $resize_args['quality'];

$imagehw = GetImageSize($org_img);
$org_width = $imagehw[0];
$org_height = $imagehw[1];

if ($new_width !== $org_width) {
$imagevsize = $org_height * $new_width / $org_width;
$new_height = ceil($imagevsize);

$src_img = imagecreatefromjpeg($org_img);
$dest_img = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($dest_img, $src_img, 0, 0, 0, 0, $new_width, $new_height, $org_width, $org_height);
imagejpeg($dest_img, $org_img, $quality);
imagedestroy($src_img);
imagedestroy($dest_img);
} else {
$newheight = $org_height;
} 
// see above how to use array
$resize_stats = array("Orginal width" => $org_width, "Orginal height" => $org_height, "New width" => $new_width, "New height" => $new_height);

if ($resize_args['show_stats'] == "yes") {
foreach($resize_stats as $key => $value) {
echo $key . " = " . $value . "\r\n";
} 
} 

return $resize_stats;
} 


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

[PHP] Re: Testing for Well-Formed XML

2003-12-30 Thread Al
"Ian Williams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
> I'm trying to build a validator in PHP, to check that XML documents are
> well-formed.

As a starting point I'd check out the excellent, open-source PEAR modules
available for XML manipulation at
http://pear.php.net/packages.php?catpid=22&catname=XML, and in particular
the XML parser module at http://pear.php.net/package/XML_Parser.

Hope that helps,

Al

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



[PHP] Another Session Question

2003-12-31 Thread Al
There is a little code that worked before my virtual host before they 
updated to 4.3.1.

First time the function is called session should be set, subsequent 
calls should be skipped.

session_start();   

   if($_SESSION['counter_file'] !==$counterFile)//See if 
visitor has already been counted for this page
   {$num += 1;   
   $_SESSION['counter_file'] = $counterFile;
   }

echo $_SESSION['counterFile'] . '  testx  ' . $counterFile;

$_SESSION['counterFile'] shows nothing, even the first time through

$counterFile shows just fine. 

Al..

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


Re: [PHP] Another Session Question

2003-12-31 Thread Al
Your'e right, that's a typo.

If I put a

echo $_SESSION['counter_file'] .
'  testx  ' . $counterFile;
Before and after the conditional, $_SESSION['counter_file'] is set after the conditional, as it should be.  But, it is gone from the before echo when the function is recalled.  

The Session buffer looses the value. 

session_start() is called again before returning to the function; but, I thought repeated session_starts() were ignored and thus should not restart the session. 

I use the session buffer extensively in other places without any problem.

Matt Matijevich wrote:

[snip]
session_start();   

   if($_SESSION['counter_file'] !==$counterFile)//See if 
visitor has already been counted for this page
   {$num += 1;   
   $_SESSION['counter_file'] = $counterFile;
   }

echo $_SESSION['counterFile'] . '  testx  ' . $counterFile;
[/snip]
might just be a typeo but do you mean: echo $_SESSION['counter_file'] .
'  testx  ' . $counterFile;
instead of this: echo $_SESSION['counterFile'] . '  testx  ' .
$counterFile;
?
 

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


[PHP] Session logic question

2004-01-02 Thread Al
I use the $_SESSION buffer extensively on my site without a problem, 
except one.
Maybe someone can help me understand the problem.

I have a simple page counter with a test to see if the page has been 
counted for the user.

   start_session();
   *
   * [additional  code]
   *
   if($_SESSION['ctr_file']!==$counterFile) //See if 
visitor has already been counted for this page
   {$num = $num+1;   
  
   $_SESSION['ctr_file'] = $counterFile;//set/reset 
counter file for next time

Pages that use the counter function all have a start_session(); and a 
call to the counter function,

Everything works fine, except when I include another script file that 
also uses the $_SESSION buffer.

What appears to be happening is that start_session() on the second 
script reinitializes the session buffer and I lose the data from the 
first session.

Yet, as I read php manual, it seems to say that start_session is suppose 
to simply restore the variables for the page it is on; not start a new 
session. 

many thanks

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


Re: [PHP] Session logic question

2004-01-02 Thread Al
Thanks for the reply.

i just found the bug in my code.  I had a statement in the second script:

$_SESSION  = $array;  that obviously, completely replaced everything in 
the $_ SESSION  buffer.

These little I gotchas can be fun. 

Chris Shiflett wrote:

--- Al <[EMAIL PROTECTED]> wrote:
 

Everything works fine, except when I include another script file that 
also uses the $_SESSION buffer.

What appears to be happening is that start_session() on the second 
script reinitializes the session buffer and I lose the data from the 
first session.
   

Yes, as it should. You need to only start the session once.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
 

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


[PHP] Re: PHP $_SESSION Expiring in IE

2004-01-03 Thread Al
IE and Moz have different JAVA script engines.  Try turning off JAVA and 
see if IE maintains it's session. 

Tarrant Costelloe wrote:

Hello,

I have recently launched the new Planet-Tolkien.com, one would think
that writing a message board from scratch and a dynamic weather system,
a simple session login would be the least of my problems right? Wrong.
It would appear that for Mozilla and Opera keep a $_SESSION is not an
issue and the $_SESSION is continued until the member logs out. However
when members are using Internet Explorer browser (most versions it
seems), they can go around the site for varied amounts of time, usually
less than five minutes and then their $_SESSION will expire!!??
I cannot for the life of me figure out why a server side $_SESSION would
expire on IE but not for MOZ or Opera but it is, and I need to figure
out why and how can I fix this.
REF. All login information is saved as such:

session_save_path("$path/sessions"); 
session_start(); $_SESSION['session_memberID']=$session_memberID;
$_SESSION['session_username']=$session_username;
$_SESSION['session_groupID']=$membergroup;

In Fellowship,
Tarrant 
 

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


[PHP] Re: Comparison PHP to Perl

2004-01-06 Thread Al
"Warren Vail" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am looking for a comparison of features supported by PHP vs those
> supported by Perl.
>
[snip]

Ah, this old chestnut.

As someone who wrote a major application in Perl, and now (mostly) uses PHP,
I can only reiterate what's been said a thousand times before: the language
you choose depends on what features you want and the type of script you'll
be writing.

You've only identified session support as a requirement, and although PHP
has native session support, Perl has similar functionality available via the
Apache::Session CPAN module. Actually, this is true for almost all extra
native functionality in PHP that Perl does not support -- it's there in
Perl, but you need to download a CPAN module for it. Another example of this
is PHP's native mail( ) support. (For the uninitiated, CPAN
[http://www.cpan.org] is a fantastic collection of standardised Perl
extensions with an easy install script that has evolved over many years).

Unfortunately the same does not apply for PHP: although it has an impressive
array of built-in functions (especially compared to Perl's paltry offering),
if a particular feature is not handled natively then you'll probably have to
write your own code to implement it. Although there *is* a CPAN equivalent
in PHP called PEAR [http://pear.php.net] that boasts a decent number of
modules (most of which are still in early development stages), PHP simply
hasn't been around long enough attract as much module development as Perl.

So in summary: list all the features you need and if PHP supports them all
(or if a few are missing and PHP's ease-of-use and other benefits outweigh
the cons) then go with PHP, otherwise take another look at Perl. For a list
of PHP's features, take a look at the documentation ... it's very
user-friendly. [http://www.php.net/manual/en/]

You'll also find a ridiculously large number of articles online comparing
PHP to Perl, just do a Google search such as:
[http://www.google.com/search?q=php+perl+comparison]

Hope it helps,

Al

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



[PHP] Re: Syntax Highlighting

2004-01-06 Thread Al
"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm after a technique/method that will allow me to syntax highlight
> source code on my web site. PHP already does a brilliant job of this
> for PHP code, but I need to extend this to ANY form of source code.

Try http://www.beautifier.org/, a free PHP app that can syntax highlight a
ridiculously large number of languages ... even Logo!

Hope it helps,

Al

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



[PHP] Ques: Conflicting functions in two include files.

2004-01-23 Thread Al
I have a page that calls functions from two different include files.  
Unfortunately, some of the functions have the same name; but are 
slightly different. 

I know I can change the names of the conflicting functions; but, that is 
a bit of a chore. 

Is it possible to control from which include file the functions are used? 

I tried putting the include statement just before the function call, 
hoping the server would replace the functions with the new include.  I'm 
using include_once.  It didn't work.

I tried putting the include file with the function call inside of a 
function.  Didn't work, still executed the functions stated at the top 
of the page. 

Any suggestions?

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


[PHP] One some problem with uploading

2001-03-15 Thread Al

I have one script on PHP for uploading files on ftp server.
This source code downloaded from PHP manual help (upload files)
His work not correctable. If i changed Text files for uploading on ftp
server it's work all right . if i changed Binary files to uploading (for
example logo.gif) it's don't work!
Php reporting "Ftp upload has failed!". And in temporary variables
$source_file have got "none".
This is problem with Binnary mode and ASCII mode uploading.
What's problem? I don't understand.
Source code attach with this message.


begin 666 upload.phtml
M/#]P:' -"B\O('-E="!U<"!B87-I8R!C;VYN96-T:6]N#0IR97%U:7)E*")U
M'0B.PT*)&QO8V%T:6]N/21L;V=O.PT*)&-O;FY?:60@/2!F='!?8V]N
M;F5C="@B)&9T<%]S97)V97(B*3L@#0H-"B\O(&QO9VEN('=I=&@@=7-Ehttp://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Hmmm... What's problems?

2001-03-15 Thread Al

I'm using manual online on php.net  and use example of File uploader.
If i changed TEXT file All right!
If i changed Binary file php script answer Error!
in sources code PHP using Binary method...
And temporary subject $source_file is empty!
if i insert in PHP { echo "source: $source_file"; } and PHP say "Source:
none" And "Ftp upload has failed!"
Whats problem?
I don't understand...



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




[PHP] Newbie Questionabout variables

2002-05-25 Thread Al


I hope this posting is not a duplicate.  I originally posted it yesterday,
but it doesn't show on the newsgroup for me.

Apparently you can set a variable as part of a URL statement.  For example:
www.company.com/index.php?admin=password.

Where "password" might be a simple variable to test as a rudimentary
authorization password.

I can't find anything like this on the php website or manual.

Can someone point me in the right direction?

Thanks



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




[PHP] Posting problem with Mozilla

2002-05-25 Thread Al

Anyone have a clue why I can't post messages with Mozilla [RC2]?

Goes through all the motions as if the message is sent.  Shows in my sent
folder and the terminal icon indicates the message is sent.

Works fine for all other newsgroup servers.

I'm posting this with IE6.



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




[PHP] Re: Newbie Questionabout variables

2002-05-25 Thread Al

I got it now, thanks a lot. For some reason Mozilla won't let me post to the
newsgroup.

I've used your answer, and another one, and have already made a simple php
script to test the variable and echo "passed" or "failed"

 I'm modifying a php application and the admin file is named "index.php"
[yes that's right] and access to it is not protected.

The application is not very critical and there is no particularly sensitive
material in the DB.  So, I set the .htaccess file to default to the user's
file and thought I'd make access to the "index.php" a little secure with a
password. I've seen other applications with this technique.

Thanks again,

Al..

"Al" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I hope this posting is not a duplicate.  I originally posted it yesterday,
> but it doesn't show on the newsgroup for me.
>
> Apparently you can set a variable as part of a URL statement.  For
example:
> www.company.com/index.php?admin=password.
>
> Where "password" might be a simple variable to test as a rudimentary
> authorization password.
>
> I can't find anything like this on the php website or manual.
>
> Can someone point me in the right direction?
>
> Thanks
>
>



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




[PHP] Re: javascript reference (slightly ot)

2001-08-15 Thread Al

Try searching for "javascript" and "reference" on Google for online
references. If you want a decent book, get something like "JavaScript:
The Definitive Guide" by David Flanagan, published by O'Reilly.

Regardless, pay attention to flags stating IE or Netscape only! :)

-Al (used to use your handle "lemming" *way* back when)

On Tue, 14 Aug 2001 22:58:44 -0300, [EMAIL PROTECTED] (Christian
Dechery) wrote:

>Sorry for the OT but, but I'm struggling to get my forms to have a good 
>validation in JavaScript.
>
>Does anyone know a complete reference to JavaScript, like, with all 
>objects, it's functions, parameters and etc...
>
>that would help a lot..
>
>Thanks...
>
> Christian Dechery (lemming)
> http://www.tanamesa.com.br
> Gaita-L Owner / Web Developer
>


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




[PHP] INPUT type=file value=????

2001-08-20 Thread Al

I realize that this isn't a PHP issue, but I'd like find out they
why's/wherefore's of this:

The W3C HTM 4x spec(s) say that when using the file type on a form
input element, "User agents may use the value of the value attribute
as the initial file name."

I can't get Mozilla, Netscape, nor IE to do this. Here's my code:


METHOD="POST">

Attachment #1: 




The wrapped lines do have a space in front of them.

Is this an oversight, did I miss something in the docs, or have I done
something really stupid?

-Al

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




[PHP] Re: HTML Escaping

2004-07-23 Thread Al
Look up heredoc in te php manual
Robb Kerr wrote:
I've got a conditional button that needs to appear/hide on my page
depending upon the contents of a field in my database. The button is an
image and has a long URL and JavaScript for image rotation attached to it.
Needless to say, the href is quite long and includes several "'"
characters. My conditional works great but I want to know if there is an
easy way to escape the whole href so that the "'" characters will not be
seen as PHP quote marks. See below...
;
?>
Thanx in advance,
Robb
 

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


[PHP] Re: Code elegance and cleanliness

2004-07-25 Thread Al
Not really knowing why you need to provide indexes for the array, since 
they are generated automatically if none are provided, I'd use:

$imgBkgrnd = array(
 'bkgrnd-default.gif',
 'bkgrnd-positive.gif',
 'bkgrnd-negative.gif'
);
$imgNeeded = table['field'];
$imgName = $imgBkgrnd[$imgNeeded];
The  last two lines are a it doesn't matter. 

Note the use of single quotes in the array.
The parser can simply treat the values as text rather than having to 
check for variables, etc.




Robb Kerr wrote:
Just a quick question. Does it really matter how long your code is or how
many variables you use? For instance you can enter the following...
$imgBkgrnd = array("1"=> "bkgrnd-default.gif", "2" =>
"bkgrnd-positive.gif", "3" => "bkgrnd-negative.gif");
$imgNeeded = table['field'];
$imgName = $imgBkgrnd[$imgNeeded];
or, you can code the same thing as...
$imgBkgrnd = array("1"=> "bkgrnd-default.gif", "2" =>
"bkgrnd-positive.gif", "3" => "bkgrnd-negative.gif");
$imgName = $imgBkgrnd[$table['field']];
The first example uses one more variable and a longer code block but is
easier to read and debug. The second example uses one less variable and a
shorter code block but is harder to debug later. Should I be striving for
the shortest most compact code utilizing the fewest possible variables. Or,
can I code in a style which is easier to read and debug?
 

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


[PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
I need to active php error level "Warning" and log the errors in a file 
for my whole Apache virtual website.  It is clear how to do everything 
on a script-by-script basis; but, I need to do it across the site. 

I can't find any direct documentation to help.  The php manual and 
Apache directives documentation point me in the right direction; but, 
leave out too much for me to get it to work. 

I want to set error reporting to "Warning" and log the errors in one 
file.  Maybe, send an email with the errors. 

Can anyone help me get started or point me to some good lit on the subject?
Thanks..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
Thanks, that has me started.
Per the documentation, error_reporting must use the bitmask values 
form.  And, that works great.

However, I can't get the errors to log in a special file.  They insist 
on being logged in the system's error log file. 

I've tried:
php_value error_log "errors.txt"
with and without the quotes, etc. 


John Holmes wrote:
From: "Al" <[EMAIL PROTECTED]>

I need to active php error level "Warning" and log the errors in a 
file for my whole Apache virtual website.  It is clear how to do 
everything on a script-by-script basis; but, I need to do it across 
the site. 

http://us2.php.net/manual/en/configuration.changes.php
php_value error_reporting E_WARNING
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
The php.ini is already set to log errors and it works; but, they are 
appended to the system log.

Just for the heck of it I tried; but it doesn't work.  

php_value error_reporting 2047
php_value log_errors TRUE
php_value error_log "./errors.txt"[and the full path string]
John Holmes wrote:
From: "Al" <[EMAIL PROTECTED]>
Per the documentation, error_reporting must use the bitmask values 
form. And, that works great.

However, I can't get the errors to log in a special file.  They 
insist on being logged in the system's error log file.

There is a "log_errors" setting and a "error_log" setting. Try setting 
the "log_errors" value.

http://us3.php.net/manual/en/ref.errorfunc.php#ini.log-errors
---John Holmes... 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
Here is what I having working so far:
php_value error_reporting 2# Just warnings, which is 
what I want

php_flag log_errors 1  #this turns logging on 
and off in the syslog

php_flag display_errors 1  #this turns error display at 
client's browser on/off

php_value error_log errors.txt#Doesn't work OR
php_value error_log  /home/jones/public_html/AutoSch/errors.txt  
#This doesn't work either.

Anyone know how to write the errors to a file?  The documentation says 
it should work. 



Jason Wong wrote:
On Tuesday 24 August 2004 23:37, Al wrote:
 

The php.ini is already set to log errors and it works; but, they are
appended to the system log.
Just for the heck of it I tried; but it doesn't work.
php_value error_reporting 2047
php_value log_errors TRUE
php_value error_log "./errors.txt"[and the full path string]
   

"... Don't use php_value to set boolean values. ..."
And you may have to specify an absolute path.
 



Re: [PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
Here is what I having working so far:
php_value error_reporting 2# Just warnings, which is 
what I want

php_flag log_errors 1  #this turns logging on 
and off in the syslog

php_flag display_errors 1  #this turns error display at 
client's browser on/off

php_value error_log errors.txt#Doesn't work OR
php_value error_log  /home/jones/public_html/AutoSch/errors.txt  
#This doesn't work either.

Anyone know how to write the errors to a file?  The documentation says 
it should work. 

Jason Wong wrote:
On Tuesday 24 August 2004 23:37, Al wrote:
 

The php.ini is already set to log errors and it works; but, they are
appended to the system log.
Just for the heck of it I tried; but it doesn't work.
php_value error_reporting 2047
php_value log_errors TRUE
php_value error_log "./errors.txt"[and the full path string]
   

"... Don't use php_value to set boolean values. ..."
And you may have to specify an absolute path.
 



Re: [PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
Here is what I having working so far:
php_value error_reporting 2# Just warnings, which is 
what I want

php_flag log_errors 1  #this turns logging on 
and off in the syslog

php_flag display_errors 1  #this turns error display at 
client's browser on/off

php_value error_log errors.txt#Doesn't work OR
php_value error_log  /home/jones/public_html/AutoSch/errors.txt  
#This doesn't work either.

Anyone know how to write the errors to a file?  The documentation says 
it should work. 

Jason Wong wrote:
On Tuesday 24 August 2004 23:37, Al wrote:
 

The php.ini is already set to log errors and it works; but, they are
appended to the system log.
Just for the heck of it I tried; but it doesn't work.
php_value error_reporting 2047
php_value log_errors TRUE
php_value error_log "./errors.txt"[and the full path string]
   

"... Don't use php_value to set boolean values. ..."
And you may have to specify an absolute path.
 

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


Re: [PHP] Need help with using htaccess to override php.ini error

2004-08-24 Thread Al
test
Al wrote:
The php.ini is already set to log errors and it works; but, they are 
appended to the system log.

Just for the heck of it I tried; but it doesn't work. 
php_value error_reporting 2047

php_value log_errors TRUE
php_value error_log "./errors.txt"[and the full path string]
John Holmes wrote:
From: "Al" <[EMAIL PROTECTED]>
Per the documentation, error_reporting must use the bitmask values 
form. And, that works great.

However, I can't get the errors to log in a special file.  They 
insist on being logged in the system's error log file.

There is a "log_errors" setting and a "error_log" setting. Try 
setting the "log_errors" value.

http://us3.php.net/manual/en/ref.errorfunc.php#ini.log-errors
---John Holmes... 

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


Re: [PHP] Need help with using htaccess to override php.ini error settings

2004-08-24 Thread Al
Everything is working, thanks to you and Jason.
The key was that I had to provide a seed file since error_log only 
appends messages to an existing file and doesn't create one if it does 
not exist.

Al
John Holmes wrote:
From: "Al" <[EMAIL PROTECTED]>
php_value error_log  /home/jones/public_html/AutoSch/errors.txt
#This doesn't work either.
Anyone know how to write the errors to a file?  The documentation says
it should work.

It should. What are the permissions on the above file? Does the 
apache/php user have permission to write to it?

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


[PHP] Book recommendation

2004-09-21 Thread Al
How can get "Edit/Mail & Newsgroups/Composition/defaults for Html" to work?
"Edit/Mail & Newsgroups/Send Format/Send in HTML is checked.
All newsgroups and emails default to plain small text.
Is this a bug, or am I missing something?
Thanks..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Book recommendation

2004-09-21 Thread Al
John Nichel wrote:
Al wrote:
How can get "Edit/Mail & Newsgroups/Composition/defaults for Html" to 
work?

"Edit/Mail & Newsgroups/Send Format/Send in HTML is checked.
All newsgroups and emails default to plain small text.
Is this a bug, or am I missing something?
Thanks..
Huh?
Sorry everyone.  I was composing 2 messages, one for here and one for a Mozilla 
group, at the time and screwed up.  I immediately canceled this one; but, it 
apparently registered at you reader anyhow.

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


[PHP] Question about error_reporting()

2004-10-01 Thread Al
If I place this at the top of my script file, the page just hangs.
error_reporting (E_ERROR | E_WARNING);
A virtual host on a Unix/Apache system.  Runs fine without the error_reporting().
The default system error reporting only shows E_ERRORS, so I wanted to see 
warnings also.

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


Re: [PHP] Question about error_reporting()

2004-10-01 Thread Al
Greg Donald wrote:
On Fri, 01 Oct 2004 10:36:28 -0400, Al <[EMAIL PROTECTED]> wrote:
If I place this at the top of my script file, the page just hangs.
error_reporting (E_ERROR | E_WARNING);
A virtual host on a Unix/Apache system.  Runs fine without the error_reporting().
The default system error reporting only shows E_ERRORS, so I wanted to see
warnings also.

Comment the entire script out starting below your call to
error_reporting(), then start uncommenting and testing it from the top
down until you find the issue.  It's doubtful error_reporting() is
causing the issue, it more likely it's uncovering an issue.  You might
try E_ALL, as it may help you discover the issue faster.
Posting the script and getting some more eyes on it also an option.

What's puzzling is that I can simply comment out the error_reporting line and 
the code runs fine.

Also, the Apache error log doesn't show any errors. with or without the 
error_reporting.

Is error_reporting() all that is necessary, or must I also have a error_log() 
statement?

The manual is not clear on this point.
Also, must I have a an existing error file for the errors to append to?
Again, thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] session_save_path

2004-10-07 Thread Al
My virtual host eliminated the common session tmp folder which forces me to set 
up one in my area.

I'm trying to come up with the best, considering:
Custom php.ini; resisting because having to make certain it is always in sync 
with host's changes.

Tried adding to htaccess: php_value session.save_path 
/www/u/username/htdoc/session  Hoping it would override php.ini. Got a server 
error 500.

Tried adding to a common functions file used by several pages:
session_save_path /www/u/user/htdoc/session; and
session_save_path $_SERVER['DOCUMENT_ROOT'] . "/SESSION";
Doesn't work, uses the path in php.ini; I'm guessing that session_save_path has 
to be declared on page using session stuff.  That's a pain, if so.

Haven't tried ini_set yet; is it a solution?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] session_save_path

2004-10-07 Thread Al
John Holmes wrote:
Al wrote:
Tried adding to htaccess: php_value session.save_path 
/www/u/username/htdoc/session  Hoping it would override php.ini. Got a 
server error 500.

Try putting quotes around the path and this should work, providing your 
ISP allows .htaccess files.

I'm guessing that session_save_path has to be declared on page using 
session stuff.  

You can use session_save_path() to do this, but you'll need it in every 
script.

My declaration is simply appended to the end of a htaccess that has been running 
for a year.

Here it is exactly:
php_value session.save_path "/www/r/restonx/htdocs/sessions2"
Also, tried it without the quotes.
Also, echoed "session.save_path()" to make certain my path syntax was identical 
to the one in php.ini that works.

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


Re: [PHP] session_save_path

2004-10-07 Thread Al
Ed Lazor wrote:
Can you do an .htaccess solution?  If so, you could probably just set
session save path with PHP_VALUE in the .htaccess file
Note, from my original message:
Tried adding to htaccess:
php_value session.save_path /www/u/username/htdoc/session
Hoping it would override php.ini. Got a server error 500.


-Original Message-
From: Al [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 07, 2004 8:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] session_save_path
My virtual host eliminated the common session tmp folder which forces me
to set
up one in my area.
I'm trying to come up with the best, considering:
Custom php.ini; resisting because having to make certain it is always in
sync
with host's changes.
Tried adding to htaccess: php_value session.save_path
/www/u/username/htdoc/session  Hoping it would override php.ini. Got a
server
error 500.
Tried adding to a common functions file used by several pages:
session_save_path /www/u/user/htdoc/session; and
session_save_path $_SERVER['DOCUMENT_ROOT'] . "/SESSION";
Doesn't work, uses the path in php.ini; I'm guessing that
session_save_path has
to be declared on page using session stuff.  That's a pain, if so.
Haven't tried ini_set yet; is it a solution?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] session_save_path

2004-10-07 Thread Al
John Holmes wrote:
Al wrote:
Tried adding to htaccess: php_value session.save_path 
/www/u/username/htdoc/session  Hoping it would override php.ini. Got a 
server error 500.

Try putting quotes around the path and this should work, providing your 
ISP allows .htaccess files.

I'm guessing that session_save_path has to be declared on page using 
session stuff.  

You can use session_save_path() to do this, but you'll need it in every 
script.

Meant for this to reply to you:
My declaration is simply appended to the end of a htaccess that has been running for a 
year.
Here it is exactly:
php_value session.save_path "/www/r/restonx/htdocs/sessions2"
Also, tried it without the quotes.
Also, echoed "session.save_path()" to make certain my path syntax was identical to the 
one in php.ini that works.
Thanks... 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Memcached is driving me nuts

2008-11-24 Thread Al

Try debug_backtrace()

Rico Secada wrote:

Hi.

This post has also been posted on the Debian list.

I have two different Debian Etch machines running with the exact same
packages installed, when I use PHP memcached with compression (zlib) it
works at one machine but not the other. No errors are thrown. 


I need to know why it is only working on one machine and not the other.

I am talking about the MEMCACHE_COMPRESSED flag if anyone knows about
this.

I am using this small script to test with:

connect('localhost', 11211);

$version = $memcached->getVersion();
print ("Memcached version: ".$version."");

//  $memcached->flush();

$output = $memcached->get('var_key');

if (empty($output)) {

$memcached->set('var_key', 'Hello I am Memcached',
MEMCACHE_COMPRESSED, 3600);

print ("Memcached has just been set!");

} else {

print ("Memcached is already set with this value:
$output");

}
?>

If I disable the compression flag (using the 'false' value or zero
value) on the failing machine, all works correctly, but when I enable
it like in the above script it fails without error.

I have also tried running memcached with "-vv" options, and checked the
log, but no errors show up.

I am suspecting that zlib isn't working right on the failing machine,
but using phpinfo() it shows that zlib is enabled.

On both machines the following packages are installed:

ii  libcompress-zlib-perl   1.42-2  
ii libio-zlib-perl  1.04-1

ii zlib1g   1.2.3-13

ii  libapache2-mod-php5 5.2.0-8+etch13
ii php5 5.2.0-8+etch13
ii php5-common  5.2.0-8+etch13
ii php5-gd  5.2.0-8+etch13
ii  php5-imagick0.9.11+1-4.1
ii php5-memcache2.0.1-1.1
ii  php5-mysql  5.2.0-8
+etch13 
ii php5-pgsql   	5.2.0-8+etch13


Any help in understanding what is going on would be greatly
appreciated.

Best regards.

Rico







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



  1   2   3   4   5   6   7   8   >