php-general Digest 25 Feb 2001 16:56:03 -0000 Issue 533

Topics (messages 41542 through 41592):

Re: Detecting JavaScript
        41542 by: Mitchell Hagerty
        41544 by: Mitchell Hagerty
        41588 by: Trevor DeVore

Re: Temporarily turning off magic quotes?
        41543 by: Zeev Suraski
        41560 by: mwaples.waples.net
        41574 by: PHPBeginner.com

Unwanted Characters
        41545 by: Clayton Dukes
        41546 by: Joe Stump
        41555 by: CC Zona
        41558 by: mwaples.waples.net
        41575 by: PHPBeginner.com
        41589 by: Clayton Dukes

php and apache 2.0
        41547 by: jeremy.netwyred.com

Escaping double quotes?
        41548 by: Ben Cheng
        41549 by: Joe Stump

MYSQL HELP!!!
        41550 by: Felipe Lopes

extract() help
        41551 by: Jaxon
        41553 by: CC Zona

Re: session_register in function
        41552 by: Jeff Lacy
        41569 by: PHPBeginner.com

really weird html - was "extract() help"
        41554 by: Jaxon
        41556 by: Jaxon

Re: Cookie References?
        41557 by: mwaples.waples.net
        41571 by: PHPBeginner.com

Re: isset()
        41559 by: Mark Maggelet
        41561 by: Joe Stump
        41576 by: PHPBeginner.com
        41577 by: Christian Reiniger

Join causing Error?
        41562 by: Keith Spiller
        41566 by: CC Zona
        41568 by: Chris Adams

Implode?
        41563 by: Kenneth R Zink II

How do I submit a POST form?
        41564 by: Alexis Michel Golzman

php.ini
        41565 by: Brandon Feldhahn

Re: PHP4 install question
        41567 by: Michael Hall

Re: DIsplaying page before script finnished
        41570 by: PHPBeginner.com

Re: php_self
        41572 by: PHPBeginner.com

Re: comparing numbers
        41573 by: PHPBeginner.com

incrementing  a date!
        41578 by: kaab kaoutar
        41583 by: Web Admin

session_start
        41579 by: kaab kaoutar

Plugin Detection with PHP?
        41580 by: Andy Clarke

No same username
        41581 by: Brandon Feldhahn
        41584 by: Web Admin
        41585 by: Kath
        41587 by: Web Admin

Re: [PHP-DEV] No same username
        41582 by: André Langhorst

Re: crontab help
        41586 by: Joe Stump

so what program?
        41590 by: Knasen

Re: [PHP-DB] Join causing Error?
        41591 by: Bob Hall

Re: [PHP-DB] Re: [PHP] No same username
        41592 by: Scott Bernard

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]


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


I think phpclient sniffer can do that...

found here: http://www.php.net/manual/en/ref.imap.php

mitch

----- Original Message -----
From: Jochen K?chelin <[EMAIL PROTECTED]>
Date: Saturday, February 24, 2001 10:37 pm
Subject: [PHP] Detecting JavaScript

> Who can give me a PHP-Script to
> detect if JavaScript is enabled?
> 
> It should work with both, IE and NN!
> 
> thanks
> 
> --
> Ihr WEBberater
> Stuttgarter Str.3, D-73033 Göppingen
> Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> http://www.wa-p.de ** mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>






woooops didn't check to see what was in my paste buffer

sorry: http://www.asphyxia.com/

mitch

----- Original Message -----
From: Ed Lazor <[EMAIL PROTECTED]>
Date: Saturday, February 24, 2001 11:12 pm
Subject: Re: [PHP] Detecting JavaScript

> I couldn't find anything about phpclient sniffer on that page.  Is 
> that the 
> right page?
> 
> -Ed
> 
> At 10:54 PM 2/24/2001 -0600, you wrote:
> >I think phpclient sniffer can do that...
> >
> >found here: http://www.php.net/manual/en/ref.imap.php
> >
> >mitch
> >
> >----- Original Message -----
> >From: Jochen K?chelin <[EMAIL PROTECTED]>
> >Date: Saturday, February 24, 2001 10:37 pm
> >Subject: [PHP] Detecting JavaScript
> >
> > > Who can give me a PHP-Script to
> > > detect if JavaScript is enabled?
> > >
> > > It should work with both, IE and NN!
> > >
> > > thanks
> > >
> > > --
> > > Ihr WEBberater
> > > Stuttgarter Str.3, D-73033 Göppingen
> > > Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> > > http://www.wa-p.de ** mailto:[EMAIL PROTECTED]
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: php-list-
> > > [EMAIL PROTECTED]
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>





PHP won't be able to tell you if JavaScript is enabled or not.  PHP can 
only determine what version of JavaScript is supported based on the browser 
information provided in HTTP_USER_AGENT.


Trevor DeVore
Blue Mango Multimedia



> > >
> > > > Who can give me a PHP-Script to
> > > > detect if JavaScript is enabled?
> > > >
> > > > It should work with both, IE and NN!
> > > >
> > > > thanks
> > > >
> > > > --
> > > > Ihr WEBberater
> > > > Stuttgarter Str.3, D-73033 Göppingen
> > > > Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> > > > http://www.wa-p.de ** mailto:[EMAIL PROTECTED]





You can do it using .htaccess (or equivalent) directive:

php_flag magic_quotes_gpc off



