OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 1 Aug 2003 11:15:03 -0000 Issue 2210

php-general-digest-helplists.php.net
Date: Fri Aug 01 2003 - 06:15:03 CDT


php-general Digest 1 Aug 2003 11:15:03 -0000 Issue 2210

Topics (messages 157841 through 157917):

Re: Cookies on WinXP
        157841 by: Jeff Harris
        157842 by: Chris Shiflett
        157843 by: Steve Buehler
        157844 by: Steve Buehler
        157845 by: Chris Shiflett
        157846 by: Chris Shiflett
        157852 by: Curt Zirzow

headline news retriever
        157847 by: andu
        157869 by: David Otton

is there a way?
        157848 by: karl james
        157850 by: Jennifer Goodie

Re: include help please
        157849 by: Curt Zirzow
        157894 by: LoonySalmon
        157909 by: Ford, Mike [LSS]

Re: Possible My Website was hacked... with PHP... please tell me what this is???
        157851 by: Tom Rogers

Re: System() works on /usr/sbin commands
        157853 by: Daevid Vincent

Is there an easier way?
        157854 by: Ryan A
        157856 by: Jennifer Goodie
        157857 by: David Nicholson
        157879 by: Joona Kulmala

splitting content from database into pages again
        157855 by: daniel.electroteque.org
        157858 by: daniel.electroteque.org
        157859 by: daniel.electroteque.org

Re: Page Break
        157860 by: hu zhenghui

Re: Yet another socket question...
        157861 by: Jason Wong

Re: jabber - chmod on files
        157862 by: Jason Wong
        157891 by: desa15.necso.es

Re: PHP or CGI in C/C++
        157863 by: Joel Rees
        157884 by: Decapode Azur
        157886 by: John Manko
        157892 by: desa15.necso.es

Re: Opinions on Micro$oft .NET
        157864 by: Wendell Brown
        157874 by: Nka
        157876 by: John Manko
        157881 by: Joel Rees
        157912 by: Adrian Teasdale

What is $$
        157865 by: Ryan A
        157866 by: Paul Marinas
        157867 by: Jason Wong

Re: Using $PHP_SELF
        157868 by: David Otton

Re: session header issue
        157870 by: Ow Mun Heng

Re: tags to lowercase
        157871 by: Justin French
        157873 by: Justin French

Upload scripts timing out
        157872 by: Josh Abernathy
        157878 by: Evan Nemerson

Re: value submit button
        157875 by: hu zhenghui
        157877 by: Justin French

Re: Mysql query and PHP loops
        157880 by: Nicholas Robinson
        157893 by: Nicholas Robinson

Please Help
        157882 by: Sathiyabama
        157883 by: John Manko
        157887 by: Joona Kulmala
        157890 by: Joseph Blythe

eval
        157885 by: Decapode Azur
        157888 by: Adrian
        157889 by: Joona Kulmala
        157911 by: Bogdan Stancescu

Re: load the PHP script last on the page
        157895 by: Sek-Mun Wong

Re: learning php - problem already
        157896 by: Ford, Mike [LSS]

Display question
        157897 by: John T. Beresford
        157913 by: messju mohr

Redirect to HTTPS
        157898 by: desa15.necso.es
        157900 by: Richard Baskett
        157910 by: Nicholas Robinson

howto set variablevalue with link?
        157899 by: Kalle Saarinen
        157901 by: Craig Roberts
        157902 by: Richard Baskett
        157905 by: Kalle Saarinen

COUNT(*)
        157903 by: Yury B.
        157904 by: Craig Roberts
        157907 by: Richard Baskett

Multiple targets with fscanf
        157906 by: Denis 'Alpheus' Cahuk

Re: Deleteing one session
        157908 by: Ford, Mike [LSS]

reading variables in other script files
        157914 by: Kalle Saarinen
        157915 by: Craig Roberts

force load of ldap.conf
        157916 by: Turbo Fredriksson

Search Engine
        157917 by: imran

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On Jul 31, 2003, "Steve Buehler" claimed that:

|I still can't figure something out. I am using WinXP/Apache 1.3.24/PHP
|4.2.3 on my laptop and my cookies still don't work like they
|should. Hopefully someone can explain to me why.
|<?
|$cookhost=$_SERVER["HTTP_HOST"];
|header("Set-Cookie: aa_host=$cookhost;");
|setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
|setcookie ("aa_host", "localhost",0,"/","localhost");
|setcookie ('aa_host', 'localhost',0,'/','localhost');
|?>
|
|I can set the cookie with the "header" line with no problem, but either one
|of the "setcookie" lines will not set the cookie. Has anybody seen
|this? Does anybody know why this might be happening? BTW, no, I do not
|try to set all of these at once. Just showing the lines that I use. The
|"header" line and the first two "setcookie" lines work just fine on a
|RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.
|
|Thanks
|Steve

1st, what is the difference between what you are expecting and what you
are getting?

2nd, you do realize that since you're setting the cookies to have an
expiration of 0, that will delete the cookies when the brower is closed.

3rd, you know that you can't pick up the cookies in the same page where
they are set.

try letting some defaults persist to track downm errors:
setcookie ("aa_host", $cookhost,time()+3600);

Jeff
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.

attached mail follows:


--- Steve Buehler <steveibapp.com> wrote:
> $cookhost=$_SERVER["HTTP_HOST"];
> header("Set-Cookie: aa_host=$cookhost;");
> setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
> setcookie ("aa_host", "localhost",0,"/","localhost");
> setcookie ('aa_host', 'localhost',0,'/','localhost');
...
> I can set the cookie with the "header" line with no problem,
> but either one of the "setcookie" lines will not set the cookie.

Hi Steve,

You're not specifying a hostname in your header() example, but you are in each
of the setcookie() examples (and randomly switching between using $cookhost as
a value or as a hostname).

My advice is to check out http://www.php.net/setcookie and paying close
attention to:

1. The order of the parameters
2. The fact that they are not all required

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


hmmmm. Just found out what was wrong. These are the specs that php.net
says a setcookie function can have:
setcookie ( string name [, string value [, int expire [, string path [,
string domain [, int secure]]]]])
Well, if I take off the "string domain" part, it will work just fine. The
problem is that I can't use the "int secure". No biggy right now, but I
might want to do that in the future. So the following works just fine now:
setcookie("aa_host",$cookhost,'0','/');
Can anybody explain this now? BTW, I put on an actual domain name to my
laptop and put that domain name in the "string domain" parameter and it
still didn't work.

Steve

At 05:53 PM 7/31/2003 -0500, Steve Buehler wrote:
>I still can't figure something out. I am using WinXP/Apache 1.3.24/PHP
>4.2.3 on my laptop and my cookies still don't work like they
>should. Hopefully someone can explain to me why.
><?
>$cookhost=$_SERVER["HTTP_HOST"];
>header("Set-Cookie: aa_host=$cookhost;");
>setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
>setcookie ("aa_host", "localhost",0,"/","localhost");
>setcookie ('aa_host', 'localhost',0,'/','localhost');
>?>
>
>I can set the cookie with the "header" line with no problem, but either
>one of the "setcookie" lines will not set the cookie. Has anybody seen
>this? Does anybody know why this might be happening? BTW, no, I do not
>try to set all of these at once. Just showing the lines that I use. The
>"header" line and the first two "setcookie" lines work just fine on a
>RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.
>
>Thanks
>Steve

attached mail follows:


