php-general Digest 9 Feb 2003 03:04:49 -0000 Issue 1872

Topics (messages 134873 through 134932):

Re: Globals off and passing data
        134873 by: Jason Wong

Single vs. Multiple DBs || Which way to go?
        134874 by: CF High
        134875 by: John W. Holmes
        134876 by: CF High

need help with preg_match
        134877 by: joe
        134895 by: Chris Hayes
        134902 by: joe
        134908 by: John W. Holmes

Permenant Page Generation
        134878 by: Mecca
        134880 by: Mecca
        134882 by: Jason Sheets
        134910 by: John W. Holmes

Problems with SQL queries in PHP script
        134879 by: Mike Hilty
        134881 by: Justin Garrett

Attaining NTLM information from IE browsers.
        134883 by: Marriner, Bruce W.
        134888 by: Danny Shepherd

Downloading File rather then Executing
        134884 by: Stephen Craton
        134886 by: Jason Wong
        134887 by: Stephen Craton

html tags
        134885 by: Erich C. Beyrent

problems with 'exec' in 4.3
        134889 by: Gav

Another Prob: MySQL Passwords
        134890 by: Stephen Craton

Alternating Row Colors in PHP........
        134891 by: CF High
        134892 by: olinux
        134893 by: Chris Hayes
        134896 by: CF High
        134919 by: Brian V Bonini

Problem When Linking Array Element To Itself
        134894 by: Guru Geek
        134897 by: Chris Hayes

Output yyyymmdd formatted date || 20030131 to FridayJanuary 31, 2003
        134898 by: CF High
        134899 by: Michael Geier
        134900 by: CF High
        134909 by: John W. Holmes
        134917 by: CF High
        134922 by: John W. Holmes

returning results of cURL POST
        134901 by: Lowell Allen
        134904 by: Lowell Allen

Re: 3 tier web development
        134903 by: Jonathan Chum

any windows php developers out here?
        134905 by: Victor
        134906 by: John W. Holmes
        134907 by: Jason Sheets
        134915 by: Victor
        134916 by: Victor
        134920 by: Adolfo Bello
        134926 by: Victor
        134929 by: Adolfo Bello
        134930 by: John W. Holmes

question about quote and double-quoted strings
        134911 by: Duncan
        134913 by: Justin Garrett

Test
        134912 by: John Nichel

MIME Decoding Class
        134914 by: Jonathan Chum
        134918 by: Hatem Ben

Why does this happen?
        134921 by: CF High
        134927 by: Victor
        134928 by: John W. Holmes

