php-general Digest 7 Jan 2003 10:38:05 -0000 Issue 1808

Topics (messages 130503 through 130551):

Re: mail() not working on Win2k
        130503 by: Manuel Lemos
        130507 by: Rad Craig
        130513 by: Manuel Lemos

Directory Listing with php on unix boxes
        130504 by: Joe Jeffcoat
        130508 by: Joe Jeffcoat

re> Save Image?
        130505 by: greg R

Re: MySQL vs PostgreSQL
        130506 by: Jeffrey B. Ferland

Empty messages from PHP General...
        130509 by: Richard Baskett

Parse source for braces
        130510 by: Shawn McKenzie
        130522 by: Greg Beaver

Re: time stamp screwing up
        130511 by: Justin French

Re: Defaults in drop down list...
        130512 by: Justin French
        130514 by: Rick Widmer

PHP sendmail configuration
        130515 by: Richard Baskett
        130521 by: Peter Houchin
        130545 by: Petre Agenbag

Double entry into MySQL..
        130516 by: Altug Sahin

mmmmm SELECT
        130517 by: Bruce Levick
        130520 by: Steve Edberg
        130523 by: Jason k Larson
        130524 by: Bruce Levick

Re: Dreaded Return-Path and mail()
        130518 by: David T-G
        130519 by: Timothy Hitchens \(HiTCHO\)
        130547 by: Petre Agenbag
        130548 by: Timothy Hitchens \(HiTCHO\)

Using VS.NET for PHP Projects
        130525 by: Sean Malloy

MySQL field to maintain formatting
        130526 by: Vernon
        130527 by: Jason Sheets

Access page via user & password
        130528 by: Ezequiel Sapoznik
        130529 by: Peter Houchin

populate a list menu
        130530 by: Bruce Levick
        130531 by: Jean-Christian Imbeault
        130532 by: Justin French
        130533 by: Bruce Levick
        130534 by: Jean-Christian Imbeault
        130537 by: Justin French

Using VS.NET for PHP Projects - Revisit
        130535 by: Sean Malloy

Text editors
        130536 by: Karl James

ftp and www
        130538 by: Mukta Telang
        130539 by: Jason k Larson

Re: progress page
        130540 by: Nuno Lopes

XHTML Validator Problem
        130541 by: Michael Egan

PHP Editors
        130542 by: Nilza Lafayette
        130549 by: Neil Freeman
        130551 by: Khalid El-Kary

InStallation Error Of ZendStudio on win98
        130543 by: Steven Seijmonsbergen
        130544 by: Timothy Hitchens \(HiTCHO\)

Re: PHP and MySQL bug
        130546 by: Nuno Lopes

Re: Creating an extra library
        130550 by: Tom Vandeplas

Administrivia:

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

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

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello,

On 01/06/2003 01:21 PM, Rad Craig wrote:
I'm running under Win2k, new install of PHP(last week), I have been trying
to test the mail() function, but it doesn't seem to work.  I host my own
mail server on the same machine and I know it works, has been for months,
all other mail come/goes just fine.  I don't have the default SMTP server
for IIS installed since I have my own SMTP/POP3 mail server on this same
server.

I have tried it with the following:
mail("[EMAIL PROTECTED]", "test message", "this is a test");

I have SMTP authentication turned off on my mail server for this testing.

It never arrives, I never get an error.

I can telnet to port 25, all works fine.

phpinfo.php reports that everything looks good, only thing i saw was that
the extension directory shows c:\php4 instead of c:\php.

I don't have any extra .dll's or anything turned on since it has built-in
support for MySQL.
Have you tried this alternative as I suggested in this other message to you? Many people solved their problem with it, so can you.

http://news.php.net/article.php?group=php.general&article=130351


--

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
I can't use that as the program that I need for the email to work with, I
don't have access to it's mail() function...yet.

Rad...

> -----Original Message-----
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 06, 2003 4:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: mail() not working on Win2k
>
>
> Hello,
>
> On 01/06/2003 01:21 PM, Rad Craig wrote:
> > I'm running under Win2k, new install of PHP(last week), I have
> been trying
> > to test the mail() function, but it doesn't seem to work.  I host my own
> > mail server on the same machine and I know it works, has been
> for months,
> > all other mail come/goes just fine.  I don't have the default
> SMTP server
> > for IIS installed since I have my own SMTP/POP3 mail server on this same
> > server.
> >
> > I have tried it with the following:
> > mail("[EMAIL PROTECTED]", "test message", "this is a test");
> >
> > I have SMTP authentication turned off on my mail server for
> this testing.
> >
> > It never arrives, I never get an error.
> >
> > I can telnet to port 25, all works fine.
> >
> > phpinfo.php reports that everything looks good, only thing i
> saw was that
> > the extension directory shows c:\php4 instead of c:\php.
> >
> > I don't have any extra .dll's or anything turned on since it
> has built-in
> > support for MySQL.
>
> Have you tried this alternative as I suggested in this other message to
> you? Many people solved their problem with it, so can you.
>
> http://news.php.net/article.php?group=php.general&article=130351
>
>
> --
>
> Regards,
> Manuel Lemos
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hello,

On 01/06/2003 08:46 PM, Rad Craig wrote:
I can't use that as the program that I need for the email to work with, I
don't have access to it's mail() function...yet.
As I explained, the class comes with a wrapper function named smtp_mail() that emulates mail() function (but without the bugs). All you need to do is to replace mail() calls by smtp_mail() calls including smtp_mail.php where needed.

Even if you do not want to replace anything, you can still try the class test scripts to see if it works for you. If it doesn't, it will provide helpful error messages unlike the mail() function. Now it is up to you if you want to progress in solving your problem.

Regards,
Manuel Lemos


-----Original Message-----
From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 4:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: mail() not working on Win2k


Hello,

On 01/06/2003 01:21 PM, Rad Craig wrote:

I'm running under Win2k, new install of PHP(last week), I have
been trying

to test the mail() function, but it doesn't seem to work.  I host my own
mail server on the same machine and I know it works, has been
for months,

all other mail come/goes just fine.  I don't have the default
SMTP server

for IIS installed since I have my own SMTP/POP3 mail server on this same
server.

I have tried it with the following:
mail("[EMAIL PROTECTED]", "test message", "this is a test");

I have SMTP authentication turned off on my mail server for
this testing.

It never arrives, I never get an error.

I can telnet to port 25, all works fine.

phpinfo.php reports that everything looks good, only thing i
saw was that

the extension directory shows c:\php4 instead of c:\php.

I don't have any extra .dll's or anything turned on since it
has built-in

support for MySQL.
Have you tried this alternative as I suggested in this other message to
you? Many people solved their problem with it, so can you.

http://news.php.net/article.php?group=php.general&article=130351

--- End Message ---
--- Begin Message ---
I have 3 SunOS boxes, all running the same version of OS, apache and php.  I
have a page on all three servers that will allow a user to select a
directory from a drop down box and upon selecting the directory, be able to
select a file to view from a drop down box.  When the user selects the
directory, the page is refreshed and a second drop down box containing the
file names is displayed.