Something else I found out now. I think it was Cpt John W. Holmes (not
sure though) that said I couldn't have a cookie as an array like this the
following. So i am not sure if it is something that is going away or not.
setcookie ("admin_access[host]", "$cookhost",0,"/","$cookhost");
setcookie ("admin_access[hostName]", "$hostName",0,"/","$cookhost");

But I found the following on the php site at:
http://us3.php.net/manual/en/function.setcookie.php

-----snip---------
    * Cookies names can be set as array names and will be available to your
PHP scripts as arrays but seperate cookies are stored on the users system.
Consider <http://us3.php.net/manual/en/function.explode.php>explode() or
<http://us3.php.net/manual/en/function.serialize.php>serialize() to set one
cookie with multiple names and values.

<?php
// set the cookies
setcookie ("cookie[three]", "cookiethree");
setcookie ("cookie[two]", "cookietwo");
setcookie ("cookie[one]", "cookieone");

// after the page reloads, print them out
if (isset($_COOKIE['cookie'])) {
     foreach ($_COOKIE['cookie'] as $name => $value) {
         echo "$name : $value <br />\n";
     }
}

/* which prints

three : cookiethree
two : cookietwo
one : cookieone

*/
?>
---------end snip--------

I want to thank everybody for your help.

Thanks
Steve

attached mail follows:


--- Steve Buehler <steveibapp.com> wrote:
> Well, if I take off the "string domain" part, it will work just
> fine.

This is what I was trying to explain. The cookie wasn't being returned, because
the browser didn't think the hostname matched. By leaving it out, the browser
will use whatever it thinks the current hostname is, so it's sure to match.

You're also right about the order of setcookie() - the parameters are optional,
but since they are based on order, you can't selectively leave any out except
in between.

If you want to be able to specify whatever cookie restrictions you want, you
can always use header(). Both functions modify the HTTP headers; the only
difference with manually writing your own is that you could screw up the
formatting. My opinion on that is that you could screw up the formatting of the
values of setcookie() anyway, so it doesn't necessarily save you. :-) In short,
use header() if you require the flexibility, and use setcookie() if you want a
bit of help and abstraction.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


--- Steve Buehler <steveibapp.com> wrote:
> Something else I found out now. I think it was Cpt John W. Holmes
> (not sure though) that said I couldn't have a cookie as an array
> like this the following. So i am not sure if it is something that
> is going away or not.
> setcookie ("admin_access[host]", "$cookhost",0,"/","$cookhost");
> setcookie ("admin_access[hostName]", "$hostName",0,"/","$cookhost");

No, this is fine, as I mentioned previously. Yes, I recall someone saying you
could not do this, claiming the name was invalid by referencing 2109, but I
thought I replied and corrected them. My apologies if I failed to do so.

Actually, I just searched and found the link:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=20030730231223.3962.qmail%40web14303.mail.yahoo.com

I may write up a detailed explanation of cookies sometime, since they are a
somewhat confusing topic (especially with the odd use of words we use, such as
setting a cookie). Since they are essentially an extension of the HTTP
protocol, it helps to understand the architecture of the Web a bit more to
really grok the subject

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


* Thus wrote Chris Shiflett (shiflettphp.net):
> --- Steve Buehler <steveibapp.com> wrote:
> > Something else I found out now. I think it was Cpt John W. Holmes
> > (not sure though) that said I couldn't have a cookie as an array
> > like this the following. So i am not sure if it is something that
> > is going away or not.
> > setcookie ("admin_access[host]", "$cookhost",0,"/","$cookhost");
> > setcookie ("admin_access[hostName]", "$hostName",0,"/","$cookhost");
>
> No, this is fine, as I mentioned previously. Yes, I recall someone saying you
> could not do this, claiming the name was invalid by referencing 2109, but I
> thought I replied and corrected them. My apologies if I failed to do so.

I was the one stating rfc2109, and only suggesting that might be
the problem. And yes the reply did come through.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Does anyone know any headline news retrieving script/library specially
something able to check with several news sites? I'm planing to roll my own
but I want to see different approaches.

Andu

attached mail follows:


On Thu, 31 Jul 2003 20:26:25 -0400, you wrote:

>Does anyone know any headline news retrieving script/library specially
>something able to check with several news sites? I'm planing to roll my own
>but I want to see different approaches.

RSS.

The BBC (for example) have RSS feeds, and most journal sites offer them too.
See:

http://backend.userland.com/rss
http://directory.google.com/Top/Computers/Software/Internet/Site_Management/Content_Management/Content_Providers/

Competing formats (eg Echo) aren't so common, so unless you're planning to
interface with a specific provider RSS parsing offers maximum return for
minimum implementation effort.

attached mail follows:


Hello guys,
This may be off subject but not sure!

Is there a way to have your html table represent one color,
Cause when I click the link it turnes purple, and I want it to stay
336699
no matter what state.

I tried to use css, but it does the whole page.
And I want the 336699 to be in this table alone.

Can anyone help me out with this small problem?

Here is my site,
Im starting with the quick links.
If you can show me an example with that code..
At theufl.com

Any advise would be tremendous!
Thanks
karl
("The Saint")
karl.jamesverizon.net
theufl.com

attached mail follows:


> Is there a way to have your html table represent one color,
> Cause when I click the link it turnes purple, and I want it to stay
> 336699
> no matter what state.
>
> I tried to use css, but it does the whole page.
> And I want the 336699 to be in this table alone.
>
> Can anyone help me out with this small problem?

Create a class specifically for that table and it's links.

for example