How to uncompress PHP
        134923 by: $BNS(B $B7C72(B
        134924 by: Victor
        134925 by: Adolfo Bello

Re: How to remove only the last character?
        134931 by: Kevin Waterson

fopen problem
        134932 by: Jeff Schwartz

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 ---
On Sunday 09 February 2003 07:59, Paul wrote:
> I'm opening a socket to the remote machine and using post to send the data.
> But please enlighten me, what is the usual method of accessing a remote
> database?

One usually use stuff like mysql_connect() and friends to connect to 
databases. If you're using 'post' (as in HTTP POST) then aren't you in fact 
accessing a webserver which returns data from a database as opposed to 
accessing the database directly?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If it heals good, say it.
*/

--- End Message ---
--- Begin Message ---
Hey all.

I'm attempting to organize a sport report site into working order.

We've got approximately 100 tables, and I'm unsure whether to break the info
up by sport (i.e. baseball, basketball, hockey, etc.) or to lump all the
tables in one db and prefix tables by their sport name (e.g. bk_scoring =
basketball scoring table).

On the surface, it would seem easier to use multiple dbs, but then again,
common tables, such as schools and coach_info would have to be duplicated in
each db.

Any ideas/suggestions much appreciated,

--Noah

--



--- End Message ---
--- Begin Message ---
> I'm attempting to organize a sport report site into working order.
> 
> We've got approximately 100 tables, and I'm unsure whether to break
the
> info
> up by sport (i.e. baseball, basketball, hockey, etc.) or to lump all
the
> tables in one db and prefix tables by their sport name (e.g.
bk_scoring =
> basketball scoring table).

How about just a "scoring" table that has a column on whether it's
Basketball, Hockey, Basket-Weaving, etc? How similar are the scoring
tables between sports? If the tables for each sport are the same, then
keep them in one database and just have identifiers in the table that
say what sport it's for. Do you normally run queries that combine
sports? Or is it something like if a user is in the "basketball" area,
then all of the queries will pull basketball related data?

> On the surface, it would seem easier to use multiple dbs, but then
again,
> common tables, such as schools and coach_info would have to be
duplicated
> in
> each db.

That's not a good idea...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
Hey John.

Thanks for the candid reply -- basket weaving ;--)

Re: scoring, yes, you're right, queries are sport dependent; i.e. if you're
in the basketball section, basketball queries are run...........

At this point in my development experience, creating an all sport scoring
table is stretching it a bit.  Based on a hockey report I created a few
months ago, I understand how to create functional, albeit crude, single
sport interfaces.

Given the limited time frame I'm working with, using the single sport model
is preferred -- because I've yet to learn the alternatives!

In any case, the multi-db model is out of the picture for now.  I'll just
have to alias the table names and do the best I can to organize the table
structure in a sensible manner.

If you have any brainstorms about how to work with a multi-sport interface
in a single db, let me know.  I'm not looking forward to sifting through a
100 tables..........

Thanks,

                --Noah

----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'CF High'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 7:32 AM
Subject: RE: [PHP] Single vs. Multiple DBs || Which way to go?


> > I'm attempting to organize a sport report site into working order.
> >
> > We've got approximately 100 tables, and I'm unsure whether to break
> the
> > info
> > up by sport (i.e. baseball, basketball, hockey, etc.) or to lump all
> the
> > tables in one db and prefix tables by their sport name (e.g.
> bk_scoring =
> > basketball scoring table).
>
> How about just a "scoring" table that has a column on whether it's
> Basketball, Hockey, Basket-Weaving, etc? How similar are the scoring
> tables between sports? If the tables for each sport are the same, then
> keep them in one database and just have identifiers in the table that
> say what sport it's for. Do you normally run queries that combine
> sports? Or is it something like if a user is in the "basketball" area,
> then all of the queries will pull basketball related data?
>
> > On the surface, it would seem easier to use multiple dbs, but then
> again,
> > common tables, such as schools and coach_info would have to be
> duplicated
> > in
> > each db.
>
> That's not a good idea...
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>

--- End Message ---
--- Begin Message ---
Hi
I have to alter this code:
<?php
$fp = fopen ('http://www.whatever.ee/', 'r');

for ($src = ''; !feof ($fp); $src .= fgets ($fp, 1024));

fclose ($fp);

if (preg_match ('/\<font color=black\>([^<]*)\<\/font>/i', $src, $matches))
    echo    'Match: <b>'.$matches[1].'</b>';
else
    echo    'No match !';
?>

It extracts the data (words) from www.whatever.com between <font=black> and
</font>.
It works well if the source looks something like this:
<font=black>text</font> (it echos "text")
but i am having some serious problems when the source looks like
this<table><font=black><tr>text</tr></font></table>. It wont do anything if
it is supposed to echo html. but i need html!
Could somebody help me change the script so that it can extract html as
well?
If you can, mail me at [EMAIL PROTECTED] or just reply here....
Thank You!


--- End Message ---
--- Begin Message ---
At 17:21 8-2-2003, you wrote:
Hi
I have to alter this code:
<?php
$fp = fopen ('http://www.whatever.ee/', 'r');

for ($src = ''; !feof ($fp); $src .= fgets ($fp, 1024));

fclose ($fp);

if (preg_match ('/\<font color=black\>([^<]*)\<\/font>/i', $src, $matches))
    echo    'Match: <b>'.$matches[1].'</b>';
else
    echo    'No match !';
?>

It extracts the data (words) from www.whatever.com between <font=black> and
</font>.
It works well if the source looks something like this:
<font=black>text</font> (it echos "text")
but i am having some serious problems when the source looks like
this<table><font=black><tr>text</tr></font></table>. It wont do anything if
it is supposed to echo html. but i need html!
Could somebody help me change the script so that it can extract html as
well?
If you can, mail me at [EMAIL PROTECTED] or just reply here....
Thank You!

anyway. this did what you asked for.

<?PHP
$src='<table><font color=black><tr>text</tr></font></table>.';
$pattern='/\<font color=black\>(.*)\<\/font>/i';

if (preg_match ($pattern, $src, $matches))
echo 'Match: <b>'.htmlspecialchars($matches[0]).'</b>';
else
echo 'No match !';

?>

note that i show the output with htmlspecialchars() so you can actually see the tag while testing
also note that i replaced your [^<]* with .*




--- End Message ---
--- Begin Message ---
Thank You very much!
It Really works the way I want it to. But i still have a slight problem. The
script cant read the data if it is on several rows. For example:
<table>
<font color=black>
<tr>text</tr>
</font>
</table>

Is there a way to fix this problem?
Thank You!







"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 17:21 8-2-2003, you wrote:
> >Hi
> >I have to alter this code:
> ><?php
> >$fp = fopen ('http://www.whatever.ee/', 'r');
> >
> >for ($src = ''; !feof ($fp); $src .= fgets ($fp, 1024));
> >
> >fclose ($fp);
> >
> >if (preg_match ('/\<font color=black\>([^<]*)\<\/font>/i', $src,
$matches))
> >     echo    'Match: <b>'.$matches[1].'</b>';
> >else
> >     echo    'No match !';
> >?>
> >
> >It extracts the data (words) from www.whatever.com between <font=black>
and
> ></font>.
> >It works well if the source looks something like this:
> ><font=black>text</font> (it echos "text")
> >but i am having some serious problems when the source looks like
> >this<table><font=black><tr>text</tr></font></table>. It wont do anything
if
> >it is supposed to echo html. but i need html!
> >Could somebody help me change the script so that it can extract html as
> >well?
> >If you can, mail me at [EMAIL PROTECTED] or just reply here....
> >Thank You!
>
>
> anyway. this did what you asked for.
>
> <?PHP
> $src='<table><font color=black><tr>text</tr></font></table>.';
> $pattern='/\<font color=black\>(.*)\<\/font>/i';
>
> if (preg_match ($pattern, $src, $matches))
>      echo    'Match: <b>'.htmlspecialchars($matches[0]).'</b>';
> else
>      echo    'No match !';
>
>    ?>
>
> note that i show the output with htmlspecialchars() so you can actually
see
> the tag while testing
> also note that i replaced your [^<]* with .*
>
>
>
>


--- End Message ---
--- Begin Message ---
> Thank You very much!
> It Really works the way I want it to. But i still have a slight
problem.
> The
> script cant read the data if it is on several rows. For example:
> <table>
> <font color=black>
> <tr>text</tr>
> </font>
> </table>
> 
> Is there a way to fix this problem?

http://www.php.net/manual/en/pcre.pattern.modifiers.php

In particular, look at the 's' modifier. Also, if your matching (.*)
between your font elements, you will probably want to use the 'U'
modifier, also, if there can be more than one pattern on the page. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
I would like to create two pages using the fwrite() and fopen() variables...btw I am a 
newbie: 

One form page to enter information. I've done that and used the same format as a 
typical html page. method="post" action="submit.php"> 

I want the second page to show the information was submitted and have the information 
create a permenant html page named after one of the text areas on the page. 

I guess this will lead to three pages because i will have a template set up for the 
created page to look like the pages that have already been created by static html. 

In effect...the user will physically upload a file to an intranet server. Next go to 
the form page and add the information on the file they just submitted to the server. 
Once that information is added and the submit button is pressed, it will trigger a 
html page to be created with the info submitted. Help!
--- End Message ---
--- Begin Message ---
I would like to create two pages using the fwrite() and fopen() variables...btw I am a 
newbie I don't know where to start: 

One form page to enter information. I've done that and used the same format as a 
typical html page. method="post" action="submit.php"> 

I want the second page to show the information was submitted and have the information 
create a permenant html page named after one of the text areas on the page. 

I guess this will lead to three pages because i will have a template set up for the 
created page to look like the pages that have already been created by static html. 

In effect...the user will physically upload a file to an intranet server. Next go to 
the form page and add the information on the file they just submitted to the server. 
Once that information is added and the submit button is pressed, it will trigger a 
html page to be created with the info submitted. Help!
--- End Message ---
--- Begin Message ---
Hello msmecca,

I would suggest reading the PHP tutorials and then taking a look at the
PHP manual.  If you want to save and display the same page you can use
output buffering to capture the html output of your script.

If you are just starting with PHP I would recommend reading tutorials or
getting a good PHP book like PHP & MySQL Development, Programming PHP,
or many others.  You can find many PHP books on amazon.com or bn.com

Jason
On Sat, 2003-02-08 at 10:17, msmecca wrote:
> I would like to create two pages using the fwrite() and fopen() variables...btw I am 
>a newbie I don't know where to start: 
> 
> One form page to enter information. I've done that and used the same format as a 
>typical html page. method="post" action="submit.php"> 
> 
> I want the second page to show the information was submitted and have the 
>information create a permenant html page named after one of the text areas on the 
>page. 
> 
> I guess this will lead to three pages because i will have a template set up for the 
>created page to look like the pages that have already been created by static html. 
> 
> In effect...the user will physically upload a file to an intranet server. Next go to 
>the form page and add the information on the file they just submitted to the server. 
>Once that information is added and the submit button is pressed, it will trigger a 
>html page to be created with the info submitted. Help!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
> I would like to create two pages using the fwrite() and fopen()
> variables...btw I am a newbie:
> 
> One form page to enter information. I've done that and used the same
> format as a typical html page. method="post" action="submit.php">
> 
> I want the second page to show the information was submitted and have
the
> information create a permenant html page named after one of the text
areas
> on the page.
> 
> I guess this will lead to three pages because i will have a template
set
> up for the created page to look like the pages that have already been
> created by static html.
> 
> In effect...the user will physically upload a file to an intranet
server.
> Next go to the form page and add the information on the file they just
> submitted to the server. Once that information is added and the submit
> button is pressed, it will trigger a html page to be created with the
info
> submitted. Help!

Assuming $_POST['text'] would contain what is in your text area, writing
it to a page is as simple as this:

$fp = fopen('filename.html','w');
$fwrite($fp,$_POST['text']);
fclose($fp);

How easy is that? Have you even read the manual pages on fopen() or
fwrite()??

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
Hello,
    I am running into an issue where when a user inputs an apostrophie '
into the textarea section of my form, it will generate an error in the SQL
statement.
    I have narrowed down the issue to this snippet of code:

$insertQuery = "INSERT INTO changeLog(vendorNumber, newVendorNumber,
oldName, newName, changedBy, dateChanged, comments)
VALUES('$vendorNumber','$newVendorNumber','$oldName','$newName','$changedBy'
,'$dateChanged','$comments')";

    The thing that is causing this issue is the use of apostrophies to