Here is where I'm running into some problems.  I need the file listing to be
sorted as if I were performing an 'ls -lt' listing on the server itself.
I'm using the readdir() function to get the file names and load them into an
array.  I then walk down the array backwards to build my drop-down list.  On
2 of my servers, this method works great!  However, on the other one, it is
throwing the most recently created files in the middle of the list.

Here is the code that I'm using:
$handle=opendir("$path");
  while (false !== ($file = readdir($handle)))  $filenames[] = $file;
  for($i=(count($filenames) - 1); $i >= 0; $i--) {
   $selected = ( $cboListFiles == $filenames[$i] ? " selected" : "" );
   if ($filenames[$i] != "." and $filenames[$i] !="..") {
    echo "<option value=". "$filenames[$i]" . " $selected>" .
"$filenames[$i]" . "</option>\n";
   }
  }

Even if I take out the sorting, the file listing order does not change.

Any ideas about what may be causing this?

Thanks!
Joe



--- End Message ---
--- Begin Message ---
I have 3 SunOS boxes, all running the same version of OS, apache and php.  I
have a page on all three servers that will allow a user to select a
directory from a drop down box and upon selecting the directory, be able to
select a file to view from a drop down box.  When the user selects the
directory, the page is refreshed and a second drop down box containing the
file names is displayed.

Here is where I'm running into some problems.  I need the file listing to be
sorted as if I were performing an 'ls -lt' listing on the server itself.
I'm using the readdir() function to get the file names and load them into an
array.  I then walk down the array backwards to build my drop-down list.  On
2 of my servers, this method works great!  However, on the other one, it is
throwing the most recently created files in the middle of the list.

Here is the code that I'm using:
$handle=opendir("$path");
  while (false !== ($file = readdir($handle)))  $filenames[] = $file;
  for($i=(count($filenames) - 1); $i >= 0; $i--) {
   $selected = ( $cboListFiles == $filenames[$i] ? " selected" : "" );
   if ($filenames[$i] != "." and $filenames[$i] !="..") {
    echo "<option value=". "$filenames[$i]" . " $selected>" .
"$filenames[$i]" . "</option>\n";
   }
  }

Even if I take out the sorting, the file listing order does not change.

Any ideas about what may be causing this?

Thanks!
Joe





---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--- End Message ---
--- Begin Message ---
If it were possible, it would likely be a javascript
function, rather than PHP, because it would be
controlled by the browser. Check the JavaScript
navigator or window objects. 

# # #
Hi all,

I have a PHP page that returns products.  My client
wants to have a 
button
beside each product that says "Download".  When you
click download, he 
wants
the "Save Picture" Window box to automatically open
and allow the 
viewer to
select the location to save the image that he clicked
"DownLoad" on.

Is this possible with PHP?

Thanks,

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
> Not to cause a flame war, but, MySQL and PostgreSQL are both excellent
> choices, MySQL tends to be a lighter less feature rich database while
> PostgreSQL tends to have more features, perform better under load, etc.

Under differing types of load, yes. MySQL is more hit-based, while
PostgreSQL deals well with bigger queries. So basically undisputed.

> You can read a lot about the two databases at google.com and also at
> postgresql.org.
>
> I highly dispute the claim that MySQL is more actively used or that it
> is more actively developed, PostgreSQL has a very good sized user base
> with a lot of both non commericial community support and commericial
> quality support.

PostgreSQL does have its own significant user base. I think MySQL has a
larger user base. Of course, I won't state that user base is a heavily
weighted factor in this case (or in most).

> There are a large number of applications that use postgres as well, even
> if there weren't the reasoning "there are lots of applications that use
> this product so it must be good" is amazing to me, if that were true
> Windows would be the winner because there is the most commercial support
> for windows, there is also the most applications for windows so
> therefore windows must be better than Unix (we all know that is not
> true, at least in most cases).
>
> This is not intended to cause a flame, just to balance the comments, as
> always you should do your own benchmarking or at least do in dept
> research before deciding on any solution.  Your mileage will vary so
> take other people's advice carefully, in the end look at performance,
> stability, ability to scale, and support.

My understanding is for speed / fast + simple queries go with MySQL. Heavier
or more complex / long queries go with PostgreSQL. I'm biased to MySQL
(though unhappy with lack of subselects, but have found that I can sometimes
write better queries when forced to avoid them), so take with a large dose
of salt. As for the comment about subselects in version 4 being available,
well... I am right that they are... but they're sorta not out yet as was
stated so... well, let's just say my words taste bitter on the way back down
*sigh*

-Jeff
SIG: HUP

--- End Message ---
--- Begin Message ---
Any idea why Im getting these empty messages?

Rick

"Freedom and immorality can not co-exist because freedom requires personal
responsibility." - Unknown

------ Forwarded Message
From: [EMAIL PROTECTED]
Date: Mon, 6 Jan 2003 17:41:19 -0500 (EST)



------ End of Forwarded Message

--- End Message ---
--- Begin Message ---
I need to parse some source code to find the contents of a specific
function.  The only way I can think of is to load the source file into a
string find the function by name and parse the text in the string and find
the end brace of the function, made difficult by the existence of all the
other braces that may be there (if, while, switch, foreach, etc...).
Anybody have some code to do this???

function someFunc() {

if(something) {
   something...
}

while(something) {
   something...
}

} // So I need the code from the beginning of the function to here

TIA
-Shawn


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

check out phpDocumentor, it has a class named Parser that does exactly what
you need.

You can get the latest release at http://sourceforge.net/projects/phpdocu
nightly cvs builds are at http://developer.phpdoc.org/downloads

In CVS, there are 2 parsers to choose from, and both are very stable, but
the CVS build of phpDocumentorTParser is MUCH faster (up to 11 times faster
depending on the filesize) but requires php 4.3.0.  Look in
phpDocumentor/Parser.inc and phpDocumentor/phpDocumentorTParser.inc in CVS,
and in ./Parser.inc in the 1.1.0 release.

You would only need to create an object with a method HandleEvent like:
class receive {
    function HandleEvent($event,$data) {
        if ($event != PHPDOCUMENTOR_EVENT_NEWSTATE) {
            if ($data->getType() == 'function' && $data->name == 'someFunc')
            {
                 $source = $data->getSource();
            }
        }
    }
}

Then, modify Parser::parse() by changing the line:

            if ($this->p_flags['get_source'])
            {
                if ($pevent == PARSER_EVENT_FUNCTION)
                {
                    $this->wp->retrievesource("function $word");
                    $this->p_flags['get_source'] = false;
                    $this->p_flags['getting_source'] = true;
                }
            }

to:

            if (true)
            {
                if ($pevent == PARSER_EVENT_FUNCTION)
                {
                    $this->wp->retrievesource("function $word");
                    $this->p_flags['get_source'] = false;
                    $this->p_flags['getting_source'] = true;
                }
            }