On Sat, 24 Feb 2001, Ben Cheng wrote:

> If I have magic quotes turned on for post/get/etc. in my php.ini, is 
> there any way to temporarily turn it off for one page?  For example, 
> I have a preview page inbetween my data entry page and the page that 
> actually saves to db.  I don't want magic quotes turned on when going 
> from the data entry to the preview page since all quotes keep getting 
> backslashed.  Is there a way to do this?
> 
> -Ben
> 
> 

-- 
Zeev Suraski <[EMAIL PROTECTED]>
http://www.zend.com/





Ben Cheng wrote:
> 
> If I have magic quotes turned on for post/get/etc. in my php.ini, is
> there any way to temporarily turn it off for one page?  For example,
> I have a preview page inbetween my data entry page and the page that
> actually saves to db.  I don't want magic quotes turned on when going
> from the data entry to the preview page since all quotes keep getting
> backslashed.  Is there a way to do this?
> 
> -Ben
> 
For php4
look for ini_alter
under
www.php.net/manual/en/ref.info.php




you can use:

if($REQUEST_METHOD=='GET' or $REQUEST_METHOD=='POST')
        ini_set ('magic_quotes_gpc',  'off'); 




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Ben Cheng [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Temporarily turning off magic quotes?


If I have magic quotes turned on for post/get/etc. in my php.ini, is 
there any way to temporarily turn it off for one page?  For example, 
I have a preview page inbetween my data entry page and the page that 
actually saves to db.  I don't want magic quotes turned on when going 
from the data entry to the preview page since all quotes keep getting 
backslashed.  Is there a way to do this?

-Ben

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







How do I remove unwanted/unprintable characters from a variable?

$sometext = "ThÀe cØar röøan over mÖy dog"
needs to be filtered and reprinted as:
"The car ran over my dog"




Thanks :-)
Clayton Dukes





Look at the chr() function - figure out what the character is (number wise) and
then do an ereg_replace(chr(),'',$string) (from the hip - you can do a replace
with chr() on one of the replaces, I've done it before)

--Joe

On Sun, Feb 25, 2001 at 12:34:21AM -0500, Clayton Dukes wrote:
> 
> How do I remove unwanted/unprintable characters from a variable?
> 
> $sometext = "ThÀe cØar röøan over mÖy dog"
> needs to be filtered and reprinted as:
> "The car ran over my dog"
> 
> 
> 
> 
> Thanks :-)
> Clayton Dukes
> 

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------





In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Joe Stump) wrote:

> Look at the chr() function - figure out what the character is (number wise) 
> and
> then do an ereg_replace(chr(),'',$string) (from the hip - you can do a 
> replace
> with chr() on one of the replaces, I've done it before)
> 
> --Joe
> 
> On Sun, Feb 25, 2001 at 12:34:21AM -0500, Clayton Dukes wrote:
> > 
> > How do I remove unwanted/unprintable characters from a variable?
> > 
> > $sometext = "ThÀe cØar röøan over mÖy dog"
> > needs to be filtered and reprinted as:
> > "The car ran over my dog"

And you might also want to look at strtr() 
<http://php.net/manual/en/function.strtr.php>.  You could, I suppose, use 
it to substitute some character that you know would never legitimately 
appear in $sometext, then do a straight str_replace() on the string for all 
occurences of that character.

-- 
CC




Clayton Dukes wrote:
> 
> How do I remove unwanted/unprintable characters from a variable?
> 
> $sometext = "ThÀe cØar röøan over mÖy dog"
> needs to be filtered and reprinted as:
> "The car ran over my dog"
> 
> Thanks :-)
> Clayton Dukes

<?php
$sometext = "ThÀe cØar röøan over mÖy dog";
$thread =  ereg_replace("[^[:alnum:][:space:]]", "", $sometext);
echo $thread
?>

will print what you asked - of course you may not want numbers but you
get the idea.
I do this check on all my user inputs to php scripts- I choose what is
allowed not what to deny which makes it easier.




use eregi_replace("[asutk]+", '', $string)

in this way there will be no such letters as a,s,u,t,k in $string




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 2:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Unwanted Characters



How do I remove unwanted/unprintable characters from a variable?

$sometext = "ThÀe cØar röøan over mÖy dog"
needs to be filtered and reprinted as:
"The car ran over my dog"




Thanks :-)
Clayton Dukes







This doesn't seem to work, have I done something wrong?



$sometext = "ThÀe cØar röøan over mÖy dog\n";
   $thread =  ereg_replace("[^[:alnum:][:space:]]", "", $sometext);
   echo $thread;

still prints:
ThÀe cØar röøan over mÖy dog


Thanks,
Clayton


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>
Sent: Sunday, February 25, 2001 2:28 AM
Subject: Re: [PHP] Unwanted Characters


> Clayton Dukes wrote:
> >
> > How do I remove unwanted/unprintable characters from a variable?
> >
> > $sometext = "ThÀe cØar röøan over mÖy dog"
> > needs to be filtered and reprinted as:
> > "The car ran over my dog"
> >
> > Thanks :-)
> > Clayton Dukes
>
> <?php
> $sometext = "ThÀe cØar röøan over mÖy dog";
> $thread =  ereg_replace("[^[:alnum:][:space:]]", "", $sometext);
> echo $thread
> ?>
>
> will print what you asked - of course you may not want numbers but you
> get the idea.
> I do this check on all my user inputs to php scripts- I choose what is
> allowed not what to deny which makes it easier.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]