designate my variables in the SQL query.  How do I rewrite this to avoid
this issue?



Thanks,

Mike Hilty



--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/function.addslashes.php

Justin Garrett

"Mike Hilty" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>     I am running into an issue where when a user inputs an apostrophie '
> into the textarea section of my form, it will generate an error in the SQL
> statement.
>     I have narrowed down the issue to this snippet of code:
>
> $insertQuery = "INSERT INTO changeLog(vendorNumber, newVendorNumber,
> oldName, newName, changedBy, dateChanged, comments)
>
VALUES('$vendorNumber','$newVendorNumber','$oldName','$newName','$changedBy'
> ,'$dateChanged','$comments')";
>
>     The thing that is causing this issue is the use of apostrophies to
> designate my variables in the SQL query.  How do I rewrite this to avoid
> this issue?
>
>
>
> Thanks,
>
> Mike Hilty
>
>
>


--- End Message ---
--- Begin Message ---
    I know this is in the archives, but I couldnt seem to find the answer I needed.  I 
am running redhat8, apache 2.0.44, and php 4.2.2.
I am trying to write a script that will emulate the IIS server and request NTLM auth. 
from the browser.  And then decode the base64? information and compate the user 
information against a ldap function that connects to a active directory server.  I 
know that you must modify the header with the header() command.  I have done that, and 
the most I get in one line of information back from the browser.  There is suppose to 
be three lines of encoded information sent back.   If anyone has any code or knows the 
complete hand shake or anything really, I would really like the help. This is a really 
big project at my company, and they are considering moving to a linux platform and 
even PHP.  But if I can't make the same stuff work that their w2k cold fusion platform 
does.  It's not going to work so well.



--- End Message ---
--- Begin Message ---
There is actually an NTLM Auth module available for Apache.
(http://modntlm.sourceforge.net/).

If you really need to do it though PHP I'd suggest running a packet sniffer
to see what headers IIS sends and what to expect back from IE.

HTH

Danny Shepherd.

----- Original Message -----
From: "Marriner, Bruce W." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 6:39 PM
Subject: [PHP] Attaining NTLM information from IE browsers.



    I know this is in the archives, but I couldnt seem to find the answer I
needed.  I am running redhat8, apache 2.0.44, and php 4.2.2.
I am trying to write a script that will emulate the IIS server and request
NTLM auth. from the browser.  And then decode the base64? information and
compate the user information against a ldap function that connects to a
active directory server.  I know that you must modify the header with the
header() command.  I have done that, and the most I get in one line of
information back from the browser.  There is suppose to be three lines of
encoded information sent back.   If anyone has any code or knows the
complete hand shake or anything really, I would really like the help. This
is a really big project at my company, and they are considering moving to a
linux platform and even PHP.  But if I can't make the same stuff work that
their w2k cold fusion platform does.  It's not going to work so well.




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

--- End Message ---
--- Begin Message ---
Got a problem. For some reason, when I try to view a PHP file on my server, it wants 
to download the file rather then open and execute. I have no control over my server so 
what should I do?

Here's a sample URL:

http://d2mods.xfernet.com/filecenter/team.php

Please help! I'm not sending any header() commands so why is it doing this?
--- End Message ---
--- Begin Message ---
On Sunday 09 February 2003 02:46, Stephen Craton wrote:

> Got a problem. For some reason, when I try to view a PHP file on my server,
> it wants to download the file rather then open and execute. I have no
> control over my server so what should I do?
>
> Here's a sample URL:
>
> http://d2mods.xfernet.com/filecenter/team.php
>
> Please help! I'm not sending any header() commands so why is it doing this?

Does this happen for that particular file or for all files? If the latter then 
take it up with whomever has control over your server. If the former then 
post your code.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Our country has plenty of good five-cent cigars, but the trouble is
they charge fifteen cents for them.
*/

--- End Message ---
--- Begin Message ---
It happens for all the files on the server. Some other subdomains had the
same problem but somehow they had fixed it by changing their username and
passwords.

Another file is this : http://d2mods.xfernet.com/test.php

All it has on it is <?php phpinfo(); ?>


----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 1:51 PM
Subject: Re: [PHP] Downloading File rather then Executing


> On Sunday 09 February 2003 02:46, Stephen Craton wrote:
>
> > Got a problem. For some reason, when I try to view a PHP file on my
server,
> > it wants to download the file rather then open and execute. I have no
> > control over my server so what should I do?
> >
> > Here's a sample URL:
> >
> > http://d2mods.xfernet.com/filecenter/team.php
> >
> > Please help! I'm not sending any header() commands so why is it doing
this?
>
> Does this happen for that particular file or for all files? If the latter
then
> take it up with whomever has control over your server. If the former then
> post your code.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Our country has plenty of good five-cent cigars, but the trouble is
> they charge fifteen cents for them.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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

A quick question about html tags and PHP.  I have a text area where users
can submit text, and I need them to able to have links in the text if they
so choose.

The contents get written to an ini style flat file database.

The problem comes when I try to print that content back out from the file -
I get a warning from the parse_ini_file() function:

Warning: Error parsing ./data/events on line 9 in Unknown on line 0

Line 9 happens to be the line in the events file that contains the <a href>
tag.  I have tried to do a base64_encode() on the data from the text area,
and then wrote it to the ini file encapsulated in double quotes.  It still
fails when I do the base64_decode(), except then I get nothing printed back
to the browser.  Any ideas?

-Erich-

===========CODE============
// Get the form variables
 $month = $_REQUEST['month'];
 $day = $_REQUEST['day'];
 $year = $_REQUEST['year'];
 $time = $_REQUEST['time'];
 $bands = $_REQUEST['bands'];
 $venue = $_REQUEST['venue'];
 $description = base64_encode($_REQUEST['description']);

list_events()
{
$ALLEVENTS = parse_ini_file('./data/events', TRUE);
while (list ($key, $value) = each ($ALLEVENTS))
 {
  print '<br>';
  print '<table border=0 cellpadding=0 cellspacing=0 width="100%">
       <tr>
        <td bgcolor="#AAAAAA" align="left">
         <font color="black" size=2>
          Saje, Live at '.stripslashes($value['venue']).
         '</font>
        </td>
        <td bgcolor="#AAAAAA" align="right">
         <font color="black" size=2>'.
         $value['month'].'/'.$value['day'].'/'.$value['year'].'</font>
        </td>
       </tr>
       <tr>
        <td colspan=2>
         <font color="#efa68a">With:
'.stripslashes($value['bands']).'</font><br>
         <br><font color="white">'.base64_decode($value['description']).
        '</font></td>
       </tr>
      </table>';
}

--- End Message ---
--- Begin Message ---
I'm having problems with the exec command since upgrading to 4.3.  Code that
previously worked now doesn't.  I'm using IIS5 and have checked in the
php.ini file to make sure that safe mode is off.  Is there anything else
that I should check?

Thanks in advance.


--- End Message ---
--- Begin Message ---
It's me again, trying to get some more help.

My boss is hosting sites now for games and I need some help with setting up
phpMyAdmin privelages for certain MySQL users and such. Right now, my
problem is setting up a new MySQL username and password.

I add a new user in phpMyAdmin, I type in the details, everything is fine.
When I go to test the connection with those connection details, I get this
error: (I copied and pasted the username and password so they are the same
for both the script and when I entered them into phpMyAdmin.)

    Access denied for user: 'd2sector@localhost' (Using password: YES)

My code is as follows:

    <?php
if(@mysql_connect('localhost', 'd2sector', '**Edited Out**')) {
 header("Location: index.php");
} else {
 echo '<font color="red">Unable to connect to database. Error as
follows:</font><br>'.mysql_error();
}
?>

Does anyone have a clue as to why this happens and how to fix it? I'll need
to know how to fix this for future users as well. Thanks in advanced.


Thanks,
Stephen Craton
http://www.melchior.us


--- End Message ---
--- Begin Message ---
Hey all.

I'm coming from Cold Fusion to PHP; in CF I could alternate rows with the
following:

    <tr bgcolor="###Iif(((CurrentRow MOD 2) is
0),de('FFFFFF'),de('EEEEEE'))#">