Alternately, you can get the cvs build and use the new phpDocumentorTParser
that takes advantage of PHP 4.3.0's stable tokenizer extension
(http://www.php.net/tokenizer) to parse faster.  The line to replace in that
class is phpDocumentorTParser::parse():

            if ($this->_pf_get_source)
            {
                if ($pevent == PARSER_EVENT_FUNCTION)
                {
                    $this->_wp->retrievesource($word);
                    $this->_pf_get_source = false;
                    $this->_pf_getting_source = true;
                }
            }

change to:

            if (true)
            {
                if ($pevent == PARSER_EVENT_FUNCTION)
                {
                    $this->_wp->retrievesource($word);
                    $this->_pf_get_source = false;
                    $this->_pf_getting_source = true;
                }
            }


Here's the complete code you need to write (except for the modifications
above):

<?php
// change the path to be that which is necessary
include_once("phpDocumentor/WordParser.inc");
include_once("phpDocumentor/EventStack.inc");
include_once("phpDocumentor/ParserData.inc");
include_once("phpDocumentor/InlineTags.inc");
include_once("phpDocumentor/DocBlockTags.inc");
include_once("phpDocumentor/DescHTML.inc");
include_once("phpDocumentor/ParserDocBlock.inc");
include_once("phpDocumentor/ParserElements.inc");
include_once("phpDocumentor/Parser.inc");
include_once("phpDocumentor/phpDocumentorTWordParser.inc");
include_once("phpDocumentor/phpDocumentorTParser.inc");


class someFunc_receive {
    function HandleEvent($event,$data) {
        if ($event != PHPDOCUMENTOR_EVENT_NEWSTATE) {
            if ($data->getType() == 'function' && $data->name == 'someFunc')
            {
                 $source = $data->getSource();
                 {do something with the source}
            }
        }
    }
}

$fp = fopen('/path/to/file.php','r');
$contents = fread($fp,filesize('/path/to/file.php'));

$parser = new phpDocumentorTParser; // or $parser = new Parser;
$receiver = new someFunc_receive;

$parser->subscribe('*',$receiver);
$parser->parse($contents, ''); // the other parameters are for
phpDocumentor, you won't need them

?>

You can also modify the Parser class to avoid publishing anything that isn't
necessary, and speed things up for your specific case.

It is possible to do some other method, but you need to be able to parse
strings, and recognize functions in a class otherwise code like this will
break your parser:

<?php
class myclass
{
 // {this brace is parsed even though it's in a comment
  /* } so is this one and this one } */
    function someFunc() {
        $data = "Now you're up a creek without a paddle! }";
    }
}

function someFunc() {
}
?>

In the end, you'll be forced to reinvent the wheel at great personal agony
:).  Go with phpDocumentor, and your life will be smooth sailing.
Incidentally, the source returned by the phpDocumentorTParser is an array of
tokens from the tokenizer, so the code will already be split up, if that is
useful.  If not, you can easily join the code back into a string using:

$total = '';
foreach($source as $item) {
    if (is_array($item)) $item = $item[1]; // $item[0] is the token
    $total .= $item;
}

Take care,
Greg
--
phpDocumentor
http://www.phpdoc.org

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to parse some source code to find the contents of a specific
> function.  The only way I can think of is to load the source file into a
> string find the function by name and parse the text in the string and find
> the end brace of the function, made difficult by the existence of all the
> other braces that may be there (if, while, switch, foreach, etc...).
> Anybody have some code to do this???
>
> function someFunc() {
>
> if(something) {
>    something...
> }
>
> while(something) {
>    something...
> }
>
> } // So I need the code from the beginning of the function to here
>
> TIA
> -Shawn
>
>


--- End Message ---
--- Begin Message ---
A MySQL timestamp is different to a MySQL timestamp.


$time = time(); will produce a unix timestamp

what you want is 

$time = date('Y-m-d');
to give a value in the format YYYY-MM-DD

I think you can also use NOW():
$query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
(NULL, '$name', '$pass', '$email', NOW())";
... but I've never tried -- loook up NOW() in the MySQL manual.


IF you wanted the unix stamp instead (seconds since unix epoch), you should
change the column type of dateAdded to an unsigned integer of 32 bits (from
what I can tell from the manual).

I personally prefer unix stamps (seconds) over formatted dates (YYYY-MM-DD)
because it's easy to compare them and find out the difference (subtract one
from the other), add a day (add 24*60*60) etc etc, BUT it's harder
(impossible) for a human to read the raw data in the DB.


Good luck,

Justin French



on 07/01/03 3:19 AM, - [ Paul Ferrie ] - ([EMAIL PROTECTED])
wrote:

> hey guys could someone help me
> I have created a user login register system in  flash with PHP and Mysql.
> Everthing Now works fine aprt from the time stamp of when the user
> registered.
> 
> Code -----------------------------------
> // Get current date & time
> $time = time();
> // Connects to the Database.
> $Connect = mysql_connect($dbServer, $dbUser, $dbPass);
> mysql_select_db("$dbName");
> // Preforms the SQL query to see if user name already exsists
> $query = "SELECT name FROM contacts WHERE name='$name'";
> $rs_contacts = mysql_query($query) or die(mysql_error());
> $row = mysql_fetch_assoc($rs_contacts);
> if ($row[name] == $name) {
> print "loginT=UserName in Use&checklog=2";
> }else{
> $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
> (NULL, '$name', '$pass', '$email', '$time')";
> }
> 
> 
> It inserts 0000-00-00
> instead of the current date
> 
> ideas
> 
> P.S
> I am a newbie try keeping reponse's simple please
> 
> 

--- End Message ---
--- Begin Message ---
What I would do, and this is one of those "write it once, use it a 1000
times" things, is store all your states in an array.

<?
$states = array(
            'AL' => 'Alabama',
            'AK' => 'Alaska',
            'AZ' => 'Arizona'
            );
?>

Then, you can loop through that array to build your form element:

<?
echo '<select name="state">';
foreach($states as $code => $fullName)
    {
    echo "<option value='{$code}'>{$fullName}</option>";
    }
echo '</select>';
?>

MUCH less code eh?

Then, to have the pre-selected element selected again, I'll assume you have
a value like $state or $selectedState, with a value of 'AZ' for example.

<?
$selectedState = 'AZ'; //usually grabbed from a database I assume?

echo '<select name="state">';
foreach($states as $code => $fullName)
    {
    if($stateSelected == $code) { $sel = ' SELECTED'; } else { $sel = ''; }
    echo "<option value='{$code}'{$sel}>{$fullName}</option>";
    }
echo '</select>';
?>

The result of which would be something like:

<select name="state">
<option value='AL'>Alabama</option>
<option value='AK'>Alaska</option>
<option value='AZ' SELECTED>Arizona</option>
</select>


Season to taste :)

Justin French




on 07/01/03 4:54 AM, Steven Kallstrom ([EMAIL PROTECTED]) wrote:

