php-general Digest 4 Oct 2003 15:27:29 -0000 Issue 2335

Topics (messages 165013 through 165037):

Re: embedding code
        165013 by: John Taylor-Johnston

Re: PHP coders spare time [OT}
        165014 by: John W. Holmes
        165016 by: Evan Nemerson
        165026 by: Ryan A

Re: libcurl and getting mutiple files
        165015 by: Evan Nemerson

Re: Tracking IP Addresses
        165017 by: Cameron Metzke

SQL Server through PEAR - problem
        165018 by: orlandopozo.icnet.com.ve
        165019 by: orlandopozo.icnet.com.ve
        165020 by: Evan Nemerson

still not able to exec useradd with apache
        165021 by: nabil

Apache API support?
        165022 by: \[ASDF\] Jeremy

alpha channel inpng
        165023 by: Andrew Chernyack

Re: XML Application Objects
        165024 by: Terence
        165025 by: Terence
        165028 by: Raditha Dissanayake
        165037 by: Robert Cummings

PHP Notice: Undefined variable
        165027 by: nabil
        165029 by: Comex
        165030 by: Andrew Chernyack
        165033 by: Jon Kriek
        165034 by: Marek Kilimajer

hotscripts style program
        165031 by: Ryan A
        165032 by: Nathan Taylor
        165035 by: Marek Kilimajer
        165036 by: Ryan A

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 ---
John
Apache.
How exactly?
John

"John W. Holmes" wrote:

> John Taylor-Johnston wrote:
> > Brian or anyone,
> >
> > Ok, supposing I don't want someone to be able to use <script language="php"> and 
> > I'm the paranoid sysadmin, (WebCT system see open source moodle.org). What advice 
> > would you give me? Students are allowed to upload files to my server through a 
> > special ftp account. Already, they can't upload files with *.pl, *.php or *.asp 
> > etc. But I need to enable php in *.htm files for myself.
> >
> > But I'm talking about PHP here. Students on a WbCT system. They cannot, however, 
> > upload files, even htm, if there is <?php or <? or ?> in them. What other hacks 
> > might I think of and code for?
>
> Wouldn't it be a WHOLE lot smarter to just disable/enable PHP for
> specific sites/folders, etc? What web server are you using?
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com

--- End Message ---
--- Begin Message --- Ryan A wrote:

I think you're on thin ice dude, all she has to do is type your name in
google and guess what....after she catches up with you...you're not gonna be
able to move even your little finger to type no more :-D

Dude... have you EVER typed my name into google?? You may be amazed at the other careers I've had! ;)


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hahaha yeah I saw something on TV about you a while back and chuckled a 
little.

I even tried Captain John Holmes, but apparently you "drowned off Piel island 
in December 1881". Sorry about that.

At least you don't have _my_ luck. I click the wrong address in my address 
book and oh look, its the number one result... How does that get ahead of a 
bugtraq posting?!?!?



On Friday 03 October 2003 08:09 pm, John W. Holmes wrote:
> Ryan A wrote:
> > I think you're on thin ice dude, all she has to do is type your name in
> > google and guess what....after she catches up with you...you're not gonna
> > be able to move even your little finger to type no more :-D
>
> Dude... have you EVER typed my name into google?? You may be amazed at
> the other careers I've had! ;)

-- 
Evan Nemerson
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hehehe, pretty funny.
But guess what happens if you just add 3 letters in front of your name and
search.....
eg
"php john w holmes"
http://www.google.se/search?q=php+john+w+holmes&hl=en&ie=UTF-8&oe=UTF-8

you would have to get ready to push up daisys :-D



Cheers,
-Ryan


> Ryan A wrote:
>
> > I think you're on thin ice dude, all she has to do is type your name in
> > google and guess what....after she catches up with you...you're not
gonna be
> > able to move even your little finger to type no more :-D
>
> Dude... have you EVER typed my name into google?? You may be amazed at
> the other careers I've had! ;)
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Dunno if you can do this through curl (honestly never used it), but you could 
always do

