php-general Digest 21 Jan 2007 21:15:12 -0000 Issue 4582

Topics (messages 247484 through 247519):

Re: PHP Warning: session_destroy
        247484 by: Roman Neuhauser

Re: wierd slash
        247485 by: Roman Neuhauser
        247490 by: Don

Re: Forced File Downloads
        247486 by: Roman Neuhauser
        247499 by: Jochem Maas

Re: Php / MySQL DESC tablename
        247487 by: Roman Neuhauser

Re: one click - two actions?
        247488 by: pub
        247491 by: Paul Novitski

Re: I lied, another question / problem
        247489 by: Roman Neuhauser
        247493 by: Roman Neuhauser

Re: most powerful php editor
        247492 by: Peter Lauri
        247494 by: Jochem Maas
        247495 by: Børge Holen
        247496 by: Robert Cummings
        247504 by: Miles Thompson
        247506 by: tg-php.gryffyndevelopment.com
        247514 by: Satyam
        247516 by: Larry Garfield
        247517 by: Peter Lauri
        247519 by: Curt Zirzow

Re: Request for...
        247497 by: Robert Cummings
        247498 by: Robert Cummings

proxy
        247500 by: wwww.freenet.am
        247505 by: Roman Neuhauser
        247509 by: Jochem Maas
        247518 by: wwww.freenet.am

First Character In A String
        247501 by: Christopher Deeley
        247502 by: Peter Lauri
        247503 by: Nicholas Yim
        247507 by: Jochem Maas
        247510 by: Robert Cummings
        247511 by: Jochem Maas
        247512 by: Robert Cummings
        247513 by: Jochem Maas
        247515 by: Robert Cummings

PHP Functions as XML or DB
        247508 by: WeberSites LTD

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-20 17:14:34 -0500:
> To stop bots from accessing secured pages, I've added the following
> code to a banner page that is called by every page. Furthermore, each
> page starts with <?php session_start(); ?> and includes the banner
> page:
> 
> 'top1.php' [banner page]
> 
> <?php 
>       if((eregi("((Yahoo! Slurp|Yahoo! Slurp China|.NET CLR|Googlebot/2.1|
> Gigabot/2.0|Accoona-AI-Agent))",$_SERVER['HTTP_USER_AGENT'])))
>       { 
>               if ($_SERVER['HTTPS'] == "on")
>               {
>                       session_destroy();
>                       header("Location: http://localhost/logout.php";);

google for robots.txt, less work with the same effect.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-20 21:50:48 -0700:
> I have a line of code that validates form info for some POST vars, but not
> others.
> 
>         if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )
> 
> when I put O'Toole in the form to test, my script kicks the page back (I
> thought this entry would be OK)
> 
> but moreover, when it redisplays the form and populates the new form with
> the entries previously entered, O'Toole becomes O\

magic_quotes_gpc?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
magic_quotes_gpc On On 
magic_quotes_runtime Off Off 
magic_quotes_sybase Off Off

but I know if I can change that

is there some other way to fix this problem?

Don



# [EMAIL PROTECTED] / 2007-01-20 21:50:48 -0700:
> I have a line of code that validates form info for some POST vars, but not
> others.
> 
>         if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )
> 
> when I put O'Toole in the form to test, my script kicks the page back (I
> thought this entry would be OK)
> 
> but moreover, when it redisplays the form and populates the new form with
> the entries previously entered, O'Toole becomes O\

magic_quotes_gpc?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-20 22:51:41 -0800:
> I've been having my forced downloads sometimes finish prematurely using
> readfile(). I'm downloading a Windows .exe file.
> 
> I've read several posts that have suggested the substitution of a fread/feof
> loop to write out the download in smaller chunks. I tried using a function
> (readfile_chunked) I found in the user comments on php.net.
> 
> But for some odd reason, every time the downloaded file is one byte larger
> than the original file, and it's not being recognized as a valid Windows 
> file.

What value does the one byte you send in excess have, and where is it
located, prepended or appended to the file?

--- End Message ---
--- Begin Message ---
Don wrote:
> I've been having my forced downloads sometimes finish prematurely using
> readfile(). I'm downloading a Windows .exe file.
> 
> I've read several posts that have suggested the substitution of a fread/feof
> loop to write out the download in smaller chunks. I tried using a function
> (readfile_chunked) I found in the user comments on php.net.
> 
> But for some odd reason, every time the downloaded file is one byte larger
> than the original file, and it's not being recognized as a valid Windows 
> file.


