php-general Digest 14 Apr 2008 18:48:41 -0000 Issue 5404

Topics (messages 272964 through 272984):

Re: SERVER_PORT always at 80 ?
        272964 by: Julien Pauli
        272965 by: mike
        272975 by: Julien Pauli

Re: Developing existing java portal in php
        272966 by: Sangamesh B

Re: Quarters -- ERRORS --
        272967 by: Peter Ford
        272969 by: tedd

Re: File Upload Security
        272968 by: Peter Ford
        272970 by: Al

Re: Writing MySQL Update Query with NULL value
        272971 by: tedd
        272973 by: Daniel Brown

Re: $_SESSION problem [NOW SOLVED]
        272972 by: Andrew Ballard

Re: Quarters
        272974 by: Andrew Ballard

where to put a function
        272976 by: Rick Pasotto
        272977 by: Nathan Nobbe
        272979 by: Daniel Brown
        272981 by: Eric Butera

Re: Need a simple one time search utility
        272978 by: Daniel Brown
        272984 by: Philip Thompson

Re: standard format for Web portal administration side
        272980 by: Daniel Brown
        272982 by: Richard Heyes

Re: Include problems
        272983 by: Daniel Brown

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:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....

Regards, Julien.P

2008/4/11 Thiago Pojda <[EMAIL PROTECTED]>:

> {Top posting}
>
> What shows your phpinfo() on both ports?
>
> Is it really running your 5.3 in :81?
>
>
> Regards,
> Thiago
>
> -----Mensagem original-----
> De: Julien Pauli [mailto:[EMAIL PROTECTED]
> Enviada em: sexta-feira, 11 de abril de 2008 09:28
> Para: PHP General list
> Assunto: [PHP] SERVER_PORT always at 80 ?
>
> Hi all, I'm running Windows XP, and here is a piece of my
> apache (2.2.8) conf :
>
> --- httpd.conf ---
> ... ... ...
> Listen 81
> Listen 80
> Listen 8080
> LoadModule php5_module "e:/php/php5apache2_2.dll"
> LoadModule fastcgi_module modules/mod_fastcgi.dll AddType
> application/x-httpd-php .php ... ... ...
>
> --- vhosts.conf ----
>
> NameVirtualHost 127.0.0.1:81
>
> <VirtualHost 127.0.0.1:81>
>    ServerName myserver
>    DocumentRoot e:/www
>    ScriptAlias /php/ "e:/php53/"
>    Action php5-fastcgi "/php/php-cgi.exe"
>    AddHandler php5-fastcgi .php
> </VirtualHost>
>
> That's a configuration to be able to run both PHP 5.2 (as
> apache module), and PHP 5.3 (throught fast-cgi) on the same
> apache2 instance.
> There are no apache rewrite rules in my stuff.
>
> All works right, the only problem is that in both cases,
> $_SERVER["SERVER_PORT"] returns 80, even when I'm connected
> throught port 81.
>
> Is it a fastcgi / Apache bug or does it come from PHP or even me :-) ?
>
>
> Cheers
> Julien.P
>
>
>

--- End Message ---
--- Begin Message ---
I would think PHP is just passing through what it receives from
Apache. I assume it's just passing through environment variables it
gets from the server.

Can you disable all the other ports and only have :81 running to
ensure there is no confusion?

On 4/14/08, Julien Pauli <[EMAIL PROTECTED]> wrote:
> Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....
>
> Regards, Julien.P

--- End Message ---
--- Begin Message ---
Ok I did that, but it's the same.
HTTP_HOST says myhost:81 , but SERVER_PORT still says 80....

Cheers
Julien.P

2008/4/14 mike <[EMAIL PROTECTED]>:

> I would think PHP is just passing through what it receives from
> Apache. I assume it's just passing through environment variables it
> gets from the server.
>
> Can you disable all the other ports and only have :81 running to
> ensure there is no confusion?
>
> On 4/14/08, Julien Pauli <[EMAIL PROTECTED]> wrote:
> > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....
> >
> > Regards, Julien.P
>

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

      I know that php is an interpreter, like shell. It won't produce any
object or executable file.

      Now the portal has to be developed such that the php source shouldn't
be visible in the product. Means the product should be able to produced in
binary format.

    Is it possible to embed php code in any other programming language such
as C?

    Or there any other tool which can store/embed the php script in binary
format?

    Has anybody has implemented this kind of stuff?

   Is it possible? Please let me know at the earliest..