will php 4.0.4 build as a module with apache 2.0?

- jeremy





How do you escape double quotes?  I have the following which is 
supposed to make any " in a string into \" but it doesn't seem to 
work.  What's wrong with it?

$tmp_string = str_replace ("\"", "\\\"", $tmp_string);

-Ben




addslashes() usually works for me...

--Joe

On Sun, Feb 25, 2001 at 01:46:30AM -0500, Ben Cheng wrote:
> How do you escape double quotes?  I have the following which is 
> supposed to make any " in a string into \" but it doesn't seem to 
> work.  What's wrong with it?
> 
> $tmp_string = str_replace ("\"", "\\\"", $tmp_string);
> 
> -Ben
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------





Hi!
Here I am again...I have a problem to insert user name, password and 
host into mysql...I'd like to know what commands I need to do that 
(since the command to start mysql on my computer) so that way I won't be 
able to do anything wrong!
Thank you

Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!




Hi PHPers,

the following function is supposed to build an html table, creating a
content row for every row in a database table.  It is creating a table with
the correct number of rows, but NO content is being echoed...

I think I must be using the extract() function inside the for loop wrong...
any pointers?

tia!
jaxon


<?php

function news_box($max)
{

include_once("inc/config.inc");
include_once("inc/db_connect_params.inc");

$link_id = mysql_connect($host, $usr, $pass);
mysql_select_db($database, $link_id); //select database catalog

echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\"
width=\"165\">";


if (!isset($max)) $max=5; //upper limit of news boxes to build

for ($i = 1; $i <= $max; $i++)

        {
        
        $sql="select i.nID, i.date, i.headline, i.subtitle, i.blurb from
        news_items i, news_box b where i.nID = b.nID and b.dID = $i";
        
        $result = mysql_query($sql, $link_id);
        $row = mysql_fetch_row($result);
        
        extract($row); //the variables below match field names in this row

        echo "
        <tr><td><h1>$headline</h1></td></tr>
        <tr><td><h4>$subtitle</h4></td></tr>
        <tr><td align=\"right\"><h6>$date</h6></td></tr>
        <tr><td>$blurb</td></tr>
        <tr><td><a href=\"news.php?#$nID\"><h5>...more</h5></a></td></tr>
             ";

        echo "</table>";
        }
}
?>





In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jaxon) wrote:

> the following function is supposed to build an html table, creating a
> content row for every row in a database table.  It is creating a table with
> the correct number of rows, but NO content is being echoed...
<snip>
>         $sql="select i.nID, i.date, i.headline, i.subtitle, i.blurb from
>         news_items i, news_box b where i.nID = b.nID and b.dID = $i";
>         
>         $result = mysql_query($sql, $link_id);
>         $row = mysql_fetch_row($result);
>         
>         extract($row); //the variables below match field names in this row
> 
>         echo "
>         <tr><td><h1>$headline</h1></td></tr>
>         <tr><td><h4>$subtitle</h4></td></tr>
>         <tr><td align=\"right\"><h6>$date</h6></td></tr>
>         <tr><td>$blurb</td></tr>
>         <tr><td><a href=\"news.php?#$nID\"><h5>...more</h5></a></td></tr>

The elements in $row will have indexes like $row['i.headline'], rather than 
$row['headline'], just as the columns would have those names if you ran the 
query at the command line.

(BTW, I find that doing a var_dump() or print_r() on variables--such as 
$row, in this case--to be very helpful when data isn't coming out in the 
way I expected it to...)

-- 
CC




I had this same exact problem just today.  It all stems from the variable
namespace, I think....

A similar code 'snippet' is shown below.  I just made it up, but I think it
illustrates my point.

<?php
session_start ();
function crud ($user, $password) {
    session_register ('user');
    session_register ('password');
    $GLOBALS['user'] = $user;
    global $password;
    /* NOTE: $GLOBALS['varname'] = $value is the same as global $varname.
Either will work....*/
}
echo "User is $user and password is $password";
?>

Good luck with whatever you are doing,

Jeff Lacy


""Jon Rosenberg"" <[EMAIL PROTECTED]> wrote in message
000901c09e7d$16835420$0100a8c0@slinkyboi5">news:000901c09e7d$16835420$0100a8c0@slinkyboi5...
> The variable I register before the function becomes available in the
session
> to other pages...the variable I register inside the function are not
> accessible in the session to ohter pages.  Is this normal?  How can I work
> around this?  Thanks!  PHP4.0.4pl1 on Linux.
>
> sample code:
>
> <?
> session_Start();
>
> $foo = "bar";
> session_register("foo");
>
> function bob($user){
>     $username = $user . "one";
>     $username2 = $user . "two";
>     session_register("username");
>     session_register("username2");
> return true;
> }
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






you have to have the variable you register (in both ways) global.

so no matter how you call the function the variable must be defined global.

<?
session_Start();

$foo = "bar";
session_register("foo");