does the end of your download script look like this?:

?>

by which I mean does it actually resemble one of the following strings:

$end = "?>
";
$end = "?> ";


is there a space or newline AFTER the last closing php tag?

avoid this PITA type of bug and never ever add a closing php tag
*if* it's the last thing in the file .. the php engine will see that it's 
reached
EOF and consider that as a closing tag as far as trying to parse any code
goes.

> 
> I'm using PHP 4.4.4 on a shared Linux server running Apache.
> IE and FireFox both exhibit the problem on the Windows end. I'm
> using WinXP SP2.
> 
> I've listed relevant snippets below. $file_name is the fully qualified
> path to the (.exe) file.
> 
> Any ideas?
> #=============================
> 
> # Download the File
> 
> #=============================
> 
> header("Pragma: public");
> 
> header("Expires: 0");
> 
> header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
> 
> header("Cache-Control: private", false);
> 
> header("Content-Description: File Transfer");
> 
> header("Content-Type: application/octet-stream");
> 
> header("Accept-Ranges: bytes");
> 
> header("Content-Disposition: attachment; filename=" . $file_name . ";");
> 
> header("Content-Transfer-Encoding: binary");
> 
> header("Content-Length: " . @filesize($file_path));
> 
> header ("Connection: close");
> 
> @ignore_user_abort();
> 
> @set_time_limit(0);
> 
> // @readfile($file_path);
> 
> readfile_chunked($file_path, FALSE);
> 
> exit();
> 
> ......
> 
> function readfile_chunked($filename, $retbytes = true) {
> 
>  $chunksize = 8 * 1024; // how many bytes per chunk
> 
>  $buffer = '';
> 
>  $cnt = 0;
> 
>  $handle = fopen($filename, 'rb');
> 
>  if ($handle === false) {
> 
>  return false;
> 
>  }
> 
>  while (!feof($handle)) {
> 
>  $buffer = fread($handle, $chunksize);
> 
>  echo $buffer;
> 
>  ob_flush();
> 
>  flush();
> 
>  if ($retbytes) {
> 
>  $cnt += strlen($buffer);
> 
>  }
> 
>  }
> 
>  $status = fclose($handle);
> 
>  if ($retbytes && $status) {
> 
>  return $cnt; // return num. bytes delivered like readfile() does.
> 
>  }
> 
>  return $status;
> 
> }
> 

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-21 03:05:49 -0500:
> I am trying to do a DESC table_name using PHP so it looks like it would it
> you did it from the command line.
> 
> i.e. 
> 
> | Field     | Type         | Null | Key | Default | Extra          |
> +-----------+--------------+------+-----+---------+----------------+
> | id        | int(11)      | NO   | PRI | NULL    | auto_increment | 
> | name      | varchar(30)  | NO   |     | NULL    |                | 
> 
> What I have found is that the following does not work the way I would have
> thought.
> 
>       $query = "DESC table ".$currenttb;
>       $result = mysql_query($query);
        