Thanks for your guidance,

Sangamesh

On Sat, Mar 29, 2008 at 12:10 PM, Sangamesh B <[EMAIL PROTECTED]> wrote:

> Thanks for the reply.
>
> Can it be done by just using php + html or perl + html.
>
> Also, May I know a beginners document to start working on html, php and
> perl.
>
> Thanks,
> Sangamesh
>
>
>
> On Fri, Mar 28, 2008 at 1:50 AM, ganu <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > On Thu, Mar 27, 2008 at 7:52 AM, Sangamesh B <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hi all,
> > >
> > > Here is one web portal product which is already developed using java
> > > tools.
> > > I don't know java, php or perl. But I can learn php quickly compared
> > > to
> > > java.
> >
> >
> > Learning PHP,Perl is very easy as compare to Java.
> >
> > >
> > >
> > > My question is: Is it possible to develop such web portal using php &
> > > html?
> >
> >
> > Yea, is possible.
> >
> > >
> > >
> > > Let me explain how the java portal/product works:
> > >
> > > The user logs in to the portal with his user name and password thru
> > > web
> > > browser by using a public ip or for example say xyz-portal.com
> > >
> > > The user name and password are the user names of the  Linux OS. So
> > > username
> > > authentication is required.
> > >
> > > In the next page, the user accesses  the preinstalled applications (
> > > these
> > > are C or Fortran apps) and submits the job.
> > > While submitting the job, he is allowed to give the command line
> > > options and
> > > input file. The input files are present in his home directory. These
> > > files
> > > should be listed in combo box.
> > >
> > > It doesn't mean that, all installed apps in linux must be listed in
> > > the
> > > portal. There should be a mechanism to add a particular application to
> > > the
> > > portal ( part of administrator's work). And all apps which are to be
> > > displayed in portal are in a different dir, say /usr/local/bin.
> > >
> > > This portal is totally based on the server. i.e. The user accesses the
> > > portal and submits his application job from client system to run the
> > > job in
> > > the server. The client system uses only web browser. So other software
> > > can
> > > not be used to do this.
> > >
> > > Regarding php, I know that linux commands can be bypassed thru php.
> > >
> > > So can any one tell me whether this can be done using php with the
> > > above
> > > mentioned conditions/facilities?
> > >
> > >
> > > Thanks & Regards,
> > > Sangamesh
> >
> >
> > I think you can do all front end things in PHP and html and you can do
> > all system calls with Perl.
> > Perl will be fast and easy for all linux things.
> >
> > you can refer this for calling Perl from PHP page -
> > http://devzone.zend.com/node/view/id/1712
> >
> >
> > ---
>
>
>

--- End Message ---
--- Begin Message ---
tedd wrote:
Hi gang:

Sorry for the lame app, but the program worked for Safari (Mac and Win). However, I did get it to work for FF and a couple of other browsers (Mac and Win), see again:

http://webbytedd.com/quarters

But the critter is dead in the water for all versions of IE -- if -- I don't figure out a way around the following single statement.

document.getElementById(id).checked = true;

Granted it's javascript, but all that line does is to set a checkbox variable (id) to 'on'. Surely, $M code can do that, right?

After reading a bunch, it seems that M$ has a better way to do things (big surprise there, huh?) and thus does not use the document.getElementById(id) thing that everyone else in the world uses. Instead, they use something "better" and it's not documented well as is typical.

Unfortunately, I have not been able to find a M$ work-a-round.

So, what I need is:

if (document.getElementById)
   {
   document.getElementById(id).checked = true;
   }
else
   {
   <<<<< inset solution here. >>>>>>
   }

All the code has to do is to set a simple checkbox to 'on' in IE.

Anyone have any ideas?

Cheers,

tedd

PS: I'm going to post this on a js list as well.

PPS: You have to wonder how much more technically advanced we would be if we weren't always held back by the "what's in it for me" shortsightedness of M$.



What you talkin' bout?
Document.getElementById() works fine in IE5 and later.
There must be some other error.

You could check that document.getElementById(id) is actually returning something - if it fails it returns null.

Maybe you have given your checkbox a name and not an id, although that should fail with FF (and Safari) too...

It's fine on IE7 - anything older than IE7 is too broken to be usable, really. 
:)



--
Peter Ford                              phone: 01580 893333
Developer                               fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--- End Message ---
--- Begin Message ---
What you talkin' bout?
Document.getElementById() works fine in IE5 and later.
There must be some other error.