.yourtable {font-family: Verdana, Arial, Helvetica, sans-serif;font-size:
8pt; color: #ffffff;}
A.yourtable:link { text-decoration: underline; font-weight: normal; color:
#336699;}
A.yourtable:visited { text-decoration: underline; font-weight: normal;
color: #336699;}
A.yourtable:hover { text-decoration: underline; font-weight: normal; color:
#336699;}
A.yourtable:active { text-decoration: underline; font-weight: normal; color:
#336699;}

attached mail follows:


* Thus wrote LoonySalmon (l33trushotmail.com):
>
> i want to call up my contact page, but how do i do it?
>
> http://localhost/index.php?page=$contact

I hope you cant use something like:
  http://localhost/index.php?page=%2Fetc%2Fpasswd

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


nope, it doesn't work. it'll only call up the variables that were specified
in my files.inc.php.......well so far at least

"Curt Zirzow" <curtzirzow.dyndns.org> wrote in message
news:20030801004744.GO21938bagend.shire...
> * Thus wrote LoonySalmon (l33trushotmail.com):
> >
> > i want to call up my contact page, but how do i do it?
> >
> > http://localhost/index.php?page=$contact
>
> I hope you cant use something like:
> http://localhost/index.php?page=%2Fetc%2Fpasswd
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


> -----Original Message-----
> From: Jennifer Goodie [mailto:goodieapollointeractive.com]
> Sent: 31 July 2003 22:42
>
> > if (isset($page)) {
> > include $$_GET['page'];
> > } else {
> > $page = $home;
> > include $page;
> > }
> >
> > would that be right?
> > or should i use
> >
> > if (isset($page)) {
> > include $$_GET['page'];
> > } else {
> > include $home;
> > }
> >
> > hopefully that's right. if so, pretty good for a n00b
> >
>
> I don't think I'd let someone pass any page they wanted via a
> get and just
> include that page.
>
> If you have URL fopen wrappers on I can create a page on my server and
> include it to your page and pretty much execute any code I
> want on your
> server.
>
> example:
>
> http://www.yourdomain.com?yourscript.php?page=http://mydomain.
com/myscript.p
hp

Take a closer look -- that's a double $$ in front of _GET['page'], not a single one -- that means he must have a variable defined with the name of whatever you put as the value of page=, and I think he's very unlikely to have a $http://mydomain.com/myscript.php...!!

But, you're right, there should be some error checking for invalid page values, just in case someone (or something!) should try this -- something like (not tested!):

   if (isset($_GET['page'])) {
      if (isset($$_GET['page']))
         include $$_GET['page'];
      else
         include('no_such_page.inc');
   } else {
      include $home;
   }

And, as a final BTW, I'd do this with an array:

   $pages = array('fred'=>'fred.php',
                  'barney'=>'barney.php',
                  'rubble'=>'quarry/mr_rubble.inc');

   ------

   if (isset($_GET['page'])) {
      if (isset($pages[$_GET['page']]))
         include $pages[$_GET['page']];
      else
         include('no_such_page.inc');
   } else {
      include $home;
   }

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Hi,

Thursday, July 31, 2003, 4:06:12 PM, you wrote:
JH> I found this on my server... I have no idea what it is... can someone
JH> tell me what it does...

if you use apache you can do this to protect against uploaded php
scripts

<LocationMatch "/uploads/">
        php_flag engine off
</LocationMatch>

--
regards,
Tom

attached mail follows:


Add an entry to /etc/sudoers like so:

        nobody ALL=NOPASSWD: /bin/date

Daevid Vincent
http://daevid.com
 

> -----Original Message-----
> From: Marek Kilimajer [mailto:kilimajerwebglobe.sk]
> Sent: Thursday, July 31, 2003 3:02 AM
> To: tirumal b
> Cc: php-generallists.php.net
> Subject: Re: [PHP] System() works on /usr/sbin commands
>
>
> Check out sudo (man sudo), but you must be carefull.
>
> tirumal b wrote:
>
> > hello,
> >
> > yes the /usr/sbin commands require root permissions
> > but is there any way to run these commands using
> > system() through suid or something.please let me know
> >
> > Thank you
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design software
> > http://sitebuilder.yahoo.com
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hi,
This is what i am doing, querying a database via a select statement (getting
max 5 records), then dumping everything into an associative array. And then
assign the arrays value to a variable for easier readibility and usability
like so:

if(!($rs = mysql_query($q))) // querying
  { echo "Query failed". mysql_error(); exit; }

   $n = 0;
  while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
    foreach ($line as $field => $value) {
      $data[$field][$n] = $value;
    }
    $n++;
  }

and this is how i use the arrays values (blah is the field name):
$blah1=$data['blah'][0];
$blah2=$data['blah'][1];
$blah3=$data['blah'][2];

The problem is I have 38 fields and i can get upto 5 records.... that means
i will end up with over 150 of these statements:
$blahn=$data['blah'][n];
and since i dont want to go all over my script saying "echo
$data['blah'][n];" is there an easier way to avoid the 150 possible
statements? maybe via a for loop or something? Am feeling braindead right
now after sitting on the comp for 7hrs straight.

Any and all suggestions welcome. When/If replying please give me a code
example of what you say as I may not understand you.

Thanks,
-Ryan

We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

attached mail follows:


> if(!($rs = mysql_query($q))) // querying
> { echo "Query failed". mysql_error(); exit; }
>
>
> $n = 0;
> while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
> foreach ($line as $field => $value) {
> $data[$field][$n] = $value;
> }
> $n++;
> }
>
> and this is how i use the arrays values (blah is the field name):
> $blah1=$data['blah'][0];
> $blah2=$data['blah'][1];
> $blah3=$data['blah'][2];

This should work. Try it and see.
    $n = 0;
   while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
     foreach ($line as $field => $value) {
             $tmp = $field.$n;
        $$tmp = $value;
        }
     $n++;
   }

attached mail follows:


Hello,

This is a reply to an e-mail that you wrote on Fri, 1 Aug 2003 at
02:04, lines prefixed by '>' were originally written by you.
> Hi,
> This is what i am doing, querying a database via a select
statement
> (getting
> max 5 records), then dumping everything into an associative array.
And
> then
> assign the arrays value to a variable for easier readibility and
> usability
> like so:
> if(!($rs = mysql_query($q))) // querying
> { echo "Query failed". mysql_error(); exit; }
> $n = 0;
> while ($line = mysql_fetch_assoc($rs)) { //dumping into an
array
> foreach ($line as $field => $value) {
> $data[$field][$n] = $value;
> }
> $n++;
> }
> and this is how i use the arrays values (blah is the field name):
> $blah1=$data['blah'][0];
> $blah2=$data['blah'][1];
> $blah3=$data['blah'][2];

The logic you are using is a bit messed up. You should be aiming to
get an array like...
$data[0]['field1']
        ['field2']
     [1]['field1']
        ['field2']
..and this can be done like this...
  $data = array();
  while ($line = mysql_fetch_assoc($rs)) {
      $data[] = $line;
  }

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

attached mail follows:


Ryan A wrote:
> The problem is I have 38 fields and i can get upto 5 records.... that means
> i will end up with over 150 of these statements:
> $blahn=$data['blah'][n];
> and since i dont want to go all over my script saying "echo
> $data['blah'][n];" is there an easier way to avoid the 150 possible
> statements? maybe via a for loop or something? Am feeling braindead right
> now after sitting on the comp for 7hrs straight.

PHP has function which makes normal variables of associative array.

http://fi2.php.net/manual/en/function.extract.php

With this just try something like this:

[code]

extract($data);

// then you can see what happened
var_dump($blah, $secondindex, $thirdindex); // try here few index names
// from $data.

[/code]

I hope this will help you.

Cheers, Joona
--
Joona Kulmala <joonafiveam.org>
PHP Finland

attached mail follows:


hi guys regarding my question yesterday here is exactly what i want to do

http://www.evilwalrus.com/articles.php?aid=42

this is obvioiusly splitting the content up when pull from the database

here is an example but is uses text files

http://www.evilwalrus.com/viewcode.php?codeEx=522

is there a way to stream the data from the database into an fopen ?

attached mail follows:


ok this seemed to work using the text paging example replace the file line
with this $afile = explode("\r\n", $string);
> hi guys regarding my question yesterday here is exactly what i want to
> do
>
> http://www.evilwalrus.com/articles.php?aid=42
>
> this is obvioiusly splitting the content up when pull from the database
>
> here is an example but is uses text files
>
> http://www.evilwalrus.com/viewcode.php?codeEx=522
>
> is there a way to stream the data from the database into an fopen ?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


function page_content($content,$limit = 10,$page) {
        $limit=20;

        $afile = explode("\r\n", $content);
        $maxline = count($afile); // count existing lines
        $max = $maxline - 1;
        $page ? $page = $page : $page = 1;
        $s=$page+$limit;
        for ($i=$page; $i<$s; $i++) {
           $dtrow = explode("|", $afile[$i]);
           $row = "$dtrow[0]";
           $formatted_content .= $row."\n";
        }

        $p = 1;
        $u = ceil($max/$limit);
        for ($t=1; $t<=$u; $t++) {
               $formatted_content .= "<a href=\"$PHP_SELF?
page=$p\">$t</a> ";
                $p=$p+$limit;
        }
        return $formatted_content;
}

attached mail follows:


in ie the code below will work:
<br style='page-break-before:always'>

--
----------------------------------------------------------------------------
Hu Zhenghui
IBM Certified Solutions Expert IBM WebSphere Studio
<New Intranet Series - Intranet DIY> ISBN 7-5606-1163-X
<Flash MX Tutorial for Training> ISBN 7-900107-51-7
mailto:webmasterhuzhenghui.51.net
http://huzhenghui.51.net
----------------------------------------------------------------------------
"Php" <tabarryemail.com> дÈëÏûÏ¢ news:8heb1f$75u$1cvs.php.net...
> Hello There!
>
> I am taking a report output in a .php3 page. Now if the report is long and
I
> want to print the page from browser, the print comes on more than one
pages.
> I want to insert a page break in print after every 20 records. Is this
> possible? If yes how?
>
> Someone has said, use ASCII characters. But how?
>
> Thanks and regards!
>
>

attached mail follows:


On Friday 01 August 2003 05:43, René Fournier wrote:

[snip]

> I know, but I'm not talking about writing to the socket, just echoing
> to the local Server command line. I would expect the echo'd text to
> appear in the server terminal window as the script runs--but it only
> appears when the server terminates. Here's the code:

[snip]

Try setting this in php.ini:

  output_buffering = Off

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Your manuscript is both good and original, but the part that is good is not
original and the part that is original is not good.
                -- Samuel Johnson
*/

attached mail follows:


On Friday 01 August 2003 05:51, Carlos Castillo wrote:

[snip]

> How can I change the perm from the php page, so I change with chmod 644
> xxxx.xml before I open it....

You can't unless you're running your php as root.

> or how can I modify jabber so it doesn't
> change the perm of the files?

Ask on the Jabber list, or ask the Jabber author(s).

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Knocked, you weren't in.
                -- Opportunity
*/

attached mail follows:


To change the rights from a php script put the following lines

define('CHMOD_FILES', 0666);
//define('CHMOD_DIRS', 0777);

chmod(Your file name, CHMOD_FILES);

Un saludo, Danny

                                                                                                                                       
                      Carlos Castillo
                      <ccastilloimagine. Para: "'php-generallists.php.net'" <php-generallists.php.net>
                      com.co> cc:
                                               Asunto: [PHP] jabber - chmod on files
                      31/07/2003 23:51
                                                                                                                                       
                                                                                                                                       

HI,

I'm using jabber but I have one problem, I did an administrator webpage for
it, so I create the users for jabber in that page, when I create the user,
it creates a xml file with permission of 644 and the owner is apache, but
when I connect on the jabber or that user connects the xml file changes to
600 and the owner to root.

The problem is that I have to read that file after he connects but when I
try I don't have access, because the perm is on 600,

How can I change the perm from the php page, so I change with chmod 644
xxxx.xml before I open it....or how can I modify jabber so it doesn't
change the perm of the files?

Thanks!

Carlos A. Castillo.
Ingeniero de desarrollo
ccastilloimagine.com.co
____________________________________

Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia
____________________________________
- Soluciones web para Internet e Intranet

- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico
____________________________________

attached mail follows:


> Greetinx,

Greetinx to you to.

> I'm a newbie and wondering which PHP script or CGI in C/C++ generally can
> run/respond faster via http from the same server doing the same tasks.

CGI is inherently slow. The way I understand it, php as CGI will
probably be pretty much the same speed as C/C++ as CGI. PHP with mod_php
should be faster than C/C++ as CGI.

Compiling a server module is a complicated business, so you would
probably want to avoid trying to compile a C/C++ webapp as a server
module unless you have lots of experience (and I doubt you would be
asking this question if you have that much experience.

A book you might find useful in this context is Chris Radcliff's Perl
for the Web. (Perl is one of PHP's grandpappies, so much of the
discussion will apply to PHP.)

> I appreciate your comments in advance.

I made no comments in advance, but you're welcome anyway. ;-P

--
Joel Rees, programmer, Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp

attached mail follows:


> I would expect compiled C/C++ to be faster as there is no need for
> the code to be interperated and compiled on each request.

Is it possible to compile PHP to improve the speed execution ?

attached mail follows:


i did a quick google, and found the following. hope it helps

http://phpcomplete.com/articles.php?sec=readArticle&id=306
http://www.php-accelerator.co.uk

plus, there is something called PHP bcompiler (byte compiler).

I dont know the details of any of these, but should help. maybe others
can expand on the details.

- John Manko

Decapode Azur wrote:

>>I would expect compiled C/C++ to be faster as there is no need for
>>the code to be interperated and compiled on each request.
>>
>>
>
>
>Is it possible to compile PHP to improve the speed execution ?
>
>
>
>
>

attached mail follows:


You can install Zend Optimizer from www.zend.com is free but with comercial
license.

Perform some optimizations in your code to not compile the same code in
each request.

Un saludo, Danny

                                                                                                                                       
                      John Manko
                      <xeridadelphia.net Para: Decapode Azur <blue_prawntuxfamily.org>
> cc: php-generallists.php.net
                                               Asunto: Re: [PHP] PHP or CGI in C/C++
                      01/08/2003 08:45
                                                                                                                                       
                                                                                                                                       

i did a quick google, and found the following. hope it helps

http://phpcomplete.com/articles.php?sec=readArticle&id=306
http://www.php-accelerator.co.uk

plus, there is something called PHP bcompiler (byte compiler).

I dont know the details of any of these, but should help. maybe others
can expand on the details.

- John Manko

Decapode Azur wrote:

>>I would expect compiled C/C++ to be faster as there is no need for
>>the code to be interperated and compiled on each request.
>>
>>
>
>
>Is it possible to compile PHP to improve the speed execution ?
>
>
>
>
>

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

attached mail follows:


On Thu, 31 Jul 2003 14:04:02 -0400, Dan Joseph wrote:

>Yeah, the framework does. The free editor is for web apps, the Visual
>Studio is for normal apps.

FYI, I just had Visual Studio ordered for me - a single license for it
with a 1 year subscription to MSDN was over $2800! I don't know yet
what the yearly cost is going to be. To be able to put the generated
code on the net is going to require a Microsoft web server. My
understanding is that there is supposed to be a seat on the license for
EVERY non-anonymous login that is provided users.

I've been looking (under duress) at moving from PHP to .net and have
played with Web Matrix (the free .net IDE). It now supports VB.net and
C#. Visual Studio supports those and more as well as allows for
Windows app development. I'm a pretty good PHP programmer, and things
I could knock out in a couple of hours seem to be WAY more difficult to
do in .Net.

For instance (and before anyone gripes that the following comparison is
unfair - I am not trying to do a comparison - merely offering a couple
of observations), I dragged a xml viewer component to the aspx work
area (this "generated" about 50 lines of code) and then pointed it at a
40 meg xml file..... about 15 minutes later I got an "Out Of Memory"
error on the asp page and no usable output. Using PHP, I opened a 100
meg xml file, read through the records checking each one using a perl
regular expression and it took it 21 seconds to return - no output (I
wanted it to just count the number of xml groups - >17,000 with 20-30
elements each). I'm probably going to see what happens tomorrow if I
try to load the entire 100 meg xml file into a PHP array --- I expect
it to "just work" and deal with the memory.

attached mail follows:


On Thu, 31 Jul 2003 12:35:55 -0500, you wrote:

>I know this is a little off topic but I really need some help with this.
>
>The company I work for just got bought out by a larger company. The larger company uses .NET from Micro$oft. I of course use all open source stuff for our web sites and now the new company wants to come in and pretty much blow away everything I have done and use their .NET setup.
>
>I've basically got a month to do research and get my guns loaded for what I'm sure will be a heated debate about the Open Source Solution vs the Micro$oft .NET solution. So what I am looking for is personal and professional opinions about both solutions (specifically PHP etc), any and all links to good articles about both solutions giving the pros and cons of both technologies. Any other mailing lists I can get on to get more opinions about the two technologies. Are their any links to show the cost benifits of using Open Source vs Micro$oft .NET? (I know Open Source is free but I have no clue where to find how much .NET is).

In my experience, software and hardware costs are nothing. A VS.NET license
costs, what... 2 billed days of programmer time? Maybe 3 or 4 days of web
monkey time. Either way, it's trivial compared to a 5% (and that's a very
conservative estimate) saving in development time over 3 or 4 years use of
the tool.

Having said that, you have to factor in retraining costs. If it takes six
months to get your old programmers up to speed, it's probably easier to
stick with what you know. But in this case... what they know is .NET and
you're the interloper.

If I was management in that situation, I would be looking to reduce costs by
jettisoning the second company's overheads (such as the IT dept), and you're
about to make a massive pain-in-the-ass of yourself because of some dumb
religious issues. Way to go.

If they offer you .NET training grab it with both hands, because it means
they want to keep you around and it makes you more marketable. Remember, if
they already have/can find a .NET developer who knows enough PHP to maintain
legacy code... why even bother to retrain you?

(BTW, if you try to argue PHP v. ASP.NET on technical grounds you're gonna
get steamrollered, IMO. Seriously, look to what's best for you (learning new
skills) and the company you work for (supporting one platform, not two) and
spend your time developing a migration path, not a diatribe).

attached mail follows:


  "You have to be deviant if you're going to do anything new."
        - David Lee

Nka wrote:

>On Thu, 31 Jul 2003 12:35:55 -0500, you wrote:
>
>
>
>>I know this is a little off topic but I really need some help with this.
>>
>>The company I work for just got bought out by a larger company. The larger company uses .NET from Micro$oft. I of course use all open source stuff for our web sites and now the new company wants to come in and pretty much blow away everything I have done and use their .NET setup.
>>
>>I've basically got a month to do research and get my guns loaded for what I'm sure will be a heated debate about the Open Source Solution vs the Micro$oft .NET solution. So what I am looking for is personal and professional opinions about both solutions (specifically PHP etc), any and all links to good articles about both solutions giving the pros and cons of both technologies. Any other mailing lists I can get on to get more opinions about the two technologies. Are their any links to show the cost benifits of using Open Source vs Micro$oft .NET? (I know Open Source is free but I have no clue where to find how much .NET is).
>>
>>
>
>In my experience, software and hardware costs are nothing. A VS.NET license
>costs, what... 2 billed days of programmer time? Maybe 3 or 4 days of web
>monkey time. Either way, it's trivial compared to a 5% (and that's a very
>conservative estimate) saving in development time over 3 or 4 years use of
>the tool.
>
>Having said that, you have to factor in retraining costs. If it takes six
>months to get your old programmers up to speed, it's probably easier to
>stick with what you know. But in this case... what they know is .NET and
>you're the interloper.
>
>If I was management in that situation, I would be looking to reduce costs by
>jettisoning the second company's overheads (such as the IT dept), and you're
>about to make a massive pain-in-the-ass of yourself because of some dumb
>religious issues. Way to go.
>
>If they offer you .NET training grab it with both hands, because it means
>they want to keep you around and it makes you more marketable. Remember, if
>they already have/can find a .NET developer who knows enough PHP to maintain
>legacy code... why even bother to retrain you?
>
>(BTW, if you try to argue PHP v. ASP.NET on technical grounds you're gonna
>get steamrollered, IMO. Seriously, look to what's best for you (learning new
>skills) and the company you work for (supporting one platform, not two) and
>spend your time developing a migration path, not a diatribe).
>
>
>
>