>       while ($row = mysql_fetch_row($result)) {
>               etc.....

DESC is not a sql command, it's specific to the mysql(1) command line
client.

> I have found something that works, but it is still not like the above and is
> really bulky. I can not get the type (varchar, etc) to show like above, it
> will show string, blob, etc, and the last problem is it puts the last 4
> fields in one variable (flags).

What you've found is similar to what mysql(1) does when you send
DESC mytable.

> Does anyone know of a way to get this to output as shown above. I am putting
> this into a form for editing, so I need everything in the proper places.

Finish your effort to produce the desired output. You're almost there.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
On Nov 13, 2006, at 9:44 PM, Paul Novitski wrote:

Paul,

Thank you again for your amazingly generous email.

I am working on my query as you suggested. I have a joint query that seems to work except that I get the name of the company repeated for each job. Could you please help me figure out how to make it echo the company once and list all the jobs next to it on the same line and start a new line with the next company like you suggested bellow?

 Here is the code I have now:

$query = "SELECT client.companyName, job.jobType, job.pix, job.info, job.url
                FROM client, job
                WHERE client.companyId=job.companyId
                AND client.view='yes'
                order by client.companyName";
                

        $result = mysql_query($query)
        or die ("Couldn't execute query");
                
        while   ($aaa = mysql_fetch_array($result,MYSQL_ASSOC))
                {                                       
echo "<span class='navCompany'>{$aaa['companyName']}</span><span class='navArrow'> > </span><span class='navText'><a href='single_page_t10.php?art=".$aaa['pix']."'>{$aaa['jobType']}</a></ span><br>\n";
                }                       
        



I think what you're looking for is JOIN syntax for your queries:
http://dev.mysql.com/doc/refman/4.1/en/join.html

For example:

        SELECT * FROM client, job
        WHERE client.companyId=job.companyId
        AND (client.status='active' or client.status='old')
        order by client.companyName;

(Note that when you extract fields from more than one table like this, you identify the table that each field belongs to, e.g. client.companyId.)

Then you can extract the desired fields from both tables in the same loop because they've been captured together. Your current logic executes a job query for every row of client, which is extremely inefficient.

The dataset produced by the join query is going to look something like this:

client.         job.
companyId       companyId
    1           2
    1           3
    1           9
    2           4
    2           5
...

In other words, there will be one row for each job record, with the (parent) client fields duplicated each row.


You can further improve the efficiency of your query by naming only the fields you need, instead of using * to extract all fields:

SELECT client.companyName, job.pix, job.jobType, job.url, job.web
        FROM client, job
        WHERE client.companyId=job.companyId
        AND (client.status='active' or client.status='old')
        order by client.companyName;

Once you execute the join query, your PHP loop can cycle in a similar way, echoing a company name and then listing all the job types until a new company name occurs, etc.


You've got other problems, however. If you look at your HTML source, you'll see markup like this:

<span class='navCompany'>Builtworks</span><span class='navArrow'> > </span> <span class='navText'><a href='single_page.php? art=btw_logo.jpg'>logo</a></span>
<span class='navText'><a href='single_page.php?art='></a></span>
<span class='navText'><a href='single_page.php?art='></a></span>
<span class='navText'><a href='single_page.php?art='></a></span>
<span class='navText'><a href='single_page.php?art='></a></span>
<br><span class='navCompany'>Citizens Bank / eProperty</span><span class='navArrow'> > </span> <span class='navText'><a href='single_page.php? art=ctz_web1.jpg'>website</a></span>

All those empty hyperlinks aren't doing anything but making your download heavier than it has to be. I think you need to test your 'jobType' fields and output only those that aren't blank.




Good luck,
Paul



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


--- End Message ---
--- Begin Message ---
At 1/21/2007 01:54 AM, pub wrote:
I am working on my query as you suggested. I have a joint query that
seems to work except that I get the name of the company repeated for
each job. Could you please help me figure out how to make it echo the
company once and list all the jobs next to it on the same line and
start a new line with the next company like you suggested bellow?


You want to output the company name only when it changes. I usually do this by keeping a variable equal to the previous value in the loop and compare it each time with the current value:

PreviousCompany = '';

while (fetching data records)
{
                if (PreviousCompany != CurrentCompany)
                {
                        output CurrentCompany;
                        PreviousCompany = CurrentCompany;
                }

        output Job;
}


One markup structure you might consider for this application is the definition list:

<dl>
        <dt>Company</dt>
        <dd>job 1</dd>
        <dd>job 2</dd>
        <dd>job 3</dd>
        <dd>job 4</dd>

        <dt>Company</dt>
        <dd>job 1</dd>
        <dd>job 2</dd>
        <dd>job 3</dd>
        <dd>job 4</dd>
        ...
</dl>

Regards,

Paul
__________________________

Juniper Webcraft Ltd.
http://juniperwebcraft.com

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-21 00:11:13 +0100:
> Roman Neuhauser wrote:
> > # [EMAIL PROTECTED] / 2007-01-17 16:59:26 +0100:
> >> wouldn't it be fair to assume (safety through paranoia) that
> >> ctype_alnum() would suffer the same problem? (given the manual's
> >> indication that ctype_alnum() and the offending regexp are equivalent?)
> > 
> > isalnum(3) uses isalpha(3) and isdigit(3), so yes, their results are
> > locale-dependent (LC_CTYPE, see setlocale(3)), but don't depend on
> > collating sequence. 
> 
> so really the doc's are slightly misleading or even incorrect,

Slightly, in a usually-behaves-as-described-but-for-different-reasons
way.

> as a side note: do you have any real world example of where this
> collation issue might actually bite someone making use of the aforementioned
> regexp range?

Not off the top of my head. :(

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-21 10:48:30 +0000:
> # [EMAIL PROTECTED] / 2007-01-21 00:11:13 +0100:
> > Roman Neuhauser wrote:
> > > # [EMAIL PROTECTED] / 2007-01-17 16:59:26 +0100:
> > >> wouldn't it be fair to assume (safety through paranoia) that
> > >> ctype_alnum() would suffer the same problem? (given the manual's
> > >> indication that ctype_alnum() and the offending regexp are equivalent?)
> > > 
> > > isalnum(3) uses isalpha(3) and isdigit(3), so yes, their results are
> > > locale-dependent (LC_CTYPE, see setlocale(3)), but don't depend on
> > > collating sequence. 
> > 
> > so really the doc's are slightly misleading or even incorrect,
> 
> Slightly, in a usually-behaves-as-described-but-for-different-reasons
> way.
> 
> > as a side note: do you have any real world example of where this
> > collation issue might actually bite someone making use of the aforementioned
> > regexp range?
> 
> Not off the top of my head. :(

Trying the Czech locale (I normally run with the values below), I've
come across some unexpected behavior.

0xE8 is c caron, and sorts between c and d, but not on this computer.
0xBE is z caron, and sorts just after z.
I'd expect [a-z] to match 0xE8 but it does not.

LANG=cs_CZ.ISO8859-2
LC_COLLATE=en_US.ISO8859-1
LC_CTYPE=en_US.ISO8859-1
LC_MESSAGES=en_US.ISO8859-1
LC_NUMERIC=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1

[EMAIL PROTECTED] ~/tmp/blemc 1042:0 > uname -srm       
FreeBSD 6.1-PRERELEASE amd64
[EMAIL PROTECTED] ~/tmp/blemc 1043:0 > cat ./collseq.php
#!/usr/bin/env php
<?php

function f($c, $l)
{
    printf("char=%c locale=%s\n", $c, $l);
    setlocale(LC_COLLATE, $l);
    setlocale(LC_CTYPE,   $l);

    printf("[a-z]       = %s\n", var_export(preg_match('~[a-z]~', chr($c)), 1));
    printf("[[:lower:]] = %s\n", var_export(preg_match('~[[:lower:]]~', 
chr($c)), 1));
    printf("islower(3)  = %s\n", var_export(ctype_lower(chr($c)), 1));
    print "\n";
}

f(0xE8, 'C'); f(0xE8, 'cs_CZ.ISO8859-2');
f(0xBE, 'C'); f(0xBE, 'cs_CZ.ISO8859-2');

[EMAIL PROTECTED] ~/tmp/blemc 1044:0 > ./collseq.php
char=č locale=C
[a-z]       = 0
[[:lower:]] = 0
islower(3)  = false

char=č locale=cs_CZ.ISO8859-2
[a-z]       = 0
[[:lower:]] = 1
islower(3)  = true

char=ž locale=C
[a-z]       = 0
[[:lower:]] = 0
islower(3)  = false

char=ž locale=cs_CZ.ISO8859-2
[a-z]       = 0
[[:lower:]] = 1
islower(3)  = true

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
I would put my vote on Eclipse. It has great support for cvs and also for
general coding "autofilling" etc. The downside is that it is resource
demanding...

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free


-----Original Message-----
From: Vinicius C Silva [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 21, 2007 2:54 AM
To: php-general@lists.php.net
Subject: [PHP] most powerful php editor

hi everyone!

i'd like to ask something maybe commonly asked here. what is the most
powerful php editor?

--- End Message ---
--- Begin Message ---
Gregory Beaver wrote:
> Vinicius C Silva wrote:
>> hi everyone!
>>
>> i'd like to ask something maybe commonly asked here. what is the most
>> powerful php editor?
> 
> I am

that's it, consider yourself enrolled in a Celebrity Death Match
against mr Lerdorf :-P


> 
> Yours,
> Greg
> 

--- End Message ---
--- Begin Message ---
On Sunday 21 January 2007 12:40, Jochem Maas wrote:
> Gregory Beaver wrote:
> > Vinicius C Silva wrote:
> >> hi everyone!
> >>
> >> i'd like to ask something maybe commonly asked here. what is the most
> >> powerful php editor?
> >
> > I am
>
> that's it, consider yourself enrolled in a Celebrity Death Match
> against mr Lerdorf :-P
THATS IT... I know someone who knows someone... you both will die.!. 

;D

>
> > Yours,
> > Greg

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

--- End Message ---
--- Begin Message ---
On Sat, 2007-01-20 at 22:54 -0200, Vinicius C Silva wrote:
> hi everyone!
> 
> i'd like to ask something maybe commonly asked here. what is the most
> powerful php editor?

Everyone knows, everyone probably being me, that joe is the best:

    http://sourceforge.net/projects/joe-editor/

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
At 08:21 AM 1/21/2007, Robert Cummings wrote:

On Sat, 2007-01-20 at 22:54 -0200, Vinicius C Silva wrote:
> hi everyone!
>
> i'd like to ask something maybe commonly asked here. what is the most
> powerful php editor?

EditPlus or UltraEdit - particularly like the former because I can edit files on the server with its very transparent FTP functions. On top of that they do v. nice syntax highlighting in other languages, even Actionscript.

If I could figure out a way to do the same (remote editing) with Eclipse I'd probably invest the time in it; code hinting / completion would be nice, particularly with frameworks like Qcodo.

Which then leads me towards ZEND, although I've never used it.

These observations have probably not been at all helpful. <g>

Regards - Miles

PS You're not forgetting source code control, are you? /mt

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.410 / Virus Database: 268.17.3/642 - Release Date: 1/20/2007

--- End Message ---
--- Begin Message ---
God I love this list.. great answers everyone! (serious and non-serious :)

In addition to the editors listed, here's a few more to consider:

Crimson Editor - my personal favorite when I don't need code completion. Code 
highlights for many different types of code (including my beloved LUA files used
in World of Warcraft scripting hah).  I use the macro record/playback a lot.
http://www.crimsoneditor.com/

Emerald Editor - crimson editor has been abandoned for years (and still kicks 
ass), these guys hope to revive it as a new project called Emerald.  It's not 
done yet.
http://www.emeraldeditor.com/

Notepad++ - looks spiffy, but wasn't enough of of a change to get me to switch 
from Crimson editor (although it came damn close)
http://notepad-plus.sourceforge.net/uk/site.htm

Zend Studio - Still my 'professional' choice, but since it's a java app, it's 
kind of heavy on the system.  And it's made by the people who created the core 
PHP engine, so they know a few things.
http://www.zend.com/products/zend_studio

Komodo - Similar to Zend Studio.. but much like Notepad++ and Crimson Editor.. 
not enough of an 'upgrade' to get me to switch, but a former coworker swore by 
it.
http://www.activestate.com/Products/Komodo/


Should be enough to get you started investigating.

-TG

= = = Original message = = =

At 08:21 AM 1/21/2007, Robert Cummings wrote:

>On Sat, 2007-01-20 at 22:54 -0200, Vinicius C Silva wrote:
> > hi everyone!
> >
> > i'd like to ask something maybe commonly asked here. what is the most
> > powerful php editor?


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message --- Since a couple of IDEs have also been mentioned, I would like to add to the list of sugestions phpEdit (http://waterproof.fr/) for Windows only. It does all that Eclipse with all the plugins for PHP does, plus some, but it is much slimmer and faster. I admit that since what I have already installed satisfies me, I never went beyond the free trial version, but it was really good and woked as advertised, and this was more than a year ago and they keep sending e.mails with the updates, and they keep adding and adding. As I said, I already have all I need, in bits and pieces assembled together over time, but if you start from scratch, this product is great.

Satyam



----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Sunday, January 21, 2007 3:58 PM
Subject: Re: [PHP] most powerful php editor


God I love this list.. great answers everyone! (serious and non-serious :)

In addition to the editors listed, here's a few more to consider:

Crimson Editor - my personal favorite when I don't need code completion. Code highlights for many different types of code (including my beloved LUA files used in World of Warcraft scripting hah). I use the macro record/playback a lot.
http://www.crimsoneditor.com/

Emerald Editor - crimson editor has been abandoned for years (and still kicks ass), these guys hope to revive it as a new project called Emerald. It's not done yet.
http://www.emeraldeditor.com/

Notepad++ - looks spiffy, but wasn't enough of of a change to get me to switch from Crimson editor (although it came damn close)
http://notepad-plus.sourceforge.net/uk/site.htm

Zend Studio - Still my 'professional' choice, but since it's a java app, it's kind of heavy on the system. And it's made by the people who created the core PHP engine, so they know a few things.
http://www.zend.com/products/zend_studio

Komodo - Similar to Zend Studio.. but much like Notepad++ and Crimson Editor.. not enough of an 'upgrade' to get me to switch, but a former coworker swore by it.
http://www.activestate.com/Products/Komodo/


Should be enough to get you started investigating.

-TG

= = = Original message = = =

At 08:21 AM 1/21/2007, Robert Cummings wrote:

On Sat, 2007-01-20 at 22:54 -0200, Vinicius C Silva wrote:
> hi everyone!
>
> i'd like to ask something maybe commonly asked here. what is the most
> powerful php editor?


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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




--- End Message ---
--- Begin Message ---
That's interesting.  I've been trying to use Eclipse, and its code-assistance 
for PHP is some of the worst I've ever used.  I can't type "array" without it 
trying to complete that to an Array class from SPL, yet it never 
auto-completes to any function or class I wrote myself.  Nor does it seem to 
pick up on anything BUT classes.  It's terrible.  How'd you get it to behave?

On Sunday 21 January 2007 5:22 am, Peter Lauri wrote:
> I would put my vote on Eclipse. It has great support for cvs and also for
> general coding "autofilling" etc. The downside is that it is resource
> demanding...
>
> Best regards,
> Peter Lauri
>
> www.dwsasia.com - company web site
> www.lauri.se - personal web site
> www.carbonfree.org.uk - become Carbon Free
>
>
> -----Original Message-----
> From: Vinicius C Silva [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 21, 2007 2:54 AM
> To: php-general@lists.php.net
> Subject: [PHP] most powerful php editor
>
> hi everyone!
>
> i'd like to ask something maybe commonly asked here. what is the most
> powerful php editor?

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
I don't know what version you are using or what plugin you are using, there
are more then one plugin :)

To be clear: I am using Eclipse 3.1 with PHPEclipse 1.1.8 and that is
working very well. It does auto complete classes and functions written by my
self etc.

I tried some other PHP plugin for Eclipse, and that one behavied like you
describe, therefore my change to SourceForge PHP Eclipse Plugin.

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free



-----Original Message-----
From: Larry Garfield [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 21, 2007 9:31 PM
To: php-general@lists.php.net
Subject: Re: [PHP] most powerful php editor

That's interesting.  I've been trying to use Eclipse, and its
code-assistance 
for PHP is some of the worst I've ever used.  I can't type "array" without
it 
trying to complete that to an Array class from SPL, yet it never 
auto-completes to any function or class I wrote myself.  Nor does it seem to

pick up on anything BUT classes.  It's terrible.  How'd you get it to
behave?

On Sunday 21 January 2007 5:22 am, Peter Lauri wrote:
> I would put my vote on Eclipse. It has great support for cvs and also for
> general coding "autofilling" etc. The downside is that it is resource
> demanding...
>
> Best regards,
> Peter Lauri
>
> www.dwsasia.com - company web site
> www.lauri.se - personal web site
> www.carbonfree.org.uk - become Carbon Free
>
>
> -----Original Message-----
> From: Vinicius C Silva [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 21, 2007 2:54 AM
> To: php-general@lists.php.net
> Subject: [PHP] most powerful php editor
>
> hi everyone!
>
> i'd like to ask something maybe commonly asked here. what is the most
> powerful php editor?

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession

of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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

--- End Message ---
--- Begin Message ---
On 1/20/07, Vinicius C Silva <[EMAIL PROTECTED]> wrote:
hi everyone!

i'd like to ask something maybe commonly asked here. what is the most
powerful php editor?



I think Stut hinted a lot in his PS he provided, if you believe this
to be a common question, it would be best to research this and provide
information on what kind of editor you would like to work with.

Considering the editors that have been requested:
 vim: this is the best if you do vim
 eclipse: this is the best if you do eclipse
 editor2: this is the best if you do editor2
 editor3: this is the best if you do editor3

I would though add to the the mix: ed or cat /dev/random they are the best imo

As far as powerful, it depends on what power you want and are capable
to do, some people think DreamWeaver is powerful for a php editor, and
some people will think a hex editor is even more powerful

You have to look at this at what level you want the editor to do
things for you. Asking a general question like this  to an audience
dependent on where their level of comfort is, will  get you a
different answer all the time.

Curt.

--- End Message ---
--- Begin Message ---
On Sat, 2007-01-20 at 14:42 +0000, Wikus Moller wrote:
> Hi.
> 
> Since this is a mailing list for web developers,

Nope, you Sir are wrong. This is a mailing list for PHP web developers.
Note the PHP part, it's quite important.

HAND

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Sat, 2007-01-20 at 16:09 +0000, Stut wrote:
>
> 3) This is not a mailing list for web developers, it's a mailing list 
> for PHP developers. The fact that most PHP development happens in a web 
> context does not make it exclusively for web development.

Not that this was directed at me, but I apologize for alienating the
large volumne of non web PHP developers in my previous post. I should
know better since I do plenty of shell scripting with PHP :)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hi list,

I am trying to create a link checker that would look for broken URLs
with help of the following code"

$handle = @fopen("http://www.circle.am";, "r");
if ($handle):
print "OK";
else:
print "Error";
endif;

The problem is that I want to check if the links are accessible under
certain proxy, so is there any way to tell the script to open the URL
under a proxy?

Thank you in advance.

Ed

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-21 17:29:56 +0300:
> I am trying to create a link checker that would look for broken URLs
> with help of the following code"
> 
> $handle = @fopen("http://www.circle.am";, "r");
> if ($handle):
> print "OK";
> else:
> print "Error";
> endif;
> 
> The problem is that I want to check if the links are accessible under
> certain proxy, so is there any way to tell the script to open the URL
> under a proxy?

Several, start by googling for connect.c

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
> Hi list,
> 
> I am trying to create a link checker that would look for broken URLs
> with help of the following code"
> 
> $handle = @fopen("http://www.circle.am";, "r");
> if ($handle):
> print "OK";
> else:
> print "Error";
> endif;
> 
> The problem is that I want to check if the links are accessible under
> certain proxy, so is there any way to tell the script to open the URL
> under a proxy?

the curl extension is [probably] what your looking for:

        http://php.net/curl

check out the user-notes, there is an example in there for specifying
a request via a given proxy.

> 
> Thank you in advance.
> 
> Ed
> 

--- End Message ---
--- Begin Message ---
Thank you Roman and Jochem,

I'll try both.

Best regards,
Ed

Sunday, January 21, 2007, 6:27:44 PM, you wrote:

> # [EMAIL PROTECTED] / 2007-01-21 17:29:56 +0300:
>> I am trying to create a link checker that would look for broken URLs
>> with help of the following code"
>> 
>> $handle = @fopen("http://www.circle.am";, "r");
>> if ($handle):
>> print "OK";
>> else:
>> print "Error";
>> endif;
>> 
>> The problem is that I want to check if the links are accessible under
>> certain proxy, so is there any way to tell the script to open the URL
>> under a proxy?

> Several, start by googling for connect.c

> -- 
> How many Vietnam vets does it take to screw in a light bulb?
> You don't know, man.  You don't KNOW.
> Cause you weren't THERE.             http://bash.org/?255991


--- End Message ---
--- Begin Message ---
Can anyone tell me if there is a function to return the first letter in a
string, such as:

$surname="SMITH";
$forename="ALAN";

Is there a function which I can use to make $forename "A", so I can display
it as A SMITH?

Thank You In Advance

--- End Message ---
--- Begin Message ---
$firstchar = substr($string, 0, 1);

Read www.php.net/substr

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free


-----Original Message-----
From: Christopher Deeley [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 21, 2007 3:44 PM
To: php-general@lists.php.net
Subject: [PHP] First Character In A String

Can anyone tell me if there is a function to return the first letter in a
string, such as:

$surname="SMITH";
$forename="ALAN";

Is there a function which I can use to make $forename "A", so I can display
it as A SMITH?

Thank You In Advance

--- End Message ---
--- Begin Message ---
Hello Christopher Deeley,



Best regards, 
  
======= At 2007-01-21, 21:49:06 you wrote: =======

>Can anyone tell me if there is a function to return the first letter in a
>string, such as:
>
>$surname="SMITH";
>$forename="ALAN";
>
>Is there a function which I can use to make $forename "A", so I can display
>it as A SMITH?
$forename[0].' '.$surname
>
>Thank You In Advance
>
just like an array

= = = = = = = = = = = = = = = = = = = =
                        
Nicholas Yim
[EMAIL PROTECTED]
2007-01-21

--- End Message ---
--- Begin Message ---
Christopher Deeley wrote:
> Can anyone tell me if there is a function to return the first letter in a
> string, such as:
> 
> $surname="SMITH";
> $forename="ALAN";
> 
> Is there a function which I can use to make $forename "A", so I can display
> it as A SMITH?

another alternative to the other answers you have had,
this alternative introduces you to the 'String access and modification by 
character'
functionality as described here:

        http://nl2.php.net/manual/en/language.types.string.php


<?php

$initial = (is_string($forename) && strlen($forename) > 0)
         ? $forename[0]
         : ''
         ;

echo trim($initial.' '.$surname);

> 
> Thank You In Advance
> 

--- End Message ---
--- Begin Message ---
On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
>
> <?php
> 
> $initial = (is_string($forename) && strlen($forename) > 0)
>        ? $forename[0]
>        : ''
>        ;
> 
> echo trim($initial.' '.$surname);
>
> ?>

That sure is verbose Jochem...

<?php

echo trim( substr( (string)$forename, 0, 1 ).' '.$surname );

?>

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
> On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
>> <?php
>>
>> $initial = (is_string($forename) && strlen($forename) > 0)
>>       ? $forename[0]
>>       : ''
>>       ;
>>
>> echo trim($initial.' '.$surname);
>>
>> ?>
> 
> That sure is verbose Jochem...

agreed, it was done on purpose in the spirit of 'give the OP
a hint about not assuming anything about the input', I could have done this:

<?= trim(@$forename[0].' '),$surname; ?>

which is as short as I can make it :-) it also assumes that the OP
actually santized the incoming data ($forename) before doing *anything* with
it.

> 
> <?php
> 
> echo trim( substr( (string)$forename, 0, 1 ).' '.$surname );
> 
> ?>
> 
> Cheers,
> Rob.

--- End Message ---
--- Begin Message ---
On Sun, 2007-01-21 at 16:27 +0100, Jochem Maas wrote:
> Robert Cummings wrote:
> > On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
> >> <?php
> >>
> >> $initial = (is_string($forename) && strlen($forename) > 0)
> >>     ? $forename[0]
> >>     : ''
> >>     ;
> >>
> >> echo trim($initial.' '.$surname);
> >>
> >> ?>
> > 
> > That sure is verbose Jochem...
> 
> agreed, it was done on purpose in the spirit of 'give the OP
> a hint about not assuming anything about the input', I could have done this:
> 
> <?= trim(@$forename[0].' '),$surname; ?>
> 
> which is as short as I can make it :-) it also assumes that the OP
> actually santized the incoming data ($forename) before doing *anything* with
> it.

Oh, I didn't make mine as short as I could, I sanitized it, and didn't
cheat by using the error suppression operator ;)

> > echo trim( substr( (string)$forename, 0, 1 ).' '.$surname );

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
> On Sun, 2007-01-21 at 16:27 +0100, Jochem Maas wrote:
>> Robert Cummings wrote:
>>> On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
>>>> <?php
>>>>
>>>> $initial = (is_string($forename) && strlen($forename) > 0)
>>>>     ? $forename[0]
>>>>     : ''
>>>>     ;
>>>>
>>>> echo trim($initial.' '.$surname);
>>>>
>>>> ?>
>>> That sure is verbose Jochem...
>> agreed, it was done on purpose in the spirit of 'give the OP
>> a hint about not assuming anything about the input', I could have done this:
>>
>> <?= trim(@$forename[0].' '),$surname; ?>
>>
>> which is as short as I can make it :-) it also assumes that the OP
>> actually santized the incoming data ($forename) before doing *anything* with
>> it.
> 
> Oh, I didn't make mine as short as I could, I sanitized it, and didn't
> cheat by using the error suppression operator ;)

consider it my evil streak :-)
indeed yours is the better.