> I have a drop down list with all fifty states. very common.  I conjured
> up a way to store the value when you return to edit the form, but there
> most be an easier way either in html, or in php.  Here is what I
> currently have.
> 
> <select name="state">
> <option value="AL"{$stateselected['AL']}>Alabama</option>
> <option value="AK"{$stateselected['AK']}>Alaska</option>
> <option value="AZ"{$stateselected['AZ']}>Arizona</option>
> .
> </select>
> 
> $stateselected['$state'] is an array that stores the state that was
> selected on the prior form.  is there an easier way, to have a default
> state picked out of this drop down list.???
> 
> Thanks,
> 
> Steven Kallstrom
> 

--- End Message ---
--- Begin Message ---
At 11:54 AM 1/6/03 -0600, Steven Kallstrom wrote:
<select name="state">
            <option value="AL"{$stateselected['AL']}>Alabama</option>
            <option value="AK"{$stateselected['AK']}>Alaska</option>
            <option value="AZ"{$stateselected['AZ']}>Arizona</option>
            .
</select>

$stateselected['$state'] is an array that stores the state that was
selected on the prior form.  is there an easier way, to have a default
state picked out of this drop down list.???

Write a function that paints selects:

$States = array( 'AL' => 'Alabama', ...


function PaintSelect( $Name, $Values, $Selected ) {

echo "<SELECT NAME=\"$Name\">\n";

reset( $Values );
while( list( $Index, $Value ) = each( $Values )) {
   $Selected = ( $Selected == $Index ) ? ' SELECTED' : '';
   echo "   <OPTION VALUE=\"$Index\"$SELECTED>$Value</OPTION>\n'
   }

echo "</SELECT>\n";

}


Then call lt like this ...

State: <? PaintSelect( 'State', $States, $stateselected['$state'] ) ?><BR>


Rick



--- End Message ---
--- Begin Message ---
Ok I know it's off topic, but I've been working on this for over 5 hours now
and I almost have it configured, but something is definitely wrong!
Basically I can send email using sendmail by this command:

echo "Just a test" | mail -s "test" [EMAIL PROTECTED]

Now [EMAIL PROTECTED] receives the email, but the From address is
[EMAIL PROTECTED] and I have no idea where it is getting that
address from!  Does anyone know how I can change that from address?

And what would stop the above command from delivering to certain valid email
addresses?

This is definitely causing problems with my php server also when trying to
send emails...

Rick

"Only a life lived for others is worth living." - Albert Einstein

--- End Message ---
--- Begin Message ---
richard check your php.ini & the mail stuff in there .. it's most likely
using the address either there or ur web server config file

> -----Original Message-----
> From: Richard Baskett [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 7 January 2003 10:49 AM
> To: PHP General
> Subject: [PHP] PHP sendmail configuration
>
>
> Ok I know it's off topic, but I've been working on this for over
> 5 hours now
> and I almost have it configured, but something is definitely wrong!
> Basically I can send email using sendmail by this command:
>
> echo "Just a test" | mail -s "test" [EMAIL PROTECTED]
>
> Now [EMAIL PROTECTED] receives the email, but the From address is
> [EMAIL PROTECTED] and I have no idea where it is getting that
> address from!  Does anyone know how I can change that from address?
>
> And what would stop the above command from delivering to certain
> valid email
> addresses?
>
> This is definitely causing problems with my php server also when trying to
> send emails...
>
> Rick
>
> "Only a life lived for others is worth living." - Albert Einstein
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
The problem you are having took me a while to grasp. Basically, what
happens is that sendmail sends the mail as the user php/apache was
installed as (usually nobody@ or apache@ yourdomain.com).
Setting the Return-Path does not work, as you cannot override the
Return-Path set by the server in this way, that's why messages bounce to
your root account when sent with a php mail() function. If you only host
one domain on a server, you can fix this by editing the sendmail.cf file
and setting the Return-Path: to something more meaningful: However, most
people don't have the luxury of having a "one domain" hosting solution.

Your only other option is to invoke sendmail with the -f switch:
sendmail -f sender@address recipient@address <file_containing_message

This "forces" a from: address, but it also produces a warning to the
recipient that the message headers might be forged, but return mails and
replies are directed to the address specified.

Only problem with all this is that you need to do one of 2 things:
a) use of PHP's system commands eg.
$mail = `echo -e "Subject: Subject here\n\n Message here" |
/usr/sbin/sendmail -f $your_address $recipient_address`;

OR

b) use a PERL script to do it.

I am currently looking at both, and it seems at this stage that the PERL
script will be the better option, specially if you need to mail to alot
of people. You need to issue the sendmail in a loop, and for load
balancing, it's best to put a sleep() inside the loop; even if you only
make this a sleep(1) (sleep for 1 sec), PHP will timeout after only 30
recipients unless you override the default timeout setting for php
scripts.

On Tue, 2003-01-07 at 03:09, Peter Houchin wrote:
> richard check your php.ini & the mail stuff in there .. it's most likely
> using the address either there or ur web server config file
> 
> > -----Original Message-----
> > From: Richard Baskett [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, 7 January 2003 10:49 AM
> > To: PHP General
> > Subject: [PHP] PHP sendmail configuration
> >
> >
> > Ok I know it's off topic, but I've been working on this for over
> > 5 hours now
> > and I almost have it configured, but something is definitely wrong!
> > Basically I can send email using sendmail by this command:
> >
> > echo "Just a test" | mail -s "test" [EMAIL PROTECTED]
> >
> > Now [EMAIL PROTECTED] receives the email, but the From address is
> > [EMAIL PROTECTED] and I have no idea where it is getting that
> > address from!  Does anyone know how I can change that from address?
> >
> > And what would stop the above command from delivering to certain
> > valid email
> > addresses?
> >
> > This is definitely causing problems with my php server also when trying to
> > send emails...
> >
> > Rick
> >
> > "Only a life lived for others is worth living." - Albert Einstein
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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

I am sending a file to user's browser and logging the downloaded file into
MySQL but everytime this script works, I see double entry in the MySQL
table... Why is this happening?

Any ideas?

Thanks

<?
 $today = date("Y-m-d");

 $conn = db_connect();

 if(!$conn)
  echo "Can't connect to database...";

 $query = "INSERT INTO track_dl (dldate, email, file)
    VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')";

 $result = mysql_query($query);

 if(!$result)
  echo "Can't execute query: " . mysql_error();

header("Content-type: application/pdf");
readfile("file.pdf");
exit();
?>


--- End Message ---
--- Begin Message ---

I have this silly problem. This select query works fine.

####################################################
$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id ORDER by tasks.ID";
####################################################

But when I add a further filter (AND active="yes") ....it comes up
blank...currently all the active rows in the tasks table are equal to
"yes" so they should still display, but comes up with a blank. 

####################################################
$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id AND active="yes" ORDER by tasks.ID";
####################################################

Can't understand this, is it just something simple I am missing??

Cheers
--- End Message ---
--- Begin Message ---
At 04:27 PM 1/6/03 , Bruce Levick wrote:


I have this silly problem. This select query works fine.

####################################################
$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id ORDER by tasks.ID";
####################################################

But when I add a further filter (AND active="yes") ....it comes up
blank...currently all the active rows in the tasks table are equal to
"yes" so they should still display, but comes up with a blank.

####################################################
$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id AND active="yes" ORDER by tasks.ID";
####################################################

Can't understand this, is it just something simple I am missing??

If this is the query you are actually using, it is causing a PHP syntax error due to the nested double-quotes. Use

$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id AND active='yes' ORDER by tasks.ID";

Note the single-quotes around 'yes'.

I'm guessing your installation is set up to not echo PHP errormessages back to the screen, that's why you didn't see an error message.

-steve


+------------------------------------------------------------------------+
| Steve Edberg [EMAIL PROTECTED] |
| Database/Programming/SysAdmin (530)754-9127 |
| University of California, Davis http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+
--- End Message ---
--- Begin Message --- Your SQL statement is selecting from two tables, it doesn't know which table the 'active' column belongs to. Try one of the following as appropriate to your schema:

tasks.active="yes"
or
users.active="yes"

HTH,
Jason k Larson


Bruce Levick wrote:

I have this silly problem. This select query works fine.

####################################################
$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id ORDER by tasks.ID";
####################################################

But when I add a further filter (AND active="yes") ....it comes up
blank...currently all the active rows in the tasks table are equal to
"yes" so they should still display, but comes up with a blank.

####################################################
$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id AND active="yes" ORDER by tasks.ID";
####################################################

Can't understand this, is it just something simple I am missing??

Cheers


--- End Message ---
--- Begin Message ---
Yes that works.....me newbie php skills falling down again...;0)