Any ideas how to do this in PHP?

Thanks for clues,

--Noah

--



--- End Message ---
--- Begin Message ---
Pop this in your loop

$bgcolor = ($i++ % 2) ? '#FFFFFF' : '#EEEEEE';

echo "<tr bgcolor=\"$bgcolor\">";

olinux


--- CF High <[EMAIL PROTECTED]> wrote:
> Hey all.
> 
> I'm coming from Cold Fusion to PHP; in CF I could
> alternate rows with the
> following:
> 
>     <tr bgcolor="###Iif(((CurrentRow MOD 2) is
> 0),de('FFFFFF'),de('EEEEEE'))#">
> 
> Any ideas how to do this in PHP?
> 
> Thanks for clues,
> 
> --Noah
> 
> --
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message --- At 00:25 9-2-2003, you wrote:
Hey all.

I'm coming from Cold Fusion to PHP; in CF I could alternate rows with the
following:

<tr bgcolor="###Iif(((CurrentRow MOD 2) is
0),de('FFFFFF'),de('EEEEEE'))#">

Any ideas how to do this in PHP?

one way would be:


<?PHP
$color_toggle=true;
$color1='red';
$color2='white';


$output="<table border=1>";
for ($i=0;$i<10;$i++) //or any other way to walk through results
{ $output.= '<TR bgcolor="'.(($color_toggle)?$color1:$color2).'"><td>'.$i.' Make love not war</td></tr>';
$color_toggle=!$color_toggle;
}
$output.="</table>";


echo $output;

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

or shorter:

$color_toggle=false;
echo('<table border=1>');
for ($i=0;$i<10;$i++)
{
echo('<TR bgcolor="'.(($color_toggle=!$color_toggle)?'red':'white').'"><td>'.$i.' Leve de SP</td></tr>');
}
echo('</table>');

--- End Message ---
--- Begin Message ---
Thanks olinux.

Just what I was looking for -- I'll check it out.........

-Noah

----- Original Message ----- 
From: "olinux" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 12:45 PM
Subject: Re: [PHP] Alternating Row Colors in PHP........


> Pop this in your loop
> 
> $bgcolor = ($i++ % 2) ? '#FFFFFF' : '#EEEEEE';
> 
> echo "<tr bgcolor=\"$bgcolor\">";
> 
> olinux
> 
> 
> --- CF High <[EMAIL PROTECTED]> wrote:
> > Hey all.
> > 
> > I'm coming from Cold Fusion to PHP; in CF I could
> > alternate rows with the
> > following:
> > 
> >     <tr bgcolor="###Iif(((CurrentRow MOD 2) is
> > 0),de('FFFFFF'),de('EEEEEE'))#">
> > 
> > Any ideas how to do this in PHP?
> > 
> > Thanks for clues,
> > 
> > --Noah
> > 
> > --
> > 
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 

--- End Message ---
--- Begin Message ---
On Sat, 2003-02-08 at 18:25, CF High wrote:
> Hey all.
> 
> I'm coming from Cold Fusion to PHP; in CF I could alternate rows with the
> following:
> 
>     <tr bgcolor="###Iif(((CurrentRow MOD 2) is
> 0),de('FFFFFF'),de('EEEEEE'))#">
> 
> Any ideas how to do this in PHP?
> 

One possibility:

while (whatever) {

$bgcolor = ($i++ & 1) ? '#c0c0c0' : '#ffffff';
  echo "<tr bgcolor=\"$bgcolor\"><td>bla-bla</td></tr>";

}


-Brian

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

I have an array called $array_of_files.
I want to echo each element of that array as a link to itself.
That way when I click on an element I can send it as an actual value

Here's my code:

for ($counter = 0; $counter < count($array_of_files); $counter++)
 {
 $category = $array_of_files[$counter];
 echo "<a href='$category'>$category</a><br>";
 }
 exit;
}

Here's an example of the variable $category before I place it in the <a
href>:
/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt

Once I place the variable $category inside the <a href> statement it
looks like this:
http://www.myserver.com/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt

Why is it the <a href> adds 'http://www.myserver.com' to the front of
the value of $category?

I worked around this by placing '?file=$category' in the echo statement
above.  Just wondered if anyone had any better way to do this...

Thanks in advance,
Roger


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

I have an array called $array_of_files.
I want to echo each element of that array as a link to itself.
That way when I click on an element I can send it as an actual value
/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt

Once I place the variable $category inside the <a href> statement it
looks like this:
http://www.myserver.com/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt

Why is it the <a href> adds 'http://www.myserver.com' to the front of
the value of $category?
It is the browser trying to help by completing what it sees as a relative link.

I worked around this by placing '?file=$category' in the echo statement
above.  Just wondered if anyone had any better way to do this...
Looks like an excellent way.

Other ways might include making associated arrays but i see no reason to do it differently.

By the way, i don't know what you do with the rest of the code but what happens if some joker links to
'?file=etc/passwd' ?



--- End Message ---
--- Begin Message ---
Sorry for the frequent simple posts...........

I've been storing my dates in yyyymmdd format (apparently this is a bad
idea).