function bob($user){

    Global $user, $username, $username2;
    #  In this way they can "escape the prison of function"

    $username = $user . "one";
    $username2 = $user . "two";
    session_register("username");
    session_register("username2");
return true;
}


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Jon Rosenberg [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:16 AM
To: PHP List
Subject: [PHP] session_register in function


The variable I register before the function becomes available in the session
to other pages...the variable I register inside the function are not
accessible in the session to ohter pages.  Is this normal?  How can I work
around this?  Thanks!  PHP4.0.4pl1 on Linux.

sample code:

<?
session_Start();

$foo = "bar";
session_register("foo");

function bob($user){
    $username = $user . "one";
    $username2 = $user . "two";
    session_register("username");
    session_register("username2");
return true;
}
?>


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






I replaced extract() with $row[] - much better.

Now I have the strangest thing happening - the <td align="right"> html
formatting only applies to the first iteration in the loop, even though it
shows up in the html source!!

regard,
jaxon


html generation:
----------------
for ($i = 1; $i <= 5; $i++)
        
        {
        $sql="select stuff from table";
        $result = mysql_query($sql, $link_id);
        $row = mysql_fetch_row($result);
        
        echo "
        <tr><td><h3>$row[2]</h3></td></tr>
        <tr><td><h4>$row[3]</h4></td></tr>
        <tr><td align=\"right\"><h6>$row[1]</h6></td></tr>
        <tr><td>$row[4]</td></tr>
        <tr><td align=\"right\"><a
href=\"news.php?#$row[0]\"><h5>...more</h5></a></td></tr>
        
        <hr />     
             ";
             
        echo "</table>";
        }

resultant source:
-----------------
<table border="0" cellpadding="1" cellspacing="0">
        <tr><td><h3>First Headline</h3></td></tr>
        <tr><td><h4>first subtitle</h4></td></tr>
        <tr><td align="right"><h6>2001-02-24</h6></td></tr>
        <tr><td>get it right here now... this is the place to be, I tell
you</td></tr>
        <tr><td align="right"><a
href="news.php?#1"><h5>...more</h5></a></td></tr>
        <tr><td><hr /></tr></td>
             </table>
        <tr><td><h3>SECOND HEADLINE!</h3></td></tr>
        <tr><td><h4>second subtitle</h4></td></tr>
        <tr><td align="right"><h6>0000-00-00</h6></td></tr>
        <tr><td>even more good stuff coming out of our second news
item!!!</td></tr>
        <tr><td align="right"><a
href="news.php?#2"><h5>...more</h5></a></td></tr>
        <tr><td><hr /></tr></td>
             </table>
        <tr><td><h3>HEADLINE 3!!!</h3></td></tr>
        <tr><td><h4>subtitle 3</h4></td></tr>
        <tr><td align="right"><h6>2001-02-26</h6></td></tr>
        <tr><td>getcha third item here!!</td></tr>
        <tr><td align="right"><a
href="news.php?#3"><h5>...more</h5></a></td></tr>
        <tr><td><hr /></tr></td>
             </table>





gak. everyone ignore me.
idiocy is setting in this late at night.

stoopid me put a </table> tag INSIDE the loop.

and thanks CC Zona for the pointer on the var_dump() - very helpful!

regards,
jaxon

On 2/25/01 2:38 AM, "Jaxon" <[EMAIL PROTECTED]> wrote:

> I replaced extract() with $row[] - much better.
> 
> Now I have the strangest thing happening - the <td align="right"> html
> formatting only applies to the first iteration in the loop, even though it
> shows up in the html source!!
> 
> regard,
> jaxon
> 
> 
> html generation:
> ----------------
> for ($i = 1; $i <= 5; $i++)
>       
>       {
>       $sql="select stuff from table";
>       $result = mysql_query($sql, $link_id);
>       $row = mysql_fetch_row($result);
>       
>       echo "
>       <tr><td><h3>$row[2]</h3></td></tr>
>       <tr><td><h4>$row[3]</h4></td></tr>
>       <tr><td align=\"right\"><h6>$row[1]</h6></td></tr>
>       <tr><td>$row[4]</td></tr>
>       <tr><td align=\"right\"><a
> href=\"news.php?#$row[0]\"><h5>...more</h5></a></td></tr>
>       
>       <hr />     
>            ";
>            
>       echo "</table>";
>       }
> 
> resultant source:
> -----------------
> <table border="0" cellpadding="1" cellspacing="0">
>       <tr><td><h3>First Headline</h3></td></tr>
>       <tr><td><h4>first subtitle</h4></td></tr>
>       <tr><td align="right"><h6>2001-02-24</h6></td></tr>
>       <tr><td>get it right here now... this is the place to be, I tell
> you</td></tr>
>       <tr><td align="right"><a
> href="news.php?#1"><h5>...more</h5></a></td></tr>
>       <tr><td><hr /></tr></td>
>            </table>
>       <tr><td><h3>SECOND HEADLINE!</h3></td></tr>
>       <tr><td><h4>second subtitle</h4></td></tr>
>       <tr><td align="right"><h6>0000-00-00</h6></td></tr>
>       <tr><td>even more good stuff coming out of our second news
> item!!!</td></tr>
>       <tr><td align="right"><a
> href="news.php?#2"><h5>...more</h5></a></td></tr>
>       <tr><td><hr /></tr></td>
>            </table>
>       <tr><td><h3>HEADLINE 3!!!</h3></td></tr>
>       <tr><td><h4>subtitle 3</h4></td></tr>
>       <tr><td align="right"><h6>2001-02-26</h6></td></tr>
>       <tr><td>getcha third item here!!</td></tr>
>       <tr><td align="right"><a
> href="news.php?#3"><h5>...more</h5></a></td></tr>
>       <tr><td><hr /></tr></td>
>            </table>
> 





Jeff Oien wrote:
> 
> Could you give me some URLs for tutorials related
> to cookies and good reference material?

www.cookiecentral.com/faq/ has some good general info

rfc2109 - more technical but useful 
http://www.cis.ohio-state.edu/htbin/rfc/rfc2109.html
> 
> One question I have is can a cookie never expire?
> Jeff Oien
>




Yes it can :

here's what I once was doing to assign a user with a cookie containing a
Session ID:


$uniqid = md5 (uniqid (rand()));

if(!isset($sid)) {
        $time = time();
        setcookie ("sid", $uniqid, $time*3);
}

time()+time() makes it really, really LONG ...  (62 years?), of course it
has not expired from anyone yet :-))



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 7:42 AM
To: PHP
Subject: [PHP] Cookie References?