-----Original Message-----
From: Wee Keat (VisualDensity] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 07, 2003 10:25 AM
To: Bruce Levick
Subject: Re: [PHP] mmmmm SELECT




>####################################################
>$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID = 
>users.User_id AND active="yes" ORDER by tasks.ID"; 
>####################################################

>Can't understand this, is it just something simple I am missing??


Try using single quote instead of double quote... like this


$query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID =
users.User_id AND active='yes' ORDER by tasks.ID";

Not too sure myself... but it's just a wild guess...

Hope this helps!

Yours,
Wee Keat

------------------------------------------------------------
"Good timber does not grow with ease; the stronger the wind, the
stronger the trees."



--- End Message ---
--- Begin Message ---
Monty --

...and then Monty said...
% 
% Okay, I've read just about everything on the Internet about how the change
% the Return-Path header in an e-mail sent using mail(), but, I STILL can't
% get it to work. All e-mail sent via PHP says Return-Path: [EMAIL PROTECTED]
% and Received: (from nobody@localhost).

How interesting.

What do you get if you put

  $to = "[EMAIL PROTECTED]" ;
  $subj = "here is a subject" ;
  $body = "this is the message body" ;
  $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path: [EMAIL PROTECTED]" ;

  mail($to,$subj,$body,$hdrs) ;

in a php script and execute it?  If it doesn't work, what do the mail
server lots on your web server say?  I just tested this code on my box
and it worked, so if you have problems then you can figure it's your mail
setup and not your code.  If it works, expand from there in small steps :-)


HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg91896/pgp00000.pgp
Description: PGP signature

--- End Message ---
--- Begin Message ---
Hmm... I would expect that your sendmail.cf (if you are using sendmail)
hasn't got
your webserver (running as eg www or apache etc) in it's trusted users
file / listing.



HiTCHO has Spoken! 
Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED] 

> -----Original Message-----
> From: David T-G [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, 7 January 2003 10:34 AM
> To: PHP General list
> Cc: Monty
> Subject: Re: [PHP] Dreaded Return-Path and mail()
> 
> 
> Monty --
> 
> ...and then Monty said...
> % 
> % Okay, I've read just about everything on the Internet about 
> how the change % the Return-Path header in an e-mail sent 
> using mail(), but, I STILL can't % get it to work. All e-mail 
> sent via PHP says Return-Path: [EMAIL PROTECTED] % and 
> Received: (from nobody@localhost).
> 
> How interesting.
> 
> What do you get if you put
> 
>   $to = "[EMAIL PROTECTED]" ;
>   $subj = "here is a subject" ;
>   $body = "this is the message body" ;
>   $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path: 
> [EMAIL PROTECTED]" ;
> 
>   mail($to,$subj,$body,$hdrs) ;
> 
> in a php script and execute it?  If it doesn't work, what do 
> the mail server lots on your web server say?  I just tested 
> this code on my box and it worked, so if you have problems 
> then you can figure it's your mail setup and not your code.  
> If it works, expand from there in small steps :-)
> 
> 
> HTH & HAND
> 
> :-D
> -- 
> David T-G                      * There is too much animal courage in 
> (play) [EMAIL PROTECTED] * society and not sufficient 
> moral courage.
> (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, 
> "Science and Health"
> http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf 
> Qrprapl Npg!
> 
> 

--- End Message ---
--- Begin Message ---
Almost exactly the same question as the message with subject: Sendmail
configuration....

The problem you are having took me a while to grasp. Basically, what
happens is that sendmail sends the mail as the user php/apache was
installed as (usually nobody@ or apache@ yourdomain.com).
Setting the Return-Path does not work, as you cannot override the
Return-Path set by the server in this way, that's why messages bounce to
your root account when sent with a php mail() function. If you only host
one domain on a server, you can fix this by editing the sendmail.cf file
and setting the Return-Path: to something more meaningful: However, most
people don't have the luxury of having a "one domain" hosting solution.

Your only other option is to invoke sendmail with the -f switch:
sendmail -f sender@address recipient@address <file_containing_message

This "forces" a from: address, but it also produces a warning to the
recipient that the message headers might be forged, but return mails and
replies are directed to the address specified.

Only problem with all this is that you need to do one of 2 things:
a) use of PHP's system commands eg.
$mail = `echo -e "Subject: Subject here\n\n Message here" |
/usr/sbin/sendmail -f $your_address $recipient_address`;

OR

b) use a PERL script to do it.

I am currently looking at both, and it seems at this stage that the PERL
script will be the better option, specially if you need to mail to alot
of people. You need to issue the sendmail in a loop, and for load
balancing, it's best to put a sleep() inside the loop; even if you only
make this a sleep(1) (sleep for 1 sec), PHP will timeout after only 30
recipients unless you override the default timeout setting for php
scripts.