attached mail follows:


I hate to rain on this parade, but,

> I'm a pretty good PHP programmer, and things
> I could knock out in a couple of hours seem to be WAY more difficult to
> do in .Net.

This is the pith of the question. If you knew what you're doing,
anything from Microsoft takes longer to do than doing it the right way.

If you don't know what you're doing, M$ gets you most of the way there
for a cost.

Management has historically actually preferred that labor not know
anything.

Therefore, Microsoft is Business.

If management thinks that's okay and you think that's okay, jump into
bed with them.

If you don't like the deepening recession, run like hell, because if you
think about it, it's exactly that kind of business that sucks all the
value out of things. (And that's exactly what recession and depression
are all about.)

--
Joel Rees
(The above opinion probably does not reflect the opinions of my employer.)

attached mail follows:


I'd just like to say that I've found this discussion to be very interesting
and enlightning. It also makes a change to see people not "microsoft
bashing" but taking an objective view on everything. We keep getting more
and more requests to develop products for .net because our clients want
software which runs under windows, online or (more recently) for handheld
devices. So far we've concentrated on PHP for web development and Delphi for
application development, but I think that .net cannot be ignored.

Even though I didn't start the thread, I found it very useful to follow

Best

Ade

attached mail follows:


Hi,
I have just found this in my book: $$var = $value
what is the double dollar for? or is that a typo?
Thanks,
-Ryan