for ( $x=0 ; $x<=10 ; $x++ ) {
        curl_setopt($ch, CURLOPT_URL, "http://www.server.com/file";.
                (($x < 10) ? '0' : '').$x.".txt");
}

Sincerely,
Captain Obvious


On Friday 03 October 2003 07:25 pm, [EMAIL PROTECTED] wrote:
> i know that with command line curl i can do this:
>
> % curl http://www.server.com/file[01-10].txt
>
> and it will get all files: file01.txt - file10.txt
>
> how can i achive this with libcurl?
>
> when i do
>
> curl_setopt($ch, CURLOPT_URL, "http://www.server.com/file[01-10].txt";);
>
> it always bombs....is there a certain way of doing this? or can it even be
> done in libcurl?
>
> (i'm using php libcurl).
>
> thanks in advance!

-- 
Evan Nemerson
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Well couldnt this be done with the majority of browsers, im not sure myself
but i remember reading somewhere that you can "ask" the browser where the
the user is ?. I think it has something to do with when the system is setup
the country is recorded ? might be a windows only thing again im not sure.
"Evan Nemerson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well you're going to need to play with ARIN, APNIC, and RIPE. First,
figure
> out which group the IP belongs to, then query their database. That will
> provide a good hint as to the location, but it's far from perfect. You
only
> get the location of the people who own that block. So everyone w/ AOHell
will
> appear to be in $wherever_aohell_is_based
>
> It's a good starting point, though. Knowing my addr would allow you to
find
> out I live in San Diego...
>
>
> On Friday 03 October 2003 01:19 pm, Stephen Craton wrote:
> > Hello,
> >
> >
> >
> > I'm wanting to track IP addresses by pinpointing their geological
location
> > (country and whatever) but I have no idea how to go about doing this.
I've
> > been searching on the net and PHP websites all day but with no luck. Can
> > anyone point me towards a tutorial site or explain to it for me? Thanks
in
> > advance!
> >
> >
> >
> > Thanks,
> >
> > Stephen Craton
> >
> > http://www.melchior.us -- http://www.melchior.us/portfolio
>
> --
> Evan Nemerson
> [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hello mailing list, I try to connect SQL server from ODBC through PEAR, but it doesn't 
work, this is the code:

<html><head><title>Test DB Class - PEAR</title></head>
<body>
<table border=1>
<tr><th>Estado</th></tr>
<?php
  //connect
  require_once('DB.php');
  $db =DB::connect("odbc://[EMAIL PROTECTED]/testmssql"); // testmssql is the DSN
  if (DB::iserror($db)) {
    die($db->getMessage());
  }
  //issue the query
  $sql ="SELECT * from tablaEstado";
  $q =$db->query($sql);
  if (DB::iserror($q)) {
    die($q->getMessage());
  }
  //generate table
  while ($q->fetchInto($row)) {
?>
<tr><td><?= $row[0] ?></td></tr>
<?php
  }
?>
</table>
</body></html>

this is the output

DB Error: connect failed

If any could give me hand, I will aprecciate, thanks, bye.

--- End Message ---
--- Begin Message ---
Hello mailing list, I try to connect SQL server through PEAR directly, but
 it doesn't work too, this is the code:
 
<html><head><title>Test DB Class - PEAR</title></head>
 <body>
 <table border=1>
 <tr><th>Estado</th></tr>
 <?php
  //connect
   require_once('DB.php');
   $db =DB::connect("mssql://[EMAIL PROTECTED]/videoclub");
   if (DB::iserror($db)) {
     die($db->getMessage());
   }
   //issue the query
   $sql ="SELECT * from tablaEstado";
   $q =$db->query($sql);
   if (DB::iserror($q)) {
     die($q->getMessage());
   }
   //generate table
   while ($q->fetchInto($row)) {
 ?>
 <tr><td><?= $row[0] ?></td></tr>
 <?php
   }
 ?>
 </table>
</body></html>

 this is the output
 DB Error: extension not found
 
If any could give me hand, I will aprecciate, thanks, bye.

--- End Message ---
--- Begin Message ---
PHP must be compiled --with-mssql in order to use the MS SQL extension.


On Friday 03 October 2003 11:18 pm, [EMAIL PROTECTED] wrote:
> Hello mailing list, I try to connect SQL server through PEAR directly, but
>  it doesn't work too, this is the code:
>
> <html><head><title>Test DB Class - PEAR</title></head>
>  <body>
>  <table border=1>
>  <tr><th>Estado</th></tr>
>  <?php
>   //connect
>    require_once('DB.php');
>    $db =DB::connect("mssql://[EMAIL PROTECTED]/videoclub");
>    if (DB::iserror($db)) {
>      die($db->getMessage());
>    }
>    //issue the query
>    $sql ="SELECT * from tablaEstado";
>    $q =$db->query($sql);
>    if (DB::iserror($q)) {
>      die($q->getMessage());
>    }
>    //generate table
>    while ($q->fetchInto($row)) {
>  ?>
>  <tr><td><?= $row[0] ?></td></tr>
>  <?php
>    }
>  ?>
>  </table>
> </body></html>
>
>  this is the output
>  DB Error: extension not found
>
> If any could give me hand, I will aprecciate, thanks, bye.

-- 
Evan Nemerson
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
still not able to exec useradd as apache

<?php
echo passthru('sudo /usr/sbin/useradd  -g popusers -d /home/all -s
/bin/false  mailtest') or die ('not done');
?>


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

I've been thinking of developing an Apache module to ease my job, but I
don't have a clue of C. I know that mod_perl and mod_tcl provides module
programming support for Apache, are there any implementations of PHP in
programming Apache modules?

Thanks
- Jeremy

--- End Message ---
--- Begin Message ---
Hi all...
I have the problem:

<?php
      $w = 100;
      $h = 100;
      $im = imagecreatetruecolor($w, $h);
      $color = imagecolorallocatealpha($im, 230, 200,200,90);
      imagefilledrectangle($im, 0,0,$w-1, $h-1, $color);
      imagesavealpha($im, TRUE);
      imagepng($im,"test.png");
?>

As a result i get an image but without transparency.
What's the matter?

--- End Message ---
--- Begin Message --- Robert Cummings wrote:

On Fri, 2003-10-03 at 11:30, Raditha Dissanayake wrote:

Hi,

Please give it a shot, it's real easy. far easier than any of the lame php template systems i have seen. The beauty is that the same XML/XSL combo can be used with PHP, perl, JSP/Servlets, C++, VC++,VB,C,C# and the list goes on and on.

Disclaimer: I have never written a single line of VB ,VC++ or C# code and don't intend to do so in the future.


I have used XSLT before and can't say I particularly liked it. I have my
own "lame" (as you put it ;) php templating system which I prefer much
more. Mind you, in all honesty, XSLT support can be plugged into my
templating engine if I wanted without any adaptation to the engine
itself.

Bloody hell Rob, you've started me on another rant when I could be in bed ;)

XSLT is a pain in the butt if you want to master it - particularly if you're going from imperative programming to declarative (maybe XPath is functional, but declaring templates is definately declarative) as many PHP developers would be. It took me a good twelve months to "get it" (eg. use XPath filters and not <xsl:if/>). That didn't stop me from churning out some production applications using XSLT. You can learn the basics without mastering it and still find it plenty useful. I would argue that my XSLT skills still leave a lot to be desired, but mastery of it is still worthwhile persuing. Quite simply, XSLT has a lot of depth.

I also develop in Java and C# where I can re-use all my "template" knowledge since this knowledge is based on a standard. I plan on having a play with building web apps in C++ and Python if I get the chance (by porting the XAO concept). For the time being, it happens that I am more skilled with PHP so I will develop the XAO architecture and concept in PHP.

It's pointless splitting hairs over the capabilities/advantages of one templating language over another. If the idea of cross-technology compatability doesn't appeal to you enough to put the effort in to master XSLT, then don't master it. Everyone has their own style. XAO is for object oriented developers of XML-centric applications. I imagine it won't be everyone's cup of tea even for such a group.

<<warning: very personal opinion to follow...>>
If you *do* finally decide to master XSLT, you have to conclude that *any* other templating system is a complete/utter waste of time. (all authors of ``yet another PHP templating system'', please try not to be offended). I'm not talking about features/functionality either (for which XSLT is more than adequate), I'm talking about sheer bothersomeness. ie. I'm fundamentally lazy and I couldn't be bothered learning "snazzy g.o.a.t. [proprietary] templaty goodness system" -- "crappy" or otherwise -- I don't care how fantastic it is. The reason why the PHP template has been re-invented so many times, is becuase there is something missing - IMHO, XSLT fits that gap more than "good enough". And since it is a standard, it will only get better -- it has a future. And that, my friends, it good enough for me (being that I am lazy and all).


As it happens, XAO supports custom tags, but a savvy user will realise that using custom tags to expand into display logic is just downright stupid - it missing the point. Still, the facility is there to allow expansion of business logic. It seems to have CMS potential - I may be using it in the future "form controls" feature -- or I may decide it's crap and ignore it alltoegether :D The savvy user will always process the business payload with XSLT - hence maintaining pure separation of display logic.

<<note-to-self: stop ranting and go to bed...>>
--- End Message ---
--- Begin Message --- Robert Cummings wrote:

On Fri, 2003-10-03 at 11:30, Raditha Dissanayake wrote:

Hi,

Please give it a shot, it's real easy. far easier than any of the lame php template systems i have seen. The beauty is that the same XML/XSL combo can be used with PHP, perl, JSP/Servlets, C++, VC++,VB,C,C# and the list goes on and on.

Disclaimer: I have never written a single line of VB ,VC++ or C# code and don't intend to do so in the future.


I have used XSLT before and can't say I particularly liked it. I have my
own "lame" (as you put it ;) php templating system which I prefer much
more. Mind you, in all honesty, XSLT support can be plugged into my
templating engine if I wanted without any adaptation to the engine
itself.

Bloody hell Rob, you've started me on another rant when I could be in bed ;)

XSLT is a pain in the butt if you want to master it - particularly if you're going from imperative programming to declarative (maybe XPath is functional, but declaring templates is definately declarative) as many PHP developers would be. It took me a good twelve months to "get it" (eg. use XPath filters and not <xsl:if/>). That didn't stop me from churning out some production applications using XSLT. You can learn the basics without mastering it and still find it plenty useful. I would argue that my XSLT skills still leave a lot to be desired, but mastery of it is still worthwhile persuing. Quite simply, XSLT has a lot of depth.

I also develop in Java and C# where I can re-use all my "template" knowledge since this knowledge is based on a standard. I plan on having a play with building web apps in C++ and Python if I get the chance (by porting the XAO concept). For the time being, it happens that I am more skilled with PHP so I will develop the XAO architecture and concept in PHP.

It's pointless splitting hairs over the capabilities/advantages of one templating language over another. If the idea of cross-technology compatability doesn't appeal to you enough to put the effort in to master XSLT, then don't master it. Everyone has their own style. XAO is for object oriented developers of XML-centric applications. I imagine it won't be everyone's cup of tea even for such a group.

<<warning: very personal opinion to follow...>>
If you *do* finally decide to master XSLT, you have to conclude that *any* other templating system is a complete/utter waste of time. (all authors of ``yet another PHP templating system'', please try not to be offended). I'm not talking about features/functionality either (for which XSLT is more than adequate), I'm talking about sheer bothersomeness. ie. I'm fundamentally lazy and I couldn't be bothered learning "snazzy g.o.a.t. [proprietary] templaty goodness system" -- "crappy" or otherwise -- I don't care how fantastic it is. The reason why the PHP template has been re-invented so many times, is becuase there is something missing - IMHO, XSLT fits that gap more than "good enough". And since it is a standard, it will only get better -- it has a future. And that, my friends, it good enough for me (being that I am lazy and all).


As it happens, XAO supports custom tags, but a savvy user will realise that using custom tags to expand into display logic is just downright stupid - it missing the point. Still, the facility is there to allow expansion of business logic. It seems to have CMS potential - I may be using it in the future "form controls" feature -- or I may decide it's crap and ignore it alltoegether :D The savvy user will always process the business payload with XSLT - hence maintaining pure separation of display logic.

<<note-to-self: stop ranting and go to bed...>>
--- End Message ---
--- Begin Message --- Hi Terrence
The only thing that disagree with in your whole post is 'XSLT is a pain in the butt' far from it. I aint no master either but i really like it.



XSLT is a pain in the butt if you want to master it - particularly if you're going from imperative programming to declarative (maybe XPath is functional, but declaring templates is definately declarative) as many PHP developers would be. It took me a good twelve months to "get it" (eg. use XPath filters and not <xsl:if/>). That didn't stop me from churning out some production applications using XSLT. You can learn the basics without mastering it and still find it plenty useful. I would argue that my XSLT skills still leave a lot to be desired, but mastery of it is still worthwhile persuing. Quite simply, XSLT has a lot of depth.


--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/          |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.

--- End Message ---
--- Begin Message ---
On Sat, 2003-10-04 at 08:18, Terence wrote:
> 
> Bloody hell Rob, you've started me on another rant when I could be in bed ;)
> 

*grin* glad to help out.

> XSLT is a pain in the butt if you want to master it - particularly if 
> you're going from imperative programming to declarative (maybe XPath is 
> functional, but declaring templates is definately declarative) as many 

My understanding, which could very well be incorrect, is that
declarative and functional are synonymous and imperative and procedural
are synonymous. Most of the literature I've read describes XSL as a
functional language, and while XSL is not necessarily XSLT, it is most
definitely a part.

> PHP developers would be. It took me a good twelve months to "get it" 
> (eg. use XPath filters and not <xsl:if/>). That didn't stop me from 
> churning out some production applications using XSLT. You can learn the 
> basics without mastering it and still find it plenty useful. I would 
> argue that my XSLT skills still leave a lot to be desired, but mastery 
> of it is still worthwhile persuing. Quite simply, XSLT has a lot of depth.
> 
> I also develop in Java and C# where I can re-use all my "template" 
> knowledge since this knowledge is based on a standard. I plan on having 
> a play with building web apps in C++ and Python if I get the chance (by 
> porting the XAO concept). For the time being, it happens that I am more 
> skilled with PHP so I will develop the XAO architecture and concept in PHP.
> 
> It's pointless splitting hairs over the capabilities/advantages of one 
> templating language over another. If the idea of cross-technology 
> compatability doesn't appeal to you enough to put the effort in to 
> master XSLT, then don't master it. Everyone has their own style. XAO is 
> for object oriented developers of XML-centric applications. I imagine it 
> won't be everyone's cup of tea even for such a group.

Its the same reason I never bothered to master LISP. It isn't my cup of
tea, generally it isn't most people's cup of tea :) But in all honesty
when a project insists I use XSL(T) then I do.

> 
> <<warning: very personal opinion to follow...>>
> If you *do* finally decide to master XSLT, you have to conclude that 
> *any* other templating system is a complete/utter waste of time. (all 

While this is a "very personal opinion" you state for others that "you
have to conclude that ..." which changes the opinion from personal to a
foredrawn conclusion of ubiquity.

> authors of ``yet another PHP templating system'', please try not to be 
> offended). I'm not talking about features/functionality either (for 
> which XSLT is more than adequate), I'm talking about sheer 
> bothersomeness. ie. I'm fundamentally lazy and I couldn't be bothered 
> learning "snazzy g.o.a.t. [proprietary] templaty goodness system" -- 
> "crappy" or otherwise -- I don't care how fantastic it is. The reason 
> why the PHP template has been re-invented so many times, is becuase 
> there is something missing - IMHO, XSLT fits that gap more than "good 
> enough". And since it is a standard, it will only get better -- it has a 
> future. And that, my friends, it good enough for me (being that I am 
> lazy and all).