The error was that I was passing the id as an array and not as a string.

What's interesting is that only IE's would not accept that mistake.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Al wrote:
Thanks guys.

I had written a newer version restricted to images which checks MIME and image width and height.

I have one application which needs a text file. I think I'll have my users hide a password in it and scan the whole file for <? an <?php and other signs of scripts, etc.

Al wrote:
One of my sites has been hacked and I'm trying to find the hole. The hack code creates dirs with "nobody" ownership, so it's obvious stuff is not via ftp [ownership would be foo]

Site is virtual host, Linux/Apache

I'm concerned about a file uploader my users use to upload photos.

Can anyone see a hole in this scrip? Can my code upload an executable masquerading as an image file?

You probably need a deeper inspection than checking the extension - that's Microsoft thinking... You can't trust what the client is telling you - even the MIME type sent by the browser is no guarantee. Since you're on Linux, why not look at using the 'file' shell command to get a more detailed inspection of the upload. I made a basic function like this a few years ago - probably needs a bit of tweaking:

<?php
    function getMimeType($file)
    {
        global $magicFile;
$mimecmd = "/usr/bin/file -b -m ".escapeshellargs($magicFile)." ".escapeshellargs($file)." 2> /dev/null";
        $ret = exec($mimecmd);
        if (!$ret)
        {
            $ret = "unknown";
        }
        return $ret;
    }
?>