> 
>>> echo trim( substr( (string)$forename, 0, 1 ).' '.$surname );

now we can get on with having a flame war as to the 'best' way to style
your code, because obviously this is better ;-) ...

echo trim(substr((string)$forename, 0, 1).' '.$surname);

> 
> Cheers,
> Rob.

--- End Message ---
--- Begin Message ---
On Sun, 2007-01-21 at 16:49 +0100, Jochem Maas wrote:
> now we can get on with having a flame war as to the 'best' way to style
> your code, because obviously this is better ;-) ...

Game on! :B

> echo trim(substr((string)$forename, 0, 1).' '.$surname);

Surely any fool can see that yours is inferior to the following:

    echo trim( substr( (string)$forename, 0, 1 ).' '.$surname );

Why? (some misguided readers might ask) Because, by placing spaces
between function paramater parenthesis, it is clearly easy to
distinguish function parameter bounds from expression evaluation
precedence parenthesis (say that 5 times fast).

>:D

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hi
 
I'm looking to create a Table that holds all of the PHP Functions, their
description and syntax. 

It's all in the manual and I'm trying to extract it from there but I find it
hard since the HTML template is not the same for all the functions. 

I may be going about this the wrong way... is there an easier way? 
 
thanks
 
berber

--- End Message ---

Reply via email to