php-general Digest 17 Jan 2001 03:24:59 -0000 Issue 459

Topics (messages 34822 through 34973):

xmltree() function - what PHP version?
        34822 by: kev
        34825 by: Hrishi
        34841 by: Ignacio Vazquez-Abrams
        34866 by: kev

Re: Perl regular expression bug]
        34823 by: Andrei Zmievski

Re: Reading specific data from a .txt file into PHP
        34824 by: Romulo Roberto Pereira
        34826 by: Parker, John (Snorkel)

Anyone knows?
        34827 by: Wee Chua
        34854 by: Chris Lee

Who to make an additon of fetched rows
        34828 by: K.Simon
        34848 by: Chris Lee
        34871 by: K.Simon

Working out the name of the day given a date
        34829 by: Jon Haworth
        34836 by: Jon Haworth
        34837 by: Ignacio Vazquez-Abrams
        34840 by: Jon Haworth
        34843 by: Ignacio Vazquez-Abrams
        34844 by: Jon Haworth

Re: WML/WAP and PHP
        34830 by: Rick Hodger
        34831 by: Jon Haworth
        34834 by: Pavel Kalian
        34856 by: Chris Adams

graph 3d
        34832 by: Pablo Martin De Natale

How to handle multiple lines in PHP?
        34833 by: david klein
        34835 by: Ignacio Vazquez-Abrams
        34838 by: Christian Reiniger
        34839 by: Pavel Kalian
        34842 by: Romulo Roberto Pereira

How can I "download" information (file) without standard "save as" dialog ??
        34845 by: Benny Nissen

Re: PHP & FDF on Linux PPC
        34846 by: Mathias Meyer

Re: RedHat+Apache+php+MSSQL
        34847 by: Chris Lee
        34897 by: webbie.server.deanox.com
        34963 by: Alex Black

Thanks for all -- Re: [PHP] How to handle multiple lines in PHP?
        34849 by: david klein

Netscape's back button not working like Explorer's...Why?
        34850 by: Todd H MacPherson
        34852 by: Ignacio Vazquez-Abrams
        34855 by: Romulo Roberto Pereira
        34870 by: Todd H MacPherson

regexps
        34851 by: Elliot L. Tobin
        34859 by: Romulo Roberto Pereira
        34907 by: Monte Ohrt

Re: what is wrong with this sniplet? oops! forgot to close tag
        34853 by: Ignacio Vazquez-Abrams

Re: [phplib] problems ie suggestions
        34857 by: Herbel, Rick

Re: Database Connections - permanent or something else?
        34858 by: Ignacio Vazquez-Abrams
        34868 by: mOrP
        34885 by: Steve Ruby

Re: PHPLIB and PHPMyAdmin
        34860 by: Ignacio Vazquez-Abrams
        34867 by: Michael A. Peters
        34886 by: Matt Friedman

Re: Variables in 'friendly' urls
        34861 by: Ignacio Vazquez-Abrams

XML, what is that supposed to do?
        34862 by: Brandon Orther
        34937 by: Terrence Chay
        34961 by: Alex Black
        34968 by: Maxim Maletsky

Sessions
        34863 by: Brandon Orther
        34879 by: Hardy Merrill
        34954 by: Maxim Maletsky

HELP! Date formatting
        34864 by: Niel Zeeman
        34865 by: Boget, Chris
        34958 by: Maxim Maletsky

win 2000 nt 5.0  and IIS
        34869 by: Serge Montmarquette
        34917 by: Todd Cary

if php is so great, why is it so hard to make it work?
        34872 by: Serge Montmarquette
        34873 by: Jerry Lake
        34874 by: K.Simon
        34875 by: Rob
        34876 by: Romulo Roberto Pereira

Re: mixing HTML and PHP code
        34877 by: Iván Sánchez Ortega \"MR\"

Images ???
        34878 by: Miguel Loureiro
        34888 by: Ignacio Vazquez-Abrams

sessions_destroy(); aint werking?
        34880 by: Brandon Orther

got it
        34881 by: Serge Montmarquette
        34882 by: Sam Masiello
        34957 by: Maxim Maletsky

gc_probability
        34883 by: Brandon Orther

php'ed mysql query
        34884 by: Christopher Allen
        34887 by: Brian Paulson
        34889 by: Sam Masiello
        34890 by: Ignacio Vazquez-Abrams
        34891 by: Christopher Allen
        34973 by: Toby Butzon

string replace
        34892 by: Tait Grove
        34894 by: Nathan Cook
        34895 by: Jerry Lake
        34896 by: Gregor
        34955 by: Maxim Maletsky

session_destroy
        34893 by: Brandon Orther

Re: Cookies, Dammit!
        34898 by: Richard S. Crawford
        34899 by: Rasmus Lerdorf
        34902 by: Jamie Burns
        34903 by: Jamie Burns
        34909 by: Rasmus Lerdorf
        34912 by: Jason Brooke
        34914 by: Richard S. Crawford
        34918 by: Jason Brooke
        34921 by: Richard S. Crawford
        34923 by: Jason Brooke
        34928 by: Richard S. Crawford
        34932 by: Michael Kimsal

SOS to a Salvadorean PHP user.
        34900 by: Douglas Galindo

Re: Redhat 7 problem and fix
        34901 by: Michael Kimsal

Re: How can I get a random number
        34904 by: Angela

How to escape from a function?
        34905 by: Zenith
        34913 by: Chris Hayes
        34916 by: Ignacio Vazquez-Abrams
        34927 by: James, Yz
        34956 by: Maxim Maletsky

Strings??
        34906 by: Website4S.aol.com
        34908 by: Benjamin Munoz
        34911 by: April
        34915 by: Chris Hayes

Re: [PHP-DEV] cookies and sessions   security
        34910 by: Jason Murray

Working with time()...
        34919 by: Dallas Kropka
        34922 by: Jason Brooke

Trouble With MySQL Auto-Increment
        34920 by: Parag Mallick

How to keep unauthorized viewers out
        34924 by: Miles Thompson
        34930 by: Benjamin Munoz
        34931 by: Benjamin Munoz
        34934 by: Miles Thompson
        34935 by: Nathan Cook
        34953 by: Maxim Maletsky

PHP as a MUD engine?
        34925 by: Daniel Grace
        34929 by: Antonio S. Martins Jr.

Macromedia and Allaire (cold fusion) have agreed to merge.
        34926 by: lou
        34962 by: Alex Black
        34966 by: Boris Kozovich

Mail problems
        34933 by: Todd H MacPherson

MySQL + PWS Problems
        34936 by: Chris
        34939 by: Dell Coleman

Setting Up Openlink ODBC to Work With PHP
        34938 by: Grant Walters
        34941 by: Andrew Hill

MySQL - How to transfer a query resault into a variable?
        34940 by: SED
        34942 by: Benjamin Munoz
        34943 by: Ignacio Vazquez-Abrams

Help! Oracle...
        34944 by: Paul
        34950 by: Alex Black

I love/hate FrontPage - need another HTML editor.
        34945 by: Murph
        34948 by: Kath
        34959 by: Todd H MacPherson
        34969 by: Chris Aitken
        34970 by: Todd H MacPherson
        34971 by: Murph

comparing two arrays in PHP3
        34946 by: Maurice Rickard

unserialize() unexpectedly returns a boolean
        34947 by: TR Henigson

Re: I love/hate FrontPage - need another HTML editor. -> Dreamweaver 4
        34949 by: SED
        34967 by: Murph

$row->user_id;
        34951 by: SED
        34960 by: Benjamin Munoz

XML, Parser and newbie links
        34952 by: Robert Mena

Re: Template parser
        34964 by: Alex Black

log out from secure server
        34965 by: Jacky.lilst

Re: is 1 a Variable...Discoverd it just now...
        34972 by: Toby Butzon

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]


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


Hi,

I want to use the xmltree(), xmldoc() functions, etc.
According to the PHP manual, these functions should be available in PHP
4.0b4 onwards,
I am running PHP 4.0.1pl2 but when I try to call xmltree() I get this
error:

Fatal error: Call to undefined function: xmltree() in
   /usr/local/apache/htdocs/megsoc2/test/xml_parse/test1.php on line 5


How can I use these functions?

thanks,

- Kev


--
http://www.fa-premier.com - English Premier League Football







>  Fatal error: Call to undefined function: xmltree() in
>     /usr/local/apache/htdocs/megsoc2/test/xml_parse/test1.php on line 5

you prob. need to compile php again with '--with-xml'

see 'configure --help' for more info.

Hrishi




On 16 Jan 2001, Hrishi wrote:

> >  Fatal error: Call to undefined function: xmltree() in
> >     /usr/local/apache/htdocs/megsoc2/test/xml_parse/test1.php on line 5
>
> you prob. need to compile php again with '--with-xml'
>
> see 'configure --help' for more info.
>
> Hrishi
>

No, you need --with-dom.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





I have now compiled PHP with the --with-dom option, but unfortunately
something is wrong!

Here's my source (adapted from code in the manual):

<?
$fd = fopen("Competition8.xml","r");
$myXML = fread($fd,filesize("Competition8.xml"));
fclose($fd);
$docTree = xmltree($myXML);
print("<pre>");
print_r( $docTree );
print( "</pre>" );
?>


The only HTML output I get is this:

<pre></pre>


Any ideas?

TIA,

- Kev





Ignacio Vazquez-Abrams wrote:

> On 16 Jan 2001, Hrishi wrote:
>
> > >  Fatal error: Call to undefined function: xmltree() in
> > >     /usr/local/apache/htdocs/megsoc2/test/xml_parse/test1.php on line 5
> >
> > you prob. need to compile php again with '--with-xml'
> >
> > see 'configure --help' for more info.
> >
> > Hrishi
> >
>
> No, you need --with-dom.
>
> --
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
http://www.fa-premier.com - English Premier League Football







> This only applies to PHP 4.0.4
> 
> Back with PHP 4.0.2, I could do this:
> 
> <?PHP
> $string = "[[";
> $string = preg_replace("/(\W)/", "\\\\1", $string);
> ?>
> 
> $string would then contain "\[\[".
> 
> Now, if I use that same code, $string contains "\\1\\1\\1\\1".
> 
> I tried to compensate for this using PHP's new ability to allow
> perl syntax in the replace section.
> 
> <?PHP
> $string = "[[";
> $string = preg_replace("/(\W)/", "\\$1", $string);
> ?>
> 
> That leaves $string with "\$1\$1\$1\$1".  Which tells me it thought
> I was backreferencing the $.  So, to combat said assumption, I tried
> three, four, even five slashes in front of $1, and nothing worked.
> All I got were variations of "\$1\$1\$1\$1".
> 
> I have to assume this is a bug, since this worked back in 4.0.2 which
> I stopped using due to segfaults under certain circumstances.
> 
> Ideas?

It is indeed a bug - I fixed it in CVS version if you want to try that.

-Andrei
* A feature is a bug with seniority. *




Another good way to do that is to load the file in the database.

The cities are a constant, and you can have them loaded in the database by a
script that check if they exist, if not create a new row with the new city;
if exist you update the data only...
Because if each time that a user goes to a page and this script check in the
text for a specific city, it would be very slow... it would be easier, in my
point of view,  that the same script that grab the file from the server also
update the data in the database table. This will give you more power like,
the time that was updated, number of times per day and etc, that you can
show to your users.

Have fun,

Rom
----- Original Message -----
From: Glen Scott <[EMAIL PROTECTED]>
To: James Holloway <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 10:15 AM
Subject: Re: [PHP] Reading specific data from a .txt file into PHP


James,

The trouble is, that there are about 3000 cities in the text file.  I'm
>assuming that I fill use fopen(); and fread(); to open and read the files,
>but does anyone know of a way of singling out one line (say:
>
>CYGL 161346Z 34004KT 15SM -SN BKN011 BKN030 RMK SF6SC1
>
>) from the whole text file?  Like if a variable, $city = CYGL, is it
>possible to then go to that one line in the text file and read all the
>information from just one line?  I'm pretty confident I could then split
the
>information up into readable variable using the split(); function :)

Assuming the first field (i.e. CYGL) is unique, just read each line and
check using a regular expression whether it matches the city you
require.  If it matches, you can stop reading the file and do whatever you
need to do with the line.

Regards,

Glen

-----------------------------------------------------
   Design Solution Limited
   t: +44 (0)1502 513008
   f: +44 (0)1502 588622
   e: [EMAIL PROTECTED]
   w: http://www.designsolution.co.uk
   Nouvotech House, Harbour Road,
   Oulton Broad, Suffolk, NR32 3LZ, UK
-----------------------------------------------------


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





Sounds like a great database application, actually.

John Parker

> -----Original Message-----
> From: James Holloway [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, January 16, 2001 8:58 AM
> To:   [EMAIL PROTECTED]
> Subject:      Reading specific data from a .txt file into PHP
> 
> Hi all,
> 
> I'm attempting to write a weather script, which will display weather
> conditions for areas in the UK.
> 
> I have the data I need, which is stored in a file on another server.   The
> data comes in the format:
> 
> 2001/01/16 13:50
> OOOO SCT010 BKNDPIP WYXWE Q1012
> 
> 2001/01/16 13:46
> CYGL 161346Z 34004KT 15SM -SN BKN011 BKN030 RMK SF6SC1
> 
> Where the first four characters below the dates are 4 letter codes for
> cities (the script will be using metar(aviation) readings) and the rest is
> the actual weather information.
> 
> The trouble is, that there are about 3000 cities in the text file.  I'm
> assuming that I fill use fopen(); and fread(); to open and read the files,
> but does anyone know of a way of singling out one line (say:
> 
> CYGL 161346Z 34004KT 15SM -SN BKN011 BKN030 RMK SF6SC1
> 
> ) from the whole text file?  Like if a variable, $city = CYGL, is it
> possible to then go to that one line in the text file and read all the
> information from just one line?  I'm pretty confident I could then split
> the
> information up into readable variable using the split(); function :)
> 
> Thanks in advance for any help you might be able to give,
> 
> James.
> 
> 




Hi everyone,
Does anyone have any ideas how does Windows Explorer work? I am trying to
create same functionality for Event Type in my Event table, I need to have
same kind of expand function like Explorer.  Could anyone tell me the
structure, ideas or methods to create such expand function. Thanks!

Calvin Chua





This is a quite involved question youve asked :) I think your more
interested in how the hiarky works in a folder inside of folder system
right? I use a table with three fields.

category_num
parent_num
category_name

base (100, 0, base) -> fruits (101, 100, fruits) -> tomatoes (103, 101,
tomatoes)
                                                                         ->
oranges (104, 101, oranges)
                                -> vegetables (102, 100, fruits) -> brocolli
(105, 102, brocolli)
                                                                            
    -> carotts (106, 102, carotts)

| category_num | parent_num | category_name |
================================
| 100                | 0                 | base                 |
| 101                | 100             | fruits                 |
| 103                | 101             | tomatoes           |
| 104                | 101             | oranges             |
| 102                | 100             | vegetables         |
| 105                | 102             | brocolli             |
| 106                | 102             | carotts               |

draw a fairly simple tree out on paper and you will begin to see it all
clearer then outlook express allows me to :)

Ive seen tutorials around, ie phpbuilder.com, I found them confusing, hehe,
good luck !

Chris Lee
Mediawaveonline.com


"Wee Chua" <[EMAIL PROTECTED]> wrote in message
0F9D3D919AADD211BE7E00A0C99B842009F242@SERVERDELL2200">news:0F9D3D919AADD211BE7E00A0C99B842009F242@SERVERDELL2200...
> Hi everyone,
> Does anyone have any ideas how does Windows Explorer work? I am trying to
> create same functionality for Event Type in my Event table, I need to have
> same kind of expand function like Explorer.  Could anyone tell me the
> structure, ideas or methods to create such expand function. Thanks!
>
> Calvin Chua
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






How can i add all the fetched rows from a table?