Could you give me some URLs for tutorials related
to cookies and good reference material?

One question I have is can a cookie never expire?
Jeff Oien

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






On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger
([EMAIL PROTECTED]) wrote:
>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
>> in my preceding email I've written:
>>
>> if($var!='')
>>
>> will fix your all your worries without an intervention of a
strings
>> function.
>
>Except that it will throw a warning in PHP4 if $var is not set.
>=> isset () should be used.

man, this is like the thread that will not die. isset() will return
true for an empty string, which is not what he wants. the right thing
to do is use

if((isset($var))&&($var!=""))

the isset on the left gets evaluated first so a warning is never
thrown. to be even safer, you can go:

if((isset($var))&&(trim($var)!=""))

you do not want to use strlen() for the following reasons:
1) makes code unreadable -> very sloppy
2) overhead
3) it will give a warning when $var is not set (error_reporting 15
only).






> you do not want to use strlen() for the following reasons:
> 1) makes code unreadable -> very sloppy

Yeah and your if(isset($var) && $var != '') is pretty

> 2) overhead

You call one function and do two comparisons - vs an age old C function ....
I'd like to run some numbers on that.

> 3) it will give a warning when $var is not set (error_reporting 15 
> only).

I run on the default error_reporting setting and it's never complained so far.

--Joe


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

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------





100% agreed!

this makes much more sense then any of us was saying before.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Mark Maggelet [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 5:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger 
([EMAIL PROTECTED]) wrote:
>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
>> in my preceding email I've written:
>>
>> if($var!='')
>>
>> will fix your all your worries without an intervention of a 
strings
>> function.
>
>Except that it will throw a warning in PHP4 if $var is not set.
>=> isset () should be used.

man, this is like the thread that will not die. isset() will return 
true for an empty string, which is not what he wants. the right thing 
to do is use

if((isset($var))&&($var!=""))

the isset on the left gets evaluated first so a warning is never 
thrown. to be even safer, you can go:

if((isset($var))&&(trim($var)!=""))

you do not want to use strlen() for the following reasons:
1) makes code unreadable -> very sloppy
2) overhead
3) it will give a warning when $var is not set (error_reporting 15 
only).



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






On Sunday 25 February 2001 09:01, Mark Maggelet wrote:

> >> if($var!='')
> >>
> >> will fix your all your worries without an intervention of a

> >Except that it will throw a warning in PHP4 if $var is not set.
> >=> isset () should be used.
>
> man, this is like the thread that will not die. isset() will return
> true for an empty string, which is not what he wants. the right thing
> to do is use
>
> if((isset($var))&&($var!=""))

I never said *only* isset() should be used :)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