This doesn't really affect me personally. My templating system is open
source, I made it and released it without the intent of making money.
While it has a business license it is only because if someone *is* going
to profit from it, then consideration should trickle back to the
developer. Without being argumentative, but rather to be descriptive,
the reason I made my own templating system was because it satisfied my
needs long ago (at which time I already had been exposed to XSLT) and by
creating hooks to custom tags in PHP itself it lent itself to re-use
much of the code I had already developed in PHP for one reason or
another. Another reason is that by not crossing technologies too many
times, it becomes much more reachable to the average "Joe" who may not
have a clue about XSL, XSLT, or even the dependencies necessary to have
it running in PHP (PHP didn't always bundle this technology from what I
recall). Thus if Joe already knows PHP, what better way from him to at
least jump into the foray of separating design from business logic with
a minimal amount of effort. It took you 12 months to master XSL, some
people don't have that luxury of time.

> As it happens, XAO supports custom tags, but a savvy user will realise 
> that using custom tags to expand into display logic is just downright 
> stupid - it missing the point. Still, the facility is there to allow 
> expansion of business logic. It seems to have CMS potential - I may be 

Custom tags are not always used to expand business logic to display
logic. Sometimes they are used to bundle multi tag display logic into
neat little single tag display logic.

> using it in the future "form controls" feature --  or I may decide it's 
> crap and ignore it alltoegether :D The savvy user will always process 
> the business payload with XSLT - hence maintaining pure separation of 
> display logic.