In any case, I need to display this date format as [day name month name day
#, year] e.g. Friday January 31, 2003.

Any ideas?

Thanks for any leads,

--Noah

--



--- End Message ---
--- Begin Message ---
the real question here is are you "storing" your dates in a file or database.

If in a database (say MySQL), you can use the native DATE_FORMAT function of 
MySQL to pull the date out in the proper format.

Otherwise, have a look at http://www.php.net/date

Quoting CF High <[EMAIL PROTECTED]>:

> Sorry for the frequent simple posts...........
> 
> I've been storing my dates in yyyymmdd format (apparently this is a bad
> idea).
> 
> In any case, I need to display this date format as [day name month name day
> #, year] e.g. Friday January 31, 2003.
> 
> Any ideas?
> 
> Thanks for any leads,
> 
> --Noah
> 
> --
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
   email: [EMAIL PROTECTED]
   phone: 314.692.3540

-----------------------------------------------
 This email sent using CDM Sports Webmail v3.1
              [ http://webmail.cdmsports.com ]
--- End Message ---
--- Begin Message ---
Hey Michael.

The dates are stored in a MySql db.

I checked out the MySql DATE_FORMAT function -- pretty cool.

However, pardon my ignorance here, how can I do date comparisons?

For example, if I want to retrieve records from the db where the date is
between say, 2003-02-01 and 2003-02-07, will MySql be able to compare the
strings?

I stored my dates as integer fields to do such a comparison, but it looks
like I need to graduate to MySql date time functions..........

--Noah

----- Original Message -----
From: "Michael Geier" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 1:31 PM
Subject: Re: [PHP] Output yyyymmdd formatted date || 20030131 to
FridayJanuary 31, 2003


> the real question here is are you "storing" your dates in a file or
database.
>
> If in a database (say MySQL), you can use the native DATE_FORMAT function
of
> MySQL to pull the date out in the proper format.
>
> Otherwise, have a look at http://www.php.net/date
>
> Quoting CF High <[EMAIL PROTECTED]>:
>
> > Sorry for the frequent simple posts...........
> >
> > I've been storing my dates in yyyymmdd format (apparently this is a bad
> > idea).
> >
> > In any case, I need to display this date format as [day name month name
day
> > #, year] e.g. Friday January 31, 2003.
> >
> > Any ideas?
> >
> > Thanks for any leads,
> >
> > --Noah
> >
> > --
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> =======================================
> Michael Geier
> CDM Sports, Inc. Systems Administration
>    email: [EMAIL PROTECTED]
>    phone: 314.692.3540
>
> -----------------------------------------------
>  This email sent using CDM Sports Webmail v3.1
>               [ http://webmail.cdmsports.com ]
>

--- End Message ---
--- Begin Message ---
> The dates are stored in a MySql db.
> 
> I checked out the MySql DATE_FORMAT function -- pretty cool.
> 
> However, pardon my ignorance here, how can I do date comparisons?
> 
> For example, if I want to retrieve records from the db where the date
is
> between say, 2003-02-01 and 2003-02-07, will MySql be able to compare
the
> strings?
> 
> I stored my dates as integer fields to do such a comparison, but it
looks
> like I need to graduate to MySql date time functions..........

If you've done it correctly and stored your dates in a MySQL DATE,
DATETIME, or TIMESTAMP column, then you can do something like this:

SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207

If you're storing them in an INT column, then change it over to one of
the above. 

Go back to the manual and read about date_sub() and date_add() in MySQL
for further date manipulation...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
Right.

I've switched the date column from type INT to type DATE in our MySql db.

The problem I've had with retrieving records in a certain date range with:

SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207

is getting the latter part of the expression; i.e. in this case 20030207 to
be seven days "older" than the first part.

This is where I need to use MySql's DATE_ADD, and other date manipulation
functions..........

Lots to learn; little time to do it.

Thanks for feedback, John.


--Noah


----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Noah'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 3:31 PM
Subject: RE: [PHP] Output yyyymmdd formatted date || 20030131 to
FridayJanuary 31, 2003


> > The dates are stored in a MySql db.
> >
> > I checked out the MySql DATE_FORMAT function -- pretty cool.
> >
> > However, pardon my ignorance here, how can I do date comparisons?
> >
> > For example, if I want to retrieve records from the db where the date
> is
> > between say, 2003-02-01 and 2003-02-07, will MySql be able to compare
> the
> > strings?
> >
> > I stored my dates as integer fields to do such a comparison, but it
> looks
> > like I need to graduate to MySql date time functions..........
>
> If you've done it correctly and stored your dates in a MySQL DATE,
> DATETIME, or TIMESTAMP column, then you can do something like this:
>
> SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207
>
> If you're storing them in an INT column, then change it over to one of
> the above.
>
> Go back to the manual and read about date_sub() and date_add() in MySQL
> for further date manipulation...
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>

--- End Message ---
--- Begin Message ---
SELECT * FROM table WHERE date BETWEEN 20030201 AND 20030201 + INTERVAL
7 DAY

I assume '20030201' will come from PHP eventually, right, or the current
date?

For any record between now and 7 days from now:
SELECT * FROM table WHERE date BETWEEN CURDATE() AND CURDATE() +
INTERVAL 7 DAY

For a date from PHP, 

$date = '20030201';

SELECT * FROM table WHERE date BETWEEN $date AND $date + INTERVAL 7 DAY

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Noah [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 08, 2003 10:20 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Output yyyymmdd formatted date || 20030131 to
> FridayJanuary 31, 2003
> 
> Right.
> 
> I've switched the date column from type INT to type DATE in our MySql
db.
> 
> The problem I've had with retrieving records in a certain date range
with:
> 
> SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207
> 
> is getting the latter part of the expression; i.e. in this case
20030207
> to
> be seven days "older" than the first part.
> 
> This is where I need to use MySql's DATE_ADD, and other date
manipulation
> functions..........
> 
> Lots to learn; little time to do it.
> 
> Thanks for feedback, John.
> 
> 
> --Noah
> 
> 
> ----- Original Message -----
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "'Noah'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Saturday, February 08, 2003 3:31 PM
> Subject: RE: [PHP] Output yyyymmdd formatted date || 20030131 to
> FridayJanuary 31, 2003
> 
> 
> > > The dates are stored in a MySql db.
> > >
> > > I checked out the MySql DATE_FORMAT function -- pretty cool.
> > >
> > > However, pardon my ignorance here, how can I do date comparisons?
> > >
> > > For example, if I want to retrieve records from the db where the
date
> > is
> > > between say, 2003-02-01 and 2003-02-07, will MySql be able to
compare
> > the
> > > strings?
> > >
> > > I stored my dates as integer fields to do such a comparison, but
it
> > looks
> > > like I need to graduate to MySql date time functions..........
> >
> > If you've done it correctly and stored your dates in a MySQL DATE,
> > DATETIME, or TIMESTAMP column, then you can do something like this:
> >
> > SELECT * FROM table WHERE yourdate BETWEEN 20030201 AND 20030207
> >
> > If you're storing them in an INT column, then change it over to one
of
> > the above.
> >
> > Go back to the manual and read about date_sub() and date_add() in
MySQL
> > for further date manipulation...
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> > today. http://www.phparch.com/
> >
> >



--- End Message ---
--- Begin Message ---
I'm using cURL to POST form fields to a PHP script on a different server
that does a database insertion. I know the POST is working, because the
values are being inserted into the database. But I want to return results
from the remote server so I can tell if the insert was *not* done.

Here's the relevant part of the sending script:

$ch = curl_init();
$remote_url = "http://www.whatever.com/scriptname.php";;
curl_setopt ($ch, CURLOPT_URL, $remote_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $field_values);
ob_start();
curl_exec ($ch);
curl_close ($ch);
$curl_results = ob_get_contents();
ob_end_clean();

// check cURL results
if ((trim($curl_results) != 1) || (trim($curl_results) != 0)) {
// maybe nothing returned, bail out
     echo("<p>Can't confirm results of attempt to add to database!</p>\n");
     exit;
}

Here are the relevant parts of the receiving script:

// return notice if connection fails
if (!$db_connection) {
    echo 0;
    exit;
}
...

// return notice if database insert fails
if (!$db_connection->execute($insert_sql)) {
    echo 0;
    exit;
} else {
    echo 1;
}

The receiving script doesn't display anything and should only echo as shown
above. I don't get how to return success or failure from the receiving
script. The information I've been able to find on cURL doesn't clarify this.
Can anyone shed some light?

Thanks.

--
Lowell Allen

--- End Message ---
--- Begin Message ---
> From: Lowell Allen <[EMAIL PROTECTED]>
> 
[snip]
> 
> // check cURL results
> if ((trim($curl_results) != 1) || (trim($curl_results) != 0)) {
> // maybe nothing returned, bail out
> echo("<p>Can't confirm results of attempt to add to database!</p>\n");
> exit;
> }

I knew I'd find a stupid mistake as soon as I posted the question. I was
using a condition that could never be true, instead, I needed:

if ((trim($curl_results) != 1) && (trim($curl_results) != 0))

Sorry.

--
Lowell Allen

--- End Message ---
--- Begin Message ---
I use Smarty for seperate PHP logic and template logic.

For database abstraction, I use AdoDB. Not much a fan of Pear.... Adodb was
pretty faithful when I ported my MySQL app to PostGreSQL.

"Hardik Doshi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok so for seperating interface and PHP code, smarty
> templace engine is the best right?
>
> What about database abstraction layer?
>
> thanks for your information. I really appreciate that.
>
> Hardik
>
> --- John Wells <[EMAIL PROTECTED]> wrote:
> > Hardik Doshi said:
> > > 1. How one can seperate HTML and PHP (or any other
> > > programming code).  Is there anything in PHP so i
> > can
> > > seperate Interface layer and programming logic
> > layer?
> >
> > http://smarty.php.net
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com


--- End Message ---
--- Begin Message ---
Hello, I am wondering if any of you got a reliable php and MySQL
installation (MySQL is easy) I am mostly wondering if there is a point
in tying to use windows as a development platform for PHP. I have a nice
and working red hat 8.0 installation, but I did an upgrade from 7.3 and
now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X
and all I want is to erase the old apache and use the new one or erase
the new one and use the old one, whichever works. But anyway... I also
do design and I have people submit me illustrator and Photoshop files
and word docs, so for now I might have to stick to windows for work. BUT
what do u suggest? I it futile to try to get php to work in windows?
With IIS preferably so that I can play with ASP and Cold Fusion once in
a while. Please help if you are using windows with php and send me some
instructions if you feel like it, much appreciated.

- Vic

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
> Hello, I am wondering if any of you got a reliable php and MySQL
> installation (MySQL is easy) I am mostly wondering if there is a point
> in tying to use windows as a development platform for PHP. I have a
nice
> and working red hat 8.0 installation, but I did an upgrade from 7.3
and
> now apache doesn't work cuz it wants me to switch form apache 1.X to
2.X
> and all I want is to erase the old apache and use the new one or erase
> the new one and use the old one, whichever works. But anyway... I also
> do design and I have people submit me illustrator and Photoshop files
> and word docs, so for now I might have to stick to windows for work.
BUT
> what do u suggest? I it futile to try to get php to work in windows?
> With IIS preferably so that I can play with ASP and Cold Fusion once
in
> a while. Please help if you are using windows with php and send me
some
> instructions if you feel like it, much appreciated.

I've got PHP and IIS running on a production server and several
development servers with no issues. It takes all of 5 minutes to get
installed. Do you at least have IIS running yet? It's only a couple
steps after that, most of which are outlined in the manual. Contact me
off list if you want more help and let me know what point you're at
right now. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
You can install PHP + Apache 1.3 on Windows pretty easily.  There are
instructions in the manual at http://www.php.net/manual and there are
also pre-constructed installers that other people make (try
www.hotscripts.com/PHP under applications).

If you just need to get apache 1.3 installed on redhat you just need to
either disable apache 2 or install apache 1.3 and make it listen on a
different port (8080 or something).  You can have both installed if you
configure them with a --prefix, something like ./configure
--prefix=/usr/local/apache13

Jason
On Sat, 2003-02-08 at 16:13, Victor wrote:
> Hello, I am wondering if any of you got a reliable php and MySQL
> installation (MySQL is easy) I am mostly wondering if there is a point
> in tying to use windows as a development platform for PHP. I have a nice
> and working red hat 8.0 installation, but I did an upgrade from 7.3 and
> now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X
> and all I want is to erase the old apache and use the new one or erase
> the new one and use the old one, whichever works. But anyway... I also
> do design and I have people submit me illustrator and Photoshop files
> and word docs, so for now I might have to stick to windows for work. BUT
> what do u suggest? I it futile to try to get php to work in windows?
> With IIS preferably so that I can play with ASP and Cold Fusion once in
> a while. Please help if you are using windows with php and send me some
> instructions if you feel like it, much appreciated.
> 
> - Vic
> 
> ______________________________________________________________________ 
> Post your free ad now! http://personals.yahoo.ca
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I got IIS working fine, and I did I think, the steps in the php ISAPI
instaltion manual. I think. .. but when I call the php page, it tries to
download it, as far as I know that is a sign that is doesn't know how to
handle that file, whicth means that my instaltion is not that great.

So I guess I al looking to finding out what I need to configure IIS to
to get the ISAPI module to work, etc.

-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 6:27 PM
To: 'Victor'; [EMAIL PROTECTED]
Subject: RE: [PHP] any windows php developers out here?

> Hello, I am wondering if any of you got a reliable php and MySQL
> installation (MySQL is easy) I am mostly wondering if there is a point
> in tying to use windows as a development platform for PHP. I have a
nice
> and working red hat 8.0 installation, but I did an upgrade from 7.3
and
> now apache doesn't work cuz it wants me to switch form apache 1.X to
2.X
> and all I want is to erase the old apache and use the new one or erase
> the new one and use the old one, whichever works. But anyway... I also
> do design and I have people submit me illustrator and Photoshop files
> and word docs, so for now I might have to stick to windows for work.
BUT
> what do u suggest? I it futile to try to get php to work in windows?
> With IIS preferably so that I can play with ASP and Cold Fusion once
in
> a while. Please help if you are using windows with php and send me
some
> instructions if you feel like it, much appreciated.

I've got PHP and IIS running on a production server and several
development servers with no issues. It takes all of 5 minutes to get
installed. Do you at least have IIS running yet? It's only a couple
steps after that, most of which are outlined in the manual. Contact me
off list if you want more help and let me know what point you're at
right now. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
How do I disable apache 2.0?

-----Original Message-----
From: Jason Sheets [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 6:33 PM
To: Victor
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] any windows php developers out here?

You can install PHP + Apache 1.3 on Windows pretty easily.  There are
instructions in the manual at http://www.php.net/manual and there are
also pre-constructed installers that other people make (try
www.hotscripts.com/PHP under applications).

If you just need to get apache 1.3 installed on redhat you just need to
either disable apache 2 or install apache 1.3 and make it listen on a
different port (8080 or something).  You can have both installed if you
configure them with a --prefix, something like ./configure
--prefix=/usr/local/apache13

Jason
On Sat, 2003-02-08 at 16:13, Victor wrote:
> Hello, I am wondering if any of you got a reliable php and MySQL
> installation (MySQL is easy) I am mostly wondering if there is a point
> in tying to use windows as a development platform for PHP. I have a
nice
> and working red hat 8.0 installation, but I did an upgrade from 7.3
and
> now apache doesn't work cuz it wants me to switch form apache 1.X to
2.X
> and all I want is to erase the old apache and use the new one or erase
> the new one and use the old one, whichever works. But anyway... I also
> do design and I have people submit me illustrator and Photoshop files
> and word docs, so for now I might have to stick to windows for work.
BUT
> what do u suggest? I it futile to try to get php to work in windows?
> With IIS preferably so that I can play with ASP and Cold Fusion once
in
> a while. Please help if you are using windows with php and send me
some
> instructions if you feel like it, much appreciated.
> 
> - Vic
> 
> ______________________________________________________________________

> Post your free ad now! http://personals.yahoo.ca
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
On Sat, 2003-02-08 at 20:18, Victor wrote:
> How do I disable apache 2.0?
In Windows, go to service->apache->manual start
In GNU/Linux, chkconfig --level 35 httpd off
-- 
    __                               
   / \\   @       __     __    @   Adolfo Bello <[EMAIL PROTECTED]>
  /  //  // /\   / \\   // \  //   Bello Ingenieria S.A, ICQ: 65910258
 /  \\  // / \\ /  //  //  / //    cel: +58 416 609-6213
/___// // / <_/ \__\\ //__/ //     fax: +58 212 952-6797
    www.bisapi.com   //            pager: www.tun-tun.com (# 609-6213)

--- End Message ---
--- Begin Message ---
"In GNU/Linux, chkconfig --level 35 httpd off"

Wow man, that just SCREAMS "apache off"! How intuitive Linux is...
-
Vic

Thanks, I'll try it. 

But, what will that turn off? I have apache 1.X and apache 2.X on red
hat? I want to use either or, whichever works with the php 4.3 on red
hat. So ... what do I choose? How do I make the system use only one of
them, how do I erase the other one?

-----Original Message-----
From: Adolfo Bello [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 7:31 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] any windows php developers out here?

On Sat, 2003-02-08 at 20:18, Victor wrote:
> How do I disable apache 2.0?
In Windows, go to service->apache->manual start
In GNU/Linux, chkconfig --level 35 httpd off
-- 
    __                               
   / \\   @       __     __    @   Adolfo Bello <[EMAIL PROTECTED]>
  /  //  // /\   / \\   // \  //   Bello Ingenieria S.A, ICQ: 65910258
 /  \\  // / \\ /  //  //  / //    cel: +58 416 609-6213
/___// // / <_/ \__\\ //__/ //     fax: +58 212 952-6797
    www.bisapi.com   //            pager: www.tun-tun.com (# 609-6213)


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

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
On Sat, 2003-02-08 at 21:41, Victor wrote:
> "In GNU/Linux, chkconfig --level 35 httpd off"
> 
> Wow man, that just SCREAMS "apache off"! How intuitive Linux is...
> -
> Vic
> 
> Thanks, I'll try it. 
> 
> But, what will that turn off? I have apache 1.X and apache 2.X on red
> hat? I want to use either or, whichever works with the php 4.3 on red
> hat. So ... what do I choose? How do I make the system use only one of
> them, how do I erase the other one?
In Windows and Linux the service is named httpd, it's not my fault.

Well, now you have two Apache in your and you want just one of them to
come up when you boot your machine.

Apache 1.3.x is usually installed in /usr/share/httpd and is started
with a script in /etc/rc.d/init.d called httpd.

Apache 2.0.x is installed by default in /usr/local/apache2 and the
script to start/stop the service is called apachectl and is located in
/usr/local/apache2/bin.

If you want to leave the first one that you installed, just do nothing.

On the other hand, if you want to start the second one, then rename
/etc/rc.d/init.d/httpd to something you want and create a symlink
pointing to the one you want to start. Example:

ln -s /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

Now:

chkconfig --level 35 httpd on

In this case you don't need to turn off the other. It will never get
started because there is no script in /etc/rc.d/init.d to start it.

Hope this help.
-- 
    __                               
   / \\   @       __     __    @   Adolfo Bello <[EMAIL PROTECTED]>
  /  //  // /\   / \\   // \  //   Bello Ingenieria S.A, ICQ: 65910258
 /  \\  // / \\ /  //  //  / //    cel: +58 416 609-6213
/___// // / <_/ \__\\ //__/ //     fax: +58 212 952-6797
    www.bisapi.com   //            pager: www.tun-tun.com (# 609-6213)

--- End Message ---
--- Begin Message ---
> So I guess I al looking to finding out what I need to configure IIS to
> to get the ISAPI module to work, etc.

1. Unzip the php .zip file to C:\php\

2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll

3. Ensure the user IIS runs as, generally IUSR_<computer_name>, has read
permissions to C:\php\ and all subdirectories.

4. Follow directions as in the manual

5. Shut down IIS (net stop iisadmin)

6. Open up IIS control panel

7. Add ISAPI filter pointing to c:\php\php4isapi.dll

8. Add application mapping pointing to c:\php\php4isapi.dll

9. Start up IIS (net start w3svc)

That's it...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


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

i am just adding some mail() functions to my script and had to realize, that this:

$email_from = 'From: [EMAIL PROTECTED]\r\nReply-To: [EMAIL PROTECTED]\r\n';
mail($_POST['email'],'Your account details','You can login with your account details\r\nusername: '.$_POST['username'].'\npassword: '.$_POST['password'].'\n\nhere: http://----/index.php',$email_from);

will make the email include the \r\n instead of adding a line feed, but this works just fine:

$email_from = "From: [EMAIL PROTECTED]\r\nReply-To: [EMAIL PROTECTED]\r\n";
mail($_POST['email'],'Your account details',"You can login with your account details\r\nusername: ".$_POST['username']."\npassword: ".$_POST['password']."\n\nhere: http://----/index.php",$email_from);

Why is there this difference in the normal- & double-quoted string, i though it would only affect included variables, where one shows them and the other would need them to be added via '.' ?

...just curious :)

Regards,
Duncan

--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/language.types.string.php

Just the way ' and " are defined. " understands more escape sequences then
'.

Justin Garrett


"Duncan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> i am just adding some mail() functions to my script and had to realize,
> that this:
>
> $email_from = 'From: [EMAIL PROTECTED]\r\nReply-To:
> [EMAIL PROTECTED]\r\n';
> mail($_POST['email'],'Your account details','You can login with your
> account details\r\nusername: '.$_POST['username'].'\npassword:
> '.$_POST['password'].'\n\nhere: http://----/index.php',$email_from);
>
> will make the email include the \r\n instead of adding a line feed, but
> this works just fine:
>
> $email_from = "From: [EMAIL PROTECTED]\r\nReply-To:
> [EMAIL PROTECTED]\r\n";
> mail($_POST['email'],'Your account details',"You can login with your
> account details\r\nusername: ".$_POST['username']."\npassword:
> ".$_POST['password']."\n\nhere: http://----/index.php",$email_from);
>
> Why is there this difference in the normal- & double-quoted string, i
> though it would only affect included variables, where one shows them and
> the other would need them to be added via '.' ?
>
> ...just curious :)
>
> Regards,
> Duncan
>


--- End Message ---
--- Begin Message ---
Just checking to see if there's a problem with the list, or my STMP server.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
I'm looking through Google for MIME decoding classes, one developed by
Richard Heyes used in Pear and a few others. What I'm curious is how
complete are these classes or if there is one you recommend that completely
decodes emails from Outlook, Hotmail, Eudora, etc. based emails.

I've looked at solutions written in C and they are about 800 KB source code
in size compared to classes written in apps like Squirrel Mail which is
90KB. Does anyone know of any complete decoding classes in PHP either free
or commercial. Command line are also fine. If there are C, C++, or C#
libraries, those are okay as well if you know of any. I just couldn't come
across any that are well coded to perform the task of complete MIME
decoding.


--- End Message ---
--- Begin Message ---
http://sourceforge.net/projects/phpmimeclass


"Jonathan Chum" <[EMAIL PROTECTED]> a crit dans le message de news:
[EMAIL PROTECTED]
> I'm looking through Google for MIME decoding classes, one developed by
> Richard Heyes used in Pear and a few others. What I'm curious is how
> complete are these classes or if there is one you recommend that
completely
> decodes emails from Outlook, Hotmail, Eudora, etc. based emails.
>
> I've looked at solutions written in C and they are about 800 KB source
code
> in size compared to classes written in apps like Squirrel Mail which is
> 90KB. Does anyone know of any complete decoding classes in PHP either free
> or commercial. Command line are also fine. If there are C, C++, or C#
> libraries, those are okay as well if you know of any. I just couldn't come
> across any that are well coded to perform the task of complete MIME
> decoding.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Hey all.

Got a problem with I'm sure a simple solution::

In this test form when I submit and insert into my db, only the last select
field get entered; i.e. in this case the day value of 25.

<form name="form1" method="post" action="">

Year
<select name="date" onSelect="return check_submit()">
    <option selected value=2002>2002</option>
</select>

Month
<select name="date">
    <option selected value=12>12</option>
</select>

Day
<select name="date">
    <option selected value=25>25</option>
</select>

<input type="submit" name="textfield">

</form>

Why does this happen?  In Cold Fusion I'm able to refer to the three selects
as #date# and it returns 20021225 as expected.

Any ideas?

Thanks,

--Noah


--



--- End Message ---
--- Begin Message ---
Maybe you should rename them differently/ or make then into an array?

-----Original Message-----
From: CF High [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 10:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Why does this happen?

Hey all.

Got a problem with I'm sure a simple solution::

In this test form when I submit and insert into my db, only the last
select
field get entered; i.e. in this case the day value of 25.

<form name="form1" method="post" action="">

Year
<select name="date" onSelect="return check_submit()">
    <option selected value=2002>2002</option>
</select>

Month
<select name="date">
    <option selected value=12>12</option>
</select>

Day
<select name="date">
    <option selected value=25>25</option>
</select>

<input type="submit" name="textfield">

</form>

Why does this happen?  In Cold Fusion I'm able to refer to the three
selects
as #date# and it returns 20021225 as expected.

Any ideas?

Thanks,

--Noah


--




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

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
> Got a problem with I'm sure a simple solution::
> 
> In this test form when I submit and insert into my db, only the last
> select
> field get entered; i.e. in this case the day value of 25.
> 
> <form name="form1" method="post" action="">
> 
> Year
> <select name="date" onSelect="return check_submit()">
>     <option selected value=2002>2002</option>
> </select>
> 
> Month
> <select name="date">
>     <option selected value=12>12</option>
> </select>
> 
> Day
> <select name="date">
>     <option selected value=25>25</option>
> </select>
> 
> <input type="submit" name="textfield">
> 
> </form>

All of your form elements have the same name! What do you expect to
happen?

If you have this in PHP:

$date = 1;
$date = 2;
$date = 3;

What value do you think $date has now??

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
Hi, I am Lin.
(B
(BWhen I execute a command
(B
(Bgzip -d php-4_3_0_tar.gz
(B
(Bon the linux. The system show the following error.
(B
(Bgzip: php-4_3_0_tar.gz: not in gzip format
(B
(BHow can I uncompress this file.
(B
(B__________________________________________________
(BDo You Yahoo!?
(BYahoo! BB is Broadband by Yahoo!
(Bhttp://bb.yahoo.co.jp/
--- End Message ---
--- Begin Message ---
I think it's 

tar -xvf <name> 

-----Original Message-----
From:  bQ [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, February 08, 2003 8:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to uncompress PHP

Hi, I am Lin.

When I execute a command

gzip -d php-4_3_0_tar.gz

on the linux. The system show the following error.

gzip: php-4_3_0_tar.gz: not in gzip format

How can I uncompress this file.

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/


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

______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
On Sat, 2003-02-08 at 21:26, 林 恵群 wrote:
> Hi, I am Lin.
> 
> When I execute a command
> 
> gzip -d php-4_3_0_tar.gz
> 
> on the linux. The system show the following error.
> 
> gzip: php-4_3_0_tar.gz: not in gzip format
> 
> How can I uncompress this file.

tar -zxvf php-4_3_0_tar.gz

-- 
    __                               
   / \\   @       __     __    @   Adolfo Bello <[EMAIL PROTECTED]>
  /  //  // /\   / \\   // \  //   Bello Ingenieria S.A, ICQ: 65910258
 /  \\  // / \\ /  //  //  / //    cel: +58 416 609-6213
/___// // / <_/ \__\\ //__/ //     fax: +58 212 952-6797
    www.bisapi.com   //            pager: www.tun-tun.com (# 609-6213)

--- End Message ---
--- Begin Message ---
This one time, at band camp,
Douglas Douglas <[EMAIL PROTECTED]> wrote:

> Good day.
> 
> Is there any PHP function that removes only the last
> character of a string and returns the new string?


$new = substr("$string", 0, -1);

Kevin
-- 
 ______                              
(_____ \                             
 _____) )  ____   ____   ____   ____ 
|  ____/  / _  ) / _  | / ___) / _  )
| |      ( (/ / ( ( | |( (___ ( (/ / 
|_|       \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
I'm having trouble with a basic file write and can't figure out why. 

 

It must have something to do with the program the code is in because if I run that 
same code as a separate program, as the same user, and on the same directory, it works 
fine.

 

The program is listening on a port with:

 

$fp0 = fopen("php://stdin","r"); 
while (!feof($fp0)){

and writing to stdout, successfully, using:

   $fp1 = fopen("php://stdout","w"); 
   fputs($fp1,$response."\r\n");
   fclose($fp1);


But, the file open is failing. Is there any way to get more detail on why fopen is 
failing? Or, any ideas what could be going on in the rest of my program that could 
affect this?

Thanks,

 



if ($fp = fopen($body_file,"w")):

fputs($fp,$body,strlen($body));

@fclose($fp);

else:

echo "Failed";

endif;



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--- End Message ---

Reply via email to