$result=mysql("$DBName","SELECT * FROM basket WHERE UserID='$UID'");
while ($row = mysql_fetch_array($result)) {
$CID=$row[0];
$DMN=$row[1];
$DMB=$row[2];
$BID=$row[4];
do{
print "$DMB";
}


Let's say i have to display the endprice from all the items from user $UID in the 
basket. Price from the items is in row $[2] or $DMB. How can i do that?





well your code snipit allready shows your answer.

$result = mysql_db_query($DBName, "SELECT * FROM basket WHERE
UserID='$UID'");
while ($row = mysql_fetch_array($result))
{
 $CID = $row[0];
 $DMN = $row[1];
 $DMB = $row[2];
 $BID = $row[4];

 echo "Price: $DMB<br>\n";
}

Chris Lee
Mediawaveonline.com



""K.Simon"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
How can i add all the fetched rows from a table?

$result=mysql("$DBName","SELECT * FROM basket WHERE UserID='$UID'");
while ($row = mysql_fetch_array($result)) {
$CID=$row[0];
$DMN=$row[1];
$DMB=$row[2];
$BID=$row[4];
do{
print "$DMB";
}


Let's say i have to display the endprice from all the items from user $UID
in the basket. Price from the items is in row $[2] or $DMB. How can i do
that?


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







yeah, but if the user has 20 items in the cart (=20 rows), how do i show the endprice 
of his items? In the below example it just prints all the rows from the user but i 
want to make a simple mathematical addition $DMB+$DMB+$DMB and so on as rows for this 
user exists. It might simple for you but not for a "newcomer" :)

*********** REPLY SEPARATOR  ***********

On 16/01/2001 at 8:51 Chris Lee wrote:

>well your code snipit allready shows your answer.
>
>$result = mysql_db_query($DBName, "SELECT * FROM basket WHERE
>UserID='$UID'");
>while ($row = mysql_fetch_array($result))
>{
> $CID = $row[0];
> $DMN = $row[1];
> $DMB = $row[2];
> $BID = $row[4];
>
> echo "Price: $DMB<br>\n";
>}
>
>Chris Lee
>Mediawaveonline.com
>
>
>
>""K.Simon"" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>How can i add all the fetched rows from a table?
>
>$result=mysql("$DBName","SELECT * FROM basket WHERE UserID='$UID'");
>while ($row = mysql_fetch_array($result)) {
>$CID=$row[0];
>$DMN=$row[1];
>$DMB=$row[2];
>$BID=$row[4];
>do{
>print "$DMB";
>}
>
>
>Let's say i have to display the endprice from all the items from user $UID
>in the basket. Price from the items is in row $[2] or $DMB. How can i do
>that?
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]







Hello list,

Just a quickie. Does anyone have a code snippet for calculating the day of
the week given a date? I was hoping I could feed a string like "20010116" to
a function and have it return "Tuesday" - it doesn't have to be exactly this
date format that is used for the input, but I do need the name of the day on
the output!

I'm hunting around at the moment but I haven't had any joy so far, I thought
I'd see if anyone's already invented this wheel...

Cheers
Jon



Please visit us on the Internet:
http://www.witanjardine.co.uk

'The information included in this e-mail is of a confidential nature and is
intended only for the addressee.  If you are not the intended addressee, any
disclosure, copying or distribution by you is prohibited and may be
unlawful.  Disclosure to any party other than the addressee, whether
inadvertent or otherwise is not intended to waive privilege of
confidentiality'





Cheers Andy, between my last post and this one I came up with a rather
long-winded way of doing it...

$dayarray = getdate(mktime(0,0,0,$month,$date,$year));
switch ($dayarray["wday"]) {
        case 0:
                $day = "Sunday";
                break;
        case 1: 
                $day = "Monday";
                break;
        case 2: 
                $day = "Tuesday";
                break;
        case 3: 
                $day = "Wednesday";
                break;
        case 4: 
                $day = "Thursday";
                break;
        case 5: 
                $day = "Friday";
                break;
        case 6: 
                $day = "Saturday";
                break;
}

Ugh. I'll try your method.

Cheers
Jon


-----Original Message-----
From: Andrew Rush [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2001 16:03
To: Jon Haworth
Subject: Re: [PHP] Working out the name of the day given a date



On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote:

> Just a quickie. Does anyone have a code snippet for calculating the day of

> the week given a date? I was hoping I could feed a string like "20010116"
to 
> a function and have it return "Tuesday" - it doesn't have to be exactly
this 
> date format that is used for the input, but I do need the name of the day
on 
> the output! 

covert your date string to a unix timestamp and then use date("l",
$myString)
have a great day,
andy

:: Andrew Rush :: Lead Systems Developer :: MaineToday.com ::
**************************************************************************
"Crippled but free, blind all the time, i was learning to see"

- J. Garcia / R. Hunter
**************************************************************************

The  views expressed herein are not necessarily those of my employer, but
they let me have them anyway.




On Tue, 16 Jan 2001, Jon Haworth wrote:

> Hello list,
>
> Just a quickie. Does anyone have a code snippet for calculating the day of
> the week given a date? I was hoping I could feed a string like "20010116" to
> a function and have it return "Tuesday" - it doesn't have to be exactly this
> date format that is used for the input, but I do need the name of the day on
> the output!
>
> I'm hunting around at the moment but I haven't had any joy so far, I thought
> I'd see if anyone's already invented this wheel...
>
> Cheers
> Jon
>

Try date('l'). (lowercase L)

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





Hmmm. I did:

        $timestamp = mktime(0,0,0,$month,$date,$year);
        $day = date("1", $timestamp);

and it returns 1, no matter what the contents of $month, $date and $year
are. Did I miss something?



-----Original Message-----
From: Andrew Rush [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2001 16:03
To: Jon Haworth
Subject: Re: [PHP] Working out the name of the day given a date



On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote:

> Just a quickie. Does anyone have a code snippet for calculating the day of

> the week given a date? I was hoping I could feed a string like "20010116"
to 
> a function and have it return "Tuesday" - it doesn't have to be exactly
this 
> date format that is used for the input, but I do need the name of the day
on 
> the output! 

covert your date string to a unix timestamp and then use date("l",
$myString)
have a great day,
andy

:: Andrew Rush :: Lead Systems Developer :: MaineToday.com ::
**************************************************************************
"Crippled but free, blind all the time, i was learning to see"

- J. Garcia / R. Hunter
**************************************************************************

The  views expressed herein are not necessarily those of my employer, but
they let me have them anyway.




On Tue, 16 Jan 2001, Jon Haworth wrote:

> Hmmm. I did:
>
>       $timestamp = mktime(0,0,0,$month,$date,$year);
>       $day = date("1", $timestamp);
>
> and it returns 1, no matter what the contents of $month, $date and $year
> are. Did I miss something?
>

Yes, you're missing the fact that it's a lowercase 'L', and not in fact the
numeral '1'.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





Gah. I read that lower case l as a number 1. Time to get new glasses/switch
to 640x480 mode.

Thanks to everyone for your help.


Cheers
Jon


-----Original Message-----
From: Andrew Rush [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2001 16:03
To: Jon Haworth
Subject: Re: [PHP] Working out the name of the day given a date



On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote:

> Just a quickie. Does anyone have a code snippet for calculating the day of

> the week given a date? I was hoping I could feed a string like "20010116"
to 
> a function and have it return "Tuesday" - it doesn't have to be exactly
this 
> date format that is used for the input, but I do need the name of the day
on 
> the output! 

covert your date string to a unix timestamp and then use date("l",
$myString)
have a great day,
andy

:: Andrew Rush :: Lead Systems Developer :: MaineToday.com ::
**************************************************************************
"Crippled but free, blind all the time, i was learning to see"

- J. Garcia / R. Hunter
**************************************************************************

The  views expressed herein are not necessarily those of my employer, but
they let me have them anyway.





"Pavel Kalian" <[EMAIL PROTECTED]> wrote in message
028e01c07fc1$dffdecf0$8361d4c2@pavelk">news:028e01c07fc1$dffdecf0$8361d4c2@pavelk...
> Hi Rick,
> you are not doing anything wrong. You just have to send the proper
> content-type depending on what you're outputing. For example if you want
to
> produce a gif image you have to use header("Content-type: image/gif");
> There's nothing wrong with it as PHP can't predict what you want to do.
> text/html is set as default simply because it's the type most users in
most
> cases need.

Yes, I know that. But what I'm saying is that eg.

<?php
header("Content-type: text/vnd.wap.wml");
?>
<wml>
    <card>
        <p>Hello world!</p>
    </card>
</wml>

...gets put out with a text/html content type as opposed to the specified
text/vnd.wap.wml. Having said that, I just tried it on the linux machine and
it worked fine. A Windows thing?

--
Rick Hodger






I seem to remember reading something very recently, possibly on this list,
about WML. IIRC, if you drop out of PHP at any point the rest of the
document gets treated as text/html. Try something like

<?php
header("Content-type: text/vnd.wap.wml");
echo("<wml><card><p>Hello world!</p></card></wml>");
?>

and see if it works.

Sorry to be vague, but I didn't pay *that* much attention to it at the time!

HTH
Jon


-----Original Message-----
From: Rick Hodger [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2001 16:02
To: [EMAIL PROTECTED]
Subject: Re: [PHP] WML/WAP and PHP



"Pavel Kalian" <[EMAIL PROTECTED]> wrote in message
028e01c07fc1$dffdecf0$8361d4c2@pavelk">news:028e01c07fc1$dffdecf0$8361d4c2@pavelk...
> Hi Rick,
> you are not doing anything wrong. You just have to send the proper
> content-type depending on what you're outputing. For example if you want
to
> produce a gif image you have to use header("Content-type: image/gif");
> There's nothing wrong with it as PHP can't predict what you want to do.
> text/html is set as default simply because it's the type most users in
most
> cases need.

Yes, I know that. But what I'm saying is that eg.

<?php
header("Content-type: text/vnd.wap.wml");
?>
<wml>
    <card>
        <p>Hello world!</p>
    </card>
</wml>

...gets put out with a text/html content type as opposed to the specified
text/vnd.wap.wml. Having said that, I just tried it on the linux machine and
it worked fine. A Windows thing?

--
Rick Hodger



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




are you sure that there's nothing in the file in before you call the
header() function? The situation you describe could happen if there was an
empty line at the begining of the file and the warnings were turned off.
When I tried your code it worked as expected:

C:\>c:\php4\php test.php
X-Powered-By: PHP/4.0.4
Content-type: text/vnd.wap.wml

<wml>
    <card>
        <p>Hello world!</p>
    </card>
</wml>
C:\>

Pavel

----- Original Message -----
From: "Rick Hodger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 5:02 PM
Subject: Re: [PHP] WML/WAP and PHP


>
> "Pavel Kalian" <[EMAIL PROTECTED]> wrote in message
> 028e01c07fc1$dffdecf0$8361d4c2@pavelk">news:028e01c07fc1$dffdecf0$8361d4c2@pavelk...
> > Hi Rick,
> > you are not doing anything wrong. You just have to send the proper
> > content-type depending on what you're outputing. For example if you want
> to
> > produce a gif image you have to use header("Content-type: image/gif");
> > There's nothing wrong with it as PHP can't predict what you want to do.
> > text/html is set as default simply because it's the type most users in
> most
> > cases need.
>
> Yes, I know that. But what I'm saying is that eg.
>
> <?php
> header("Content-type: text/vnd.wap.wml");
> ?>
> <wml>
>     <card>
>         <p>Hello world!</p>
>     </card>
> </wml>
>
> ...gets put out with a text/html content type as opposed to the specified
> text/vnd.wap.wml. Having said that, I just tried it on the linux machine
and
> it worked fine. A Windows thing?
>
> --
> Rick Hodger
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





On 16 Jan 2001 05:05:18 -0800, Rick Hodger <[EMAIL PROTECTED]> wrote:
>Here's a fun little thing I discovered, possibly a bug in PHP itself?
>
>To output a WAP page you must output a content-type header else the phone's
>browser won't recognise the page. Dead simple. Use:
>
>header("Content-type: text/vnd.wap.wml");
>
>And all is well and good as long as you use echo/printf etc to output your
>page. The second you deviate out of PHP and back to HTML the content-type
>gets overwritten with a text/html, and so the page doesn't work.  ASP used
>to be able to cope with this, is it a bug or something I'm doing wrong?

Hmmm - you might need to start checking details of your configuration. I've had
no problems doing a lot of WML work in PHP and it's always correctly returned
the content-type I've set using header on 4.0.3pl1 (OpenBSD) and 4.0.3 / 4.0.4
(Win32).

Do you have anything like output buffering turned on? I doubt that's causing
the problem as I use output buffering semi-frequently[0] but it can't hurt to
check.


[0] neat hack - use ob_content_length() to tell when you've output almost as
much data as the phone can handle (find this by doing a browser detect) so you
can stop looping over a recordset and emit the Next/Prev page headers instead).




Hello. Does anybody know any class or similar for 3d graph like bars, 
lines, etc?

Thanks
Pablo





I have a textarea in one php page to allow user to leave message. How ever, 
if the user input(three lines):

123
456
567

after I get it through some php scripts, and put it into database, later on, 
I try to display it, but it becomes(only one line):

123 456 789

Does anyone know how to handle this? One idea is to convert the <END OF LINE 
CHAR> to "<BR>" before putting it into the database, but how can we detect 
the <END OF LINE CHAR> in PHP?   Or is there any other ways?

Thank you very much in advance.




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





On Tue, 16 Jan 2001, david klein wrote:

> I have a textarea in one php page to allow user to leave message. How ever,
> if the user input(three lines):
>
> 123
> 456
> 567
>
> after I get it through some php scripts, and put it into database, later on,
> I try to display it, but it becomes(only one line):
>
> 123 456 789
>
> Does anyone know how to handle this? One idea is to convert the <END OF LINE
> CHAR> to "<BR>" before putting it into the database, but how can we detect
> the <END OF LINE CHAR> in PHP?   Or is there any other ways?
>
> Thank you very much in advance.
>

The newline char in PHP is '\n'.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





On Tuesday 16 January 2001 17:12, david klein wrote:

> Does anyone know how to handle this? One idea is to convert the <END OF
> LINE CHAR> to "<BR>" before putting it into the database, but how can
> we detect the <END OF LINE CHAR> in PHP?   Or is there any other ways?

Search the list archives. I already posted a solution for this (complete, 
working source code) some time ago.
Here it is:
Date: Fri, 5 Jan 2001 18:08:51 +0100

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

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

- Margaret Mead




nl2br() will do the translation for you, just store the text in database in
the form user writes it (allows later editing of the messages in the db
without having to deal with <br>'s) and then echo(nl2br($message)) it.

Pavel


----- Original Message -----
From: "Ignacio Vazquez-Abrams" <[EMAIL PROTECTED]>
To: "david klein" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 5:25 PM
Subject: Re: [PHP] How to handle multiple lines in PHP?


> On Tue, 16 Jan 2001, david klein wrote:
>
> > I have a textarea in one php page to allow user to leave message. How
ever,
> > if the user input(three lines):
> >
> > 123
> > 456
> > 567
> >
> > after I get it through some php scripts, and put it into database, later
on,
> > I try to display it, but it becomes(only one line):
> >
> > 123 456 789
> >
> > Does anyone know how to handle this? One idea is to convert the <END OF
LINE
> > CHAR> to "<BR>" before putting it into the database, but how can we
detect
> > the <END OF LINE CHAR> in PHP?   Or is there any other ways?
> >
> > Thank you very much in advance.
> >
>
> The newline char in PHP is '\n'.
>
> --
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





you could use nl2br command on the string that holds the data...

check this for further info...

http://www.php.net/nl2br

Have fun,

Rom
----- Original Message -----
From: david klein <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 11:12 AM
Subject: [PHP] How to handle multiple lines in PHP?


I have a textarea in one php page to allow user to leave message. How ever,
if the user input(three lines):

123
456
567

after I get it through some php scripts, and put it into database, later on,
I try to display it, but it becomes(only one line):

123 456 789

Does anyone know how to handle this? One idea is to convert the <END OF LINE
CHAR> to "<BR>" before putting it into the database, but how can we detect
the <END OF LINE CHAR> in PHP?   Or is there any other ways?

Thank you very much in advance.




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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





Hi All

I am unable to find the correct solution (where to start) with this 
problem. We are an Open Source group developing an ECC based 
(elliptic curve) public key cryptography alternative to PGP. For this 
project we need a public database to store the public keys in with 
search facilities and the possibility to import the selected records 
to a local private database. We have tried to keep all things very 
open and extendable and I have tried to define an interface to the 
shared database that will allow it to be independent from the actual 
application (the database can be replaced without any changes to 
the database protocol). I will use MySQL and PHP for the server  
side work.

For more information please see:
http://www.egroups.com/group/pegwit
or
http://www.pegwit.org (not working yet)

To download the current GUI front-end download:
http://www.egroups.com/files/pegwit/Contributions/GUIBeast6.zip

I have come to the conclusion to base it on a standard protocol like 
the one used in HTML and URL with web browsers. This is mainly 
because I then can simplify the shared database protocol to 2 
basic actions (export a key(s) and import keys). All selection etc. 
is a job for the browser and not for the local application. The 
protocol is also very portable and will be easy to implement on 
many platforms.

It is easy to export a public key record to the web server with a 
search URL like: (http://site.xx/?name1=value1&name2=value2 
etc.)

My main problem is to find a way to export the selected records 
from the browser and import them into the local database (you may 
have a solution). The only solution I have found is to pass the IP 
address and port with the URL when the browser is initialized and 
start a IP server in the local application that will wait and receive the
selected records from the web server when the end user press a 
specific button in the selection web page (server then act as a IP 
client and connect to the local server to deliver the selected 
records)

A more simple and also portable solution is to download a file with 
the selections made. My main problem with this approach is the 
"save as" dialog that will come up in all cases (you may have a 
workaround this problem). If the dialog is not shown up the 
download destination (directory) need to be passed to the server 
when the session is initialized so that the web browser knows 
where to save the information. Is this possible with PHP ???

Thanks in advance.
Benny




> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Michael A.
> Peters
> Sent: Tuesday, January 16, 2001 6:20 AM
> To: Richard Lynch
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP & FDF on Linux PPC
> 
> Pardon my ignorace, but what is FDF?
> I've done a lot with Linux on PowerPC, but I am unfamiliar with FDF.
> 
FDF = Forms Data Format

At phpbuilder.com there is a tutorial about it and you'll find a lot of Info
about it @ www.adobe.com.
Search for FDF and there you go.

Best Regards




why go for anything but the newest ? is this production ? if so stick to
non-beta probably.

Chris Lee
Mediawaveonline.com



"Francesc Lladó" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have to install in a computer with RedHat 7.0, an Apache web server
> and php with connection at Microsoft SQL Server 7.
>
> Which kind of versions of Apache and php do you recommend?
> Someone of you has tried it? Which are the more frequently problems?
>
> Tank you very much!!!
>
> --
> Francesc Lladó i Dardet
> [EMAIL PROTECTED]
>
> Interkonet Publishers s.l.
> Atenes 22
> 08006 Barcelona
> Tel. 932 530 866
> Fax. 932 530 866
> http://www.interkonet.com
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Quoting Francesc Lladó <[EMAIL PROTECTED]>:

> I have to install in a computer with RedHat 7.0, an Apache web server
> and php with connection at Microsoft SQL Server 7.
> 
> Which kind of versions of Apache and php do you recommend?
> Someone of you has tried it? Which are the more frequently problems?
> 
> Tank you very much!!!

I'm using RedHat 7.0, php-4.0.4pl1, pdflib-3.03, apache-1.3.14, mysql-3.23.29

All seems to be well.

Lee.




dude,

I installed RH7

_nightmare_

so I promptly uninstalled it, and am happily running 6.2

I would advise convincing whoever told you to do that out of doing that :)

I would recommend waiting until oracle runs on redhat 7.(x) - that's a good
litmus test.

_alex


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("Chris Lee")
> Organization: Mediawaveonline.com
> Newsgroups: php.general
> Date: 16 Jan 2001 08:41:34 -0800
> Subject: Re: [PHP] RedHat+Apache+php+MSSQL
> 
> why go for anything but the newest ? is this production ? if so stick to
> non-beta probably.
> 
> Chris Lee
> Mediawaveonline.com
> 
> 
> 
> "Francesc Lladó" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> I have to install in a computer with RedHat 7.0, an Apache web server
>> and php with connection at Microsoft SQL Server 7.
>> 
>> Which kind of versions of Apache and php do you recommend?
>> Someone of you has tried it? Which are the more frequently problems?
>> 
>> Tank you very much!!!
>> 
>> --
>> Francesc Lladó i Dardet
>> [EMAIL PROTECTED]
>> 
>> Interkonet Publishers s.l.
>> Atenes 22
>> 08006 Barcelona
>> Tel. 932 530 866
>> Fax. 932 530 866
>> http://www.interkonet.com
>> [EMAIL PROTECTED]
>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Hi, it works now! Thank everyone very much for the great help, especially 
Atom and others who helped me out.

Have a wonderful day!

Best Regards,
David

>From: <[EMAIL PROTECTED]>
>To: david klein <[EMAIL PROTECTED]>
>Subject: Re: [PHP] How to handle multiple lines in PHP?
>Date: Tue, 16 Jan 2001 17:07:01 +0100 (CET)
>
>Hello David!
>
> > Atom,
> >
> >     Thank you very much for the help.
> >     I am using MySql, actually, in the database, there is no "\n".  I
> > debugged it a little bit more, and found the followings:
> > It seems that PHP took the three lines as one line (I think it can't
> > recognize "\n" from the textarea input, and convert it automatically 
>into  a
> > space char.
>Ok. I understand your problem. I created a Forum program, where I use this
>HTML tag as <textarea>.
>
>Solution:
>$szoveg contains your line from DB
>
>123 456 789
>
>$szoveg=ereg_replace("\n","<br>",$szoveg);
>
>Result is
>
>123
>456
>789
>
>:-)
>
>bye,
>
>Atom
>
>
>
>
>
> >     More idea?
> > Thanks again for helping me!
> > David
> >
> >
> > >From: <[EMAIL PROTECTED]>
> > >To: david klein <[EMAIL PROTECTED]>
> > >Subject: Re: [PHP] How to handle multiple lines in PHP?
> > >Date: Tue, 16 Jan 2001 16:47:33 +0100 (CET)
> > >
> > > > after I get it through some php scripts, and put it into database, 
>later
> > >on,
> > > > I try to display it, but it becomes(only one line):
> > > >
> > > > 123 456 789
> > > >
> > > > Does anyone know how to handle this? One idea is to convert the <END 
>OF
> > >LINE
> > > > CHAR> to "<BR>" before putting it into the database, but how can we
> > >detect
> > > > the <END OF LINE CHAR> in PHP?   Or is there any other ways?
> > >When you take it from database change \n to <BR> etc...
> > >
> > >Atom
> > >
> >
> > _________________________________________________________________
> > Get your FREE download of MSN Explorer at http://explorer.msn.com
> >
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





Hi

I have 2 forms:

subscribe.php
confirm.php

If the user enters data correctly in subscribe.php I have an an include
pointing to confirm.php. This gives the user a chance to review the data
before final submission.

I want the user to be able to click the back button on their browser and
view/make changes on the entry form if they find a typo but Netscape's back
button will not take me back to the original form. It just redisplays the
results of confirm.php while Internet Explorer works fine.

Do any of you have a solution for this? I have almost pulled out all my hair
on this one.

Thanks

Todd

PS Using Netscape 4.75 and IE 5.5





On Tue, 16 Jan 2001, Todd H MacPherson wrote:

> Hi
>
> I have 2 forms:
>
> subscribe.php
> confirm.php
>
> If the user enters data correctly in subscribe.php I have an an include
> pointing to confirm.php. This gives the user a chance to review the data
> before final submission.
>
> I want the user to be able to click the back button on their browser and
> view/make changes on the entry form if they find a typo but Netscape's back
> button will not take me back to the original form. It just redisplays the
> results of confirm.php while Internet Explorer works fine.
>
> Do any of you have a solution for this? I have almost pulled out all my hair
> on this one.
>
> Thanks
>
> Todd
>
> PS Using Netscape 4.75 and IE 5.5
>

Put a button labelled "Change" or "Make Corrections" or some such on your
confirmation screen (and then write the code for that, of course). It's not
pretty, but it can't fail.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





in the buttom href put this: javascript:history.go(-1)

works great to me... on click doesn't work very well o netscape in this
cases...

I expect that thisis what you want!

Rom
----- Original Message -----
From: Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
To: Todd H MacPherson <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 12:04 PM
Subject: Re: [PHP] Netscape's back button not working like Explorer's...Why?


On Tue, 16 Jan 2001, Todd H MacPherson wrote:

> Hi
>
> I have 2 forms:
>
> subscribe.php
> confirm.php
>
> If the user enters data correctly in subscribe.php I have an an include
> pointing to confirm.php. This gives the user a chance to review the data
> before final submission.
>
> I want the user to be able to click the back button on their browser and
> view/make changes on the entry form if they find a typo but Netscape's
back
> button will not take me back to the original form. It just redisplays the
> results of confirm.php while Internet Explorer works fine.
>
> Do any of you have a solution for this? I have almost pulled out all my
hair
> on this one.
>
> Thanks
>
> Todd
>
> PS Using Netscape 4.75 and IE 5.5
>

Put a button labelled "Change" or "Make Corrections" or some such on your
confirmation screen (and then write the code for that, of course). It's not
pretty, but it can't fail.

--
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>


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





Hi

JavaScript does not work in this instance. I will have to write code to
overcome Netscape's shortcomings I guess.

Thanks

Todd

----- Original Message -----
From: "Romulo Roberto Pereira" <[EMAIL PROTECTED]>
To: "Ignacio Vazquez-Abrams" <[EMAIL PROTECTED]>; "Todd H MacPherson"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: January 16, 2001 1:13 PM
Subject: Re: [PHP] Netscape's back button not working like Explorer's...Why?


> in the buttom href put this: javascript:history.go(-1)
>
> works great to me... on click doesn't work very well o netscape in this
> cases...
>
> I expect that thisis what you want!
>
> Rom
> ----- Original Message -----
> From: Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
> To: Todd H MacPherson <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 16, 2001 12:04 PM
> Subject: Re: [PHP] Netscape's back button not working like
Explorer's...Why?
>
>
> On Tue, 16 Jan 2001, Todd H MacPherson wrote:
>
> > Hi
> >
> > I have 2 forms:
> >
> > subscribe.php
> > confirm.php
> >
> > If the user enters data correctly in subscribe.php I have an an include
> > pointing to confirm.php. This gives the user a chance to review the data
> > before final submission.
> >
> > I want the user to be able to click the back button on their browser and
> > view/make changes on the entry form if they find a typo but Netscape's
> back
> > button will not take me back to the original form. It just redisplays
the
> > results of confirm.php while Internet Explorer works fine.
> >
> > Do any of you have a solution for this? I have almost pulled out all my
> hair
> > on this one.
> >
> > Thanks
> >
> > Todd
> >
> > PS Using Netscape 4.75 and IE 5.5
> >
>
> Put a button labelled "Change" or "Make Corrections" or some such on your
> confirmation screen (and then write the code for that, of course). It's
not
> pretty, but it can't fail.
>
> --
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Is there a way to call one regexp on multiple variables, in one statement?
In Perl, I'd do:

s/this/that for ($var1, $var2, $var3);

tia.. and please reply directly.

[EMAIL PROTECTED]





Why don't you do a function with an ereg inside?

I don't think that exist a command like that...

Rom
----- Original Message ----- 
From: Elliot L. Tobin <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 11:59 AM
Subject: [PHP] regexps


Is there a way to call one regexp on multiple variables, in one statement?
In Perl, I'd do:

s/this/that for ($var1, $var2, $var3);

tia.. and please reply directly.

[EMAIL PROTECTED]


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





Most of the preg_ functions support arrays of values as input
parameters. It's all in the documentation.

"Elliot L. Tobin" wrote:
> 
> Is there a way to call one regexp on multiple variables, in one statement?
> In Perl, I'd do:
> 
> s/this/that for ($var1, $var2, $var3);
> 
> tia.. and please reply directly.
> 
> [EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt <[EMAIL PROTECTED]>
http://www.ispi.net/




On Tue, 16 Jan 2001, Jacky@lilst wrote:

>
> Oops, forgot that I actually close the input tage, the previous one was the mistype.
> print("<td>");
> print("<input type='button' value='back' onclick='self.history.back()';>");
> print("</td>");
>
> what happen was that when the html page was generated, that specific part did not 
>apear on the page, although the source can be seen using view source.
> What did I do wrong?
> cheers
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for yourself"
>

If you're viewing it with Navigator, you have to enclose all inputs in forms.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>






I found the following problems or suggestions with phplib version 7.2c

This will get rid of errors un text which has  no javascript associated with
it
diff /usr/rickster/stuff/phplib-7.2c/php/of_text.inc
/home/httpd/html/php/of_text.inc
66c66,67
<     
---
>     if (!isset($ndx_array))  // added by me get rid of warning messages
>     return;                  // get out if no javascript?

Suggestions:

in auth I added a check to make sure the ip address of the person coming in
is the
same ip he logged on with.   Not a 100% but is another check.

156a181
>             $this->auth["ip"]=$REMOTE_ADDR;
161a187
>             $this->auth["ip"]=$REMOTE_ADDR;
170a197
>           $this->auth["ip"]=$REMOTE_ADDR;
176a204
>             $this->auth["ip"]=$REMOTE_ADDR;
214c242
< 
---
>      $this->auth["ip"]=0;
234c262,266
0;
234c262,266
>   global $REMOTE_ADDR;
>       if (
>       $REMOTE_ADDR==$this->auth["ip"] &&
In Page I added a line to make sure netscape or windoze ddoesn't cache
diff /usr/rickster/stuff/phplib-7.2c/php/page.inc
/home/httpd/html/php/page.inc
14c14
< 
---
>  
15a16,18
>   #printf("sess is %s<br>",$feature["sess"]);
>    header("Pragma: no-cache"); 
>    header("Cache-Control: no-cache, must-revalidate");

This one line took me soooooo many hours troubleshooting .
Rick





On Tue, 16 Jan 2001, Sam wrote:

> Hi,
>
> I have several web pages that are built with php and mySQL.
> I use a new connection for each script.
> Should I be using a permanent connection? Or is there a better way around
> this?
>
> Regards,
> Sam Rose
>

Persistent connections are more efficient in that they don't need to open the
connection each time. Unless you have an overwhelming need to limit concurrent
connections to your MySQL server, you should probably be using persistent
connections.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





There's one thing, that I don't understand about permanent connections.

When will they be closed?
I could use a logout-page, but there is no garanty for the use of it.

Any explanation would be appreciated.

mOrP

> -----Original Message-----
> From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 16, 2001 6:17 PM
> To: Sam
> Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> Subject: Re: [PHP] Database Connections - permanent or something else?
> 
> 
> On Tue, 16 Jan 2001, Sam wrote:
> 
> > Hi,
> >
> > I have several web pages that are built with php and mySQL.
> > I use a new connection for each script.
> > Should I be using a permanent connection? Or is there a better 
> way around
> > this?
> >
> > Regards,
> > Sam Rose
> >
> 
> Persistent connections are more efficient in that they don't need 
> to open the
> connection each time. Unless you have an overwhelming need to 
> limit concurrent
> connections to your MySQL server, you should probably be using persistent
> connections.
> 
> -- 
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





PHP handles persistent connections by leaving them open
for some other identical connection request. The next request
will check for a free connection.

see
http://www.php.net/manual/en/features.persistent-connections.php

In other words, you don't need to worry about when they are closed
php will handle that for you


mOrP wrote:
> 
> There's one thing, that I don't understand about permanent connections.
> 
> When will they be closed?
> I could use a logout-page, but there is no garanty for the use of it.
> 
> Any explanation would be appreciated.
> 
> mOrP
> 
> > -----Original Message-----
> > From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 16, 2001 6:17 PM
> > To: Sam
> > Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> > Subject: Re: [PHP] Database Connections - permanent or something else?
> >
> >
> > On Tue, 16 Jan 2001, Sam wrote:
> >
> > > Hi,
> > >
> > > I have several web pages that are built with php and mySQL.
> > > I use a new connection for each script.
> > > Should I be using a permanent connection? Or is there a better
> > way around
> > > this?
> > >
> > > Regards,
> > > Sam Rose
> > >
> >
> > Persistent connections are more efficient in that they don't need
> > to open the
> > connection each time. Unless you have an overwhelming need to
> > limit concurrent
> > connections to your MySQL server, you should probably be using persistent
> > connections.
> >
> > --
> > Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




On Tue, 16 Jan 2001, Kevin Cawthorne wrote:

> Hi,
>
> I want to install  PHPLIB but one of the configuration notes says "turn off magic 
>quotes in the php.ini file".
>
> OK But I'm, using phpMyAdmin, which I understand NEEDS magic quotes on to work.
>
> Has anyone done this using the two together?
>
> Kevin Cawthorne
>

Knowing which web server you're using helps, but if you're using Apache, the
way to do it is to turn it off in php.ini and then turn it on in httpd.conf or
.htaccess or wherever for the directory/location phpMyAdmin is in.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





using .htaccess with phpMyAdmin can cause problems with Advanced Authentication (which 
you should be using).
AFAIK only horde's implementation of phplib wants magic quotes turned off- last time I 
looked at phplib itself, it wanted them on.

It's *possible* I got that backwards, but I don't think so.
If it is horde you are trying to install- if its just an imap client you are looking 
for- check out basilix.

I also believe you can use a directive either in the php.ini file or httpd.conf to 
turn magic quotes on/off on a per directory basis, w/o .htaccess (again- I'm not 
positive... check the php documentation)

On Tuesday, January 16, 2001, at 09:24 AM, Ignacio Vazquez-Abrams wrote:

> On Tue, 16 Jan 2001, Kevin Cawthorne wrote: 
>  
> > Hi, 
> > 
> > I want to install  PHPLIB but one of the configuration notes says "turn off magic 
>quotes in 
> the php.ini file". 
> > 
> > OK But I'm, using phpMyAdmin, which I understand NEEDS magic quotes on to work. 
> > 
> > Has anyone done this using the two together? 
> > 
> > Kevin Cawthorne 
> > 
>  
> Knowing which web server you're using helps, but if you're using Apache, the 
> way to do it is to turn it off in php.ini and then turn it on in httpd.conf or 
> .htaccess or wherever for the directory/location phpMyAdmin is in. 
>  
> --  
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]> 
>  
>  
> --  
> PHP General Mailing List (http://www.php.net/) 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> To contact the list administrators, e-mail: [EMAIL PROTECTED] 
>  
>  

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer

(510)  623-9726x357
Fax: (510) 249-9125




Since phpmyadmin doesn't use an include path and an auto prepend file but
phplib does, what we do is run them under separate sub directories. Under
the phplib subdir we use an .htaccess to specify the phplib directives
needed to make it run and under the phpmyadmin subdir we don't specify
anything since phpmyadmin doesn't require this.

What we don't do is put the phplib .htaccess with it's directives under the
web root "/". That way we can specify varying configurations under various
sub directories.

So, you can have magic quotes on under one dir and off under another. Use
.htaccess for configuration.

best of both worlds.

Matt Friedman
Spry New Media

----- Original Message -----
From: "Ignacio Vazquez-Abrams" <[EMAIL PROTECTED]>
To: "Kevin Cawthorne" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 9:24 AM
Subject: Re: [PHP] PHPLIB and PHPMyAdmin


> On Tue, 16 Jan 2001, Kevin Cawthorne wrote:
>
> > Hi,
> >
> > I want to install  PHPLIB but one of the configuration notes says "turn
off magic quotes in the php.ini file".
> >
> > OK But I'm, using phpMyAdmin, which I understand NEEDS magic quotes on
to work.
> >
> > Has anyone done this using the two together?
> >
> > Kevin Cawthorne
> >
>
> Knowing which web server you're using helps, but if you're using Apache,
the
> way to do it is to turn it off in php.ini and then turn it on in
httpd.conf or
> .htaccess or wherever for the directory/location phpMyAdmin is in.
>
> --
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>





On Tue, 16 Jan 2001, William Bailey wrote:

> Hi,
>       Is there a way to pass variables as 'friendly' urls? So instead of
> haveing a url like www.blah.co.uk/profile.php?team=tigers i could have
> www.blah.co.uk/profile.php/team/tigers which would call profile.php and set
> team to tigers.
>       I've been playing with it but i can't seem to get it to set the
> variables. It will run the script (profile.php) but the variable $team if
> still unset.
>
> Thanks,
>       William.
>

If you're using Apache one way of doing it is using the all-powerful
mod_rewrite. That way you could request http://www.example.com/team/tigers and
it could automagically get converted to
http://www.example.com/profile.php3 with $team set to "tigers".

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





Hello Everybody,

I have seen a lot of people ask for XML support for PHP.  I was wondering
what it does that makes it good for PHP.

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





on 1/16/00 9:38 AM, Brandon Orther at [EMAIL PROTECTED] wrote:

> I have seen a lot of people ask for XML support for PHP.  I was wondering
> what it does that makes it good for PHP.

    That's a hard one to answer--I'll try anyway. I'm sorry if it sounds a
bit simple-minded but that's the sort of person I am ;-).

    XML stands for eXtensible Markup Language. It's an attempt by both large
corporations (notably Microsoft, Oracle, and IBM) as well as the standards
organizations (notable the W3C) to create a "lingua franca" for the web. A
lot of understanding it has first to have a slightly different perspective
of what we mean by "the internet" and "the web".

    First when most people say "the internet" now, they pretty much mean
"the web" and e-mail. When people say "the web" they mean HTTP and HTML
(with a little SSL thrown in for e-commerce). HTTP is the transport protocol
(how it is delivered) and HTML is the markup language (the message). XML
attempts to replace and supersede HTML without saying anything about HTTP
(though one can assume that most of the delivery will be done via HTTP, much
to the chagrin of many security administrators who depend on firewalls).

    XML is a markup language like HTML. Unlike HTML, the markup language is
extensible (basically think of it as saying you can define your own tags and
attributes). This means you can make descriptive tags such as

<book type="paperback"><AUTHOR>Joe Blogs</AUTHOR><TITLE>SATs - How to be
beaten by the system</TITLE><SUBJECT>Test preparation</SUBJECT></book>

Which looks a lot like HTML but isn't. Interestingly, the tags are
descriptive of the content which beats the hell out of UN/EDIFACT if you've
ever had to do any work for big business. Other differences are the rules
are more rigid than HTML: all tags must close, all attributes must be
quoted, all reserved characters must be escaped properly, all tags and
attributes are case sensitive. The default format for display is double byte
encoded characters (UTF-16 / UNICODE) (Note: The default used by PHP seems
to be UTF-8 so you should change it to that charset in the XML directives
line).-
    So basically what you have when you are done is a text based
hierarchical data structure that's extensible and machine readable. That's
all XML is.

    Now the things you can do with it. Obviously for one I can use this to
serialize objects in PHP very easily since I can store objects in XML
representation which is just a string to be saved. The WDDX module does that
in some standard way.

    A note about standards. Since XML is extensible, there is a need to be
specified so that I can communicate with you and we understand each other.
XML is really more like a markup language FORMAT than a language (or seen
another way, it's a standard but not a specification). There are various
specifications and attempts at specifications out there and are usually
referred to as DTDs, Document Type Definitions, or Schema. It used to be you
specified your Schema in another markup language called SGML but then some
people figured if XML is so extensible you should be able to specify your
own Schema in an Schema language which itself is XML. This is known, not
surprisingly, as XML Schema. Which represents another thing you can do with
XML: Use XML to specify XML data formats.

    A useful one for web programmers right now is you can use XML to turn
XML into other XML formats. This is done through XSL-T (eXtensible
Stylesheet Language - Transform) which is built into a PHP module called
Sablotron (Side Note: I couldn't compile Sablotron 0.50 in PHP yet, it
failes during the linking step in Apache and claims that it can't find some
library that is in Expat). Sablotron (and many XML-T parsers) is a little
robust in that you can use it to transform it into HTML and text too. This
warrants a bit larger description...

    Basically XSL works by taking an input XML file (we'll call this the
"data store") and using another XML file written using the XSL specification
(we'll call this the "rules file") to create another file in a different XML
format (we'll  all this the "presentation file"). Obviously when the
presentation file is in XML, we can chain another rules file to it to make
another presentation file and so on. XSLT parsers such as Sablotron allow us
to do just that. Why is this powerful? The best way is through examples

    (1) Our company builds a search engine that goes out and does a
real-time travel comparison engine of 25 separate travel websites. Given
that each search does this, we offload this to a business rules server that
creates this and returns the results. Because we add sites and features
almost at will, this messaging standard had to be extensible. The webserver
has to communicate with this business rules server and understand it. A
stylesheet can ensure that the message that gets sent to the web server is
always in line with what the webserver can understand even if we upgrade our
features on the business rules server.

    (2) Furthermore, we have some nasty internal business rules embeded in
our XML data store on the business rules server. An XSLT filter allows us to
remove  these internal business rules before delivery. This makes our
business objects resellable to third parties as an application service
without compromising our internal ones and requiring much coding. we can use
the same XML data store to store private and public information.

    (3) The webserver itself needs to parse and deliver the data. That data
may vary on our site vs. a cobranded site. With XSLT you can transform XML
on the fly to XHTML (a superset of HTML) and tack on your presentation layer
(nice little font tags and setting the color and whatnot). A different XSLT
for a different browser or cobrand, yet the same datastore for all of them.
This is called "separating your presentation from your data". Microsoft
calls this 3-tiering, n-tiering, DNA, NetDocs, and now dotNet. (Well some of
the later ones are a bit more than just 3-tiering, but the basic idea is in
tact).

    Well I hope you get the idea. I'm sure you can thing of other things
such as...

    (4) Oracle, Microsoft and others now allow you to query their databases
in XML. So do companies (in my field) such as Apollo and Sabre. These are
hardly compatible, nor do they in any way represent something that is
comfortable to manipulate. An XSLT layer as a data abstraction layer allows
you to transform someone else's standard into an internal one you can
manipulate in a known way.

    (5) I mentioned XML is machine readable. Imagine: web pages are not very
machine readable. Need I say more?

    I could go on, but I'm not an imaginative fellow.

    Let's see. There's also PDF. PDF isn't in XML but there is something
called XSL-FO (formatting objects) which some PDF generators (perhaps the
two that PHP has modules for?) understand. So writing XSL-FO for output for
a PDF generator is "doing XML" also.

    Then there is the fact that it hierarchical data which sometimes,
despite all these neat tools, needs to be parsed and understood. If we had a
standardized API for manipulating it, then all the knowledge in learning the
API for say visual basic on a Windows box can be transferred to doing in in
C++ in AIX or perhaps PHP? Yes, there are two such standards, one is an
event driven one (reads a tag and calls a callback function) known as "SAX"
(Simple API for XML) and implemented in the Expat (--with-xml in PHP which
is compiled by default in PHP4) and the other reads the whole thing into a
hierarchical (treelike) object structure called the DOM (Document Object
Model) which is implemented in libxml (--with-domxml or somesuch in PHP).

    I personally prefer the DOM version of looking at things (it's a bit
slower and chews more memory). Unfortunately the dom-xml in PHP doesn't much
resemble anyone elses DOM (at least not Oracle's or Microsofts), it's a bit
buggy (for instance, you can't remove a node, nor can you seem to modify the
text in a node) and it chews a whole slew of memory (much more than I'd
expect and that amount has almost doubled since they've incorporated XPath
support with PHP 4.0.4+).

    Now a final reason why PHP and XML should go hand in hand. (Because if
you haven't figured out by now, I'm really big on PHP and on XML). A study I
read estimates that by the end of this year over 50% of the Fortune 500 will
be using XML in some "test bed" situation and by 2004 80% of all business
communication on the internet will use XML.

    I hope this gives you some motivation to pick up XML and use PHP to do
so. Because the more of us that are doing so, the more developers there will
be working (or pushing others to work) on improving XML support in PHP. With
more robust cool tools like the PHP developers have already given me (and
hopefully will continue to do so), I won't feel so bad about studying
condensed matter physics and neuroscience for the last 9 years instead of
majoring in something real like computer science and learning how to code in
Java and C++.

    Take care,

        terry chay

--
terry chay, Director of Engineering, <http://www.QIXO.com/>
QIXO /kick.so/ - Integrating Many Travel Web Sites Into One
W: 1.408.394-8102     F:1.408.516.9090    M: 1.408.314.0717
E-Mail: <mailto:[EMAIL PROTECTED]>     ICQ: 16069322
PGP Fingerprint: 6DCF 1634 547C 935D 4912  2A44 A4A2 79AB DFFF F110 





> First when most people say "the internet" now, they pretty much mean
> "the web" and e-mail. When people say "the web" they mean HTTP and HTML
> (with a little SSL thrown in for e-commerce). HTTP is the transport protocol
> (how it is delivered) and HTML is the markup language (the message). XML
> attempts to replace and supersede HTML without saying anything about HTTP
> (though one can assume that most of the delivery will be done via HTTP, much
> to the chagrin of many security administrators who depend on firewalls).

That is not really the case. XML cannot be a replacement for html because
xml is not a set of defined elements like html is.

Think of XML as the _rules_ for defining your own markup languages.

XHTML is an attempt to being html in-line with the XML standard, but there
are gazillions of XML DTDs (document type definition, basically says what
elements and attributes you can have in a particular XML document) for all
kinds of things.

XML is fantastic specifically because it is _not_ a markup language: it
enables companies and industries to create _their_own_ markup languages for
specific purposes.

> XML is a markup language like HTML. Unlike HTML, the markup language is
> extensible (basically think of it as saying you can define your own tags and
> attributes). This means you can make descriptive tags such as

Ah, from the above, I thought you did not understand, but you do :)

> <book type="paperback"><AUTHOR>Joe Blogs</AUTHOR><TITLE>SATs - How to be
> beaten by the system</TITLE><SUBJECT>Test preparation</SUBJECT></book>
> 
> Which looks a lot like HTML but isn't. Interestingly, the tags are
> descriptive of the content which beats the hell out of UN/EDIFACT if you've
> ever had to do any work for big business. Other differences are the rules
> are more rigid than HTML: all tags must close, all attributes must be
> quoted, all reserved characters must be escaped properly, all tags and
> attributes are case sensitive. The default format for display is double byte
> encoded characters (UTF-16 / UNICODE) (Note: The default used by PHP seems
> to be UTF-8 so you should change it to that charset in the XML directives
> line).-
> So basically what you have when you are done is a text based
> hierarchical data structure that's extensible and machine readable. That's
> all XML is.

yeppers. I luv xml. :)

> Now the things you can do with it. Obviously for one I can use this to
> serialize objects in PHP very easily since I can store objects in XML
> representation which is just a string to be saved. The WDDX module does that
> in some standard way.

yes, and you can use it for document storage, remote procedure calls, EDI,
_anything_ that has a data payload :)!

> A note about standards. Since XML is extensible, there is a need to be
> specified so that I can communicate with you and we understand each other.
> XML is really more like a markup language FORMAT than a language (or seen
> another way, it's a standard but not a specification). There are various
> specifications and attempts at specifications out there and are usually
> referred to as DTDs, Document Type Definitions, or Schema. It used to be you
> specified your Schema in another markup language called SGML but then some
> people figured if XML is so extensible you should be able to specify your
> own Schema in an Schema language which itself is XML. This is known, not
> surprisingly, as XML Schema. Which represents another thing you can do with
> XML: Use XML to specify XML data formats.

for example, a DTD for that bookmark example above is unly useful if a bunch
of people agree on it as a standard, otherwise it doesn't do any real good.


> A useful one for web programmers right now is you can use XML to turn
> XML into other XML formats. This is done through XSL-T (eXtensible
> Stylesheet Language - Transform) which is built into a PHP module called
> Sablotron (Side Note: I couldn't compile Sablotron 0.50 in PHP yet, it

yes, this is a slightly more sad situation. (feel free to flame away - but
you have to do it on this list, not privately :)

XST (and XSLT) are fairly good for transforming between two document types,
but some people have started using it as a template mechanism for XML ->
HTML.

Problem is, you have to write like _ten_times_ as much XSL as html just to
get a basic template going.

XSL is like CFML but the design is even worse (gah) and it can't talk to a
database :)! (ok, that't not a perfect example...)

> failes during the linking step in Apache and claims that it can't find some
> library that is in Expat). Sablotron (and many XML-T parsers) is a little
> robust in that you can use it to transform it into HTML and text too. This
> warrants a bit larger description...
> 
> Basically XSL works by taking an input XML file (we'll call this the
> "data store") and using another XML file written using the XSL specification
> (we'll call this the "rules file") to create another file in a different XML
> format (we'll  all this the "presentation file"). Obviously when the
> presentation file is in XML, we can chain another rules file to it to make
> another presentation file and so on. XSLT parsers such as Sablotron allow us
> to do just that. Why is this powerful? The best way is through examples
> 
> (1) Our company builds a search engine that goes out and does a
> real-time travel comparison engine of 25 separate travel websites. Given
> that each search does this, we offload this to a business rules server that
> creates this and returns the results. Because we add sites and features
> almost at will, this messaging standard had to be extensible. The webserver
> has to communicate with this business rules server and understand it. A
> stylesheet can ensure that the message that gets sent to the web server is
> always in line with what the webserver can understand even if we upgrade our
> features on the business rules server.

That is cool, but why XSLT? Why not a bit of php code that is comparably
quite small?

> (2) Furthermore, we have some nasty internal business rules embeded in
> our XML data store on the business rules server. An XSLT filter allows us to
> remove  these internal business rules before delivery. This makes our
> business objects resellable to third parties as an application service
> without compromising our internal ones and requiring much coding. we can use
> the same XML data store to store private and public information.

I don't understand this, but that isn't surprising because there isn't
enough context :)

> (3) The webserver itself needs to parse and deliver the data. That data
> may vary on our site vs. a cobranded site. With XSLT you can transform XML
> on the fly to XHTML (a superset of HTML) and tack on your presentation layer
> (nice little font tags and setting the color and whatnot). A different XSLT
> for a different browser or cobrand, yet the same datastore for all of them.
> This is called "separating your presentation from your data". Microsoft
> calls this 3-tiering, n-tiering, DNA, NetDocs, and now dotNet. (Well some of
> the later ones are a bit more than just 3-tiering, but the basic idea is in
> tact).

yes, this is a central argument I've had with a few people: using XML and
parsing all that data coming out of a database is a huge hassle. XML should
be an output format and a storage format, used somewhat similarly in a
system as HTML.

for example, if you're talking to a browser, spit out html.
if you're talking to an XML-RPC server, spit out XML
if you're talking to a cell phone, spit out WML, etc.

I disagree with the idea that using schema-defined files as a base, paired
with gobs and gobs of XSL is the groovy way to go.

anyway.

> Well I hope you get the idea. I'm sure you can thing of other things
> such as...
> 
> (4) Oracle, Microsoft and others now allow you to query their databases
> in XML. So do companies (in my field) such as Apollo and Sabre. These are
> hardly compatible, nor do they in any way represent something that is
> comfortable to manipulate. An XSLT layer as a data abstraction layer allows
> you to transform someone else's standard into an internal one you can
> manipulate in a known way.

aargh :)

10x the code, and it doesn't get you anything :)

I heard about that oracle XML-query thing, gotta check it out...

but I'm rather fond of SQL.

> (5) I mentioned XML is machine readable. Imagine: web pages are not very
> machine readable. Need I say more?

yes, but only if the machine knows the rules of the document. that's been a
problem, foofy non- or proprietary standard that no one bothers to document.
:)

> I could go on, but I'm not an imaginative fellow.

seem pretty well informed to me :).

> Let's see. There's also PDF. PDF isn't in XML but there is something
> called XSL-FO (formatting objects) which some PDF generators (perhaps the
> two that PHP has modules for?) understand. So writing XSL-FO for output for
> a PDF generator is "doing XML" also.

yeah, apparently this is a complete nightmare. (speaking as someone who has
not actually done it, mind you :)

> Then there is the fact that it hierarchical data which sometimes,
> despite all these neat tools, needs to be parsed and understood. If we had a
> standardized API for manipulating it, then all the knowledge in learning the
> API for say visual basic on a Windows box can be transferred to doing in in
> C++ in AIX or perhaps PHP? Yes, there are two such standards, one is an
> event driven one (reads a tag and calls a callback function) known as "SAX"
> (Simple API for XML) and implemented in the Expat (--with-xml in PHP which
> is compiled by default in PHP4) and the other reads the whole thing into a
> hierarchical (treelike) object structure called the DOM (Document Object
> Model) which is implemented in libxml (--with-domxml or somesuch in PHP).

read:

SAX is fast as hell, and works really well for simple, not-very-nested xml
documents. it is event based:

Ohhhhh! A tag!
I'll call a function now to handle the fact that I have encountered a tag!
have a nice day!

DOM is the serious, bad-ass big brother of SAX that reads the DTD associated
with that document, and (usually) enforces all kinds of inconvenient rules
about form and correctness :) - it then takes the _entire_ document, and
turns it into a hierarchy (which is what an XML doc is).

I like dom too, but it has problems right now.

Also, most XML stuff I'm doing is _so_ simple (which is nice) that using SAX
is all that's really necessary.

once again, convenience reigns over correctness :)

> I personally prefer the DOM version of looking at things (it's a bit
> slower and chews more memory). Unfortunately the dom-xml in PHP doesn't much
> resemble anyone elses DOM (at least not Oracle's or Microsofts), it's a bit
> buggy (for instance, you can't remove a node, nor can you seem to modify the
> text in a node) and it chews a whole slew of memory (much more than I'd
> expect and that amount has almost doubled since they've incorporated XPath
> support with PHP 4.0.4+).
>
> Now a final reason why PHP and XML should go hand in hand. (Because if
> you haven't figured out by now, I'm really big on PHP and on XML). A study I
> read estimates that by the end of this year over 50% of the Fortune 500 will
> be using XML in some "test bed" situation and by 2004 80% of all business
> communication on the internet will use XML.

totally.

virtually business communications at the machine level are being converted
to XML.


> I hope this gives you some motivation to pick up XML and use PHP to do
> so. Because the more of us that are doing so, the more developers there will
> be working (or pushing others to work) on improving XML support in PHP. With
> more robust cool tools like the PHP developers have already given me (and
> hopefully will continue to do so), I won't feel so bad about studying
> condensed matter physics and neuroscience for the last 9 years instead of
> majoring in something real like computer science and learning how to code in
> Java and C++.

nah, the former's more interesting anyway :)

> Take care,
> 
> terry chay

_a

(oh yes, the obligatory ad for binarycloud:

go to http://www.binarycloud.com - it's a beefy web application platform in
PHP!)





uff... that was long but very useful, thanks Terry - a good contribution for
our developers team in here whom I just forwarded your email and for
PHP-General archives.

Cheers,
Maxim Maletsky

-----Original Message-----
From: Terrence Chay [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 9:41 AM
To: PHP User Group
Subject: [PHP] Re: XML, what is that supposed to do?


on 1/16/00 9:38 AM, Brandon Orther at [EMAIL PROTECTED] wrote:

> I have seen a lot of people ask for XML support for PHP.  I was wondering
> what it does that makes it good for PHP.

    That's a hard one to answer--I'll try anyway. I'm sorry if it sounds a
bit simple-minded but that's the sort of person I am ;-).

    XML stands for eXtensible Markup Language. It's an attempt by both large
corporations (notably Microsoft, Oracle, and IBM) as well as the standards
organizations (notable the W3C) to create a "lingua franca" for the web. A
lot of understanding it has first to have a slightly different perspective
of what we mean by "the internet" and "the web".

    First when most people say "the internet" now, they pretty much mean
"the web" and e-mail. When people say "the web" they mean HTTP and HTML
(with a little SSL thrown in for e-commerce). HTTP is the transport protocol
(how it is delivered) and HTML is the markup language (the message). XML
attempts to replace and supersede HTML without saying anything about HTTP
(though one can assume that most of the delivery will be done via HTTP, much
to the chagrin of many security administrators who depend on firewalls).

    XML is a markup language like HTML. Unlike HTML, the markup language is
extensible (basically think of it as saying you can define your own tags and
attributes). This means you can make descriptive tags such as

<book type="paperback"><AUTHOR>Joe Blogs</AUTHOR><TITLE>SATs - How to be
beaten by the system</TITLE><SUBJECT>Test preparation</SUBJECT></book>

Which looks a lot like HTML but isn't. Interestingly, the tags are
descriptive of the content which beats the hell out of UN/EDIFACT if you've
ever had to do any work for big business. Other differences are the rules
are more rigid than HTML: all tags must close, all attributes must be
quoted, all reserved characters must be escaped properly, all tags and
attributes are case sensitive. The default format for display is double byte
encoded characters (UTF-16 / UNICODE) (Note: The default used by PHP seems
to be UTF-8 so you should change it to that charset in the XML directives
line).-
    So basically what you have when you are done is a text based
hierarchical data structure that's extensible and machine readable. That's
all XML is.

    Now the things you can do with it. Obviously for one I can use this to
serialize objects in PHP very easily since I can store objects in XML
representation which is just a string to be saved. The WDDX module does that
in some standard way.

    A note about standards. Since XML is extensible, there is a need to be
specified so that I can communicate with you and we understand each other.
XML is really more like a markup language FORMAT than a language (or seen
another way, it's a standard but not a specification). There are various
specifications and attempts at specifications out there and are usually
referred to as DTDs, Document Type Definitions, or Schema. It used to be you
specified your Schema in another markup language called SGML but then some
people figured if XML is so extensible you should be able to specify your
own Schema in an Schema language which itself is XML. This is known, not
surprisingly, as XML Schema. Which represents another thing you can do with
XML: Use XML to specify XML data formats.

    A useful one for web programmers right now is you can use XML to turn
XML into other XML formats. This is done through XSL-T (eXtensible
Stylesheet Language - Transform) which is built into a PHP module called
Sablotron (Side Note: I couldn't compile Sablotron 0.50 in PHP yet, it
failes during the linking step in Apache and claims that it can't find some
library that is in Expat). Sablotron (and many XML-T parsers) is a little
robust in that you can use it to transform it into HTML and text too. This
warrants a bit larger description...

    Basically XSL works by taking an input XML file (we'll call this the
"data store") and using another XML file written using the XSL specification
(we'll call this the "rules file") to create another file in a different XML
format (we'll  all this the "presentation file"). Obviously when the
presentation file is in XML, we can chain another rules file to it to make
another presentation file and so on. XSLT parsers such as Sablotron allow us
to do just that. Why is this powerful? The best way is through examples

    (1) Our company builds a search engine that goes out and does a
real-time travel comparison engine of 25 separate travel websites. Given
that each search does this, we offload this to a business rules server that
creates this and returns the results. Because we add sites and features
almost at will, this messaging standard had to be extensible. The webserver
has to communicate with this business rules server and understand it. A
stylesheet can ensure that the message that gets sent to the web server is
always in line with what the webserver can understand even if we upgrade our
features on the business rules server.

    (2) Furthermore, we have some nasty internal business rules embeded in
our XML data store on the business rules server. An XSLT filter allows us to
remove  these internal business rules before delivery. This makes our
business objects resellable to third parties as an application service
without compromising our internal ones and requiring much coding. we can use
the same XML data store to store private and public information.

    (3) The webserver itself needs to parse and deliver the data. That data
may vary on our site vs. a cobranded site. With XSLT you can transform XML
on the fly to XHTML (a superset of HTML) and tack on your presentation layer
(nice little font tags and setting the color and whatnot). A different XSLT
for a different browser or cobrand, yet the same datastore for all of them.
This is called "separating your presentation from your data". Microsoft
calls this 3-tiering, n-tiering, DNA, NetDocs, and now dotNet. (Well some of
the later ones are a bit more than just 3-tiering, but the basic idea is in
tact).

    Well I hope you get the idea. I'm sure you can thing of other things
such as...

    (4) Oracle, Microsoft and others now allow you to query their databases
in XML. So do companies (in my field) such as Apollo and Sabre. These are
hardly compatible, nor do they in any way represent something that is
comfortable to manipulate. An XSLT layer as a data abstraction layer allows
you to transform someone else's standard into an internal one you can
manipulate in a known way.

    (5) I mentioned XML is machine readable. Imagine: web pages are not very
machine readable. Need I say more?

    I could go on, but I'm not an imaginative fellow.

    Let's see. There's also PDF. PDF isn't in XML but there is something
called XSL-FO (formatting objects) which some PDF generators (perhaps the
two that PHP has modules for?) understand. So writing XSL-FO for output for
a PDF generator is "doing XML" also.

    Then there is the fact that it hierarchical data which sometimes,
despite all these neat tools, needs to be parsed and understood. If we had a
standardized API for manipulating it, then all the knowledge in learning the
API for say visual basic on a Windows box can be transferred to doing in in
C++ in AIX or perhaps PHP? Yes, there are two such standards, one is an
event driven one (reads a tag and calls a callback function) known as "SAX"
(Simple API for XML) and implemented in the Expat (--with-xml in PHP which
is compiled by default in PHP4) and the other reads the whole thing into a
hierarchical (treelike) object structure called the DOM (Document Object
Model) which is implemented in libxml (--with-domxml or somesuch in PHP).

    I personally prefer the DOM version of looking at things (it's a bit
slower and chews more memory). Unfortunately the dom-xml in PHP doesn't much
resemble anyone elses DOM (at least not Oracle's or Microsofts), it's a bit
buggy (for instance, you can't remove a node, nor can you seem to modify the
text in a node) and it chews a whole slew of memory (much more than I'd
expect and that amount has almost doubled since they've incorporated XPath
support with PHP 4.0.4+).

    Now a final reason why PHP and XML should go hand in hand. (Because if
you haven't figured out by now, I'm really big on PHP and on XML). A study I
read estimates that by the end of this year over 50% of the Fortune 500 will
be using XML in some "test bed" situation and by 2004 80% of all business
communication on the internet will use XML.

    I hope this gives you some motivation to pick up XML and use PHP to do
so. Because the more of us that are doing so, the more developers there will
be working (or pushing others to work) on improving XML support in PHP. With
more robust cool tools like the PHP developers have already given me (and
hopefully will continue to do so), I won't feel so bad about studying
condensed matter physics and neuroscience for the last 9 years instead of
majoring in something real like computer science and learning how to code in
Java and C++.

    Take care,

        terry chay

--
terry chay, Director of Engineering, <http://www.QIXO.com/>
QIXO /kick.so/ - Integrating Many Travel Web Sites Into One
W: 1.408.394-8102     F:1.408.516.9090    M: 1.408.314.0717
E-Mail: <mailto:[EMAIL PROTECTED]>     ICQ: 16069322
PGP Fingerprint: 6DCF 1634 547C 935D 4912  2A44 A4A2 79AB DFFF F110 


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




Does anyone have a place with a little more user friendly tutorial or place
to learn about sessions?  The php manual is making me go mad.

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





Fortunately I've recently done some research into this - here
are a few links to get you going:

http://www.phpwizard.net/resources/tutorials/session_intro.html
http://www.zend.com/zend/tut/session.php

and here are more links if you are interested in storing your
session info in a database - these are specific to MySQL, but
the concepts are the same no matter what db:

http://www.phpbuilder.com/columns/ying20000602.php3
http://www.phpbuilder.com/tips/item.php?id=177
http://phpweblogs.com/adodb
http://phpweblogs.com/adodb-sessions
http://www.phpbuilder.com/columns/chad19990414.php3

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

Brandon Orther [[EMAIL PROTECTED]] wrote:
> Does anyone have a place with a little more user friendly tutorial or place
> to learn about sessions?  The php manual is making me go mad.
> 
> Thank you,
> 
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




I've read something on PHPBuilder.com.
look through the past articles....

Cheers,
Maxim Maletsky

-----Original Message-----
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 17, 2000 2:46 AM
To: PHP User Group
Subject: [PHP] Sessions


Does anyone have a place with a little more user friendly tutorial or place
to learn about sessions?  The php manual is making me go mad.

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------


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




Hi

Ive gotto format a date such as 30/12/1956 to format 30-Dec-1956,
I can not use mktime cause that only provides the timestamp from 1970.
Is there any other method of getting this right.

thnx
Niel Zeeman
Tel(W): (043)7014247
Cell: 082 651 4083
eMail: [EMAIL PROTECTED]




> Ive gotto format a date such as 30/12/1956 to format 30-Dec-1956,
> I can not use mktime cause that only provides the timestamp from 1970.
> Is there any other method of getting this right.

mktime() can be used for this.  0 is from 1970.  Negative values are used
for dates prior.

Chris




$date = 30/12/1956;
 $month = Array(1=>'Jan', 2=>'Feb', .... 12->'Dec');
 // The array of month... 

 function date_format($date) {
  Global $month;
  $date = explode('/', $date);
    // And it became to you an array...
  return $date[0].'-'.$month[$date[1]].'-'.$date[2];
 }
 //will return 30-Dec-1956

Cheers,
Maxim Maletsky


-----Original Message-----
From: Niel Zeeman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 2:46 PM
To: php gen list
Subject: [PHP] HELP! Date formatting


Hi

Ive gotto format a date such as 30/12/1956 to format 30-Dec-1956,
I can not use mktime cause that only provides the timestamp from 1970.
Is there any other method of getting this right.

thnx
Niel Zeeman
Tel(W): (043)7014247
Cell: 082 651 4083
eMail: [EMAIL PROTECTED]





how can I make php work with this now!?





Serge -

I have the same setup as you do and my install time was 10 minutes
including Interbase 6.0.  What I did is a little different than some:

I have two directories off of my root on my WIN 2K computer:

c:\php_active
c:\php404

I unzip the latest PHP (4.0.4) into php404 making sure I keep the
directories.  Then I move from the sapi and dlls directories the files I
need into c:\php404.  This is just for convenience.  The files I have
include php4isapi.dll, php_gd.dll, and php_interbase.dll.

I then copy all of the contents to c:\php_active.  If I update to a
newer version of PHP, I can move the contents into the same directory
and not have to change anything else.

The only change in the php.ini file (it goes in system32) is

[mail function]
SMTP            = 192.168.0.1              ;for win32 only
sendmail_from   = [EMAIL PROTECTED]  ;for win32 only

include_path    = .;c:\php_active\
extension_dir   = c:\php_active\

In the IIS (5.0) I add ".php" to the application mappings
(c:\php_active\php4isapi.dll) in the Home Directory tab *and* in the
ISAPI Filters.  Stop and Start IIS and you should be up and running.

Let me know if this helps....

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






if php is so great, why is it so hard to make it work?
please...someone ...for win2000 nt 5.0 ...I have apache, iis installed 
...nothing's working, did changes to php.ini, my registry...httpd.conf 
....nothing! nothing! nothig!!!!!!!!!!!!!!!!!!!!!!!!!!!1111





That is probably a good way not to get much help
however, there are install kits out there that
do all of the work for you. phpTriad is one.

Jerry Lake 

-----Original Message-----
From: Serge Montmarquette [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 10:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] if php is so great, why is it so hard to make it work?


if php is so great, why is it so hard to make it work?
please...someone ...for win2000 nt 5.0 ...I have apache, iis installed 
...nothing's working, did changes to php.ini, my registry...httpd.conf 
....nothing! nothing! nothig!!!!!!!!!!!!!!!!!!!!!!!!!!!1111


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






Goto http://www.zabia.com/downloads.php?op=viewslink&sid=24 and coose the one you like!

*********** REPLY SEPARATOR  ***********

On 16/01/2001 at 13:13 Serge Montmarquette wrote:

>if php is so great, why is it so hard to make it work?
>please...someone ...for win2000 nt 5.0 ...I have apache, iis installed
>...nothing's working, did changes to php.ini, my registry...httpd.conf
>....nothing! nothing! nothig!!!!!!!!!!!!!!!!!!!!!!!!!!!1111
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]







You can get problems when you install and run IIS AND Apache at the same
time... I think the last message was clear enough???

-----Oorspronkelijk bericht-----
Van: Serge Montmarquette [mailto:[EMAIL PROTECTED]]
Verzonden: dinsdag 16 januari 2001 19:14
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] if php is so great, why is it so hard to make it work?


if php is so great, why is it so hard to make it work?
please...someone ...for win2000 nt 5.0 ...I have apache, iis installed
...nothing's working, did changes to php.ini, my registry...httpd.conf
....nothing! nothing! nothig!!!!!!!!!!!!!!!!!!!!!!!!!!!1111


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






I just posted this in php-win - this script installs everything
automatically...

My guess is that Mr.Mortemarquete is doing something wrong, because he has
IIS AND APACHE in the same server...

I found this link and think that is useful:

http://www.firepages.com.au/phpdev.htm

Have fun,

Rom


----- Original Message -----
From: Jerry Lake <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 1:18 PM
Subject: [PHP] RE: if php is so great, why is it so hard to make it work?


That is probably a good way not to get much help
however, there are install kits out there that
do all of the work for you. phpTriad is one.

Jerry Lake

-----Original Message-----
From: Serge Montmarquette [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 10:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] if php is so great, why is it so hard to make it work?


if php is so great, why is it so hard to make it work?
please...someone ...for win2000 nt 5.0 ...I have apache, iis installed
...nothing's working, did changes to php.ini, my registry...httpd.conf
....nothing! nothing! nothig!!!!!!!!!!!!!!!!!!!!!!!!!!!1111


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



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





"Alex Black" ...
> >> the horse is back from the dead!
> >
> >huh?
>
> inside joke.

Doh.

> > > I don't like to do database connections when I've already output
markup,
> > > what if something goes wrong, or I want to do a redirect, etc?
> >
> > If something goes wrong -> It's the DBA fault. :-)
>
> hehe
>
> in a production encironment: agh!

But if you're a freelancer and the DBA works for the web-hosting enterprise,
it can be very funny!

> > I'm pretty comfortable programming directly with OCIwhatever() functions
> > directly in the main code, that's it.
>
> ok, go ahead. that in my opinion is not the way to go, especially for
> portability and reuse of code... it's also the quick route to hair-pulling
> if you QA your code...

portability to other platform = search-replace OCIwhatever to mysqlwhatever.
reuse of code = copy-paste-modify

:-DDDDD

You don't know what hellish programming gadgets i had to invent in order to
make some places of "my" website to work...

> > In other words, i don't need to make my code more maintainable because
i'm
> > comfortable with maintaining it right now.
>
> well, then why bother arguing the point?

Dunno.

> my opinion only matters if you care about it?

Only matters to who??

> otherwise I'm just babbling. (ohh I see some responses to this one)

C'mon, people, reply to this one and make Alex happy!!!


> >> True, but why not just bitch at macromedia until they include support
for
> >> PHP in ultradev?
> >
> > (Well, i haven't purchased dreamweaver either)
>
> good, that means you're not using any diabolical visual tools :)

Well, you can always call M$ windoze a "diabolical visual OS" :-)

> >> (plegh, visual authoring tools: a necessary evil)
> >
> > Why, when you have notepad.exe and a couple of browsers to test that the
> > pages work properly?
>
> whoa, dude.

Yeah. Since i learnt pure HTML code, and having seen what a *clean* code
generates M$ frontpage, i decided not to work with *any* visual web page
generator.

Perhaps i'm extrapolating, but i did it it way, and now it could be hard for
me to change.

> that's scary. but do whatever you want!

Well, it's my style right now, and that way i'm going well. Perhaps i'll
change with time, but...








Hello,
I want to show a list of images ( but in a small size - should I use ImageCopyResized 
? how ?  ), existed in a directory ( they are uploaded to dir, and the name of each 
image is also inserted into a DataBase ), with a link to the respective image and real 
size. To work with images  ( I think its the only way... ) I declare a Header telling 
that the content is an image, but the kind of image can be different (*.jpeg,*.png, 
*.gif, ...), so ( I think ...) should I have a different Headders ? My other problem 
is to show the small copied images in a page that already have other information(ex: 
the name of the user, for that I'm using sessions), so can I do it, is it possible ?
Thanks
Miguel Loureiro




On Tue, 16 Jan 2001, Miguel Loureiro wrote:

> Hello,
> I want to show a list of images ( but in a small size - should I use 
>ImageCopyResized ? how ?  ), existed in a directory ( they are uploaded to dir, and 
>the name of each image is also inserted into a DataBase ), with a link to the 
>respective image and real size. To work with images  ( I think its the only way... ) 
>I declare a Header telling that the content is an image, but the kind of image can be 
>different (*.jpeg,*.png, *.gif, ...), so ( I think ...) should I have a different 
>Headders ? My other problem is to show the small copied images in a page that already 
>have other information(ex: the name of the user, for that I'm using sessions), so can 
>I do it, is it possible ?
> Thanks
> Miguel Loureiro
>

That's what databases are for. Store the image data and the image mimetype
when the image is uploaded.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





Hello everybody.

I am just getting into sessions and they look like a very sweet thing.  here
is my problem, when I try to destroy a session using destroy_session() I get
this error:

Warning: Session object destruction failed in
c:\apache\htdocs\sessions\done.php on line 3

Thanks for help in advance

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





ok, well it's working, my 8 y/o sister helped me instead, thanks anyways!






Another satisfied customer :)

Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
[EMAIL PROTECTED]

 -----Original Message-----
From:   Serge Montmarquette [mailto:[EMAIL PROTECTED]] 
Sent:   Tuesday, January 16, 2001 2:02 PM
To:     [EMAIL PROTECTED]
Subject:        [PHP] got it

ok, well it's working, my 8 y/o sister helped me instead, thanks anyways!


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





what a personality ...

when "or when you think" no one helps you :- 
R-E-A-D--A-R-C-H-I-V-E-S

then even your 8 y/o sister, once browsed these will learn 'bout PHP more
then you ...

Maxim Maletsky



-----Original Message-----
From: Serge Montmarquette [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 4:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] got it


ok, well it's working, my 8 y/o sister helped me instead, thanks anyways!


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




Hello,

Does someone have an example of how I can use session.gc_probability.  I
want to pass the session ID through GET/POST so if someone has a better way
of making the sessions end please let me know.

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------






Hello,
Can anyone tell me why this query errors out? It works from the  mysql
client command line just fine....


$query1 = "select * from zip_base where '$zip1' >= zip  && '$zip1' <= CONCAT
(SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)";




Christopher C. M. Allen





Try printing the $query1 to the browser and see what it looks like that
solves 99% of my Query problems.

Thank you
Brian Paulson
Sr. Web Developer
[EMAIL PROTECTED]
http://www.chieftain.com
1-800-269-6397

-----Original Message-----
From: Christopher Allen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 12:25 PM
To: php
Subject: [PHP] php'ed mysql query



Hello,
Can anyone tell me why this query errors out? It works from the  mysql
client command line just fine....


$query1 = "select * from zip_base where '$zip1' >= zip  && '$zip1' <= CONCAT
(SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)";




Christopher C. M. Allen


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








If you are going to do a comparison from one of the fields in your table,
doesn't the field name need to be on the left hand side of the comparison?
So instead of "where '$zip1' >= zip", shouldn't it be "zip < '$zip1'" (et al
for the other comparisons in your query) .

HTH

Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
[EMAIL PROTECTED]

 -----Original Message-----
From:   Christopher Allen [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, January 16, 2001 2:25 PM
To:     php
Subject:        [PHP] php'ed mysql query


Hello,
Can anyone tell me why this query errors out? It works from the  mysql
client command line just fine....


$query1 = "select * from zip_base where '$zip1' >= zip  && '$zip1' <= CONCAT
(SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)";




Christopher C. M. Allen


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





On Tue, 16 Jan 2001, Christopher Allen wrote:

>
> Hello,
> Can anyone tell me why this query errors out? It works from the  mysql
> client command line just fine....
>
>
> $query1 = "select * from zip_base where '$zip1' >= zip  && '$zip1' <= CONCAT
> (SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)";
>
>
>
>
> Christopher C. M. Allen
>

Does the MySQL user ID you're connecting as have select permissions on the
database?

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





> If you are going to do a comparison from one of the fields in your table,
> doesn't the field name need to be on the left hand side of the comparison?
> So instead of "where '$zip1' >= zip", shouldn't it be "zip < '$zip1'" (et
al
> for the other comparisons in your query) .
>
Didn't matter. Is there a trick for using concat or substring or any string
functions in a mysql query that is sent by php??






Have you tried adding

or die(mysql_error())

to try and let mysql tell you what's wrong? That and the
previously-suggested echo-ing the SQL statement solve most of my problems.

--Toby

----- Original Message -----
From: "Christopher Allen" <[EMAIL PROTECTED]>
To: "Sam Masiello" <[EMAIL PROTECTED]>; "php"
<[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 3:00 PM
Subject: Re: [PHP] php'ed mysql query


> > If you are going to do a comparison from one of the fields in your
table,
> > doesn't the field name need to be on the left hand side of the
comparison?
> > So instead of "where '$zip1' >= zip", shouldn't it be "zip < '$zip1'"
(et
> al
> > for the other comparisons in your query) .
> >
> Didn't matter. Is there a trick for using concat or substring or any
string
> functions in a mysql query that is sent by php??
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





How can I strip everything past a certain character in a string?

i.e.:

$foo = "test.gif";

// strip past the .gif

$foo = "test";

// again

$foo2 = "test.jpeg";

// strip past the .jpeg

$foo2 = "test";


Tait




You may want to try exploding on the ".":

$fooPieces = explode($foo, ".");

That way everything before the dot, is in the first piece of the array and
everything after is in the second part of the array.  However this may cause
issues if filenames will contain dots.  But if you follow an 8.3 or 8.4
character filename structure you will be fine.

.:: Nathan Cook
----- Original Message -----
From: "Tait Grove" <[EMAIL PROTECTED]>
To: "PHP GENERAL" <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 1:01 PM
Subject: [PHP] string replace


How can I strip everything past a certain character in a string?

i.e.:

$foo = "test.gif";

// strip past the .gif

$foo = "test";

// again

$foo2 = "test.jpeg";

// strip past the .jpeg

$foo2 = "test";


Tait






Here is a bad way to do it, but it works

<?
$string = "test.jpg";

$replace = eregi_replace("....$", "", $string);

echo $replace;
?>

Jerry Lake 

-----Original Message-----
From: Tait Grove [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 12:01 PM
To: PHP GENERAL
Subject: [PHP] string replace


How can I strip everything past a certain character in a string?

i.e.:

$foo = "test.gif";

// strip past the .gif

$foo = "test";

// again

$foo2 = "test.jpeg";

// strip past the .jpeg

$foo2 = "test";


Tait





$foo = "test.gif";

$foo1 = substr($foo, 0, strpos($foo, "."));

this should work :)

gregor

""Tait Grove"" <[EMAIL PROTECTED]> wrote in message
002a01c07ff7$0dffee20$[EMAIL PROTECTED]">news:002a01c07ff7$0dffee20$[EMAIL PROTECTED]...
How can I strip everything past a certain character in a string?

i.e.:

$foo = "test.gif";

// strip past the .gif

$foo = "test";

// again

$foo2 = "test.jpeg";

// strip past the .jpeg

$foo2 = "test";


Tait







but you would have to count how many dots are there ...

-----Original Message-----
From: Gregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 5:20 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] string replace


$foo = "test.gif";

$foo1 = substr($foo, 0, strpos($foo, "."));

this should work :)

gregor

""Tait Grove"" <[EMAIL PROTECTED]> wrote in message
002a01c07ff7$0dffee20$[EMAIL PROTECTED]">news:002a01c07ff7$0dffee20$[EMAIL PROTECTED]...
How can I strip everything past a certain character in a string?

i.e.:

$foo = "test.gif";

// strip past the .gif

$foo = "test";

// again

$foo2 = "test.jpeg";

// strip past the .jpeg

$foo2 = "test";


Tait




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




Hello Everyone,

Can someone please give me example code on how to use session_destroy
because I can not get it to work.  Also if you have an example for
gc_probability I would love that too. Thank You :)

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





Is there a way to:

1.      Set cookies to a particular value (e.g., foo=hi and bar=ho), AND
2.      Redirect the user to a new page in a different directory?  AND
3.      have the new page be able to retrieve the values of both foo and bar?

I'm redirecting users from an index.htm page to an index.php page (because
our server is not set up to have index.php as a default page), and trying to
set cookies on the index.php page prior to redirecting the user to an
index.htm page in an entirely different directory (why? because for some
reason I thought it would streamline one of our processes).  However, the
cookies simply don't get set; a document.write command on the second
index.html page shows that the value of the cookies is null.

The value of the cookies are determined by the results of a query run
against a MySQL directory, so they cannot be set on the first index.html
page.

I have been struggling with this conundrum for three days at this point,
with no success.  Let me know if this doesn't make sense.





> 1.    Set cookies to a particular value (e.g., foo=hi and bar=ho), AND
> 2.    Redirect the user to a new page in a different directory?  AND
> 3.    have the new page be able to retrieve the values of both foo and bar?

No, 1. and 2. can not be done in the same request reliably.  Some browsers
can handle it, others can't.

-Rasmus





will this not work...

   if (($HTTP_COOKIE_VARS["foo"] != 'bar') && ($HTTP_GET_VARS["set"] !=
true)) {
    SetCookie("foo", "bar");
    header("Location: $PHP_SELF?set=true");
   }

at the top of the page. or is this what is unreliable on some browsers?

jamie.

----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Richard S. Crawford" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 9:02 PM
Subject: Re: [PHP] FW: Cookies, Dammit!


> > 1. Set cookies to a particular value (e.g., foo=hi and bar=ho), AND
> > 2. Redirect the user to a new page in a different directory?  AND
> > 3. have the new page be able to retrieve the values of both foo and bar?
>
> No, 1. and 2. can not be done in the same request reliably.  Some browsers
> can handle it, others can't.
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





oop, i missed an 'exit;' command off...

    if (($HTTP_COOKIE_VARS["foo"] != 'bar') && ($HTTP_GET_VARS["set"] !=
true)) {
     SetCookie("foo", "bar");
     header("Location: $PHP_SELF?set=true");
     exit;
    }

----- Original Message -----
From: "Jamie Burns" <[EMAIL PROTECTED]>
To: "Rasmus Lerdorf" <[EMAIL PROTECTED]>; "Richard S. Crawford"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 9:47 PM
Subject: Re: [PHP] FW: Cookies, Dammit!


> will this not work...
>
>    if (($HTTP_COOKIE_VARS["foo"] != 'bar') && ($HTTP_GET_VARS["set"] !=
> true)) {
>     SetCookie("foo", "bar");
>     header("Location: $PHP_SELF?set=true");
>    }
>
> at the top of the page. or is this what is unreliable on some browsers?
>
> jamie.
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
> To: "Richard S. Crawford" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 16, 2001 9:02 PM
> Subject: Re: [PHP] FW: Cookies, Dammit!
>
>
> > > 1. Set cookies to a particular value (e.g., foo=hi and bar=ho), AND
> > > 2. Redirect the user to a new page in a different directory?  AND
> > > 3. have the new page be able to retrieve the values of both foo and
bar?
> >
> > No, 1. and 2. can not be done in the same request reliably.  Some
browsers
> > can handle it, others can't.
> >
> > -Rasmus
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





> will this not work...
>
>    if (($HTTP_COOKIE_VARS["foo"] != 'bar') && ($HTTP_GET_VARS["set"] !=
> true)) {
>     SetCookie("foo", "bar");
>     header("Location: $PHP_SELF?set=true");
>    }
>
> at the top of the page. or is this what is unreliable on some browsers?

Some browsers just can't handle a redirect and a set-cookie header in the
same request.  How you get PHP to generate these headers is irrelevant.

-Rasmus





The thing that usually intrigues me is why people design their application
so that it needs to redirect to another page just so that they can attempt
to read the cookie back. Do they not already have the value of the cookie in
order to be able to set it? Why attempt to read it back straight away?

jason


> Some browsers just can't handle a redirect and a set-cookie header in the
> same request.  How you get PHP to generate these headers is irrelevant.
>
> -Rasmus








In this case, the value of the cookie is pulled from a database; the
specific value depends on the URL at the user is redirecting from.  If the
user comes from

www.domain.com/minisite1/index.htm

then when they're directed to www.domain.com/index.htm, they should see
"Welcome from minisite1"; but if they come from

www.domain.com/minisite2/index.htm

they should see "Welcome from minisite2" when they're redirected to
www.domain.com/index.htm.

it's a bit more complicated than that, but that's the general idea.

Hope that helps.


--
Richard S. Crawford
Senior Web Developer
NeuroHub, Inc.
(916)789-4167 / (530)307-0069(cell)
AIM Handle: Buffalo2K
http://www.neurohub.net

-----Original Message-----
From: Jason Brooke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 2:48 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] FW: Cookies, Dammit!


The thing that usually intrigues me is why people design their application
so that it needs to redirect to another page just so that they can attempt
to read the cookie back. Do they not already have the value of the cookie in
order to be able to set it? Why attempt to read it back straight away?

jason


> Some browsers just can't handle a redirect and a set-cookie header in the
> same request.  How you get PHP to generate these headers is irrelevant.
>
> -Rasmus





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






Any reason you don't include the contents of /index.htm into
/ministe1/index.htm with the appropriate welcome message instead of
redirecting, or even pass the site name in the query string of the Location:
URL if you're not wanting to rely on http_referer?

jason


> In this case, the value of the cookie is pulled from a database; the
> specific value depends on the URL at the user is redirecting from.  If the
> user comes from
>
> www.domain.com/minisite1/index.htm
>
> then when they're directed to www.domain.com/index.htm, they should see
> "Welcome from minisite1"; but if they come from
>
> www.domain.com/minisite2/index.htm
>
> they should see "Welcome from minisite2" when they're redirected to
> www.domain.com/index.htm.
>
> it's a bit more complicated than that, but that's the general idea.
>
> Hope that helps.
>
>
> --
> Richard S. Crawford
> Senior Web Developer
> NeuroHub, Inc.
> (916)789-4167 / (530)307-0069(cell)
> AIM Handle: Buffalo2K
> http://www.neurohub.net








The first approach is actually what we do now.  However, since /index.htm is
a dynamic page which changes frequently, we don't want to have to try to
echo all of those changes into all of the /minisite directories (of which
there are well over 100) every single time a change occurs.  We're going to
try the second approach now, but we still are going to try to build the
query string of the Location: header based on values retrieved from a MySQL
database.

--
Richard S. Crawford
Senior Web Developer
NeuroHub, Inc.
(916)789-4167 / (530)307-0069(cell)
AIM Handle: Buffalo2K
http://www.neurohub.net

-----Original Message-----
From: Jason Brooke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:10 PM
To: Richard S. Crawford
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] FW: Cookies, Dammit!


Any reason you don't include the contents of /index.htm into
/ministe1/index.htm with the appropriate welcome message instead of
redirecting, or even pass the site name in the query string of the Location:
URL if you're not wanting to rely on http_referer?

jason


> In this case, the value of the cookie is pulled from a database; the
> specific value depends on the URL at the user is redirecting from.  If the
> user comes from
>
> www.domain.com/minisite1/index.htm
>
> then when they're directed to www.domain.com/index.htm, they should see
> "Welcome from minisite1"; but if they come from
>
> www.domain.com/minisite2/index.htm
>
> they should see "Welcome from minisite2" when they're redirected to
> www.domain.com/index.htm.
>
> it's a bit more complicated than that, but that's the general idea.
>
> Hope that helps.
>
>
> --
> Richard S. Crawford
> Senior Web Developer
> NeuroHub, Inc.
> (916)789-4167 / (530)307-0069(cell)
> AIM Handle: Buffalo2K
> http://www.neurohub.net









I hope you don't mind me nagging on this ;) but what do you mean by having
to echo changes into the /minisite directories?

What I meant was, from minisite45/index.htm, include() the same content
include file you use in /index.htm. I'm not seeing why the
/minisite<x>/index.htm pages need to change at all? The only thing that
would change is the content of the include()'d file that /index.htm, and the
minisite/index<x>.htm include.


/index.htm

<html>
<etc etc>
<body...>

<? include "main_include.inc"; ?>

</body>
</html>

main_include.inc:

<some possible html tags>
<? echo "Welcome". ($minisite ? " from $minisite" : "."); ?>
<some possible html tags>


/minisite45/index.htm

<html stuff>
<?
$minisite = 45; /* or even a snip that dynamically gets it from the
script_name */
include "main_include.inc";
?>



----- Original Message -----
From: "Richard S. Crawford" <[EMAIL PROTECTED]>
To: "Jason Brooke" <[EMAIL PROTECTED]>; "Richard S. Crawford"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 9:19 AM
Subject: RE: [PHP] FW: Cookies, Dammit!


> The first approach is actually what we do now.  However, since /index.htm
is
> a dynamic page which changes frequently, we don't want to have to try to
> echo all of those changes into all of the /minisite directories (of which
> there are well over 100) every single time a change occurs.  We're going
to
> try the second approach now, but we still are going to try to build the
> query string of the Location: header based on values retrieved from a
MySQL
> database.
>
> --
> Richard S. Crawford
> Senior Web Developer
> NeuroHub, Inc.
> (916)789-4167 / (530)307-0069(cell)
> AIM Handle: Buffalo2K
> http://www.neurohub.net








The problem is that the main page doesn't use an include file of any sort;
it's straight HTML which is frequently updated by hand.  I agree that it
would be nice if /index.htm had an include file that contained most of the
content, and if I could convince my boss that it would be the best way to
go, then I'd be set.  :)  Unfortunately, that's not the route that we've
chosen to go (in fact, I'm still at the stage where I'm trying to convince
people around here that PHP is a much better way to go than straight HTML
for some of these documents).  So, if I were using an include file to build
/index.htm, then I would use it in microsite45/index.htm.  But since I'm
not, I can't.  I've got permission to use document.write in /index.htm, so I
was looking for a solution which would allow /index.htm to remain nothhing
but static HTML (with the exception of some JavaScript).



-----Original Message-----
From: Jason Brooke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:37 PM
To: Richard S. Crawford
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] FW: Cookies, Dammit!

I hope you don't mind me nagging on this ;) but what do you mean by having
to echo changes into the /minisite directories?

What I meant was, from minisite45/index.htm, include() the same content
include file you use in /index.htm. I'm not seeing why the
/minisite<x>/index.htm pages need to change at all? The only thing that
would change is the content of the include()'d file that /index.htm, and the
minisite/index<x>.htm include.


/index.htm

<html>
<etc etc>
<body...>

<? include "main_include.inc"; ?>

</body>
</html>

main_include.inc:

<some possible html tags>
<? echo "Welcome". ($minisite ? " from $minisite" : "."); ?>
<some possible html tags>


/minisite45/index.htm

<html stuff>
<?
$minisite = 45; /* or even a snip that dynamically gets it from the
script_name */
include "main_include.inc";
?>



----- Original Message -----
From: "Richard S. Crawford" <[EMAIL PROTECTED]>
To: "Jason Brooke" <[EMAIL PROTECTED]>; "Richard S. Crawford"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 9:19 AM
Subject: RE: [PHP] FW: Cookies, Dammit!


> The first approach is actually what we do now.  However, since /index.htm
is
> a dynamic page which changes frequently, we don't want to have to try to
> echo all of those changes into all of the /minisite directories (of which
> there are well over 100) every single time a change occurs.  We're going
to
> try the second approach now, but we still are going to try to build the
> query string of the Location: header based on values retrieved from a
MySQL
> database.
>
> --
> Richard S. Crawford
> Senior Web Developer
> NeuroHub, Inc.
> (916)789-4167 / (530)307-0069(cell)
> AIM Handle: Buffalo2K
> http://www.neurohub.net





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






With due respect to your boss, PHP would make the site *more* compatible with
people's browsers, without having to worry about which version(s) of javascript
people have, or in fact if they even have it available. I'd pitch the
accessibility angle, in your shoes, if nothing else.

Good luck.


"Richard S. Crawford" wrote:

> The problem is that the main page doesn't use an include file of any sort;
> it's straight HTML which is frequently updated by hand.  I agree that it
> would be nice if /index.htm had an include file that contained most of the
> content, and if I could convince my boss that it would be the best way to
> go, then I'd be set.  :)  Unfortunately, that's not the route that we've
> chosen to go (in fact, I'm still at the stage where I'm trying to convince
> people around here that PHP is a much better way to go than straight HTML
> for some of these documents).  So, if I were using an include file to build
> /index.htm, then I would use it in microsite45/index.htm.  But since I'm
> not, I can't.  I've got permission to use document.write in /index.htm, so I
> was looking for a solution which would allow /index.htm to remain nothhing
> but static HTML (with the exception of some JavaScript).





Hi, althout i KNOW this is not a technicall issue(wait keep on reading, 
this's not a commercial or multilevel chain),and as a newcomer for the PHP 
community,  I would appreciate to take a look to the following site:
www.terremotoenelsalvador.bigstep.com
Wich means earthquake in el salvador,  I would like to ask you is there is 
a way you could some how  help  the victims. I wanted to create a site more 
dinamic yet I just have 2 weeks of starring to learn PHP, apache and 
mysql.(Kind of a new year resolution very special coming from an AS/400 
developer).
Well enough now you can erase the message. Thanks for your attention and I 
hope something could be done.
May God Bless you




This couldn't have been a 3-4 issue, because it was working in 4, either 4.0.1
or 4.0.2.  I was just informed that we went from 4.0.2 to 4.0.4 when moving to
RH7, so that might have done it, but it was working reliably (for us) in 4.0.x
before the latest.
 :(

anyway, fixed now.


Richard Lynch wrote:

> {} inside of "" now does order-of-operations, I think...
>
> Something like that.   It's in the docs somewhere.
>
> I thought this was a PHP3 -> PHP4 change, not related to RedHat nor ereg in
> particular...
>
> ----- Original Message -----
> From: Michael Kimsal <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Thursday, January 11, 2001 9:08 AM
> Subject: [PHP] Redhat 7 problem and fix
>
> > We upgraded a box running RH6.2 to RH7.
> >
> > Same build process for PHP as before, but the ereg functions
> > didn't work the same.
> >
> > ereg_replace("{cow}",$cow,$x);
> >
> > now needs to be
> >
> > ereg_replace("\{cow\}",$cow,$x);
> >
> > The {} are escaped now.  Dunno what changed 'under the hood', but
> > the only change we made (I'm about 90% certain) was going RH6.2 to
> > 7.
> >
> > Hope this helps someone else doing an upgrade from going as crazy as we
> > did... :)
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





I see that you got a lot of responses, but I didn't see anyone using
what I use.  I had problems using rand() because it wasn't quite random
enough.  The following code is as random as you can get (at least from
what I've seen).

mt_srand ((double) microtime() * 1000000);
$myrandomnumber = mt_rand($min_number, $max_number);







... may be I have use a wrong subject, but I can't think a more suitable one
sorry first!

say, I have a function like this
function foo()
{
babababa...
/*at this point, I want to output a lot of html, can I use a ':' to escape
from there?*/
/*I know I can do this is a if construct or for... construct, but I can't do
this at this point*/
/*is there any way for me to do the similar thing?*/
}


And I have one more question, what is the meaning of 'or'?
e.g.
$db=mysql_connect("localhost","root","password") or die ("could not
connect");







> say, I have a function like this


> function foo()
> {
> babababa...;
> /*at this point, I want to output a lot of html, can I use a ':' to escape
> from there?*/


        echo '<html>';
        echo '<title>chris is great</title>';
return; // would just stop the function

OR if you want to call the function from elsewhere like this : echo foo(); 
or $string=foo();

function foo(){
        $html_construct='<html>';
        $html_construct.='<title>chris is great</title>';
return $html_construct; 

}
 /*I know I can do this is a if construct or for... construct,
> but I can't do this at this point*/ /*is there any way for me to do the
> similar thing?*/ }

not sure about your question.  The manual will give escapes for for example 
switchs parts (break;) and others. See manual part II.11 Control structures.


 
> And I have one more question, what is the meaning of 'or'?
> e.g.
> $db=mysql_connect("localhost","root","password") or die ("could not
> connect");

In case the command before 'or; fails do what is after 'or'.

So if you connect succesfully the script continues, if something goes wrong 
(wrong password, server down etc etc) the script does 

        die ('bla')

this means the script stops and the browsers shows 'bla'.
(except when you'r in the middle of building a page and the text is 
invisible due to its location in the HTML, for example when a table is 
opened before in Netscape but not closed yet.

Chris


--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 




On Wed, 17 Jan 2001, Zenith wrote:

> ... may be I have use a wrong subject, but I can't think a more suitable one
> sorry first!
>
> say, I have a function like this
> function foo()
> {
> babababa...
> /*at this point, I want to output a lot of html, can I use a ':' to escape
> from there?*/
> /*I know I can do this is a if construct or for... construct, but I can't do
> this at this point*/
> /*is there any way for me to do the similar thing?*/
> }
>

As long as you have it inside braces you're okay:

<?php
function foo()
{
?>
<p>I am now inside function foo()...</p>
<?php
}
?>

> And I have one more question, what is the meaning of 'or'?
> e.g.
> $db=mysql_connect("localhost","root","password") or die ("could not
> connect");
>

It evaluates the left operand, and if false evaluates the right operand and
returns that, otherwise returns the result of the left. The above usage is
basically a cheat-type shortcut for:

  if (!($db=mysql_connect("localhost","root","password")))
    die ("could not connect");

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





> And I have one more question, what is the meaning of 'or'?
> e.g.
> $db=mysql_connect("localhost","root","password") or die ("could not
> connect");

One more thing, which is important to me as a newbie (as I most certainly
am), you can make a custom error message for the die error; which is
important to me seeing as it happens a lot ;)

if you want to see what the error is (for use with MySQL), use

or die (mysql_error());

or use a message which will display nicely to users, if you're re-writing
something which is already online and in use (not recommended).

$error = "<html>\n<head>\n<title>We encountered an
error!</title>\n</head>\n\n";

$error .= "<body bgcolor=\"hex value\" text=\"hex value\">\n";

$error .= "We encountered an error!  Please go back to our <a
href=\"http://www.site.com\">site</a>!\n\n";

$error .= "</body>\n";

$error .= "</html>";

Then, you would use something like:

 $connection = mysql_connect("localhost","username","password")
        or die ($error);

If this is blatantly obvious to you, please ignore it, but at one time not
too long ago, it was helpful to me.  There's probably a lot neater way of
doing things too ;)

James.






function foo()
{
  bla bla bla...

  echo 'whatever...';
  // that should output it whenever the function is called...
  // need an if? then...  just put an if in here ... 
  return $any bla bla;
}

or means ||

so 

if($name=='Max' or $name=='Maxim')

is equal to

if($name=='Max' || $name=='Maxim')

this is quite useful for usability purposes...

Cheers,
Maxim Maletsky

-----Original Message-----
From: Zenith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 7:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to escape from a function?


... may be I have use a wrong subject, but I can't think a more suitable one
sorry first!

say, I have a function like this
function foo()
{
babababa...
/*at this point, I want to output a lot of html, can I use a ':' to escape
from there?*/
/*I know I can do this is a if construct or for... construct, but I can't do
this at this point*/
/*is there any way for me to do the similar thing?*/
}


And I have one more question, what is the meaning of 'or'?
e.g.
$db=mysql_connect("localhost","root","password") or die ("could not
connect");




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




Quick Question.

I have a form which has 10 fields, is there any way in PHP to take the values 
once submitted and create a string for each??

Thanks 
Ade




Ade,

What kind of string?  What do you want to do with them?  

-Ben

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 2:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Strings??


Quick Question.

I have a form which has 10 fields, is there any way in PHP to take the
values 
once submitted and create a string for each??

Thanks 
Ade

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




PHP automatically makes values submitted in a form available to the next
page.  aka:

form.htm would be:

<form action="php.php">
<input type="text" name="Field" value="Field Value">
<input type="submit">
</form>


and then in php.php the variable $Field would hold "Field Value" wihtout you
having to do anything.

So, if php.php were:

<?
echo "Field:  $Field"
?>
would print Field:  Field Value


And I might have done that wrong, I've been doing stuff in ASP the last two
weeks and I can't seem to keep them straight anymore.

April



----- Original Message -----
From: "Benjamin Munoz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 4:43 PM
Subject: RE: [PHP] Strings??


> Ade,
>
> What kind of string?  What do you want to do with them?
>
> -Ben
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 16, 2001 2:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Strings??
>
>
> Quick Question.
>
> I have a form which has 10 fields, is there any way in PHP to take the
> values
> once submitted and create a string for each??
>
> Thanks
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Ade asked:
> I have a form which has 10 fields, is there any way in PHP to take the values
> once submitted and create a string for each??

Absolutely. Worse; it is already done for you!
If you give the input box a name, and submit to a php page, the php page 
contains a variable with that name!
If the name is 'textbox3' the variable will be called $textbox3.

Be careful though; if the variable is not filled in in the form it may not 
exist. So better test that:

 if isset($textbox3) echo $textbox3;

There's a lot more to forms and variables. In every other tutorial i guess.

Chris





--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 




> Ach, oy vey! Then, having looked at AOL's info, it seems to me that 
> perhaps one could build a function or class that could evaluate 
> against a known list of alternate proxies. So, if the request came 
> from 152.163.197, it would recognize that as an AOL proxy and just 
> code the current proxy as "AOL" or something. Each subsequent request 
> (from 152.163.* etc.) would go through the same filter.

It's more trouble that it's worth. AOL isn't the only one using 
load balancing proxies... there could be hundreds.

Jason





in my database, all entries have a timestamp.... I need a way to brake the
entries up and sort the entries:

by year
by month according to year
by day according to the month
and preferably by hour according to the day...


How do I do this? Are there functions floating around the net that will do
this?

thanks.






See the mysql manual - there's a section that deals with date/time functions
already built into mysq that work perfectly with timestamps

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Fun
ctions

jason

----- Original Message -----
From: "Dallas Kropka" <[EMAIL PROTECTED]>
To: "PHP LIST" <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 9:20 AM
Subject: [PHP] Working with time()...


>
> in my database, all entries have a timestamp.... I need a way to brake the
> entries up and sort the entries:
>
> by year
> by month according to year
> by day according to the month
> and preferably by hour according to the day...
>
>
> How do I do this? Are there functions floating around the net that will do
> this?
>
> thanks.








Hello All,

I have been using PHP4 with mysql-3.23.29a-gamma-dec-osf4.0f-alphaev6
running on a machine running Digital UNIX V4.0F.  Since upgrading the
database from 3.22 to 3.23, auto-increment fields have been acting
strangely.

A brief description of the table looks like:

+--------------------+-----------------------+------+-----+--------------------------------+----------------+---------------------------------+
| Field              | Type                  | Null | Key |Default | Extra    
+--------------------+-----------------------+------+-----+--------------------------------+----------------+---------------------------------+
| scientist_pk       | mediumint(8) unsigned |      | PRI | NULL   | auto_increment  
.
.
.

At the moment, the largest scientist_pk in the database is 254:

mysql> select login,passwd,scientist_pk from users order by scientist_pk desc limit 1;

+----------+------------------+--------------+
| login    | passwd           | scientist_pk |
+----------+------------------+--------------+
| jimbo    | 18ac6f1d2a33923d |          254 |


However, if I do an insert, the next scientist_pk should be 255, but is
instead BIG (i.e. 65548).

mysql> INSERT INTO users (login,passwd) VALUES ("fred" , PASSWORD("bob"));
mysql> select login,passwd,scientist_pk from users order by scientist_pk desc limit 1;

+----------+------------------+--------------+
| login    | passwd           | scientist_pk |
+----------+------------------+--------------+
| fred     | 7d67547927a4589e |        65548 |


I don't know if this helps, but if I insert one more time:

mysql> select login,passwd,scientist_pk from users order by scientist_pk desc limit 10;
+----------+------------------+--------------+
| login    | passwd           | scientist_pk |
+----------+------------------+--------------+
| fred     | 7d67547927a4589e |        65549 |
| fred     | 7d67547927a4589e |        65548 |

Strange, huh?  It just seems to like jumping to 65548, which makes zippo
sense since the unsigned range is 0 to 16777215 for a mediumint. 

Has anyone seen this before and know how to fix it?!  

Thanks much,
Parag M








I'm using a pretty simple linking system for a subscription-based 
newsletter site.

Stories and articles are in straight html files, reached by links from the 
front page. Clicking on a link passes a story number. So the second story 
on the index page would have this link: <A HREF="./story.php?storynum=2">

and story.php consists of just these lines:

<? include "auth.inc" ;
include "header.inc" ;
include $storynum.".htm" ;
include "footer.inc" ;
?>

If someone comes in the "right way", through the index page, they will have 
to be authenticated, then the header, article and page footer are displayed.

There's nothing, however, to stop someone from typing an URL like this:
http://www.somepub.ca/2.htm and seeing the article. I assume they could 
also come in that way via a search engine.

Any suggestions on how to stop that? Resources I should look at? I do want 
to keep the stories in straight html as the editor is struggling now with 
basic layout, etc.

Regards - Miles Thompson






Miles,

If you can save 2.htm as 2.php, use some authentication code.

Story.php becomes
<?
include "auth.inc";
include "header.inc";
include $storynum.".php";
include "footer.inc";
?>

Inside X.php, you have some authentication code.  Maybe something simple as:
<?
if ($valid) {
        // redirect to story.php?storynum=X
}
// rest of article follows
?>

Inside story.php, set $valid to true
<?
$valid = TRUE;
?>

Now accessing 2.php directly means that $valid is valid and you'll be
redirected to story.php.

Another option is to place all stories x.php into a story directory and
restrict access to this directory using Apache configuration directives.

-Ben

-----Original Message-----
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to keep unauthorized viewers out


I'm using a pretty simple linking system for a subscription-based 
newsletter site.

Stories and articles are in straight html files, reached by links from the 
front page. Clicking on a link passes a story number. So the second story 
on the index page would have this link: <A HREF="./story.php?storynum=2">

and story.php consists of just these lines:

<? include "auth.inc" ;
include "header.inc" ;
include $storynum.".htm" ;
include "footer.inc" ;
?>

If someone comes in the "right way", through the index page, they will have 
to be authenticated, then the header, article and page footer are displayed.

There's nothing, however, to stop someone from typing an URL like this:
http://www.somepub.ca/2.htm and seeing the article. I assume they could 
also come in that way via a search engine.

Any suggestions on how to stop that? Resources I should look at? I do want 
to keep the stories in straight html as the editor is struggling now with 
basic layout, etc.

Regards - Miles Thompson



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





Correction:
Inside X.php, you have some authentication code.  Maybe something simple as:
<?
if (!$valid) {
        // redirect to story.php?storynum=X
}
// rest of article follows
?>

-Ben
-----Original Message-----
From: Benjamin Munoz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 4:20 PM
To: 'Miles Thompson'; [EMAIL PROTECTED]
Subject: RE: [PHP] How to keep unauthorized viewers out


Miles,

If you can save 2.htm as 2.php, use some authentication code.

Story.php becomes
<?
include "auth.inc";
include "header.inc";
include $storynum.".php";
include "footer.inc";
?>

Inside X.php, you have some authentication code.  Maybe something simple as:
<?
if ($valid) {
        // redirect to story.php?storynum=X
}
// rest of article follows
?>

Inside story.php, set $valid to true
<?
$valid = TRUE;
?>

Now accessing 2.php directly means that $valid is valid and you'll be
redirected to story.php.

Another option is to place all stories x.php into a story directory and
restrict access to this directory using Apache configuration directives.

-Ben

-----Original Message-----
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to keep unauthorized viewers out


I'm using a pretty simple linking system for a subscription-based 
newsletter site.

Stories and articles are in straight html files, reached by links from the 
front page. Clicking on a link passes a story number. So the second story 
on the index page would have this link: <A HREF="./story.php?storynum=2">

and story.php consists of just these lines:

<? include "auth.inc" ;
include "header.inc" ;
include $storynum.".htm" ;
include "footer.inc" ;
?>

If someone comes in the "right way", through the index page, they will have 
to be authenticated, then the header, article and page footer are displayed.

There's nothing, however, to stop someone from typing an URL like this:
http://www.somepub.ca/2.htm and seeing the article. I assume they could 
also come in that way via a search engine.

Any suggestions on how to stop that? Resources I should look at? I do want 
to keep the stories in straight html as the editor is struggling now with 
basic layout, etc.

Regards - Miles Thompson



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

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




Nathan,

Thanks for your reply ...

At 04:53 PM 01/16/2001 -0700, Nathan Cook wrote:
>how do they authenticate?  VIA http or a subsequent page?

HTTP authentication,using
  Header("WWW-authenticate: basic realm=\"Business Today\"")

>Whichever it is, there are variables associated with each check for those
>variables before loading.

Yes I'm using $PHP_AUTH_USER and $PHP_AUTH_PW. But I can only check for 
those within a script, not in a straight HTML page. (Although I suppose I 
could change all the page extensions to .php and put a check for these 
var's at the very top and redirect to  the login script if they are not 
present.)

Alternately, I suppose I could create a session ID, following a successful 
login. I really don't want to invoke .htaccess.

Miles

>-----------------------------------------------------------------------
>.:: Nathan Cook                            - Network/Security Admin
>office:  208.343.3110                   - Web Programmer
>email:   [EMAIL PROTECTED]         - Qmail Admin
>pager:  208.387.9983                   - MIS Admin
>-----------------------------------------------------------------------
>----- Original Message -----
>From: "Miles Thompson" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, January 16, 2001 4:49 PM
>Subject: [PHP] How to keep unauthorized viewers out
>
>
> > I'm using a pretty simple linking system for a subscription-based
> > newsletter site.
> >
> > Stories and articles are in straight html files, reached by links from the
> > front page. Clicking on a link passes a story number. So the second story
> > on the index page would have this link: <A HREF="./story.php?storynum=2">
> >
> > and story.php consists of just these lines:
> >
> > <? include "auth.inc" ;
> > include "header.inc" ;
> > include $storynum.".htm" ;
> > include "footer.inc" ;
> > ?>
> >
> > If someone comes in the "right way", through the index page, they will
>have
> > to be authenticated, then the header, article and page footer are
>displayed.
> >
> > There's nothing, however, to stop someone from typing an URL like this:
> > http://www.somepub.ca/2.htm and seeing the article. I assume they could
> > also come in that way via a search engine.
> >
> > Any suggestions on how to stop that? Resources I should look at? I do want
> > to keep the stories in straight html as the editor is struggling now with
> > basic layout, etc.
> >
> > Regards - Miles Thompson
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >







I would put it in the subsequent include page.

if($PHP_AUTH_USER)
 {
    includes();
 }
else
 {
    print("You are not authorized to view this page");
 }
-----------------------------------------------------------------------
.:: Nathan Cook                            - Network/Security Admin
office:  208.343.3110                   - Web Programmer
email:   [EMAIL PROTECTED]         - Qmail Admin
pager:  208.387.9983                   - MIS Admin
-----------------------------------------------------------------------
----- Original Message -----
From: "Miles Thompson" <[EMAIL PROTECTED]>
To: "Nathan Cook" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 5:13 PM
Subject: Re: [PHP] How to keep unauthorized viewers out


> Nathan,
>
> Thanks for your reply ...
>
> At 04:53 PM 01/16/2001 -0700, Nathan Cook wrote:
> >how do they authenticate?  VIA http or a subsequent page?
>
> HTTP authentication,using
>   Header("WWW-authenticate: basic realm=\"Business Today\"")
>
> >Whichever it is, there are variables associated with each check for those
> >variables before loading.
>
> Yes I'm using $PHP_AUTH_USER and $PHP_AUTH_PW. But I can only check for
> those within a script, not in a straight HTML page. (Although I suppose I
> could change all the page extensions to .php and put a check for these
> var's at the very top and redirect to  the login script if they are not
> present.)
>
> Alternately, I suppose I could create a session ID, following a successful
> login. I really don't want to invoke .htaccess.
>
> Miles
>
> >-----------------------------------------------------------------------
> >.:: Nathan Cook                            - Network/Security Admin
> >office:  208.343.3110                   - Web Programmer
> >email:   [EMAIL PROTECTED]         - Qmail Admin
> >pager:  208.387.9983                   - MIS Admin
> >-----------------------------------------------------------------------
> >----- Original Message -----
> >From: "Miles Thompson" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, January 16, 2001 4:49 PM
> >Subject: [PHP] How to keep unauthorized viewers out
> >
> >
> > > I'm using a pretty simple linking system for a subscription-based
> > > newsletter site.
> > >
> > > Stories and articles are in straight html files, reached by links from
the
> > > front page. Clicking on a link passes a story number. So the second
story
> > > on the index page would have this link: <A
HREF="./story.php?storynum=2">
> > >
> > > and story.php consists of just these lines:
> > >
> > > <? include "auth.inc" ;
> > > include "header.inc" ;
> > > include $storynum.".htm" ;
> > > include "footer.inc" ;
> > > ?>
> > >
> > > If someone comes in the "right way", through the index page, they will
> >have
> > > to be authenticated, then the header, article and page footer are
> >displayed.
> > >
> > > There's nothing, however, to stop someone from typing an URL like
this:
> > > http://www.somepub.ca/2.htm and seeing the article. I assume they
could
> > > also come in that way via a search engine.
> > >
> > > Any suggestions on how to stop that? Resources I should look at? I do
want
> > > to keep the stories in straight html as the editor is struggling now
with
> > > basic layout, etc.
> > >
> > > Regards - Miles Thompson
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
>
>
>
>





A dummy idea:

in story.php you put a key in:

<? include "auth.inc" ;
include "header.inc" ;
unset($key);
$key = 'BHEKFBSA"IjsjbdshlycgewypH:*:YEWCnbms';
include $storynum.".htm" ;
include "footer.inc" ;
?>

then key.php will have this:
if($key != 'BHEKFBSA"IjsjbdshlycgewypH:*:YEWCnbms';) Exit;

then in every file you wish to protect include key.php and the articles will
show up only in case it was included, or someone knew what to type in the
URL...

another idea, might not be suitable for you, but would be much smarter:
is to pass-protect the directory with articles (it HAS to be a different
directory from the story.php)
the article will then be still shown under the password or when only
included by PHP...

there's a whole bunch of ways to do what you're asking ...

Cheers,
Maxim Maletsky ..

-----Original Message-----
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 8:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to keep unauthorized viewers out


I'm using a pretty simple linking system for a subscription-based 
newsletter site.

Stories and articles are in straight html files, reached by links from the 
front page. Clicking on a link passes a story number. So the second story 
on the index page would have this link: <A HREF="./story.php?storynum=2">

and story.php consists of just these lines:

<? include "auth.inc" ;
include "header.inc" ;
include $storynum.".htm" ;
include "footer.inc" ;
?>

If someone comes in the "right way", through the index page, they will have 
to be authenticated, then the header, article and page footer are displayed.

There's nothing, however, to stop someone from typing an URL like this:
http://www.somepub.ca/2.htm and seeing the article. I assume they could 
also come in that way via a search engine.

Any suggestions on how to stop that? Resources I should look at? I do want 
to keep the stories in straight html as the editor is struggling now with 
basic layout, etc.

Regards - Miles Thompson



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




Yes, I know this sounds crazy, but think about it.

I've often pondered the feasibility of using PHP as a MUD engine. While it
would probably not run nearly as fast as something implemented in C/C++, it
would have a lot of flexibility:

- Changes to the common code wouldn't neccessarily have to require a restart
of the MUD engine but could be implemented on-the-fly.
- Rooms, characters, items, etc. could use all the power of PHP's scripting
language. This means you can a complex scripting language for them.
- We get PHP's flexibility with dealing with strings, etc.
- We don't have to worry about malloc() and free() in C -- less potential
memory leaks.

The biggest issue would be maintaining security, as using PHP to handle room
scripts means that anyone who builds for the MUD would be able to run PHP
code on the server. You can only imagine what would happen if someone put an
exit; in their script, or if the script had errors in syntax.

I personally don't yet have the time to undertake such a project (I'm
working on the Venura Message Board (= a message board & user/character
database driven in PHP, intended for use for freeform roleplaying games that
are run via a message board system -- see
http://dewin.oldbattery.com/venura/ )), but I am interested to see what
people think.

 - Daniel Grace <http://dewin.oldbattery.com/>

  "Space may be the final frontier but its made in a Hollywood basement."
    - Red Hot Chili Peppers - Californication





On Tue, 16 Jan 2001, Daniel Grace wrote:

> Yes, I know this sounds crazy, but think about it.
> 
> I've often pondered the feasibility of using PHP as a MUD engine. While it
> would probably not run nearly as fast as something implemented in C/C++, it
> would have a lot of flexibility:
> 
> - Changes to the common code wouldn't neccessarily have to require a restart
> of the MUD engine but could be implemented on-the-fly.
> - Rooms, characters, items, etc. could use all the power of PHP's scripting
> language. This means you can a complex scripting language for them.
> - We get PHP's flexibility with dealing with strings, etc.
> - We don't have to worry about malloc() and free() in C -- less potential
> memory leaks.
> 
> The biggest issue would be maintaining security, as using PHP to handle room
> scripts means that anyone who builds for the MUD would be able to run PHP
> code on the server. You can only imagine what would happen if someone put an
> exit; in their script, or if the script had errors in syntax.

Well as using a script language to make a MUD engine, I had both played
and made one a couple of years ago (well it's about 10 years). They ran on
IBM mainframes using REXX over the late BITNET :)

As using PHP to do this you had the strenght to use their DB support and
use SQL to implement lots of thinks! 

Well... take a look at this site: www.astronest.com it isn't a MUD and I
didn't know if it is made with PHP, but it's an online game that run on
HTML :)

                                                                Antonio

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Antonio S. Martins Jr. - System Analist |  "Only The Shadow Knows   |
| WorldNet Internet Maringa - PR - Brasil |   what evil lurks in the  |
| E-Mail: [EMAIL PROTECTED]              |       Heart of Men!"      |
|         [EMAIL PROTECTED]                   | !!! Linux User: 52392 !!! |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               This e-mail message is 100% Microsoft free!

                         /"\
                         \ /  CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
                          X   ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
                         / \









http://www.macromedia.com/special/allaire/

So much for php in ultradev ;)





aw, crap.

I never liked allaire... but I did kinda like macromedia.

(giant-toilet-flushing-sound)

-a


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] (lou)
> Newsgroups: php.general
> Date: 16 Jan 2001 15:50:47 -0800
> Subject: [PHP] Macromedia and Allaire (cold fusion) have agreed to merge.
> 
> http://www.macromedia.com/special/allaire/
> 
> So much for php in ultradev ;)
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Now with CodeCharge & PHP there is no more need for PHP + UltraDev ;)


----- Original Message ----- 
From: lou <[EMAIL PROTECTED]>
To: PHP-General <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 3:52 PM
Subject: [PHP] Macromedia and Allaire (cold fusion) have agreed to merge.


> http://www.macromedia.com/special/allaire/
> 
> So much for php in ultradev ;)
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 




Hello

I am doing a job for a client who has a host that just installed php4 on a
WinNT system. He can not get the mail program to work properly.

The server that php is on and the mail server are different computers. He,
the host, asked me to try and by-pass the the mail utility and send directly
to the mail server. He gave me the ip address. Is it possible? If so how?

Thanks

Todd





Whenever I try to connect with ANY Mysql code on my cpu, I get an error saying it 
can't connect. I installed usingthe 4.04 win32 installer(heresey I know) which has 
mysql built in. Do I have to edit anything to all me to try the scripts on my personal 
cpu?




Hi

Start a DOS session and cd to the location of the mysql\bin
directory;  (maybe c:\mysql\bin?)
type in:
mysqld
exit
This will start  mysql and exit from the DOS window

You can access mysql as user ODBC or as root each one with no password
If you want to set up users, do the above but type mysql -u root   instead to
login as root. Then USE mysql; to get the mysql database, and do a GRANT SQL
statement.

You can also do the database access through Winmysql or one of the other Windows
MYSQL GUI's

HTH

Chris wrote:
> 
> Whenever I try to connect with ANY Mysql code on my cpu, I get an error saying it 
>can't connect. I installed usingthe 4.04 win32 installer(heresey I know) which has 
>mysql built in. Do I have to edit anything to all me to try the scripts on my 
>personal cpu?

-- 
Dell Coleman




Hi,

Can anyone point me to a step by step setup including which files to
download for using PHP/OpenLink?

I want to make PHP talk to a Progress 8.3C database on a remote server.

Regards

Grant Walters
Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND
Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989

smime.p7s





Hi Grant,

Check out this HOWTO, and ask if you have any questions:
http://www.iodbc.org/odbc-phpHOWTO.html


Best regards,
Andrew
------------------------------------------
Andrew Hill
Director Technology Evangelism
OpenLink Software
http://www.openlinksw.com
XML & E-Business Infrastructure Technology


On 1/16/01 7:46 PM, "Grant Walters" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Can anyone point me to a step by step setup including which files to
> download for using PHP/OpenLink?
> 
> I want to make PHP talk to a Progress 8.3C database on a remote server.
> 
> Regards
> 
> Grant Walters
> Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND
> Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989
> 





Hi,

Lets say I have columns e.g.

        | name | address | phone |

I want to make a list of all the names and put the result into a HTML page
where each name is a link.

When the name is clicked (the link), it will open another HTML page with
full information (name, address and phone).

I know how to send the query to list the names (and into a formatted
HTML-file), but I don't know how to put each name into a variable or a link
for the next step.

Can you point me to functions I should focus at or even a solution?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------






http://www.php.net/manual/en/function.mysql-fetch-object.php

Modified example from the manual above...

<?php 
mysql_connect ($host, $user, $password);
$result = mysql_db_query ("database", "select * from table");
while ($row = mysql_fetch_object ($result)) {
        // save database fields into variables here
        $user_id = $row->user_id;
        $name = $row->name;
        // print them out if you want, or store them in an array to return
if this is a function
        print ("<a href=user_details.php?user_id=$user_id>$name</a><br>\n");
}
mysql_free_result ($result);
?>

-Ben



-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL - How to transfer a query resault into a variable?


Hi,

Lets say I have columns e.g.

        | name | address | phone |

I want to make a list of all the names and put the result into a HTML page
where each name is a link.

When the name is clicked (the link), it will open another HTML page with
full information (name, address and phone).

I know how to send the query to list the names (and into a formatted
HTML-file), but I don't know how to put each name into a variable or a link
for the next step.

Can you point me to functions I should focus at or even a solution?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------


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




On Wed, 17 Jan 2001, SED wrote:

> Hi,
>
> Lets say I have columns e.g.
>
>       | name | address | phone |
>
> I want to make a list of all the names and put the result into a HTML page
> where each name is a link.
>
> When the name is clicked (the link), it will open another HTML page with
> full information (name, address and phone).
>
> I know how to send the query to list the names (and into a formatted
> HTML-file), but I don't know how to put each name into a variable or a link
> for the next step.
>
> Can you point me to functions I should focus at or even a solution?
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> ------------------------------------------
> Phone:       (+354) 4615501
> Mobile:      (+354) 8960376
> Fax:         (+354) 4615503
> E-mail:      [EMAIL PROTECTED]
> Homepage:    www.sed.is <- New Homepage!
> ------------------------------------------
>

You have to give the table a key field (autoincrement primary) that you can
use as a handle to pass to the next page.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>






Can some one help me understand this error?


_oci_open_server: Error while trying to retrieve text for error ORA-12545
  in /home/develop/www/htdocs/php_dev/oracle.php on line 11


My php.php server status page shows:

oci8

OCI8 Support.....enabled
Oracle Version....8.1
Compile-time ORACLE_HOME 
/u01/app/oracle/product/8.1.5/

Libraries Used   (none listed)


Thanks!

Paul
-- 
_______________________________________________
Paul Luscher
Web Developer
Studeo Interactive Direct
Ph. 801.993.2219

[EMAIL PROTECTED]




I have a vague memory of ORA-12545 being a database not available error.

but go by the oracle errors, they are usually pretty informative.

-a


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] (Paul)
> Newsgroups: php.general
> Date: 16 Jan 2001 17:55:43 -0800
> Subject: [PHP] Help! Oracle...
> 
> 
> Can some one help me understand this error?
> 
> 
> _oci_open_server: Error while trying to retrieve text for error ORA-12545
> in /home/develop/www/htdocs/php_dev/oracle.php on line 11
> 
> 
> My php.php server status page shows:
> 
> oci8
> 
> OCI8 Support.....enabled
> Oracle Version....8.1
> Compile-time ORACLE_HOME
> /u01/app/oracle/product/8.1.5/
> 
> Libraries Used   (none listed)
> 
> 
> Thanks!
> 
> Paul
> -- 
> _______________________________________________
> Paul Luscher
> Web Developer
> Studeo Interactive Direct
> Ph. 801.993.2219
> 
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Hi.

FrontPage sucks for working with PHP.

I've been doing all my coding by hand and that's fine as far as it goes but I just got 
a promotion at work where everyone uses FrontPage so I bought it to see how I can use 
it to show these old dogs some new tricks.

Nice program. Allows for workgroups where different people can work on different parts 
of a project. That'll come in handy. It also has some nice tree charts to show you 
where the project is branching out and generates some useful reports like where the 
dead links are.

What I *really* liked about it was the ability to apply a common theme across all my 
pages. Man, that was pretty cool. Plus, let's face it, using an HTML editor really 
takes some of the drudgery out of designing your pages.

The problem is, if the web page that is designed with FrontPage doesn't end with a 
regularly accepted filename extension like *.htm, FrontPage doesn't seem to really 
know how to handle it and I need it to handle pages that end with *.php.

What are my options? I don't think I missed anything with FrontPage after scouring the 
manual and online and inline help pages.

Anyone out there using an HTML editor that they'd like to recommend? Why? Are there 
any FAQs I should be reading for this answer?

Maybe I should just use a style sheet for a common look and for the rest, suck it up 
and take it like a man?

Yours,
Murph

www.murphatnight.com
__________________________________________________________________
Brian Murphy - 193A Lowell St., Apt. 24 - Methuen, MA 01844 - (978) 725-6654





Hey,

To get Frontpage to recognize PHP files (at least to let you edit them), do
the following (I'm assuming FP2000):

1 - Open FP
2 - Click on Tools
3 - Click on Options
4 - Click on the Configure Editors tab
5 - Hit Add
6 - Make file type "php"
7 - Make editor name "FrontPage"
8 - Make command "frontpg.exe"
9 - Hit ok
10 - It should work :D

- Kath

----- Original Message -----
From: "Murph" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 8:50 PM
Subject: [PHP] I love/hate FrontPage - need another HTML editor.


Hi.

FrontPage sucks for working with PHP.

I've been doing all my coding by hand and that's fine as far as it goes but
I just got a promotion at work where everyone uses FrontPage so I bought it
to see how I can use it to show these old dogs some new tricks.

Nice program. Allows for workgroups where different people can work on
different parts of a project. That'll come in handy. It also has some nice
tree charts to show you where the project is branching out and generates
some useful reports like where the dead links are.

What I *really* liked about it was the ability to apply a common theme
across all my pages. Man, that was pretty cool. Plus, let's face it, using
an HTML editor really takes some of the drudgery out of designing your
pages.

The problem is, if the web page that is designed with FrontPage doesn't end
with a regularly accepted filename extension like *.htm, FrontPage doesn't
seem to really know how to handle it and I need it to handle pages that end
with *.php.

What are my options? I don't think I missed anything with FrontPage after
scouring the manual and online and inline help pages.

Anyone out there using an HTML editor that they'd like to recommend? Why?
Are there any FAQs I should be reading for this answer?

Maybe I should just use a style sheet for a common look and for the rest,
suck it up and take it like a man?

Yours,
Murph

www.murphatnight.com
__________________________________________________________________
Brian Murphy - 193A Lowell St., Apt. 24 - Methuen, MA 01844 - (978) 725-6654







Hi

FrontPage is a piece of garbage...try DreamWeaver....you won't be
disappointed. It is available from Macromedia and does not munge your code
like FrontPage does!

Todd


----- Original Message -----
From: "Murph" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: January 16, 2001 9:50 PM
Subject: [PHP] I love/hate FrontPage - need another HTML editor.


Hi.

FrontPage sucks for working with PHP.

I've been doing all my coding by hand and that's fine as far as it goes but
I just got a promotion at work where everyone uses FrontPage so I bought it
to see how I can use it to show these old dogs some new tricks.

Nice program. Allows for workgroups where different people can work on
different parts of a project. That'll come in handy. It also has some nice
tree charts to show you where the project is branching out and generates
some useful reports like where the dead links are.

What I *really* liked about it was the ability to apply a common theme
across all my pages. Man, that was pretty cool. Plus, let's face it, using
an HTML editor really takes some of the drudgery out of designing your
pages.

The problem is, if the web page that is designed with FrontPage doesn't end
with a regularly accepted filename extension like *.htm, FrontPage doesn't
seem to really know how to handle it and I need it to handle pages that end
with *.php.

What are my options? I don't think I missed anything with FrontPage after
scouring the manual and online and inline help pages.

Anyone out there using an HTML editor that they'd like to recommend? Why?
Are there any FAQs I should be reading for this answer?

Maybe I should just use a style sheet for a common look and for the rest,
suck it up and take it like a man?

Yours,
Murph

www.murphatnight.com
__________________________________________________________________
Brian Murphy - 193A Lowell St., Apt. 24 - Methuen, MA 01844 - (978) 725-6654







At 09:06 PM 16/01/2001, Kath wrote:
>Hey,
>
>To get Frontpage to recognize PHP files (at least to let you edit them), do
>the following (I'm assuming FP2000):
>
>1 - Open FP
>2 - Click on Tools
>3 - Click on Options
>4 - Click on the Configure Editors tab
>5 - Hit Add
>6 - Make file type "php"
>7 - Make editor name "FrontPage"
>8 - Make command "frontpg.exe"
>9 - Hit ok
>10 - It should work :D


There is a much easier and simpler way to handle Frontpage and PHP than this ..

1 - Open Control Panel
2 - Open Add/Remove Programs
3 - Click on Frontpage 2000
4 - Click on Uninstall
5 - Uninstall
6 - Click on Start
7 - Click on Run
8 - Type 'Notepad'
9 - Press Enter
10 - It DOES work :)


A much more realistic windows solution in half the time (and about a 
thousandth of the HD space :) You can add in a Step 11 if needed which is 
to Slap yourself over the wrist 5 times for wanting to use Frontpage in the 
first place.




Chris






Heh heh

Now were talkin'

:o)

Todd
----- Original Message -----
From: "Chris Aitken" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: January 16, 2001 9:11 PM
Subject: Re: [PHP] I love/hate FrontPage - need another HTML editor.


> At 09:06 PM 16/01/2001, Kath wrote:
> >Hey,
> >
> >To get Frontpage to recognize PHP files (at least to let you edit them),
do
> >the following (I'm assuming FP2000):
> >
> >1 - Open FP
> >2 - Click on Tools
> >3 - Click on Options
> >4 - Click on the Configure Editors tab
> >5 - Hit Add
> >6 - Make file type "php"
> >7 - Make editor name "FrontPage"
> >8 - Make command "frontpg.exe"
> >9 - Hit ok
> >10 - It should work :D
>
>
> There is a much easier and simpler way to handle Frontpage and PHP than
this ..
>
> 1 - Open Control Panel
> 2 - Open Add/Remove Programs
> 3 - Click on Frontpage 2000
> 4 - Click on Uninstall
> 5 - Uninstall
> 6 - Click on Start
> 7 - Click on Run
> 8 - Type 'Notepad'
> 9 - Press Enter
> 10 - It DOES work :)
>
>
> A much more realistic windows solution in half the time (and about a
> thousandth of the HD space :) You can add in a Step 11 if needed which is
> to Slap yourself over the wrist 5 times for wanting to use Frontpage in
the
> first place.
>
>
>
>
> Chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





> A much more realistic windows solution in half the time (and about a
> thousandth of the HD space :) You can add in a Step 11 if needed which is
> to Slap yourself over the wrist 5 times for wanting to use Frontpage in
the
> first place.


Hi, Chris.

Really, thanks for the suggestion. I'm with you 100% and approached this
product with a TON of trepidation. I knew I was looking at a host service
that had to have something called "FrontPage extensions" installed and read
the online manual for the server I chose where they said I could easily
corrupt these extensions and that there'd be a fee to rebuild them.

Yes, I truly love open-source because of the support from folks like you and
others and because of the flexibility across a wide variety of platforms.

But, let's face it, if you have a new job and the whole corporation is using
FrontPage, you can't change their thinking until you've mastered their own
art and then shown them some tricks that simply can't be done with what
they're using.

This is where I am now. I taught myself PHP and MySQL so well that I was
able to impress people working in an entirely different field than where I
am now. Heck, I'm just a customer service rep, for crying out loud! I'm now
poised to make the big bucks like you all!

Now, to be smart about this, I have to infiltrate. I have to weasel. I have
to beg for some cool software. But before I can gain credibility, I have to
use what they're using now and that's FrontPage, believe it or not.

So, bottom line? Thanks for bearing with me and thanks to those who help me
meld the open-source PHP with products that aren't quite designed to handle
it because of their vested interests. THIS is where the value is for groups
like this and folks like you and I thank you so very much.

Yours,
Murph





As my "learn PHP" project,  I'm setting up a version of my site to 
use it.  So far, so good.  I'm working on a relational system to 
handle what sections of my site go where in a hierarchy.

I'm able to add new rows to a table that relates categories to kinds 
of content.  That works fine, but my next step is what's confusing 
me.  I'm displaying the current subcategories ("flavors") as 
checkboxes in a form.  If they're selected, then they get passed to 
the next step and added to the relations table.  What I'd like to do, 
though, is have a checkbox already checked if there's an existing 
relation for it.

My first thought is taking the array of existing flavors and compare 
that array to the array of flavors that are children of the current 
parent category.  Array_intersect would seem to be perfect for this, 
but it's PHP4 only, right?  (I'm also open to the possibility that 
I'm approaching this in entirely the wrong way, so any contributions 
are welcome.)

Here's my existing code:

$childquery = "select * from flavors order by flavor";
$childtype = "flavor";
$childresult = mysql_query($childquery) or die(mysql_error());

//childresult behaves as expected

$relationsquery = "select * from relations where 
childtype='$childtype' and parenttype='$parenttype' and 
parentsku='$parentsku'";


$relationsresult = mysql_query($relationsquery) or die(mysql_error());

/* relationsresult is the other array I think I need; but I don't 
know what to do with it */

?>
form code goes in here, snipped for space/relevance
<?php

while ($row = mysql_fetch_array($childresult)) {

printf("<input type=\"checkbox\" name=\"childsku[]\" 
value=\"%s\">%s<br>\n", $row["flavorsku"], $row["flavor"]);

}


Any ideas/thoughts or pointers to appropriate tutorials would be most 
helpful.  Thanks!

-- 
Maurice Rickard
http://mauricerickard.com/




I built an e-commerce application using PHP4 session management. I store all
data in an array, $SESSION, which I register with the session. Most of the
time, $SESSION is restored as expected on the loading of a new page. Every
now and then, however, $SESSION is restored as a boolean variable with value
0. All of the contents of the original array are, of course, lost. Have I
encountered a known problem? I attempted to circumvent the issue by writing
my own session management logic the implementation of which follows:

I store a serialized representation of the array $SESSION with serialize()
in a MySQL database indexed by the session id. On a page load, I query the
database and unserialize the data with unserialize() and thus, $SESSION is
restored. At the end of the page, I serialize $SESSION again and write it to
the database.

I ultimately experienced the same problem with my code where $SESSION was
indiscriminately set to a boolean of value 0. This error is not reproducible
in any predictable way. In my custom session management, I was however able
to implement debugging logic that provides the following information:

PHP is faithfully retrieving the serialized session data from the MySQL
database. The unserialize() function seems to be the problem. Every so
often, it results in the boolean variable despite the fact that the
serialized data it operates on represents an array. For example, I
determined from my debugging log (physical data has been altered for
privacy):

1. raw data extracted from database and stored into $rawData:
a:2:{s:4:"USER";a:15:{s:8:"loggedIn";i:1;s:7:"user_id";s:1:"1";s:5:"admin";s
:3:"Yes";s:10:"contact_id";s:1:"1";s:5:"first";s:4:"John";s:4:"last";s:3:"Do
e";s:7:"company";s:3:"ABC";s:6:"street";s:18:"#### XXXXXX
Avenue";s:4:"city";s:11:"Los
Angeles";s:5:"state";s:1:"5";s:7:"zipcode";s:5:"######";s:7:"country";s:13:"
United States";s:5:"phone";s:14:"(323)
555-5555";s:3:"fax";s:0:"";s:5:"email";s:13:"[EMAIL PROTECTED]";}s:7:"CONTACT";a
:1:{i:1;a:11:{s:5:"first";s:4:"John";s:4:"last";s:3:"Doe";s:7:"company";s:3:
"ABC";s:6:"street";s:18:"#### XXXXXXX Avenue";s:4:"city";s:11:"Los
Angeles";s:5:"state";s:1:"5";s:7:"zipcode";s:5:"#####";s:7:"country";s:13:"U
nited States";s:5:"phone";s:14:"(323)
555-5555";s:3:"fax";s:0:"";s:5:"email";s:13:"[EMAIL PROTECTED]";}}}

2. then raw data is unserialized into session variable
$SESSION=unserialize($rawData)

3. session variable is immediately typed with gettype($SESSION) and it's a
boolean

As I said before, this happens only irregularly. Most of the time, gettype()
properly determines $SESSION is an array which, when examined, contains the
unserialized data from the database. Every now and then, though, it's a
boolean with a value of 0. So I guess my first question is does anyone know
what is going on here? Second, does native PHP4 session management use the
unserialize() function. And third, is unserialize() broken?

Ted Henigson





Hi,

I use Macromedia Dreamweaver 4 - it's the best ever for HTML and others. It
recognizes the PHP extension and checks for syntax errors though it doesn't
check for errors in the PHP-languages.

SED

-----Original Message-----
From: Murph [mailto:[EMAIL PROTECTED]]
Sent: 17. janúar 2001 01:51
To: [EMAIL PROTECTED]
Subject: [PHP] I love/hate FrontPage - need another HTML editor.


Hi.

FrontPage sucks for working with PHP.

I've been doing all my coding by hand and that's fine as far as it goes but
I just got a promotion at work where everyone uses FrontPage so I bought it
to see how I can use it to show these old dogs some new tricks.

Nice program. Allows for workgroups where different people can work on
different parts of a project. That'll come in handy. It also has some nice
tree charts to show you where the project is branching out and generates
some useful reports like where the dead links are.

What I *really* liked about it was the ability to apply a common theme
across all my pages. Man, that was pretty cool. Plus, let's face it, using
an HTML editor really takes some of the drudgery out of designing your
pages.

The problem is, if the web page that is designed with FrontPage doesn't end
with a regularly accepted filename extension like *.htm, FrontPage doesn't
seem to really know how to handle it and I need it to handle pages that end
with *.php.

What are my options? I don't think I missed anything with FrontPage after
scouring the manual and online and inline help pages.

Anyone out there using an HTML editor that they'd like to recommend? Why?
Are there any FAQs I should be reading for this answer?

Maybe I should just use a style sheet for a common look and for the rest,
suck it up and take it like a man?

Yours,
Murph

www.murphatnight.com
__________________________________________________________________
Brian Murphy - 193A Lowell St., Apt. 24 - Methuen, MA 01844 - (978) 725-6654






> I use Macromedia Dreamweaver 4 - it's the best ever for HTML and others.
It
> recognizes the PHP extension and checks for syntax errors though it
doesn't
> check for errors in the PHP-languages.


It seems like there's an awful lot of people jumping on the Macromedia
editor bandwagon and after visiting their site, I can see why! Holy smoke!
There's an awful lot there to recommend that product.

My thanks to Kath for helping me get FrontPage up and running for my
immediate needs and to everyone else who recommended their favorite editor.

Dreamweaver is on the pricey side at $300 bucks for their basic version but
to buy the editor AND have access to the flashy Flash technology for a few
more bucks really makes it rather attractive.

Has anyone gone whole-hog and developed a site with Flash graphics AND a
database? THAT would be something to see. Hell, I'd pimp my mother to be
able to do something like THAT!

Only kidding, Mom! I love you!

Yours,
Murph





Thanks! Tell me though, what does the following mean or should I ask how
does it work?

        $row->user_id;

Is it somehow relate to the following?

        $row["user_id"];

I tried to look for this in the manual but without any luck... perhaps I'm
going blind ;)

SED

-----Original Message-----
From: Benjamin Munoz [mailto:[EMAIL PROTECTED]]
Sent: 17. janúar 2001 01:46
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] MySQL - How to transfer a query resault into a
variable?



http://www.php.net/manual/en/function.mysql-fetch-object.php

Modified example from the manual above...

<?php
mysql_connect ($host, $user, $password);
$result = mysql_db_query ("database", "select * from table");
while ($row = mysql_fetch_object ($result)) {
        // save database fields into variables here
        $user_id = $row->user_id;
        $name = $row->name;
        // print them out if you want, or store them in an array to return
if this is a function
        print ("<a href=user_details.php?user_id=$user_id>$name</a><br>\n");
}
mysql_free_result ($result);
?>

-Ben



-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL - How to transfer a query resault into a variable?


Hi,

Lets say I have columns e.g.

        | name | address | phone |

I want to make a list of all the names and put the result into a HTML page
where each name is a link.

When the name is clicked (the link), it will open another HTML page with
full information (name, address and phone).

I know how to send the query to list the names (and into a formatted
HTML-file), but I don't know how to put each name into a variable or a link
for the next step.

Can you point me to functions I should focus at or even a solution?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------


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

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






When you use mysql_fetch_object(), you get back an object. $object->property
access a field.
When you use mysql_fetch_array(), you get back an array. $array[index]
access the same field.

If you'd like, replace mysql_fetch_object with mysql_fetch_array, and use
the syntax $row["user_id"].  Either one will work.

It should be in the manual under www.php.net/mysql

-Ben

-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 6:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] $row->user_id;


Thanks! Tell me though, what does the following mean or should I ask how
does it work?

        $row->user_id;

Is it somehow relate to the following?

        $row["user_id"];

I tried to look for this in the manual but without any luck... perhaps I'm
going blind ;)

SED

-----Original Message-----
From: Benjamin Munoz [mailto:[EMAIL PROTECTED]]
Sent: 17. janúar 2001 01:46
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] MySQL - How to transfer a query resault into a
variable?



http://www.php.net/manual/en/function.mysql-fetch-object.php

Modified example from the manual above...

<?php
mysql_connect ($host, $user, $password);
$result = mysql_db_query ("database", "select * from table");
while ($row = mysql_fetch_object ($result)) {
        // save database fields into variables here
        $user_id = $row->user_id;
        $name = $row->name;
        // print them out if you want, or store them in an array to return
if this is a function
        print ("<a href=user_details.php?user_id=$user_id>$name</a><br>\n");
}
mysql_free_result ($result);
?>

-Ben



-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL - How to transfer a query resault into a variable?


Hi,

Lets say I have columns e.g.

        | name | address | phone |

I want to make a list of all the names and put the result into a HTML page
where each name is a link.

When the name is clicked (the link), it will open another HTML page with
full information (name, address and phone).

I know how to send the query to list the names (and into a formatted
HTML-file), but I don't know how to put each name into a variable or a link
for the next step.

Can you point me to functions I should focus at or even a solution?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------


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

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


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




Hi, recently I was given the task to create an
application to generate xml files in order to exchange
data.

Since my knowleadge of xml is close to zero :) I also
received an english text explaining the DTD and an
example of how the file should be written.

So I got to a point where I simply should create a php
script to access my databases and output the data in
the requested format, right ?

Well close but not quite.  I am supposed to parse the
file with the DTD in order to validade it.

This seems to be the place where I got lost.  So how
exactly (with php or perhaps another tool) can do this
?

Thanks.

PS. If possible send me some urls with a tutorial of
XML so my next questions wont be so basic ;)

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




you can do that in .htaccess or httpd.conf with the apache rewrite engine.

_alex


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("Hrishi")
> Newsgroups: php.general
> Date: 16 Jan 2001 03:38:30 -0800
> Subject: [PHP] Template parser
> 
> Hello,
> 
> Is it possible using apache .htaccess to have every file served from a
> particular domain/directory
> pass through a custom script? or is it necessary to make changes at the root
> level?
> 
> Thanks,
> Hrishi
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Hi people,
How do I do the log out function out of the site?(the site is on secure server) Is 
that okay to just use the redirect function?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"




Works for me... what version of PHP are you using?

--Toby

----- Original Message -----
From: "Dhaval Desai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 7:56 AM
Subject: [PHP] is 1 a Variable...Discoverd it just now...


>
> HI!
>
>
> When I run the foillowing code:
>
>
> <form action="<?php echo"$PHP_SELF"; ?>" method="post">
> <input type="hidden" name="flag" value="0">
> <select name="recepients" onchange="javascript:submit();">
>      <option value="">--</option>
>      <option value="1">1</option>
>      <option value="2">2</option>
>      <option value="3">3</option>
>      <option value="4">4</option>
>      <option value="5">5</option>
>      </select></form></td>
>       </tr>
>      </table>
>
> <?php
> if(isset($flag))
> {
> for($i=1; $i<=$recepients; $i++)
> {
> echo "<input type=\"text\" name=\"$i\">"  ."<br>";
> }
> }
> else
> {
> echo "<input type=\"text\" name=\"1\">";
> }
> ?>
>
> I get error on saying echo $i on the next page...
>
>
> ****************************************************
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
C:\HTTPD\HTDOCS\preston\sms\send.php
>
> ****************************************************
>
>
> WHy is it so..?
> Is there any other way of doing the above...
>
> Please let me know..
>
>
>
>
>
> Thanx a lot!
>
> Dhaval Desai
>
>
>
>
>
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Mail Personal Address - Get email at your own domain with Yahoo!
Mail.



Reply via email to