IMHO the savvy user will do what is best for the task at hand. And while
XSLT is powerful, sometimes it's not the man for the job. Just like Java
is more powerful than PHP in many respects, it's not the right man for
the job in much of what we do.

Anyways I hope this isn't perceived as a flame or anything other than
just a differing of opinions.

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 ---
I got PHP Notice: Undefined variable

Should I define always any var ?? when do I have do define a var??

example if I want to write
<?php
if ($_POST['msg'] =='hi')
{
do something ...
}
?>

--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Nabil:
> I got PHP Notice: Undefined variable
>
> Should I define always any var ?? when do I have do define a var??
>
> example if I want to write
> <?php
> if ($_POST['msg'] =='hi')
> {
> do something ...
> }

<?php
if (!isset($_POST['msg'])) die("No message!");
if ($_POST['msg'] == 'hi')
{
// do something
}
?>

--- End Message ---
--- Begin Message ---
I recommend the next variant
 if ($_POST["msg"] =="hi")

Why?

I've created an html file with form's action parameter as info.php that
contains phpinfo().
The result was

      PHP_SELF  /~adolf/info.php
      _POST["a"] dv fdsvz
      _SERVER["CONTENT_LENGTH"] 10


You see, _POST["a"]


----- Original Message ----- 
From: "nabil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 04, 2003 3:45 PM
Subject: [PHP] PHP Notice: Undefined variable