We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

attached mail follows:


http://www.php.net/manual/en/language.variables.variable.php

On Fri, 1 Aug 2003, Ryan A wrote:

> Hi,
> I have just found this in my book: $$var = $value
> what is the double dollar for? or is that a typo?
> Thanks,
> -Ryan
>
>
> We will slaughter you all! - The Iraqi (Dis)information ministers site
> http://MrSahaf.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Friday 01 August 2003 10:59, Ryan A wrote:

> I have just found this in my book: $$var = $value
> what is the double dollar for? or is that a typo?
> Thanks,

Search manual for variable variables (and no, that is not a typo).

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you can't be good, be careful. If you can't be careful, give me a call.
*/

attached mail follows:


On Thu, 31 Jul 2003 15:38:41 -0500, you wrote:

>I am having problems while transfering information to another page. I
>am using $PHP_SELF and I am getting errors here is a bit of code so you
>can see what I am saying:
>
>echo "<a href='$PHP_SELF?file=$file&dir=".$mydir."'>$file</a><BR>\n";
>
>This is what the browser is saying...
>Notice: Undefined variable: PHP_SELF in
>c:\inetpub\wwwroot\test\download.php on line 54
>
>I don't know what to do.

either

you have register_globals turned off and should use $_SERVER['PHP_SELF']

or

you are attempting to use $PHP_SELF within a function, without having
declared it global first.

        function test() {
                global $PHP_SELF;
                echo ($PHP_SELF);
        }

attached mail follows:


I changed it so that it's not an ABS URL. I had it working so.. I thought,
if it aint' broken, don't fix it...

Well, I fixed it anyway, who knows it might cause problems somewhere..

Thank All.

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168

-----Original Message-----
From: Sam Folk-Williams [mailto:sfolkwilliamsmn.rr.com]
Sent: Thursday, July 31, 2003 11:41 PM
To: php-generallists.php.net
Subject: Re: [PHP] session header issue

> That doesn't justify it. This is no different than writing screwed up HTML
> tables that happen to appear as you want in the browser you're testing
with.

GREAT point! Sorry, I didn't realize it was bad form. Just ignorant here --
I tried it with an absolule URL and it now works fine. Thanks for the help.

Sam