On Tue, 2003-01-07 at 02:37, Timothy Hitchens (HiTCHO) wrote:
> Hmm... I would expect that your sendmail.cf (if you are using sendmail)
> hasn't got
> your webserver (running as eg www or apache etc) in it's trusted users
> file / listing.
> 
> 
> 
> HiTCHO has Spoken! 
> Timothy Hitchens (HiTCHO)
> [EMAIL PROTECTED] 
> 
> > -----Original Message-----
> > From: David T-G [mailto:[EMAIL PROTECTED]] 
> > Sent: Tuesday, 7 January 2003 10:34 AM
> > To: PHP General list
> > Cc: Monty
> > Subject: Re: [PHP] Dreaded Return-Path and mail()
> > 
> > 
> > Monty --
> > 
> > ...and then Monty said...
> > % 
> > % Okay, I've read just about everything on the Internet about 
> > how the change % the Return-Path header in an e-mail sent 
> > using mail(), but, I STILL can't % get it to work. All e-mail 
> > sent via PHP says Return-Path: [EMAIL PROTECTED] % and 
> > Received: (from nobody@localhost).
> > 
> > How interesting.
> > 
> > What do you get if you put
> > 
> >   $to = "[EMAIL PROTECTED]" ;
> >   $subj = "here is a subject" ;
> >   $body = "this is the message body" ;
> >   $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path: 
> > [EMAIL PROTECTED]" ;
> > 
> >   mail($to,$subj,$body,$hdrs) ;
> > 
> > in a php script and execute it?  If it doesn't work, what do 
> > the mail server lots on your web server say?  I just tested 
> > this code on my box and it worked, so if you have problems 
> > then you can figure it's your mail setup and not your code.  
> > If it works, expand from there in small steps :-)
> > 
> > 
> > HTH & HAND
> > 
> > :-D
> > -- 
> > David T-G                      * There is too much animal courage in 
> > (play) [EMAIL PROTECTED] * society and not sufficient 
> > moral courage.
> > (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, 
> > "Science and Health"
> > http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf 
> > Qrprapl Npg!
> > 
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
As I have said before that if you set the webserver user in as a trusted
user in the sendmail.cf file all is fixed.

You can then set a return-path etc without warnings as well.


HiTCHO has Spoken! 
Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED] 

> -----Original Message-----
> From: Petre Agenbag [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, 7 January 2003 7:43 PM
> To: Timothy Hitchens (HiTCHO)
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Dreaded Return-Path and mail()
> 
> 
> Almost exactly the same question as the message with subject: 
> Sendmail configuration....
> 
> The problem you are having took me a while to grasp. 
> Basically, what happens is that sendmail sends the mail as 
> the user php/apache was installed as (usually nobody@ or 
> apache@ yourdomain.com). Setting the Return-Path does not 
> work, as you cannot override the Return-Path set by the 
> server in this way, that's why messages bounce to your root 
> account when sent with a php mail() function. If you only 
> host one domain on a server, you can fix this by editing the 
> sendmail.cf file and setting the Return-Path: to something 
> more meaningful: However, most people don't have the luxury 
> of having a "one domain" hosting solution.
> 
> Your only other option is to invoke sendmail with the -f 
> switch: sendmail -f sender@address recipient@address 
> <file_containing_message
> 
> This "forces" a from: address, but it also produces a warning 
> to the recipient that the message headers might be forged, 
> but return mails and replies are directed to the address specified.
> 
> Only problem with all this is that you need to do one of 2 things:
> a) use of PHP's system commands eg.
> $mail = `echo -e "Subject: Subject here\n\n Message here" | 
> /usr/sbin/sendmail -f $your_address $recipient_address`;
> 
> OR
> 
> b) use a PERL script to do it.
> 
> I am currently looking at both, and it seems at this stage 
> that the PERL script will be the better option, specially if 
> you need to mail to alot of people. You need to issue the 
> sendmail in a loop, and for load balancing, it's best to put 
> a sleep() inside the loop; even if you only make this a 
> sleep(1) (sleep for 1 sec), PHP will timeout after only 30 
> recipients unless you override the default timeout setting 
> for php scripts.
> 
> On Tue, 2003-01-07 at 02:37, Timothy Hitchens (HiTCHO) wrote:
> > Hmm... I would expect that your sendmail.cf (if you are using 
> > sendmail) hasn't got your webserver (running as eg www or 
> apache etc) 
> > in it's trusted users file / listing.
> > 
> > 
> > 
> > HiTCHO has Spoken!
> > Timothy Hitchens (HiTCHO)
> > [EMAIL PROTECTED] 
> > 
> > > -----Original Message-----
> > > From: David T-G [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, 7 January 2003 10:34 AM
> > > To: PHP General list
> > > Cc: Monty
> > > Subject: Re: [PHP] Dreaded Return-Path and mail()
> > > 
> > > 
> > > Monty --
> > > 
> > > ...and then Monty said...
> > > %
> > > % Okay, I've read just about everything on the Internet about 
> > > how the change % the Return-Path header in an e-mail sent 
> > > using mail(), but, I STILL can't % get it to work. All e-mail 
> > > sent via PHP says Return-Path: [EMAIL PROTECTED] % and 
> > > Received: (from nobody@localhost).
> > > 
> > > How interesting.
> > > 
> > > What do you get if you put
> > > 
> > >   $to = "[EMAIL PROTECTED]" ;
> > >   $subj = "here is a subject" ;
> > >   $body = "this is the message body" ;
> > >   $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path:
> > > [EMAIL PROTECTED]" ;
> > > 
> > >   mail($to,$subj,$body,$hdrs) ;
> > > 
> > > in a php script and execute it?  If it doesn't work, what do
> > > the mail server lots on your web server say?  I just tested 
> > > this code on my box and it worked, so if you have problems 
> > > then you can figure it's your mail setup and not your code.  
> > > If it works, expand from there in small steps :-)
> > > 
> > > 
> > > HTH & HAND
> > > 
> > > :-D
> > > -- 
> > > David T-G                      * There is too much animal 
> courage in 
> > > (play) [EMAIL PROTECTED] * society and not sufficient
> > > moral courage.
> > > (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, 
> > > "Science and Health"
> > > http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf 
> > > Qrprapl Npg!
> > > 
> > > 
> > 
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 

--- End Message ---
--- Begin Message ---
I know I can use Visual Studio to edit PHP files as plain text, but has
anyone seen any way of creating some sort of add-in, or macro or whatever,
which would do syntax highlighting on PHP files?


--- End Message ---
--- Begin Message ---
I'm having users post messages to a MySQL database records and want to
retain the formatting (such as carriage returns and so forth).

I have everything actually working all except that the formatting. Messages
are being posted but when they are returned they lack the carriage returns.
I'd like to be able to make characters bold and so forth, but would settle
for the carriage returns if the rest is too difficult.

Thanks


--- End Message ---
--- Begin Message ---
Assuming you are using a <textarea></textarea> to allow your users to
input their text you need to either use the nl2br (converts new lines to
<br>) or use <pre></pre> tags, following are short examples:

print nl2br($data); or 

print '<pre>';
print $data
print '</pre>';

You can find out more about the nl2br function at
http://www.php.net/manual, if you allow users to enter <b> tags then
they should show up using method.

Jason


On Mon, 2003-01-06 at 19:34, Vernon wrote:
> I'm having users post messages to a MySQL database records and want to
> retain the formatting (such as carriage returns and so forth).
> 
> I have everything actually working all except that the formatting. Messages
> are being posted but when they are returned they lack the carriage returns.
> I'd like to be able to make characters bold and so forth, but would settle
> for the carriage returns if the rest is too difficult.
> 
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi!

I am teacher on a University and I want that our page only be access by
specific people. Anyone has or knows where to find any php to administrate a
base of user and passwords (made in mysql)?

Thanks in advance,

Ezequiel


--- End Message ---
--- Begin Message ---
yep look at sites like phpbeginner.com, phpwizard.com,zend.com,
phpbuilder.com and browse ya way thru the tutorials there are plently of
sites out there such as the ones mentioned that will give you a great
helping hand :)