The global $magicFile is the tricky bit - you need to find a nice Unix magic numbers file that returns mime types (they're easier to parse than regular magic number responses). Probably something like /usr/share/misc/magic.mime, but that depends on the system.


--
Peter Ford                              phone: 01580 893333
Developer                               fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--- End Message ---
--- Begin Message ---
I don't pay any attention to MIME sent by the client.

I check the MIME returned from getimagesize() and I'm not too certain of it. i need to do further research.

I do check the images have width and height and I extract the embedded text 
stuff.

I'm going to look into your suggestion. Thanks.

Peter Ford wrote:
Al wrote:
Thanks guys.

I had written a newer version restricted to images which checks MIME and image width and height.

I have one application which needs a text file. I think I'll have my users hide a password in it and scan the whole file for <? an <?php and other signs of scripts, etc.

Al wrote:
One of my sites has been hacked and I'm trying to find the hole. The hack code creates dirs with "nobody" ownership, so it's obvious stuff is not via ftp [ownership would be foo]

Site is virtual host, Linux/Apache

I'm concerned about a file uploader my users use to upload photos.

Can anyone see a hole in this scrip? Can my code upload an executable masquerading as an image file?

You probably need a deeper inspection than checking the extension - that's Microsoft thinking... You can't trust what the client is telling you - even the MIME type sent by the browser is no guarantee. Since you're on Linux, why not look at using the 'file' shell command to get a more detailed inspection of the upload. I made a basic function like this a few years ago - probably needs a bit of tweaking:

<?php
    function getMimeType($file)
    {
    global $magicFile;
$mimecmd = "/usr/bin/file -b -m ".escapeshellargs($magicFile)." ".escapeshellargs($file)." 2> /dev/null";
        $ret = exec($mimecmd);
        if (!$ret)
        {
            $ret = "unknown";
        }
        return $ret;
    }
?>

The global $magicFile is the tricky bit - you need to find a nice Unix magic numbers file that returns mime types (they're easier to parse than regular magic number responses). Probably something like /usr/share/misc/magic.mime, but that depends on the system.



--- End Message ---
--- Begin Message ---
At 1:42 PM +1000 4/14/08, Chris wrote:
Your query should end up looking like:


$query = "UPDATE phones set last_name='${last_name}', first_name='${first_name}' ..., suffix=${suffix}";


Why not this:

$query = "UPDATE phones set last_name='$last_name', first_name='$first_name' ..., suffix=$suffix";

Why the "{}"?

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Sun, Apr 13, 2008 at 10:24 PM, Bill Guion <[EMAIL PROTECTED]> wrote:
>
>  However, when I echo out this query, I get:
>  UPDATE 'phones' SET 'last_name' = Doe, 'first_name' = John, 'suffix' = ,
> 'phone' = 123-456-7890 WHERE 'phone_index' = 323;

    Bill,

    You're missing quotes around your data, and using quotes on field
names.  Instead, try structuring your query so that it will output
like this, with quotes around data, and backticks around table and
field names.:

UPDATE `phones` SET `last_name` = 'Doe', `first_name` = 'John',
`suffix` = '', `phone` = '123-456-7890' WHERE `phone_index` = '323'

    NOTES:
        * See the missing semicolon at the end?  It's because you
shouldn't use the semicolon in PHP's mysql_*() functions.
[http://php.net/mysql_query]
        * You may also want to force a LIMIT 1 to the end of that
query.  I'm sure `phone_index` is a unique AUTO_INCREMENT, but I still
prefer to tack it on just to ensure that MySQL knows we're only
messing with one thing.  It's also an added layer of security in case
(God forbid) anything goes wrong.

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--- End Message ---
--- Begin Message ---
On Fri, Apr 11, 2008 at 5:34 PM, tedd <[EMAIL PROTECTED]> wrote:
> At 11:33 AM -0400 4/11/08, Daniel Brown wrote:
>
> > On Fri, Apr 11, 2008 at 10:29 AM, Ford, Mike <[EMAIL PROTECTED]>
> wrote:
> >
> > >
> > >  Sounds like a register_globals=On issue....
> > >
> >
> >    It does to me, as well.  I know, Tedd, that on the php1.net site
> > that you mentioned to me off-list, I'm about 99% positive that it's
> > the reason.  Shared hosts generally keep register_globals on and leave
> > it up to the individual customer to turn it off.  On that particular
> > server, though, since it's mostly developers, I may just send out an
> > email to get feedback and turn it off at the main, and then allow
> > ya'all to override it on your individual sites.
> >
> >    The thing that makes me wonder (and I haven't checked myself to
> > verify) is why two sites, on the same server, having the same
> >
>
>  Hey!
>
>  I found it and you were right.
>
>  On my webbytedd.com site, I had a htaccess file that read:
>
>  AddDefaultCharset utf-8
>
>  php_value register_globals 0
>  php_value magic_quotes_gpc 0
>  php_value magic_quotes_sybase 0
>  php_value magic_quotes_runtime 0
>
>  And I didn't have that htaccess file on my sperling.com site. However, what
> fooled me was in both scripts I had:
>
>  ini_set( 'register_globals', '0' );
>
>  So, I thought that was the same, but apparently it's not. Maybe because my
> server had safe_mode ON it won't allow it -- I don't know. Another question
> for another time.
>
>  Thanks a bunch guys!
>
>  Cheers,
>
>  tedd
>
>  PS: I did try the session_write_close and several other suggestions, but
> none worked.


The register_globals value is something that cannot be set at runtime.
If you pass it to ini_set(), it will appear to work -- you won't get
an error and successive calls to phpinfo() will show the new value;
however, by the time PHP gets far enough down the chain to execute
your ini_set() command, PHP has already determined whether it should
register global variables. The manual indicates that this wasn't
always the case, but (not knowing the internals then or now) I don't
understand how. (The table on that page says it was PHP_INI_ALL for
versions up to 4.2.3.)

http://us.php.net/manual/en/ini.core.php#ini.register-globals

Andrew

--- End Message ---
--- Begin Message ---
On Fri, Apr 11, 2008 at 11:08 PM, Casey <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 11, 2008 at 6:49 AM, tedd <[EMAIL PROTECTED]> wrote:
>
>
> > Hi gang:
>  >
>  >  Check out my new game:
>  >
>  >  http://webbytedd.com/quarters/
>  >
>  >  What do you think?
>  >
>  >  Cheers,
>  >
>  >  tedd
>  >
>  >  PS: I originally wrote the game for the Mac over eight years ago.
>  >  --
>  >  -------
>  >  http://sperling.com  http://ancientstones.com  http://earthstones.com
>  >
>  >  --
>  >  PHP General Mailing List (http://www.php.net/)
>  >  To unsubscribe, visit: http://www.php.net/unsub.php
>  >
>  >
>
>  I won. Finally figured out the secret, without $5 >_>
>
>  --
>  -Casey

Really? I was starting to think that the secret was the coins that
kept magically reappearing. I gave up. (That was in IE, bearing
through the JavaScript error alert boxes.)

Andrew

--- End Message ---
--- Begin Message ---
Probably been answered a thousand times; if so, just tell me where to
look.

I have a function that includes a specific sql query that is used on
only one page on the site. Should that function be coded (1) in the page
itself, (2) in a separate file that only that page includes, or (3) in a
master file that contains all the functions used on the site and is
included on every page?

I've been doing #1 (not actually a function in this case) but #3 is
appealing, especially since I would implement it as OOP and the page
itself would be really just a template. What is the cost of parsing a
bunch of functions that are not used on a given page load?

-- 
"If some peoples pretend that history or geography gives them the right
 to subjugate other races, nations, or peoples, there can be no peace."
        -- Ludwig von Mises
    Rick Pasotto    [EMAIL PROTECTED]    http://www.niof.net

--- End Message ---
--- Begin Message ---
On Mon, Apr 14, 2008 at 9:34 AM, Rick Pasotto <[EMAIL PROTECTED]> wrote:

> Probably been answered a thousand times; if so, just tell me where to
> look.
>
> I have a function that includes a specific sql query that is used on
> only one page on the site. Should that function be coded (1) in the page
> itself, (2) in a separate file that only that page includes, or (3) in a
> master file that contains all the functions used on the site and is
> included on every page?


each have their merits and detriments.
1. down-and-dirty, if  you put it here, you may have to move i later
2. more organized, somewhat future conscience, because now it can already be
used by other code simply by including the file
3. hmmm.  well, i would only put it in a file w/ other functions related to
it.  if you have a small app it could make sense to just toss a bunch of
seemingly random functions together in one file, but after a while that
could get pretty messy.

What is the cost of parsing a
> bunch of functions that are not used on a given page load?
>

not much, but less if you have an opcode cache.  i would be more worried
about code organization than performance on this one.

-nathan

--- End Message ---
--- Begin Message ---
On Mon, Apr 14, 2008 at 11:34 AM, Rick Pasotto <[EMAIL PROTECTED]> wrote:
> Probably been answered a thousand times; if so, just tell me where to
>  look.

    The archives are always your best friend when searching for
specific data.  The two best are:
        http://www.marc.info/
        http://www.gmane.org/

>  I have a function that includes a specific sql query that is used on
>  only one page on the site. Should that function be coded (1) in the page
>  itself, (2) in a separate file that only that page includes, or (3) in a
>  master file that contains all the functions used on the site and is
>  included on every page?

    If you only want to include it on one page, and then especially if
there are no includes in that page as of yet, then keep it in the same
file.  It'll be completely portable and self-reliant, which will keep
execution time (and resource usage) to the minimum possible amount.
If you plan on extending the site in the future and think you'll reuse
the function, place it in an include file site-wide.

>  I've been doing #1 (not actually a function in this case) but #3 is
>  appealing, especially since I would implement it as OOP and the page
>  itself would be really just a template. What is the cost of parsing a
>  bunch of functions that are not used on a given page load?

    There's not a great deal of overhead with including unused
functions aside from general syntax and parse checking via the
runtime.  For example, even though a function isn't called, if there's
a missing ) on a non-commented line, it'll fail fatally.  Unless you
have thousands of lines of functions, the benefit will probably
outweigh the cost in most situations.

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--- End Message ---
--- Begin Message ---
On Mon, Apr 14, 2008 at 11:34 AM, Rick Pasotto <[EMAIL PROTECTED]> wrote:
>  I have a function that includes a specific sql query that is used on
>  only one page on the site. Should that function be coded (1) in the page
>  itself, (2) in a separate file that only that page includes, or (3) in a
>  master file that contains all the functions used on the site and is
>  included on every page?

Every time you include/require a file there is stat & compile stages
that do add up over the execution of a script.  It will do this on
every single page request unless you have an opcode cache installed.

Now with that said, it is better to organize your site than to build
for optimum performance.  Most sites will never reach the traffic
necessary required to deal with tweaking every aspect for performance.
 You'll end up making it harder to maintain and see the flow of the
site which costs you time.  This is all subjective and there are many
factors in it.  But usually programmer time is more important than
script execution time.  Don't completely ignore it though that is just
as bad. :)

I organize all of my data access objects/functions very meticulously.
In OOP sites I will create value objects & gateway classes for each
table and their only job is to work on said data.  For procedural
sites I will create a file that contains functions that relate to a
given table's data.

In your case I would create a single include file somewhere such as
/app_name/<table>/functions.php that would work against the table in
question.  The function prototype would be
app_name_<table>_fetch_all(); or something along those lines that
would return a data set of some sort.

This way if you need to re-use it, extend it, find it, or get rid of
it there's no guessing where it is.  You can one off this case, but
what about when you make other pages?  What if they do have lots of
functions that need to be organized?  Then you've broken the
consistency between where your functions are.  Some might be in
include files, others might be elsewhere.  Sometimes it seems like
overkill, but having a clear methodology for organization in the
beginning is better than when you've got 30 files that play
differently.  Plus when you're really consistent like this you can
easily view the real guts of your application and see how it works
over time much easier without searching templates.  Separation of code
& design is a key for success!

Just my two cents.

--- End Message ---
--- Begin Message ---
On Sat, Apr 12, 2008 at 3:13 PM, Al <[EMAIL PROTECTED]> wrote:
> I need a simple utility that simulates GREP to find a certain string in any
> php files on my website.
>
>  Site is on a shared host w/o shell access so I can't run GREP.
>
>  I can write a PHP scrip to do it; but, this is a one time thing and I was
> hoping to find something to save me the effort.

    Al,

    For yourself and others searching for the same type of thing in
the future, I threw this script together.  There's always room for
improvement, but it's a fully-functional trunk with which to start.
All native PHP functions, no external exec() access required.  Full
source linked from the bottom of the page.

    http://pilotpig.net/code-library/recursive-grep.php

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--- End Message ---
--- Begin Message ---
On Mon, Apr 14, 2008 at 12:15 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Sat, Apr 12, 2008 at 3:13 PM, Al <[EMAIL PROTECTED]> wrote:
> > I need a simple utility that simulates GREP to find a certain string in
> any
> > php files on my website.
> >
> >  Site is on a shared host w/o shell access so I can't run GREP.
> >
> >  I can write a PHP scrip to do it; but, this is a one time thing and I
> was
> > hoping to find something to save me the effort.
>
>    Al,
>
>    For yourself and others searching for the same type of thing in
> the future, I threw this script together.  There's always room for
> improvement, but it's a fully-functional trunk with which to start.
> All native PHP functions, no external exec() access required.  Full
> source linked from the bottom of the page.
>
>    http://pilotpig.net/code-library/recursive-grep.php



<?php
$stringSoMyStatsWillIncrease = "
I know it's only a demo, but there is a small error. You have this string
spit out:

Sorry, for this demo, only the word `pilopig` is allowed as a search string.

However, in the if() statement, you test for 'pilotpig'. Small misspelling.
=D
";
?>

~Philip

--- End Message ---
--- Begin Message ---
On Sat, Apr 12, 2008 at 1:19 PM, Alain Roger <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I've seen several web portal and their dedicated administration side.
>  some of those administration (portal) are according to w3c standard (1024 px
>  large), but most of them use the full screen width.
>
>  therefore i would like to know if there is a standard size (width / height)
>  for web portal administration side ?
>  what do you do usually ?

    http://www.google.com/search?q=web+design+mailing+list

    It's not a PHP question, so you're not likely to get as good of a
response as you will on a web-design-specific mailing list.

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--- End Message ---
--- Begin Message ---
 I've seen several web portal and their dedicated administration side.
 some of those administration (portal) are according to w3c standard (1024 px
 large), but most of them use the full screen width.

 therefore i would like to know if there is a standard size (width / height)
 for web portal administration side ?
 what do you do usually ?

    http://www.google.com/search?q=web+design+mailing+list

    It's not a PHP question, so you're not likely to get as good of a
response as you will on a web-design-specific mailing list.

1024(x768) is a W3C standard? News to me. Why limit yourself to only part of the browser window? Why not use it all? You can make websites that degrade when there's less screen real estate. Yes it takes marginally longer to build than a simple fixed width site, but that's life. And once it's built, continual coding doesn't really take any more time.

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

--- End Message ---
--- Begin Message ---
On Sat, Apr 12, 2008 at 11:06 PM, Bojan Tesanovic <[EMAIL PROTECTED]> wrote:
>
>  On Apr 12, 2008, at 8:28 AM, GoWtHaM NaRiSiPaLli wrote:
>
>
> > if(file_exists("../common/config.ini")) {
> >  $configData = parse_ini_file("../common/config.ini");
> > } else {
> >
>
>
>  Try changing above code so it reads
>
>
>  if(file_exists("common/config.ini")) {
>   $configData = parse_ini_file("common/config.ini");
>  } else {

    In your primary file, you could also consider adding:

<?php
$base_path = dirname(__FILE__);
?>

    And then, all includes from within that file would be included as such:

<?php
include($base_path.'/common/config.ini');
?>

    Finally, on a different note, it may not be in your best interest
to keep a .ini extension on a configuration file, since this is
generally readable on the web.

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--- End Message ---

Reply via email to