> I got PHP Notice: Undefined variable
>
> Should I define always any var ?? when do I have do define a var??
>
> example if I want to write
> <?php
> if ($_POST['msg'] =='hi')
> {
> do something ...
> }
> ?>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Simply lower your error reporting level. If you do not have access to your
php.ini (not everyone does), then can you can amend this directive in either
.htaccess or even on a per script basis by using the error_reporting()
function like so.

error_reporting(2039);

(Equivalent to E_ALL & ~E_NOTICE)

-- 
Jon Kriek
http://phpfreaks.com

--- End Message ---
--- Begin Message --- Andrew Chernyack wrote:
I recommend the next variant
 if ($_POST["msg"] =="hi")

Why?

I've created an html file with form's action parameter as info.php that
contains phpinfo().
The result was

      PHP_SELF  /~adolf/info.php
      _POST["a"] dv fdsvz
      _SERVER["CONTENT_LENGTH"] 10


You see, _POST["a"]

That does not matter, both 'a' and "a" are strings. This solves it: if(isset($_POST['msg']) && $_POST['msg']=='hi') { // do something }

--- End Message ---
--- Begin Message ---
Hey,
Anybody have any code or links to explain how to make a program like the one
running on hotscripts?
eg:
when you visit there you have a couple of categories like : ASP, JAVA, PHP
etc
(if you select php)
PHP
--Scripts
--Books
--tutorials
(if you select scripts)
--Scripts
----category1(324)
----category2(24)
----category3(54)
etc

the number in brackets at the side of the category says how many records....

I downloaded PHPlinks but have been unable to understand it.
Another good place that i visited was
http://www.hotscripts.com/PHP/Scripts_and_Programs/Software_Repository/index.html
and even searched on google but cant find much.

Any help appreciated.

Thanks,
-Ryan

--- End Message ---
--- Begin Message ---
Are you looking to make a new HotScripts style website or just a similar menu system?
  ----- Original Message ----- 
  From: Ryan A 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, October 04, 2003 9:28 AM
  Subject: [PHP] hotscripts style program


  Hey,
  Anybody have any code or links to explain how to make a program like the one
  running on hotscripts?
  eg:
  when you visit there you have a couple of categories like : ASP, JAVA, PHP
  etc
  (if you select php)
  PHP
  --Scripts
  --Books
  --tutorials
  (if you select scripts)
  --Scripts
  ----category1(324)
  ----category2(24)
  ----category3(54)
  etc

  the number in brackets at the side of the category says how many records....

  I downloaded PHPlinks but have been unable to understand it.
  Another good place that i visited was
  http://www.hotscripts.com/PHP/Scripts_and_Programs/Software_Repository/index.html
  and even searched on google but cant find much.

  Any help appreciated.

  Thanks,
  -Ryan

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


--- End Message ---
--- Begin Message --- You need to create a recursive function:

// pseudo code
function count_content($cat_id) {
        SELECT COUNT(*) FROM content WHERE cat_id='$cat_id'
        $count=sql_result();
        SELECT cat_id FROM categories WHERE cat_id='$cat_id'
        while($cat_id2 = sql_result()) {
                $count += count_content($cat_id2);
        }
        return $count;
}

Ryan A wrote:
Hey,
Anybody have any code or links to explain how to make a program like the one
running on hotscripts?
eg:
when you visit there you have a couple of categories like : ASP, JAVA, PHP
etc
(if you select php)
PHP
--Scripts
--Books
--tutorials
(if you select scripts)
--Scripts
----category1(324)
----category2(24)
----category3(54)
etc

the number in brackets at the side of the category says how many records....

I downloaded PHPlinks but have been unable to understand it.
Another good place that i visited was
http://www.hotscripts.com/PHP/Scripts_and_Programs/Software_Repository/index.html
and even searched on google but cant find much.

Any help appreciated.

Thanks,
-Ryan


--- End Message ---
--- Begin Message ---
Hey,

I want to make a resources section where a company (eg: programmer/
webdesigners/ graphic artists) etc simple fill in a form with a little
description of themselves and their website link, i then either approve or
delete their post.
If approved they should be added under that category and users can come and
browse etc to the category they want.

So to answer your question, i guess just a similar menu system.

Any ideas?

Thanks,
-Ryan



>Are you looking to make a new HotScripts style website or just a similar
menu system?


  ----- Original Message ----- 
  From: Ryan A
  To: [EMAIL PROTECTED]
  Sent: Saturday, October 04, 2003 9:28 AM
  Subject: [PHP] hotscripts style program


  Hey,
  Anybody have any code or links to explain how to make a program like the
one
  running on hotscripts?
  eg:
  when you visit there you have a couple of categories like : ASP, JAVA, PHP
  etc
  (if you select php)
  PHP
  --Scripts
  --Books
  --tutorials
  (if you select scripts)
  --Scripts
  ----category1(324)
  ----category2(24)
  ----category3(54)
  etc

  the number in brackets at the side of the category says how many
records....

  I downloaded PHPlinks but have been unable to understand it.
  Another good place that i visited was

http://www.hotscripts.com/PHP/Scripts_and_Programs/Software_Repository/index.html
  and even searched on google but cant find much.

  Any help appreciated.

  Thanks,
  -Ryan

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

--- End Message ---

Reply via email to