> -----Original Message-----
> From: Ezequiel Sapoznik [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 7 January 2003 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Access page via user & password
>
>
> Hi!
>
> I am teacher on a University and I want that our page only be access by
> specific people. Anyone has or knows where to find any php to
> administrate a
> base of user and passwords (made in mysql)?
>
> Thanks in advance,
>
> Ezequiel
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Howdy,
I am looking to populate a list menu with the current date and then the
30days after that current date. Is there a small snippet of code that
achieves this??

Cheers
--- End Message ---
--- Begin Message ---
Bruce Levick wrote:
I am looking to populate a list menu with the current date and then the
30days after that current date. Is there a small snippet of code that
achieves this??
Hvae a look at date(), mktime() in the manual.

Here something that should help you get started, it is untested.

function day_dropdown() {
?>
   <select name="date">
<?php
  for ($i=0;$i<30;$i++) {
    $timestamp = mktime(0,0,0,date("m")  ,date("d")+$i,date("Y"));
    $date = date("Ydm", $timestamp);
?>
   <option value="<?php echo *some value* ?>"><?php echo $date; ?></option>
<?php
  }
?>
  </select>
<?php
}
?>

Jc

--- End Message ---
--- Begin Message ---
I'm *positive* there is a better way, but this should work (untested):

<form>
<select name="date">
<?
$stamp = time();
$i = 0;
while($i <= 30)
    {
    if($i > 0) { $stamp = $stamp + 86400; }
    $date = date('d-m-Y',$stamp);
    echo "<option value=\"{$date}\">{$date}</option>";
    $i++;
    }
?>
</select>
</form>


Cheers,

Justin


on 07/01/03 4:39 PM, Bruce Levick ([EMAIL PROTECTED]) wrote:

> Howdy,
> I am looking to populate a list menu with the current date and then the
> 30days after that current date. Is there a small snippet of code that
> achieves this??
> 
> Cheers
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> ---
> [This E-mail scanned for viruses]
> 
> 

--- End Message ---
--- Begin Message ---
That's sweet. Can you just satisfy my curiosity and explain the 86400??
I am thinking this might be minutes??

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 07, 2003 4:12 PM
To: Bruce Levick; [EMAIL PROTECTED]
Subject: Re: [PHP] populate a list menu


I'm *positive* there is a better way, but this should work (untested):

<form>
<select name="date">
<?
$stamp = time();
$i = 0;
while($i <= 30)
    {
    if($i > 0) { $stamp = $stamp + 86400; }
    $date = date('d-m-Y',$stamp);
    echo "<option value=\"{$date}\">{$date}</option>";
    $i++;
    }
?>
</select>
</form>


Cheers,

Justin


on 07/01/03 4:39 PM, Bruce Levick ([EMAIL PROTECTED]) wrote:

> Howdy,
> I am looking to populate a list menu with the current date and then 
> the 30days after that current date. Is there a small snippet of code 
> that achieves this??
> 
> Cheers
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> ---
> [This E-mail scanned for viruses]
> 
> 

--- End Message ---
--- Begin Message ---
Bruce Levick wrote:
That's sweet. Can you just satisfy my curiosity and explain the 86400??
I am thinking this might be minutes??
It the number of seconds in a day.

But that solution doesn't take into account Daylight Savings Time.

The one I posted does, I think ...

Jc

--- End Message ---
--- Begin Message ---
on 07/01/03 5:13 PM, Bruce Levick ([EMAIL PROTECTED]) wrote:

> That's sweet. Can you just satisfy my curiosity and explain the 86400??
> I am thinking this might be minutes??

60 seconds * 60 minutes * 24 hours = 86400 seconds per day
we're increasing $stamp by 1 day each iteration of the while loop

Justin French

--- End Message ---
--- Begin Message ---
Hi.

I kind of got PHP syntax highlighting working within Visual Studio.NET

I've created a page, which mentions the steps you need to take to get it
working, as well as a screen shot. Everyone loves screen shots.

http://www.quake-au.net/php/php_and_vsdotnet.htm

Hope someone finds it useful apart from me.

Regards,

Sean

-----Original Message-----
From: Sean Malloy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 7 January 2003 1:34 PM
To: PHP General
Subject: [PHP] Using VS.NET for PHP Projects



I know I can use Visual Studio to edit PHP files as plain text, but has
anyone seen any way of creating some sort of add-in, or macro or whatever,
which would do syntax highlighting on PHP files?



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

--- End Message ---
--- Begin Message ---
Hello guys,
Right now im using dreamweaver mx 
 
I was wondering if anyone knew of any good free text editors that has
line counts
And is good for php….
 
Thanks 
karl

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002
 
--- End Message ---
--- Begin Message ---
Hi,
I am told to " merge ftp and www " !
I cant understand what it means..
May be it means that it should be possible to browse ftp directory
from a browser? 
What is php's support for ftp?
Mukta     



--- End Message ---
--- Begin Message --- Sounds vague.

Here's the reference page for starters. http://www.php.net/manual/en/ref.ftp.php

HTH,
Jason k Larson


Mukta Telang wrote:

Hi,
I am told to " merge ftp and www " !
I cant understand what it means..
May be it means that it should be possible to browse ftp directory
from a browser?
What is php's support for ftp?
Mukta

--- End Message ---
--- Begin Message ---
open pop window:
<head>
<script language="JavaScript">
<!--
setup='toolbar=no,location=no,directories=no,status=no,menubar=no,width=200,
height=150,scrollbars=no,resizable=no'
pop = window.open ("","pop",setup)
pop.document.write('<head><Title>Pop Up</Title></head><body>');
pop.document.write('<center>Please wait while this page loads.</center>');
 -->
</script>
</head>
------------
close it:
javascript:pop.window.close()


----- Original Message -----
From: "- Edwin" <[EMAIL PROTECTED]>
To: "Edward Peloke" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 06, 2003 4:40 PM
Subject: Re: [PHP] progress page


> Hello,
>
> [EMAIL PROTECTED] (Edward Peloke) wrote:
> > I am working on an application that will take data from the user and
> > run then check through all the data to find matches.  Instead of the
> > user seeing a blank screen while the page is loading, I would like to
> > pop up a page that says, processing, please wait and maybe have an
> > icon like a progress bar or something.  How do I pop up a page and
> > have it disappear when the the other page is done loading?


--- End Message ---
--- Begin Message ---
I've finally got round to making some attempt to validating the pages of a site I've 
done with PHP using the W3C XHTML Validator.  However, it's throwing out errors 
wherever I use session control on pages.

The server generates PHP Session ID variables which are added to links to other pages 
but my understanding is that these are rejected on the basis that the '&' and '=' 
characters are invalid (I might be wrong here).

Examples of the error messages generated by the validator are given below:

Line 154, column 102: cannot generate system identifier for general entity "PHPSESSID" 
  ...u' href='competitions.php?option=add&PHPSESSID=888a059dbc17855c09885c3ea978df
                                          ^
Line 154, column 102: general entity "PHPSESSID" not defined and no default entity 
(explain... <http://validator.w3.org/docs/errors.html>). 
  ...u' href='competitions.php?option=add&PHPSESSID=888a059dbc17855c09885c3ea978df
                                          ^

These are the only error messages left - having dealt with the dozens of others left 
in through my own sloppy coding :-(

I'm not sure how to tackle this given that these elements of the page are generated 
automatically.

Is there a way round this or are there any sources of information relating to this 
area?

Thanks in advance,

Michael Egan
--- End Message ---
--- Begin Message ---
I'm running Apache 2.0 as a service and PHP (like a
 module) onto a Windows Advanced Server. I´m looking
 for a good and free Editor to use with PHP (With
debugging features). Can anyone with experience guide
me?

Thanks.
Janine.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Take a look at Maguma Studio Light (www.maguma.com)

Neil

Nilza Lafayette wrote:
**************************************************************************
This Message Was Virus Checked With : SAVI 3.61 September 2002 Last Updated 2nd January 2003
**************************************************************************

I'm running Apache 2.0 as a service and PHP (like a
module) onto a Windows Advanced Server. I´m looking
for a good and free Editor to use with PHP (With
debugging features). Can anyone with experience guide
me?

Thanks.
Janine.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
----------------------
 www.curvedvision.com
----------------------

--- End Message ---
--- Begin Message ---
PHPEdit i use it personally www.phpedit.net






I'm running Apache 2.0 as a service and PHP (like a
 module) onto a Windows Advanced Server. I´m looking
 for a good and free Editor to use with PHP (With
debugging features). Can anyone with experience guide
me?