"Chris Shiflett" <shiflettphp.net> wrote in message
news:20030731151927.12356.qmailweb14309.mail.yahoo.com...
> --- Sam Folk-Williams <sfolkwilliamsmn.rr.com> wrote:
> > > The Location: header requires a correctly formed URL
> >
> > It works fine having Location: main.php
>
> That doesn't justify it. This is no different than writing screwed up HTML
> tables that happen to appear as you want in the browser you're testing
with.
> You never know when your broken code is going to cause problems somewhere,
and
> you've no one to blame but yourself when they do.
>
> It's much better for everyone just to do things the right way. The
Location
> header should be an absolute URL.
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/

attached mail follows:


Not really that useful -- essentially I want this as part of a CMS

On Thursday, July 31, 2003, at 11:55 AM, Jason Sheets wrote:

> Tidy is available for DOS as well, you could run it on your windows
> machine locally then upload the source to your host.
>
> Jason

attached mail follows:


Curt,

Thanks for the link -- have downloaded the code, and will do some
playing/testing later today -- sounds great!

Everyone else,

That tidy extension seems great, when I move into PHP 5 (a while off
I'd guess), and yes, it appears I can install tidy into my own web
space (even host said so, and offered to compile it too!), so that may
be the other option.

With any luck, I should be able to write some wrappers to "tidy" from
within a PHP script.

Thanks to everyone for their help,

Justin

On Thursday, July 31, 2003, at 12:41 PM, Curt Zirzow wrote:

> * Thus wrote Justin French (justinindent.com.au):
>> Sounds great, although I doubt my host will install... has anyone
>> considered such a beast running as a PHP function/class?
>
> Hey justin,
>
> well, i just got done toying around with a little function that can
> do almost all of what you want.
>
> With a little regex magic and the nice little function
> preg_replace_callback() I made it almost 100% combatible to html.
>
> It will choke on some badly formated attributes though, thats the
> only thing to get fixed.
>
> Here is the code and test:
> http://zirzow.dyndns.org/html/php/tests/tags_tolower/preg_replace.php

attached mail follows:


My current upload script times out too quickly when users are uploading
large files. How can I stop this from happening?

Thanks!

attached mail follows:


php.net/set-time-limit

On Thursday 31 July 2003 09:03 pm, Josh Abernathy wrote:
> My current upload script times out too quickly when users are uploading
> large files. How can I stop this from happening?
>
> Thanks!

attached mail follows:


You can get the button value use code below:

<?php echo $_POST[submit];?>
<form method="post">
<input type="submit" name="submit" value="submit1">
<input type="submit" name="submit" value="submit2">
</form>

--
----------------------------------------------------------------------------
Hu Zhenghui
IBM Certified Solutions Expert IBM WebSphere Studio
<New Intranet Series - Intranet DIY> ISBN 7-5606-1163-X
<Flash MX Tutorial for Training> ISBN 7-900107-51-7
mailto:webmasterhuzhenghui.51.net
http://huzhenghui.51.net
----------------------------------------------------------------------------
"Florian SchäFer" <florian.schaefertalknet.de> дÈëÏûÏ¢
news:8f3tei$6cs$1va.php.net...
> Hallo out there,
>
> i hava an document, with one form and two Submit buttons.
> How can i check in the target document wich button is pressed?
> tried something like if ($submit == 'xxx') .
> anyone has a hint?
>
>

attached mail follows:


Do some testing in a few browsers to see what happens when the user
hits "enter" or "return", rather than clicking on the button(s)... I
*think* you need to put in a hidden element. For example, if you
wanted "submit2" to be the default value:

<?=$_POST[submit]?>
<form method="post">
        <input type="hidden" name="submit" value="submit2" />
        <input type="submit" name="submit" value="submit1" />
        <input type="submit" name="submit" value="submit2" />
</form>

Justin

On Friday, August 1, 2003, at 02:36 PM, hu zhenghui wrote:

> You can get the button value use code below:
>
> <?php echo $_POST[submit];?>
> <form method="post">
> <input type="submit" name="submit" value="submit1">
> <input type="submit" name="submit" value="submit2">
> </form>

attached mail follows:


I think this does what you want. You can probably extend it to do the final
check for val3 vs. val2 ....

select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as t2
where t1.val2 <= t2.val2 group by t1.val1;

HTH

On Thursday 31 Jul 2003 3:22 pm, Petre Agenbag wrote:
> Hi List
>
> I've been trying to do something with one MySQL query, but I don't think
> it is possible, so, I would need to probably do multiple queries, and
> possibly have queries inside loops, but I am rather weary of that so,
> I'd like your views/possible solutions to doing the following:
>
>
> Consider this:
>
> id val1 val2 val3
> 1 a 1 1
> 2 b 2 3
> 3 a 1 2
> 4 b 2 1
> 5 c 3 3
> 6 c 2 1
>
> I need to query this table to return this:
>
> id val1 val2 val3
> 3 a 1 2
> 4 b 2 1
> 6 c 2 1
>
> Thus, I need to firstly only return ONE row for each val1, and that row
> MUST be that last row (ie, the row with the highest id, OR, should val3
> for instance be a date, then with the highest date).
>
>
> if I do a
>
> select distinct val1, MAX(id) from table order by val1, then it returns
>
> id val1
> 3 a
> 4 b
> 6 c
>
> which is correct, BUT
> select distinct val1, MAX(id), val2 from table order by val1
>
> it returns
>
> id val1 val2
> 3 a 1
> 4 b 2
> 6 c 3 <--- incorrect
>
> it then returns the FIRST "hit" for val2 in the db, and NOT the one in
> the row with the max id...
>
> Can I do this with one query? ( PS, I cannot use MAX on val2 or val3,
> they are text)
>
>
> Thanks

attached mail follows:


On further reflection, my first attempt works for the specific example but may
not in the general case. Try using a combination of max( ...id ) and min(
...val2 ) and add t1.val2 to the group by clause. This might work, but I've
deleted my test files now!

On Friday 01 Aug 2003 7:04 am, Nicholas Robinson wrote:
> I think this does what you want. You can probably extend it to do the final
> check for val3 vs. val2 ....
>
> select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as
> t2 where t1.val2 <= t2.val2 group by t1.val1;
>
> HTH
>
> On Thursday 31 Jul 2003 3:22 pm, Petre Agenbag wrote:
> > Hi List
> >
> > I've been trying to do something with one MySQL query, but I don't think
> > it is possible, so, I would need to probably do multiple queries, and
> > possibly have queries inside loops, but I am rather weary of that so,
> > I'd like your views/possible solutions to doing the following:
> >
> >
> > Consider this:
> >
> > id val1 val2 val3
> > 1 a 1 1
> > 2 b 2 3
> > 3 a 1 2
> > 4 b 2 1
> > 5 c 3 3
> > 6 c 2 1
> >
> > I need to query this table to return this:
> >
> > id val1 val2 val3
> > 3 a 1 2
> > 4 b 2 1
> > 6 c 2 1
> >
> > Thus, I need to firstly only return ONE row for each val1, and that row
> > MUST be that last row (ie, the row with the highest id, OR, should val3
> > for instance be a date, then with the highest date).
> >
> >
> > if I do a
> >
> > select distinct val1, MAX(id) from table order by val1, then it returns
> >
> > id val1
> > 3 a
> > 4 b
> > 6 c
> >
> > which is correct, BUT
> > select distinct val1, MAX(id), val2 from table order by val1
> >
> > it returns
> >
> > id val1 val2
> > 3 a 1
> > 4 b 2
> > 6 c 3 <--- incorrect
> >
> > it then returns the FIRST "hit" for val2 in the db, and NOT the one in
> > the row with the max id...
> >
> > Can I do this with one query? ( PS, I cannot use MAX on val2 or val3,
> > they are text)
> >
> >
> > Thanks

attached mail follows:


Dear PHP Team,

I request your help to sort some issues in using PHP.

1.Chennai IIT has developed one recorder.We can record our voice and
video.Its user defined extenion is MV4.

My requirement is

1.I want to send video file using mail() function in PHP.So how to send
it.What is the procedure?

2.How to delete one folder using PHP?

Please help me ...

Regards,
Sathiyabama

attached mail follows:


umm... ok.....

www.google.com
www.php.net

that should get you started.

Sathiyabama wrote:

>Dear PHP Team,
>
>I request your help to sort some issues in using PHP.
>
>1.Chennai IIT has developed one recorder.We can record our voice and
>video.Its user defined extenion is MV4.
>
>My requirement is
>
>1.I want to send video file using mail() function in PHP.So how to send
>it.What is the procedure?
>
>2.How to delete one folder using PHP?
>
>
>Please help me ...
>
>Regards,
>Sathiyabama
>
>
>
>
>
>
>
>
>

attached mail follows:


> My requirement is
 
> 1.I want to send video file using mail() function in PHP.So how to send
> it.What is the procedure?

http://fi2.php.net/manual/en/ref.mail.php

Check out the templates, there is described how to build mail headers with
attachments. PHPs own mail function doesn't support this by default, thought.

> 2.How to delete one folder using PHP?

http://fi2.php.net/manual/en/function.unlink.php
http://fi2.php.net/manual/en/function.rmdir.php

Cheers, Joona
--
Joona Kulmala <joonafiveam.org>
PHP Finland

attached mail follows:


Sathiyabama,

Is always a good idea to read the manual, search google and the list
archives before posting to this list, the below links should help you get
started.

http://www.php.net/manual/en/function.mail.php

and:

http://www.php.net/manual/en/function.rmdir.php

Regards,

Joseph

> -----Original Message-----
> From: John Manko [mailto:xeridadelphia.net]
> Sent: Friday, 1 August 2003 3:56 PM
> To: Sathiyabama
> Cc: php-generallists.php.net
> Subject: Re: [PHP] Please Help
>
>
> umm... ok.....
>
> www.google.com
> www.php.net
>
> that should get you started.
>
>
> Sathiyabama wrote:
>
> >Dear PHP Team,
> >
> >I request your help to sort some issues in using PHP.
> >
> >1.Chennai IIT has developed one recorder.We can record our voice and
> >video.Its user defined extenion is MV4.
> >
> >My requirement is
> >
> >1.I want to send video file using mail() function in PHP.So
> how to send
> >it.What is the procedure?
> >
> >2.How to delete one folder using PHP?
> >
> >
> >Please help me ...
> >
> >Regards,
> >Sathiyabama
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Is it possible to put PHP code in eval ?
Or just vars ?

<?php

$string = 'The result of <?php $a=2; $b=3; $c=$a+$b; echo "$a + $b is $c";
?>';

eval ($string);

?>

attached mail follows:


PHP-Code:
eval('?>'.$string)

Vars:

eval('$string="'.str_replace('"','\\"',$string).'";');

------------------------

> Is it possible to put PHP code in eval ?
> Or just vars ?

> <?php

> $string = 'The result of <?php $a=2; $b=3; $c=$a+$b; echo "$a + $b is $c";
?>>';

> eval ($string);

?>>

------------------------
--
Adrian
mailto:adrianplanetcoding.net
www: http://www.planetcoding.net
www: http://www.webskyline.de

attached mail follows:


Decapode Azur wrote:

> Is it possible to put PHP code in eval ?
> Or just vars ?
>
>
> <?php
>
> $string = 'The result of <?php $a=2; $b=3; $c=$a+$b; echo "$a + $b is $c";
> ?>';
>
> eval ($string);
>
> ?>

It should go like:

[code]

eval('$var = "The result of"; $a=2; $b=3; $c = $a + $b; $var .= "$a + $b is $c";');

[/code]

Just a question, what are you really trying to do?

Cheers, Joona
--
Joona Kulmala <joonafiveam.org>
PHP Finland

attached mail follows:


You can put whatever you want in eval:

<?
   $foo='foo';
   $bar='bar';
   echo("foo is $foo; bar is $bar");
   $myCode='$foo="checking eval statements"; ';
   $myCode.='$bar=str_replace(" ","--",$foo);';
   eval($myCode);
   echo("foo is $foo; bar is $bar");
?>

You could even do this:

<?
   $foo='$i++;';
   $bar='eval($foo);';
   $i=1;
   eval($foo);
   echo("i=$i");
   eval($bar);
   echo("i=$i");
?>

HTH

Bogdan

Decapode Azur wrote:

> Is it possible to put PHP code in eval ?
> Or just vars ?
>
>
> <?php
>
> $string = 'The result of <?php $a=2; $b=3; $c=$a+$b; echo "$a + $b is $c";
> ?>';
>
> eval ($string);
>
> ?>

attached mail follows:


I agree with Chris' method, but if you don't have cron, then what I do is a
page-based cache.

Since weather does not change with every page hit, you could store the
parsed page inside a database, or even write it to a flat file, so if the
page is hit 100 times an hour, and you do an hourly refresh on the cached
version, you only get 1 "slow" page per hour, instead of 100. if the page
gets hit 1000 times... you get the idea.

You could check timestamps of the file (using file based caching) or add a
timestamp field in your sql table.

This sort of caching mechanism is used quite extensively on large sites, but
it's easy enough to implement for smaller sites too.

Of course, what you're doing is totally illegal, unless you have an
agreement with msn to scrape their site <g> I know we don't like microsoft,
but the law's the law.... ;-)

"Chris W. Parker" <cparkerswatgear.com> wrote in message
news:001BD19C96E6E64E8750D72C2EA0ECEE2B7E54ati-ex-01.ati.local...
DougD <mailto:infobigfresh.com>
    on Thursday, July 31, 2003 11:18 AM said:

> If it were possible I want the include to occur after the rest of the
> page is loaded.

Maybe instead of including the file that does the processing and waiting
forever for it to finish, you might consider setting up that same page
as a cron job and have it create another page on your sever that you can
quickly read/parse into your web page.

You could have the cron job run every 1/2/3/4/5/10/15 minutes depending
on how accurate it needs to be. Each time the page is loaded by the
browser the server will grab the latest version and display it.

hth,
Chris.

attached mail follows:


> -----Original Message-----
> From: CPT John W. Holmes [mailto:holmes072000charter.net]
> Sent: 31 July 2003 15:54
 
> you basically
> have this:
>
> list($k,$v,$key,$value) = array(1=>'abc', 'value'=>'abc', 0=>'a',
> 'key'=>'a');
>
> So, how this works is that list starts with $value. $value is
> at position
> number four, so since arrays start at zero, it's going to
> look in the array
> that was passed for an element at [3]. Since there is no [3]
> in the passed
> array, you get a NOTICE about undefined offset.
>
> Next it moves on to $key and looks for element [2]. Again you
> get a warning
> since there is no element [2] in the passed array.
>
> Next is $v and list is looking for [1]. Since [1] does exist
> and has a value
> of 'abc', now $v = 'abc'
>
> Last is $k and [0] and you get $k = 'a'.
>
> That's how it works. :)
>
> That's why this code:
>
> list($a, $b, $c, $d) = array(4=>'four', 3=>'three', 2=>'two',
> 1=>'one',
> 0=>'zero');
> echo "$a, $b, $c, $d";
>
> gives:
>
> zero, one, two, three

Ho, thanks for that -- I must admit I hardly ever use each() or list(), and
taking a quick look at the current manual page for list() does seem to have
changed quite a bit since I originally read it -- so I guess my
understanding of it was faulty. I still think it's quite confusing -- your
explanation here is much better -- so I might see if I can't put together
something even better for incorporation in the manual!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Hi All,

I'm having a hard time wrapping my head around this. I have a query
that returns the following (Sorted by col2):

col1 col2
-------------
house1 Com1
house2 Com1
house3 Com2
house4 Com2
house5 Com3
house6 Com3

I would like to display it as shown below:

Com 1
house1 - Com1
house2 - Com1

Com 2
house3 - Com2
house4 - Com2

Com 3
house5 - Com3
house6 - Com3

I'm having a problem with the header for each 'com'

Thanks for any pointers,
John
--
===========================
John T. Beresford, Owner
Digital Studio Design
Edmond, OK
http://www.digitalstudiodesign.com/
405.760.0794

attached mail follows:


On Fri, Aug 01, 2003 at 03:00:23AM -0500, John T. Beresford wrote:
> Hi All,
>
> I'm having a hard time wrapping my head around this. I have a query
> that returns the following (Sorted by col2):
>
> col1 col2
> -------------
> house1 Com1
> house2 Com1
> house3 Com2
> house4 Com2
> house5 Com3
> house6 Com3
>
>
> I would like to display it as shown below:
>
> Com 1
> house1 - Com1
> house2 - Com1
>
> Com 2
> house3 - Com2
> house4 - Com2
>
> Com 3
> house5 - Com3
> house6 - Com3
>
>
> I'm having a problem with the header for each 'com'
>
> Thanks for any pointers,
> John

i think this is a common task. you can try something like:

$last = null;
while ( list($col1, $col2) = fetch_next_row() ) {
        if ($last != $col2) {
                echo "\n$col2\n";
                $last = $col2;
        }
        echo "$col1 - $col2\n";
}

attached mail follows:


I have a stupid question.

I need if i be in a http make a redirect to https.
Http is a 80 port and ssl is a 443 port

if ($HTTP_SERVER_VARS['SERVER_PORT']==80)
{

     header("Location: https://mynet.com/pay.php");
     exit;
 }

Is the correct way to do this ??? Exist any function to make this ???

Excuse my broken English, Regards from Spain

Un saludo, Danny

attached mail follows:


This is how I do it:

if ($_SERVER['HTTPS']!='on') {
  header("Location: https://mynet.com/pay.php");
  exit;
}

"It is my ambition to say in ten sentences; what others say in a whole
book." - Friedrich Nietzsche

> From: desa15necso.es
> Date: Fri, 1 Aug 2003 10:20:58 +0200
> To: php-generallists.php.net
> Subject: [PHP] Redirect to HTTPS
>
> I have a stupid question.
>
> I need if i be in a http make a redirect to https.
> Http is a 80 port and ssl is a 443 port
>
> if ($HTTP_SERVER_VARS['SERVER_PORT']==80)
> {
>
> header("Location: https://mynet.com/pay.php");
> exit;
> }
>
> Is the correct way to do this ??? Exist any function to make this ???
>
>
>
> Excuse my broken English, Regards from Spain
>
> Un saludo, Danny
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


It might also be worth making sure that your web server is configured to force
https on this page if this is what you want. Otherwise a user could type the
URL in without the HTTPS and still get the page.

On Friday 01 Aug 2003 9:20 am, desa15necso.es wrote:
> I have a stupid question.
>
> I need if i be in a http make a redirect to https.
> Http is a 80 port and ssl is a 443 port
>
> if ($HTTP_SERVER_VARS['SERVER_PORT']==80)
> {
>
> header("Location: https://mynet.com/pay.php");
> exit;
> }
>
> Is the correct way to do this ??? Exist any function to make this ???
>
>
>
> Excuse my broken English, Regards from Spain
>
> Un saludo, Danny

attached mail follows:


Hello,

I was wondering is it possible to set a variable value with html link?

I would like to have link button in my page that changes the language. I
thought to set $lang variable with the button and later use it to detedmine
what to fetch from the database.

What wound be the smartest solution?

Thanks

-Kalle

attached mail follows:


Yeah -

<a href="page.php?lang=en">

then access the variable in page.php -
$_GET['lang'] == "en";

You could then store the language variable in a cookie, session or just pass
it from page to page by calling each page with "page.php?lang=xx".

Craig Roberts

"Kalle Saarinen" <kallesacte.fi> wrote in message
news:001901c35805$e5011500$08cba8c0kalle...
> Hello,
>
> I was wondering is it possible to set a variable value with html link?
>
> I would like to have link button in my page that changes the language. I
> thought to set $lang variable with the button and later use it to
detedmine
> what to fetch from the database.
>
> What wound be the smartest solution?
>
> Thanks
>
> -Kalle
>
>
>
>

attached mail follows:


yeah you can set a variable this way:

http://www.example.com/test.php?var=something

This sets the variables $var equal to "something" and you can use them
accordingly within your script. If you have safe mode on then you'll need
to access the $var variable by using the $_GET array like so:

$_GET['var']

Cheers!

Rick

"What lies behind us and what lies before us are tiny matters compared to
what lies within us." - Oliver Wendell Holmes

> From: "Kalle Saarinen" <kallesacte.fi>
> Reply-To: "Kalle Saarinen" <kallesacte.fi>
> Date: Fri, 1 Aug 2003 11:21:23 +0300
> To: <php-generallists.php.net>
> Subject: [PHP] howto set variablevalue with link?
>
> Hello,
>
> I was wondering is it possible to set a variable value with html link?
>
> I would like to have link button in my page that changes the language. I
> thought to set $lang variable with the button and later use it to detedmine
> what to fetch from the database.
>
> What wound be the smartest solution?
>
> Thanks
>
> -Kalle
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Jep, that did it Thanks!

-Kalle

----- Original Message -----
From: "Richard Baskett" <phpbaskettcase.com>
To: "PHP General" <php-generallists.php.net>
Sent: Friday, August 01, 2003 11:28 AM
Subject: Re: [PHP] howto set variablevalue with link?

> yeah you can set a variable this way:
>
> http://www.example.com/test.php?var=something
>
> This sets the variables $var equal to "something" and you can use them
> accordingly within your script. If you have safe mode on then you'll need
> to access the $var variable by using the $_GET array like so:
>
> $_GET['var']
>
> Cheers!
>
> Rick
>
> "What lies behind us and what lies before us are tiny matters compared to
> what lies within us." - Oliver Wendell Holmes
>
> > From: "Kalle Saarinen" <kallesacte.fi>
> > Reply-To: "Kalle Saarinen" <kallesacte.fi>
> > Date: Fri, 1 Aug 2003 11:21:23 +0300
> > To: <php-generallists.php.net>
> > Subject: [PHP] howto set variablevalue with link?
> >
> > Hello,
> >
> > I was wondering is it possible to set a variable value with html link?
> >
> > I would like to have link button in my page that changes the language. I
> > thought to set $lang variable with the button and later use it to
detedmine
> > what to fetch from the database.
> >
> > What wound be the smartest solution?
> >
> > Thanks
> >
> > -Kalle
> >
> >
<