Can anyone tell me why this:
  Line 282    mysql_select_db("centraldb",$db);
  Line 283    $qorder++; 
  Line 284    $result = mysql_query("SELECT q.questid, q.question, q.answer, q.qorder, 
q.depart, q.catid, 
                  q.active, q.global, q.adate, q.author, q.authoremail, q.askemail, 
c.catid, c.category, c.under, 
                  c.corder, c.active FROM central_groupfaqq q, central_groupfaqcat c 
WHERE q.active = '1' AND 
                  q.global = '1' AND c.active = '1' ORDER BY c.under, c.order, 
q.qorder",$db);
  Line 285    while ($myrow = mysql_fetch_row($result))

Would cause this error:
  Warning: Supplied argument is not a valid MySQL result resource in faqbody.php3 on 
line 285

When changing the same SELECT statement to:
  Line 284    $result = mysql_query("SELECT * FROM central_groupfaqq WHERE active = 
'1' ORDER BY
                   qorder",$db);

Works perfectly?


Keith Spiller
a.k.a. Larentium





In article <030601c09f05$2b9e6e70$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Keith Spiller") wrote:

> Can anyone tell me why this:
>   Line 282    mysql select db("centraldb",$db);
>   Line 283    $qorder++; 
>   Line 284    $result = mysql query("SELECT q.questid, q.question, q.answer, 
>   q.qorder, q.depart, q.catid, 
>                   q.active, q.global, q.adate, q.author, q.authoremail, 
>                   q.askemail, c.catid, c.category, c.under, 
>                   c.corder, c.active FROM central groupfaqq q, central 
>                   groupfaqcat c WHERE q.active = '1' AND 
>                   q.global = '1' AND c.active = '1' ORDER BY c.under, 
>                   c.order, q.qorder",$db);
>   Line 285    while ($myrow = mysql fetch row($result))
> 
> Would cause this error:
>   Warning: Supplied argument is not a valid MySQL result resource in 
>   faqbody.php3 on line 285
> 
> When changing the same SELECT statement to:
>   Line 284    $result = mysql query("SELECT * FROM central groupfaqq WHERE 
>   active = '1' ORDER BY
>                    qorder",$db);
> 
> Works perfectly?

Sounds like the 'while' loop is failing because mysql_query isn't returning 
to $result what you think it is.  Add some error-checking, starting with at 
least an "or die(mysql_error())" on the query.  Also, try running the same 
query at the command line to confirm that it's valid.

-- 
CC




On 25 Feb 2001 00:20:37 -0800, Keith Spiller <[EMAIL PROTECTED]> wrote:
>  Line 284    $result =3D mysql_query("SELECT q.questid, q.question, =

Try changing this to something like 
        $result = mysql_query("SELECT ...") or die(mysql_error());
and seeing what error is being returned by MySQL.




What is the best way to pull data from one table and insert into another?
How can I delete entries from a table with a php document?

The gist of what I'm trying to accomplish is this.  This is somewhat of a
detailed outline, so please bear with me.

1. I have one table (members) that has all the old data.
2. I'm am going to send an e-mail to every entry in that table that has an
e-mail address and have a link for them to follow to a PHP page.  Any entry
that does not have an e-mail address, will be moved over with a different
(but similar) PHP script that will do a mass search and move of that data to
the new table (memberdetail)
3. That PHP page will ask for there name and e-mail address then display a
list of matching results to edit.
4. The edit page will pull data from (members) and insert then updated info
into a new table (memberdetail).  Password protected.  Unless you know the
password for that information, it will error and stop (exit () ).
5. If the insertion is successful, I want it to open a new window (if
statement that contains target="_blank") which will display the new data and
then the old page will refresh itself to a new page (if statement with a
meta tag).  If not, I want it to error and stop. (exit() ).  I have already
implemented anti-duplication into our new insert script (for memberdetail).
The new table (memberdetail) gets scanned for duplicate information in 5
fields (but can easily but expanded to cover more then that) before it
inserts data.  If it finds duplicate information it displays it with an
option to accept it. (password protected).  If accepted (with proper
password) it will delete the old information (from members) and refresh the
page while opening the new information in a new window.
6. The refreshed page will be passed an variable (id) from the old table
(members) and delete the entry (from members).
7. Lastly, it will refresh and pass the name and e-mail address from step 3
and display any remaining matches if any.
8. If there were any results from the search in step 7, then it will do step
4 again.  If no remaining entries it will error and stop. (exit () )

Doing it this way will help us clean up our old information and get more
current information for our new website.  Anything that is not moved over
will be erased after a couple of months.  That should give them plenty of
time to update and move the old data to the new site.

Thanks.

Kenneth R Zink II     [EMAIL PROTECTED]    ICQ# 5095094
'87 GMC S-15 Ext. Cab (Hurricane) ...BBC 524 being built !!!
http://www.s-series.org/htm/windstorm/project-windstorm.htm
'85 Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI !!!
http://www.s-series.org/htm/firestorm/firestorm.htm
'84 Oldsmobile Delta 88 Delta 88 Royal Brougham.
Racing by the grace of God!!!





Hi,

I've submitted many times a GET form like this:

header("Location:
http://examplesite.com/myscript.php3?key=value&key2=value2&keyn=valuen");

but now I need to submit a POST form.

How is this done?

I found this Perl code on the web:
--------------------------------------------------------------
use strict;
use LWP::UserAgent;     # libwww-perl

my $ua = new LWP::UserAgent or die "new UA: $!";
$ua->agent("testclient/1.0");

my $url = 'http://localhost/cgi-bin/test.pl';
my $request = new HTTP::Request('POST', $url) or
  die "new HTTP::Request POST '$url': $!";
$request->content_type('application/x-www-form-urlencoded');

$request->content('field1=value1&field2=value2&field3=value3');

#$request->content('field1=value1');    # optional method
#$request->add_content('&field2=value2');
#$request->add_content('&field3=value3');

my $response = $ua->request($request);
print $response->content;
--------------------------------------------------------------

But I want to know if there is a way of doing it in PHP...

Thanks in advance for your help! :-)

Kind regards,
Alexis Golzman
mailto:[EMAIL PROTECTED]
http://trafficbar.com





what do i put in the "Sendmail_from" section of php.ini?





There may be other/easier solutions, but what always works for me is
compiling Apache from source after removing the rpm, then compiling PHP
from source.
The instructions at the end of the README.config file in the Apache source
distro work like a charm.
This seems long-winded but at least I know it's gonna work at the end. 

Mick

On Sat, 24 Feb 2001, Ed Lazor wrote:

> I've had PHP installed through the RedHat RPMS listed below.
> 
> php-imap-4.0.4pl1-3
> php-manual-4.0.4pl1-3
> php-4.0.4pl1-3
> php-ldap-4.0.4pl1-3
> php-mysql-4.0.4pl1-3
> 
> Unfortunately, I discovered there's a bug in this version, so I need to 
> remove the rpms and install PHP by compiling the source.  I've been playing 
> with it for a few hours, but haven't had any luck, so I figured I'd ask 
> here.  What's the easiest way to compile PHP and load it into Apache?
> 
> If I understand correctly, because of the rpm, PHP resides as the file
> /usr/lib/apache/libphp4.so
> 
> Apache loads PHP with the following command in httpd.conf
> LoadModule php4_module        modules/libphp4.so
> 
> I'm not sure (can someone confirm please?), but I assume Apache is loading 
> all of the modules as DSO.  Is the goal is to remove the rpms and create a 
> new /usr/lib/apache/libphp4.so file by compiling the PHP4 source code?
> 
> If so, how do I go about it?  The directions for PHP make it sound really 
> easy.  I tried them tho and the php files just show up as plain text.  Here 
> are the instructions I tried (that didn't work).
> 
> -Ed
> 
> 
> 
> 
> $ ./configure --with-mysql --with-apxs
> $ make
> $ make install
> 
> If you get an error telling you that the apxs script could not be found,
> look for it on your system and if you find it, provide the full path to it
> as: --with-apxs=/path/to/apxs
> 
> Next you must copy php.ini-dist to the appropriate place (normally
> /usr/local/lib/php.ini) and edit it as necessary to set PHP options.
> 
> The only thing left to do is to edit your httpd.conf file and make sure the
> PHP 4 mime type is there and uncommented.  You need a line that looks like
> this:
> 
>     AddType application/x-httpd-php .php
> 
> Then restart your server (apachectl restart) and you should be able to
> serve up PHP files now.  Make a test file called test.php and put some
> PHP tags in it.  Like <?phpinfo()?>, for example.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 





use flush()

it will push the output out of apache.
But note, if you have a table, on Netscape not much will be shown (even if
it receives the data) until the </table> arrives.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: David Tandberg-Johansen [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] DIsplaying page before script finnished


Hello!

I wonder if there are any way to display the page before the script is
finished?

I have a loop in my script,and I want to display the resoult for each loop.

Thanks

David :-)



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






Here's what to do:

in Apache:
Add (this is all one line)
LoadModule php4_module C:/Webserver/php/sapi/php4apache.dll

then (five lines)
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
to your httpd.conf.

Remove(comment) Action application ... line



Copy php.ini to C:\Winnt\System32.

Copy msvcrt.dll (from C:\Webserver\PHP\dlls\msvcrt.dll) to C:\Winnt\system32
 - you're almost guranteed to have it, as I did, but just check.

Copy phpts.dll to C:\Winnt\system32.

Startup the Apache service.

At this point, if it worked, you are runniong as a module.

Hopefully this will work :-)


And if it doesn't download a new version of PHP and reinstall it as INSTALL
file says.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 9:27 AM
To: PHPBeginner.com
Subject: Re: [PHP] php_self


well i have windows so how do i recompile it?

"PHPBeginner.com" wrote:

> You have compiled it as CGI, didn't ya?
>
> recompile it as apache's module if you can so apache can give PHP_SELF the
> right value,
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
> -----Original Message-----
> From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 4:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php_self
>
> Why does php self always show php4/php.exe? how do i take  it off?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]






$id = ($id<=59) ? $id=81 : false;

or the traditional way:

if($id<=59) {
   $id=81;
}


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-----Original Message-----
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] comparing numbers



How can I do something like the following shell script, in PHP? (I know this
won't work normally, but you get the idea).

if [ $id <= 59 ]; then
$id=81

TIA!
Clayton Dukes






Hi all!
s there a way with which we can increment a date (by day) without extracting 
the month the day and the year then increment some of them depending on the 
day the month and the year ?
ex: 2001-03-28 'll become 2001-04-01

Thanks
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





hi,
try $tomorrow  = mktime(0,0,0,date("m")  ,date("d")+1,date("Y"));
or maybe better than this, if you convert the date to the standard
unix timestamp and use DATE function.
Best of luck,
Ahmad Anvari
  ----- Original Message ----- 
  From: kaab kaoutar 
  To: [EMAIL PROTECTED] 
  Sent: Sunday, February 25, 2001 2:36 PM
  Subject: [PHP] incrementing a date!


  Hi all!
  s there a way with which we can increment a date (by day) without extracting 
  the month the day and the year then increment some of them depending on the 
  day the month and the year ?
  ex: 2001-03-28 'll become 2001-04-01

  Thanks
  _________________________________________________________________________
  Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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






hi!
do we have to use in each page using the data of a session the 
session-start()?
cause in the manual it says that session_start -- Initialize session data 
and session_start() creates a session ?!
thanks
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Is there a way to use PHP to tell whether a user's browser has a particular
plugin?

I thought that the $HTTP_ACCEPT variable might have this type of
information, but in a little test that I have done, it just returns "*/*".

I know that this can be done using Javascript, but as this can be turned
off by the user etc, it seemed as though it would be more reliable to do it
server side (if it is possible).


Thanks

Andy Clarke




 ------------------------------------------------
                   Andy Clarke
      78 West Kensington Court, Edith Villas,
             London, England  W14 9AB

            phone:  44 (0)20 7602 3382
              mobile:  07947 418177

          Freelance Lingo/PHP Programmer

                 [EMAIL PROTECTED]
 ------------------------------------------------






how do i make somthing with my database that knows it the username
entered is already a name in use?





define a UNIQUE field :)

  ----- Original Message ----- 
  From: Brandon Feldhahn 
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Sunday, February 25, 2001 4:03 PM
  Subject: [PHP] No same username


  how do i make somthing with my database that knows it the username
  entered is already a name in use?


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






------------
 $sql = "SELECT username FROM main_users WHERE username = '$username'";

 $result = mysql_query($sql);

 $num = mysql_numrows($result);

 if ($num > "0") { die ("That username already exists, please chose
another"); }
-----------------
That could do it :)

- Kath

----- Original Message -----
From: "Brandon Feldhahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, February 25, 2001 7:33 AM
Subject: [PHP] No same username


> how do i make somthing with my database that knows it the username
> entered is already a name in use?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Or better using:

create table test1 (t1 char(5), t2 char(5), primary key (t1), unique (t2)); 

when creating table. No duplicate records with the same t2 because it's unique.

Ahmad Anvari
  ----- Original Message ----- 
  From: Kath 
  To: Brandon Feldhahn ; [EMAIL PROTECTED] 
  Sent: Sunday, February 25, 2001 6:19 PM
  Subject: Re: [PHP] No same username


  ------------
   $sql = "SELECT username FROM main_users WHERE username = '$username'";

   $result = mysql_query($sql);

   $num = mysql_numrows($result);

   if ($num > "0") { die ("That username already exists, please chose
  another"); }
  -----------------
  That could do it :)

  - Kath

  ----- Original Message -----
  From: "Brandon Feldhahn" <[EMAIL PROTECTED]>
  To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
  <[EMAIL PROTECTED]>
  Sent: Sunday, February 25, 2001 7:33 AM
  Subject: [PHP] No same username


  > how do i make somthing with my database that knows it the username
  > entered is already a name in use?
  >
  >
  > --
  > PHP General Mailing List (http://www.php.net/)
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > To contact the list administrators, e-mail: [EMAIL PROTECTED]
  >


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






Brandon Feldhahn wrote:

> how do i make somthing with my database that knows it the username
> entered is already a name in use?

please do not cross-post!!!
it is sufficient to post it to _one_ mailing list (php-general)

thanks


-- 
· André Langhorst        t: +49 331 5811560 ·
· [EMAIL PROTECTED]          m: +49 173 9558736 ·
* PHP Quality Assurance  http://qa.php.net  *





Didn't you just ask this a few days ago?

In your while loop put a sleep(300) which will sleep for 300 seconds after
processing X amount of emails.

--Joe

On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote:
> hi there.
> 
> is there a way to tell crontab to do:
> 
> "run script every 5 mins for 1 hour"..
> 
> i have this mass email script that is so huge that i need it to chunk into
> records and make sure that it will run every 5 mins for 1 hour.
> 
> Thanks for any help.
> 

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------





Ok..

What I found out in my first mail to the list was..quit working with
filmaker =). Sure, I can do that. But the question remains..what program
WILL a macuser use to forfill the needs in MySQL/PHP?

_________________________
knasen





Sir, I don't see anything wrong with the syntax in your query. If I 
haven't over looked something, and if you haven't misspelled 
anything, then you have a data problem. Since your first query 
returns a Cartesian product, you should get something if the WHERE 
clause returns >= 1 row for each table. So either there are no rows 
in q that meet the conditions
    q.active = '1' AND q.global = '1'
or there are no rows in c that meet the condition
    c.active = '1'
Run the first query with only the first WHERE condition. If you get 
rows, add the second condition. If that works, add the third. The 
point at which the query stops returning rows is the point at which a 
subset of your WHERE conditions  aren't met by the any of the rows in 
one of the tables.

BTW, why are you putting quotes around numbers? I'm assuming that's 
not the problem, since you say you did it in the query that worked, 
but I don't see the point.

Bob Hall

>Can anyone tell me why this:
>   Line 282    mysql_select_db("centraldb",$db);
>   Line 283    $qorder++;
>   Line 284    $result = mysql_query("SELECT q.questid, q.question, 
>q.answer, q.qorder, q.depart, q.catid,
>                   q.active, q.global, q.adate, q.author, 
>q.authoremail, q.askemail, c.catid, c.category, c.under,
>                   c.corder, c.active FROM central_groupfaqq q, 
>central_groupfaqcat c WHERE q.active = '1' AND
>                   q.global = '1' AND c.active = '1' ORDER BY 
>c.under, c.order, q.qorder",$db);
>   Line 285    while ($myrow = mysql_fetch_row($result))
>
>Would cause this error:
>   Warning: Supplied argument is not a valid MySQL result resource in 
>faqbody.php3 on line 285
>
>When changing the same SELECT statement to:
>   Line 284    $result = mysql_query("SELECT * FROM central_groupfaqq 
>WHERE active = '1' ORDER BY
>                    qorder",$db);
>
>Works perfectly?
>
>
>Keith Spiller
>a.k.a. Larentium

Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak




There is something called constraints in the database (generally).
You have to set that field in the database, to unique, or make a "unique"
index on that field.

regards.

idsarts.

-----Mensaje original-----
De: Web Admin [mailto:[EMAIL PROTECTED]]
Enviado el: Domingo, 25 de Febrero de 2001 10:26 a.m.
Para: Brandon Feldhahn; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Asunto: [PHP-DB] Re: [PHP] No same username


define a UNIQUE field :)

  ----- Original Message -----
  From: Brandon Feldhahn
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ;
[EMAIL PROTECTED]
  Sent: Sunday, February 25, 2001 4:03 PM
  Subject: [PHP] No same username


  how do i make somthing with my database that knows it the username
  entered is already a name in use?


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





Reply via email to