Thanks.
Janine.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus

--- End Message ---
--- Begin Message ---
I have a Problem With the install of ZendStudio-2_5_0b.
I'm Using Windows 98 and I will get the error:

This program has performed an illegal!

What can I do to install ZendStudio???


--- End Message ---
--- Begin Message ---
Have you tried it in Safe Mode as you may have a Java Runtime issue.


HiTCHO has Spoken! 
Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED] 

> -----Original Message-----
> From: Steven Seijmonsbergen [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, 7 January 2003 7:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] InStallation Error Of ZendStudio on win98
> 
> 
> I have a Problem With the install of ZendStudio-2_5_0b.
> I'm Using Windows 98 and I will get the error:
> 
> This program has performed an illegal!
> 
> What can I do to install ZendStudio???
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
I have the latest version of PHP (4.3.0) as module in apache 2.0.43 and
mysql 3.23.49.
Everything is working fine, except this.
With pconnect the error is the same!


----- Original Message -----
From: "Larry Brown" <[EMAIL PROTECTED]>
To: "MySQL List" <[EMAIL PROTECTED]>
Sent: Monday, January 06, 2003 6:28 PM
Subject: RE: [PHP] Re: PHP and MySQL bug


> This definitely sounds like a buggy installation or there may be some
> problem with the communication between the web server and the mysqld.  Is
> the db on a different machine?  Try using mysql_pconnect instead of
connect
> just to see what result you get.  I have read some unfavorable statements
> about using pconnect with a large number of hits so if it works you should
> read the comments about it on php.net.  Do a search for mysql_pconnect.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -----Original Message-----
> From: Nuno Lopes [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 06, 2003 1:09 PM
> To: MySQL List; [EMAIL PROTECTED]
> Subject: [PHP] Re: PHP and MySQL bug
>
> The problem is if I close the connection and reopen it the query is done,
> but if I remain with the same connection has the previous query, mysql
> returns an error.
>
>
> ----- Original Message -----
> From: "Larry Brown" <[EMAIL PROTECTED]>
> To: "MySQL List" <[EMAIL PROTECTED]>
> Sent: Sunday, January 05, 2003 4:16 PM
> Subject: Re:PHP and MySQL bug
>
>
> > Try replacing the following line...
> >
> > @MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this query
doesn't
> > work!!!!
> >
> > With...
> >
> > $query = "UPDATE d SET h='$h' WERE id='$id'";
> > $queryr = mysql_query($query) or die("The sql statement does not
> execute");
> >
> > if(mysql_affected_rows() !== 1)
> > {
> >    die("The sql statement is successfully run however either h did not
> > change or there is an internal error.  Try executing the sql from the
> > command line to make sure it otherwise works.");
> > }
> >
> > and see which is coming back.
> >
> >
> > Larry S. Brown
> > Dimension Networks, Inc.
> > (727) 723-8388


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

this is exactly the information I'm looking for, unfortunately the phpize or
pear scripts are not in the 4.2.2 distribution. Is this feature removed from
the newer distributions?

However I found the scripts on the web but they gave quite some errors:
when the script runs autoconf  I get "error: m4_defn: undefined macro:
_m4_divert_diversion"
maybe the versions are incompatible?

Any Ideas ?
Thx, Tom


"J Smith" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Since there's no PHP XSLT extension RPM from Red Hat (as far as I can
tell),
> the easiest way to build it would probably be...
>
> 1. download the PHP source code.
>
> 2. in the ext/xslt directory, run phpize. This is assuming the Red Hat RPM
> installed PEAR and it's utilities.
>
> 3. Run ./configure, make, make install, etc. on the XSLT directory to
build
> your xslt.so shared object.
>
> 4. Modify php.ini to load the new extension, or use the dl() function in
> your scripts.
>
> Of course, you'll also have to install Sablotron and such as well...
>
> J
>
>
> Tom Vandeplas wrote:
>
> > Hi all,
> >
> > this question may have been asked a couple of times already,
unfortunately
> > I can't find the answer.
> >
> > I have a complete PHP-webserver system up and running, based on a
standard
> > redhat PHP distribution. The only thing that is missing are the XSLT
> > funtions. I managed to build php on a different system with xslt
enabled,
> > but then again it lacks all the nice standard features that come with
the
> > redhat distribution.
> >
> > The thing I would like to do is to build "xslt.so" so I can add it to
the
> > existing setup. I know it should be possible since this is the way
RedHat
> > distributes additional libraries. Unfortunately it's not clear to me how
> > to build these "so" files or how to add them to a setup.
> >
> > Any help on this would be greatly appreciated.
>


--- End Message ---

Reply via email to