cvs: phpweb / .htaccess ChangeLog-4.php FAQ.html FAQ.php README.mirror anoncvs.php books.php bug-pwd-finder.php bugs-dos-and-donts.php
bugs-generating-backtrace.php bugs-php3.php bugs.php bugstats.php cfp.php credits.php cvs-php.php cvsup.php docs.php download-logos.php
download-php3.php downloads.php get-user-notes.php index.php license.html links.php manual-lookup.php mirrors.php news.php oldnews.php projects.php
quickref.php search.php source.php style.css support.php thanks.php tips.php tut.php usage.php /bin projects.xsl update-slashdot /error index.php
/gifs 2963.gif atkinson_fr.gif b-about-c.gif b-about-p.gif b-addnote-c.gif b-addnote-p.gif b-bullet-c.gif b-bullet-p.gif b-bullet-w.gif b-close-c.gif
b-close-p.gif b-contents-c.gif b-contents-p.gif b-credits-c.gif b-credits-p.gif b-development-c.gif b-development-p.gif b-docs-c.gif b-docs-p.gif
b-downloads-c.gif b-downloads-p.gif b-go.gif b-links-c.gif b-links-p.gif b-mailing-c.gif b-mailing-p.gif b-mirror-c.gif b-mirror-p.gif b-news-c.gif
b-news-p.gif b-next-c.gif b-next-p.gif b-prev-c.gif b-prev-p.gif b-projects-c.gif b-projects-p.gif b-quickref-c.gif b-quickref-p.gif b-search-c.gif
b-search-p.gif b-source-c.gif b-source-p.gif b-stats-c.gif b-stats-p.gif b-top-c.gif b-top-p.gif b-up-c.gif b-up-p.gif back1.jpg back2.jpg
back_big.jpg back_small.jpg bg-bl.gif bg-ul.gif book-php-dutch.gif box-0.gif box-1.gif bubbles-down.gif bubbles-up.gif canada-small.gif canada.gif
cap-bl.gif cap-left.gif cap-right.gif cap-right2.gif cap-ul.gif caret-l.gif caret-r.gif caret-rg.gif caret-t.gif caret-u.gif checkerboard.gif
circular_arrow.gif corner-bl.gif corner-ul.gif cvsbook.gif cvspr.gif databecker.gif db20023.gif db20029.gif deleted_images esteban_trigo.gif
flag-at.gif flag-au.gif flag-br-gray.gif flag-br.gif flag-ca.gif flag-ch.gif flag-cl.gif flag-cz-gray.gif flag-cz.gif flag-de-gray.gif flag-de.gif
flag-dk.gif flag-es-gray.gif flag-es.gif flag-fi.gif flag-fr-gray.gif flag-fr.gif flag-hu-gray.gif flag-hu.gif flag-id.gif flag-il.gif
flag-it-gray.gif flag-it.gif flag-jp-gray.gif flag-jp.gif flag-kr-gray.gif flag-kr.gif flag-lv.gif flag-mx.gif flag-nl-gray.gif flag-nl.gif
flag-no.gif flag-nz.gif flag-pl.gif flag-pt.gif flag-ro.gif flag-ru.gif flag-se.gif flag-sg.gif flag-sk.gif flag-tr.gif flag-ua.gif flag-uk-gray.gif
flag-uk.gif flag-us.gif flag-xx.gif flag-za.gif gcap-left.gif gcap-leftbot.gif gcap-lefttop.gif gcap-right.gif gcap-rightbot.gif gcap-righttop.gif
gcorn-bl.gif gcorn-br.gif gcorn-ul.gif gcorn-ur.gif gflag-at.gif gflag-au.gif gflag-br.gif gflag-ca.gif gflag-ch.gif gflag-cl.gif gflag-cz.gif
gflag-de.gif gflag-dk.gif gflag-es.gif gflag-fi.gif gflag-fr.gif gflag-id.gif gflag-il.gif gflag-it.gif gflag-jp.gif gflag-kr.gif gflag-lv.gif
gflag-mx.gif gflag-nl.gif gflag-no.gif gflag-nz.gif gflag-pl.gif gflag-pt.gif gflag-ro.gif gflag-ru.gif gflag-se.gif gflag-sg.gif gflag-sk.gif
gflag-tr.gif gflag-ua.gif gflag-uk.gif gflag-us.gif gflag-xx.gif gflag-za.gif herellier.gif israel-small.gif israel.gif japanese-book.gif kick-bb.gif
kick-bg.gif kick-bl.gif kick-br.gif kick-bt.gif kick-cbl.gif kick-cbr.gif kick-close.gif kick-ctl.gif kick-ctr.gif korean_book.gif lacroix.gif
logo-adgrafix.gif logo-amerikanclaris.gif logo-arabnet.gif logo-bellasf.gif logo-belnet.gif logo-besthost.gif logo-borsen.gif logo-bug.gif
logo-calinet.gif logo-chek.gif logo-cl.gif logo-comnet.gif logo-cooper8.gif logo-directnet.gif logo-easydns.gif logo-externet.gif logo-fast.gif
logo-gds.gif logo-globe.gif logo-guardian.gif logo-happy.gif logo-hurricane.gif logo-ibd.gif logo-indog.gif logo-inway.gif logo-inway1.gif
logo-isternet.gif logo-kimm.gif logo-lbd.gif logo-manawatu.gif logo-mikomtek.gif logo-montaigne.gif logo-murl.gif logo-ndot.gif logo-nederlandnet.gif
logo-netlife.gif logo-netswamp.gif logo-netvision.gif logo-nic.gif logo-none.gif logo-paco.gif logo-police.gif logo-pwc.gif logo-rcis.gif
logo-schlund.gif logo-squid.gif logo-sst.gif logo-sts.gif logo-sunsite.gif logo-technion.gif logo-telenet.gif logo-tgr.gif logo-upt.gif
logo-urbano.gif logo-utilina.gif logo-webtic.gif medinets.gif mysql-book.gif norway-small.gif norway.gif p-cap-left.gif p-cap-right.gif php_logo.gif
phppr.s.gif phpstats-200002.gif phpstats-200006.gif phpstats-200007.gif phpstats-200008.gif phpstats-200009.gif phpstats-200010.gif
phpstats-200012.gif phpstats-200101.gif powered_by.jpg rasmus-kug.gif regex.s.gif sm_faf.jpg sm_search.jpg sm_searchf.jpg sm_top.jpg sm_topf.jpg
sm_vs.jpg sm_vsf.jpg small_submit.gif susanne_wigard.gif theis.gif uk-small.gif uk.gif usa-small.gif usa.gif webmaster-book.gif /gifs/books 2963.gif
allen_wyke.jpg atkinson_fr.gif beginning_php4.jpg bible.jpg book-php-dutch.gif cgiphp.jpg core-book.jpg cosentino.jpg cvsbook.gif cvspr.gif
czech-book.jpg databecker.gif db20023.gif db20029.gif dehnhardt.jpg dittrich.jpg dubois-de.jpg dubois.jpg ek-eriksson.gif esteban_trigo.gif
fischer.jpg gilmore.jpg greenspan.jpg herellier.gif hilton-willis.jpg japanese-book.gif joerg_krause.jpg klaus_schmidt.jpg korean-book.jpg
korean_book.gif lacroix.gif mastregex.jpg matt_zandstra.jpg maxfield.jpg medinets.gif mysql-book.gif php_essentials.jpg php_fe.jpg phppr.s.gif
postgresql.jpg rasmus-kug.gif ratschiller_gerken.jpg regex.s.gif schmid_cartus.jpg schwendiman.jpg susanne_wigard.gif susanne_wigard.jpg theis.gif
till_gerken.jpg tobias_and_till.jpg uwe_and_gunther.jpg webmaster-book.gif wilson.jpg wjgilmore.jpg zandstra.jpg zmievski.jpg /gifs/stats
phpstats-200002.gif phpstats-200006.gif phpstats-200007.gif phpstats-200008.gif phpstats-200009.gif phpstats-200010.gif phpstats-200012.gif
phpstats-200101.gif /include email-validation.inc index.php index.php3 layout.inc prepend.inc shared-manual.inc shared-stat.inc shared.inc site.inc
/jpgs allen_wyke.jpg back1.jpg back2.jpg back_big.jpg back_small.jpg beginning_php4.jpg bible.jpg cgiphp.jpg core-book.jpg cosentino.jpg
czech-book.jpg dehnhardt.jpg dittrich.jpg dubois-de.jpg dubois.jpg fischer.jpg gilmore.jpg greenspan.jpg hilton-willis.jpg joerg_krause.jpg
klaus_schmidt.jpg korean-book.jpg mastregex.jpg matt_zandstra.jpg maxfield.jpg php_essentials.jpg php_fe.jpg postgresql.jpg powered_by.jpg
ratschiller_gerken.jpg schmid_cartus.jpg schwendiman.jpg sm_faf.jpg sm_search.jpg sm_searchf.jpg sm_top.jpg sm_topf.jpg sm_vs.jpg sm_vsf.jpg
till_gerken.jpg tobias_and_till.jpg uwe_and_gunther.jpg wilson.jpg wjgilmore.jpg zandstra.jpg zmievski.jpg /license index.php /manual .htaccess
about-notes.php add-note.php admin-notes.php browse-errata.php index.php phpfi2.html phpfi2.php set-magic-cookie.php /manual/html index.php

From: Date: Thu, 08 Mar 2001 00:18:19 +0000
Subject: cvs: phpweb / .htaccess ChangeLog-4.php FAQ.html FAQ.php README.mirror anoncvs.php books.php bug-pwd-finder.php bugs-dos-and-donts.php
bugs-generating-backtrace.php bugs-php3.php bugs.php bugstats.php cfp.php credits.php cvs-php.php cvsup.php docs.php download-logos.php
download-php3.php downloads.php get-user-notes.php index.php license.html links.php manual-lookup.php mirrors.php news.php oldnews.php projects.php
quickref.php search.php source.php style.css support.php thanks.php tips.php tut.php usage.php /bin projects.xsl update-slashdot /error index.php
/gifs 2963.gif atkinson_fr.gif b-about-c.gif b-about-p.gif b-addnote-c.gif b-addnote-p.gif b-bullet-c.gif b-bullet-p.gif b-bullet-w.gif b-close-c.gif
b-close-p.gif b-contents-c.gif b-contents-p.gif b-credits-c.gif b-credits-p.gif b-development-c.gif b-development-p.gif b-docs-c.gif b-docs-p.gif
b-downloads-c.gif b-downloads-p.gif b-go.gif b-links-c.gif b-links-p.gif b-mailing-c.gif b-mailing-p.gif b-mirror-c.gif b-mirror-p.gif b-news-c.gif
b-news-p.gif b-next-c.gif b-next-p.gif b-prev-c.gif b-prev-p.gif b-projects-c.gif b-projects-p.gif b-quickref-c.gif b-quickref-p.gif b-search-c.gif
b-search-p.gif b-source-c.gif b-source-p.gif b-stats-c.gif b-stats-p.gif b-top-c.gif b-top-p.gif b-up-c.gif b-up-p.gif back1.jpg back2.jpg
back_big.jpg back_small.jpg bg-bl.gif bg-ul.gif book-php-dutch.gif box-0.gif box-1.gif bubbles-down.gif bubbles-up.gif canada-small.gif canada.gif
cap-bl.gif cap-left.gif cap-right.gif cap-right2.gif cap-ul.gif caret-l.gif caret-r.gif caret-rg.gif caret-t.gif caret-u.gif checkerboard.gif
circular_arrow.gif corner-bl.gif corner-ul.gif cvsbook.gif cvspr.gif databecker.gif db20023.gif db20029.gif deleted_images esteban_trigo.gif
flag-at.gif flag-au.gif flag-br-gray.gif flag-br.gif flag-ca.gif flag-ch.gif flag-cl.gif flag-cz-gray.gif flag-cz.gif flag-de-gray.gif flag-de.gif
flag-dk.gif flag-es-gray.gif flag-es.gif flag-fi.gif flag-fr-gray.gif flag-fr.gif flag-hu-gray.gif flag-hu.gif flag-id.gif flag-il.gif
flag-it-gray.gif flag-it.gif flag-jp-gray.gif flag-jp.gif flag-kr-gray.gif flag-kr.gif flag-lv.gif flag-mx.gif flag-nl-gray.gif flag-nl.gif
flag-no.gif flag-nz.gif flag-pl.gif flag-pt.gif flag-ro.gif flag-ru.gif flag-se.gif flag-sg.gif flag-sk.gif flag-tr.gif flag-ua.gif flag-uk-gray.gif
flag-uk.gif flag-us.gif flag-xx.gif flag-za.gif gcap-left.gif gcap-leftbot.gif gcap-lefttop.gif gcap-right.gif gcap-rightbot.gif gcap-righttop.gif
gcorn-bl.gif gcorn-br.gif gcorn-ul.gif gcorn-ur.gif gflag-at.gif gflag-au.gif gflag-br.gif gflag-ca.gif gflag-ch.gif gflag-cl.gif gflag-cz.gif
gflag-de.gif gflag-dk.gif gflag-es.gif gflag-fi.gif gflag-fr.gif gflag-id.gif gflag-il.gif gflag-it.gif gflag-jp.gif gflag-kr.gif gflag-lv.gif
gflag-mx.gif gflag-nl.gif gflag-no.gif gflag-nz.gif gflag-pl.gif gflag-pt.gif gflag-ro.gif gflag-ru.gif gflag-se.gif gflag-sg.gif gflag-sk.gif
gflag-tr.gif gflag-ua.gif gflag-uk.gif gflag-us.gif gflag-xx.gif gflag-za.gif herellier.gif israel-small.gif israel.gif japanese-book.gif kick-bb.gif
kick-bg.gif kick-bl.gif kick-br.gif kick-bt.gif kick-cbl.gif kick-cbr.gif kick-close.gif kick-ctl.gif kick-ctr.gif korean_book.gif lacroix.gif
logo-adgrafix.gif logo-amerikanclaris.gif logo-arabnet.gif logo-bellasf.gif logo-belnet.gif logo-besthost.gif logo-borsen.gif logo-bug.gif
logo-calinet.gif logo-chek.gif logo-cl.gif logo-comnet.gif logo-cooper8.gif logo-directnet.gif logo-easydns.gif logo-externet.gif logo-fast.gif
logo-gds.gif logo-globe.gif logo-guardian.gif logo-happy.gif logo-hurricane.gif logo-ibd.gif logo-indog.gif logo-inway.gif logo-inway1.gif
logo-isternet.gif logo-kimm.gif logo-lbd.gif logo-manawatu.gif logo-mikomtek.gif logo-montaigne.gif logo-murl.gif logo-ndot.gif logo-nederlandnet.gif
logo-netlife.gif logo-netswamp.gif logo-netvision.gif logo-nic.gif logo-none.gif logo-paco.gif logo-police.gif logo-pwc.gif logo-rcis.gif
logo-schlund.gif logo-squid.gif logo-sst.gif logo-sts.gif logo-sunsite.gif logo-technion.gif logo-telenet.gif logo-tgr.gif logo-upt.gif
logo-urbano.gif logo-utilina.gif logo-webtic.gif medinets.gif mysql-book.gif norway-small.gif norway.gif p-cap-left.gif p-cap-right.gif php_logo.gif
phppr.s.gif phpstats-200002.gif phpstats-200006.gif phpstats-200007.gif phpstats-200008.gif phpstats-200009.gif phpstats-200010.gif
phpstats-200012.gif phpstats-200101.gif powered_by.jpg rasmus-kug.gif regex.s.gif sm_faf.jpg sm_search.jpg sm_searchf.jpg sm_top.jpg sm_topf.jpg
sm_vs.jpg sm_vsf.jpg small_submit.gif susanne_wigard.gif theis.gif uk-small.gif uk.gif usa-small.gif usa.gif webmaster-book.gif /gifs/books 2963.gif
allen_wyke.jpg atkinson_fr.gif beginning_php4.jpg bible.jpg book-php-dutch.gif cgiphp.jpg core-book.jpg cosentino.jpg cvsbook.gif cvspr.gif
czech-book.jpg databecker.gif db20023.gif db20029.gif dehnhardt.jpg dittrich.jpg dubois-de.jpg dubois.jpg ek-eriksson.gif esteban_trigo.gif
fischer.jpg gilmore.jpg greenspan.jpg herellier.gif hilton-willis.jpg japanese-book.gif joerg_krause.jpg klaus_schmidt.jpg korean-book.jpg
korean_book.gif lacroix.gif mastregex.jpg matt_zandstra.jpg maxfield.jpg medinets.gif mysql-book.gif php_essentials.jpg php_fe.jpg phppr.s.gif
postgresql.jpg rasmus-kug.gif ratschiller_gerken.jpg regex.s.gif schmid_cartus.jpg schwendiman.jpg susanne_wigard.gif susanne_wigard.jpg theis.gif
till_gerken.jpg tobias_and_till.jpg uwe_and_gunther.jpg webmaster-book.gif wilson.jpg wjgilmore.jpg zandstra.jpg zmievski.jpg /gifs/stats
phpstats-200002.gif phpstats-200006.gif phpstats-200007.gif phpstats-200008.gif phpstats-200009.gif phpstats-200010.gif phpstats-200012.gif
phpstats-200101.gif /include email-validation.inc index.php index.php3 layout.inc prepend.inc shared-manual.inc shared-stat.inc shared.inc site.inc
/jpgs allen_wyke.jpg back1.jpg back2.jpg back_big.jpg back_small.jpg beginning_php4.jpg bible.jpg cgiphp.jpg core-book.jpg cosentino.jpg
czech-book.jpg dehnhardt.jpg dittrich.jpg dubois-de.jpg dubois.jpg fischer.jpg gilmore.jpg greenspan.jpg hilton-willis.jpg joerg_krause.jpg
klaus_schmidt.jpg korean-book.jpg mastregex.jpg matt_zandstra.jpg maxfield.jpg php_essentials.jpg php_fe.jpg postgresql.jpg powered_by.jpg
ratschiller_gerken.jpg schmid_cartus.jpg schwendiman.jpg sm_faf.jpg sm_search.jpg sm_searchf.jpg sm_top.jpg sm_topf.jpg sm_vs.jpg sm_vsf.jpg
till_gerken.jpg tobias_and_till.jpg uwe_and_gunther.jpg wilson.jpg wjgilmore.jpg zandstra.jpg zmievski.jpg /license index.php /manual .htaccess
about-notes.php add-note.php admin-notes.php browse-errata.php index.php phpfi2.html phpfi2.php set-magic-cookie.php /manual/html index.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-4184@lists.php.net to get a copy of this message
jimw Wed Mar 7 16:18:19 2001 EDT Removed files: /phpweb FAQ.html oldnews.php /phpweb/gifs 2963.gif atkinson_fr.gif b-about-c.gif b-about-p.gif b-addnote-c.gif b-addnote-p.gif b-bullet-c.gif b-bullet-p.gif b-bullet-w.gif b-close-c.gif b-close-p.gif b-contents-c.gif b-contents-p.gif b-credits-c.gif b-credits-p.gif b-development-c.gif b-development-p.gif b-docs-c.gif b-docs-p.gif b-downloads-c.gif b-downloads-p.gif b-go.gif b-links-c.gif b-links-p.gif b-mailing-c.gif b-mailing-p.gif b-mirror-c.gif b-mirror-p.gif b-news-c.gif b-news-p.gif b-next-c.gif b-next-p.gif b-prev-c.gif b-prev-p.gif b-projects-c.gif b-projects-p.gif b-quickref-c.gif b-quickref-p.gif b-search-c.gif b-search-p.gif b-source-c.gif b-source-p.gif b-stats-c.gif b-stats-p.gif b-top-c.gif b-top-p.gif b-up-c.gif b-up-p.gif bg-bl.gif bg-ul.gif book-php-dutch.gif bubbles-down.gif bubbles-up.gif canada-small.gif canada.gif cap-bl.gif cap-left.gif cap-right.gif cap-right2.gif cap-ul.gif circular_arrow.gif corner-bl.gif corner-ul.gif cvsbook.gif cvspr.gif databecker.gif db20023.gif db20029.gif esteban_trigo.gif flag-at.gif flag-au.gif flag-br-gray.gif flag-br.gif flag-ca.gif flag-ch.gif flag-cl.gif flag-cz-gray.gif flag-cz.gif flag-de-gray.gif flag-de.gif flag-dk.gif flag-es-gray.gif flag-es.gif flag-fi.gif flag-fr-gray.gif flag-fr.gif flag-hu-gray.gif flag-hu.gif flag-id.gif flag-il.gif flag-it-gray.gif flag-it.gif flag-jp-gray.gif flag-jp.gif flag-kr-gray.gif flag-kr.gif flag-lv.gif flag-mx.gif flag-nl-gray.gif flag-nl.gif flag-no.gif flag-nz.gif flag-pl.gif flag-pt.gif flag-ro.gif flag-ru.gif flag-se.gif flag-sg.gif flag-sk.gif flag-tr.gif flag-ua.gif flag-uk-gray.gif flag-uk.gif flag-us.gif flag-xx.gif flag-za.gif gcap-left.gif gcap-leftbot.gif gcap-lefttop.gif gcap-right.gif gcap-rightbot.gif gcap-righttop.gif gcorn-bl.gif gcorn-br.gif gcorn-ul.gif gcorn-ur.gif gflag-at.gif gflag-au.gif gflag-br.gif gflag-ca.gif gflag-ch.gif gflag-cl.gif gflag-cz.gif gflag-de.gif gflag-dk.gif gflag-es.gif gflag-fi.gif gflag-fr.gif gflag-id.gif gflag-il.gif gflag-it.gif gflag-jp.gif gflag-kr.gif gflag-lv.gif gflag-mx.gif gflag-nl.gif gflag-no.gif gflag-nz.gif gflag-pl.gif gflag-pt.gif gflag-ro.gif gflag-ru.gif gflag-se.gif gflag-sg.gif gflag-sk.gif gflag-tr.gif gflag-ua.gif gflag-uk.gif gflag-us.gif gflag-xx.gif gflag-za.gif herellier.gif israel-small.gif israel.gif japanese-book.gif kick-bb.gif kick-bg.gif kick-bl.gif kick-br.gif kick-bt.gif kick-cbl.gif kick-cbr.gif kick-close.gif kick-ctl.gif kick-ctr.gif korean_book.gif lacroix.gif logo-adgrafix.gif logo-amerikanclaris.gif logo-arabnet.gif logo-bellasf.gif logo-belnet.gif logo-besthost.gif logo-borsen.gif logo-bug.gif logo-calinet.gif logo-chek.gif logo-cl.gif logo-comnet.gif logo-cooper8.gif logo-directnet.gif logo-easydns.gif logo-externet.gif logo-fast.gif logo-gds.gif logo-globe.gif logo-guardian.gif logo-happy.gif logo-hurricane.gif logo-ibd.gif logo-indog.gif logo-inway.gif logo-inway1.gif logo-isternet.gif logo-kimm.gif logo-lbd.gif logo-manawatu.gif logo-mikomtek.gif logo-montaigne.gif logo-murl.gif logo-ndot.gif logo-nederlandnet.gif logo-netlife.gif logo-netswamp.gif logo-netvision.gif logo-nic.gif logo-none.gif logo-paco.gif logo-police.gif logo-pwc.gif logo-rcis.gif logo-schlund.gif logo-squid.gif logo-sst.gif logo-sts.gif logo-sunsite.gif logo-technion.gif logo-telenet.gif logo-tgr.gif logo-upt.gif logo-urbano.gif logo-utilina.gif logo-webtic.gif medinets.gif mysql-book.gif norway-small.gif norway.gif p-cap-left.gif p-cap-right.gif phppr.s.gif phpstats-200002.gif phpstats-200006.gif phpstats-200007.gif phpstats-200008.gif phpstats-200009.gif phpstats-200010.gif phpstats-200012.gif phpstats-200101.gif rasmus-kug.gif regex.s.gif susanne_wigard.gif theis.gif uk-small.gif uk.gif usa-small.gif usa.gif webmaster-book.gif /phpweb/include index.php3 /phpweb/jpgs allen_wyke.jpg back1.jpg back2.jpg back_big.jpg back_small.jpg beginning_php4.jpg bible.jpg cgiphp.jpg core-book.jpg cosentino.jpg czech-book.jpg dehnhardt.jpg dittrich.jpg dubois-de.jpg dubois.jpg fischer.jpg gilmore.jpg greenspan.jpg hilton-willis.jpg joerg_krause.jpg klaus_schmidt.jpg korean-book.jpg mastregex.jpg matt_zandstra.jpg maxfield.jpg php_essentials.jpg php_fe.jpg postgresql.jpg powered_by.jpg ratschiller_gerken.jpg schmid_cartus.jpg schwendiman.jpg sm_faf.jpg sm_search.jpg sm_searchf.jpg sm_top.jpg sm_topf.jpg sm_vs.jpg sm_vsf.jpg till_gerken.jpg tobias_and_till.jpg uwe_and_gunther.jpg wilson.jpg wjgilmore.jpg zandstra.jpg zmievski.jpg /phpweb/manual .htaccess phpfi2.html Modified files: /phpweb style.css .htaccess ChangeLog-4.php FAQ.php README.mirror anoncvs.php books.php bug-pwd-finder.php bugs-dos-and-donts.php bugs-generating-backtrace.php bugs-php3.php bugs.php bugstats.php cfp.php credits.php cvs-php.php cvsup.php docs.php download-logos.php download-php3.php downloads.php get-user-notes.php index.php license.html links.php manual-lookup.php mirrors.php news.php projects.php quickref.php search.php source.php support.php thanks.php tips.php tut.php usage.php /phpweb/bin update-slashdot projects.xsl /phpweb/error index.php /phpweb/gifs back1.jpg back2.jpg back_big.jpg back_small.jpg box-0.gif box-1.gif caret-l.gif caret-r.gif caret-rg.gif caret-t.gif caret-u.gif checkerboard.gif deleted_images php_logo.gif powered_by.jpg sm_faf.jpg sm_search.jpg sm_searchf.jpg sm_top.jpg sm_topf.jpg sm_vs.jpg sm_vsf.jpg small_submit.gif /phpweb/gifs/books 2963.gif allen_wyke.jpg atkinson_fr.gif beginning_php4.jpg bible.jpg book-php-dutch.gif cgiphp.jpg core-book.jpg cosentino.jpg cvsbook.gif cvspr.gif czech-book.jpg databecker.gif db20023.gif db20029.gif dehnhardt.jpg dittrich.jpg dubois-de.jpg dubois.jpg ek-eriksson.gif esteban_trigo.gif fischer.jpg gilmore.jpg greenspan.jpg herellier.gif hilton-willis.jpg japanese-book.gif joerg_krause.jpg klaus_schmidt.jpg korean-book.jpg korean_book.gif lacroix.gif mastregex.jpg matt_zandstra.jpg maxfield.jpg medinets.gif mysql-book.gif php_essentials.jpg php_fe.jpg phppr.s.gif postgresql.jpg rasmus-kug.gif ratschiller_gerken.jpg regex.s.gif schmid_cartus.jpg schwendiman.jpg susanne_wigard.gif susanne_wigard.jpg theis.gif till_gerken.jpg tobias_and_till.jpg uwe_and_gunther.jpg webmaster-book.gif wilson.jpg wjgilmore.jpg zandstra.jpg zmievski.jpg /phpweb/gifs/stats phpstats-200002.gif phpstats-200006.gif phpstats-200007.gif phpstats-200008.gif phpstats-200009.gif phpstats-200010.gif phpstats-200012.gif phpstats-200101.gif /phpweb/include index.php layout.inc prepend.inc email-validation.inc shared-manual.inc shared-stat.inc shared.inc site.inc /phpweb/license index.php /phpweb/manual phpfi2.php about-notes.php add-note.php admin-notes.php browse-errata.php index.php set-magic-cookie.php /phpweb/manual/html index.php Log: here goes nothing. the new php site look. let the torrent of bitter and angry "i hate change" emails begin.

Index: phpweb/style.css diff -u /dev/null phpweb/style.css:1.2 --- /dev/null Wed Mar 7 16:18:16 2001 +++ phpweb/style.css Wed Mar 7 16:17:34 2001 @@ -0,0 +1,82 @@ +body, td, th { + font-family: arial,helvetica,sans-serif; + font-size: 13px; +} + +em { + font-weight: bold; + font-style: italic; +} + +pre,code { + font-family: "andale mono", "monotype.com", "courier new", monospace; + font-size: 12px; +} + +h1 { + font-family: arial,helvetica,sans-serif; + font-size: 18px; + font-weight: bold; + color: #000066; +} + +h2 { + font-family: arial,helvetica,sans-serif; + font-size: 16px; + font-weight: bold; + color: #000066; +} + +h3 { + font-family: arial,helvetica,sans-serif; + font-size: 14px; + font-weight: bold; + color: #000066; +} + +small { + font-family: arial,helvetica,sans-serif; + font-size: 11px; +} + +a.small { + font-family: arial,helvetica,sans-serif; + font-size: 11px; + text-decoration: none; +} + +.tableTitle { + font-family: arial,helvetica,sans-serif; + font-size: 13px; + font-weight: bold; +} + +.tableExtras { + font-family: arial,helvetica,sans-serif; + font-size: 11px; + color: #FFFFFF; +} + + +input { + font-family: arial,helvetica,sans-serif; + font-size: 13px; +} + +textarea { + font-family: "andale mono", "monotype.com", "courier new", monospace; + font-size: 13px; +} + +input.small, select.small { + font-family: arial,helvetica,sans-serif; + font-size: 11px; +} + +textarea.small { + font-family: "andale mono", "monotype.com", "courier new", monospace; + font-size: 11px; +} + +// manual stuff + Index: phpweb/.htaccess diff -u phpweb/.htaccess:1.10 phpweb/.htaccess:1.11 --- phpweb/.htaccess:1.10 Fri Jan 12 12:10:07 2001 +++ phpweb/.htaccess Wed Mar 7 16:17:34 2001 @@ -1,10 +1,8 @@ -<IfModule mod_php3.c> -php3_include_path .:./include:../include:../../include -</IfModule> <IfModule mod_php4.c> -php_value include_path .:./include:../include:../../include +php_value include_path .:./include:../include:../../include +php_flag short_open_tag on </IfModule> -DirectoryIndex index.php index.php3 +DirectoryIndex index.php AddType application/x-pilot .prc .pdb ErrorDocument 404 /error/ ErrorDocument 401 /error/ Index: phpweb/ChangeLog-4.php diff -u phpweb/ChangeLog-4.php:1.6 phpweb/ChangeLog-4.php:1.7 --- phpweb/ChangeLog-4.php:1.6 Wed Dec 20 00:41:42 2000 +++ phpweb/ChangeLog-4.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ -<? -require("shared.inc"); +<?php +require_once 'prepend.inc'; commonHeader("PHP 4 ChangeLog"); ?> Index: phpweb/FAQ.php diff -u phpweb/FAQ.php:1.1 phpweb/FAQ.php:1.2 --- phpweb/FAQ.php:1.1 Mon May 22 11:30:01 2000 +++ phpweb/FAQ.php Wed Mar 7 16:17:34 2001 @@ -1,28 +1,1461 @@ -<?$mod = GMDate("D, d M Y H:i:s",filemtime("FAQ.html")); - Header("Last-Modified: $mod GMT"); - require("shared.inc"); - commonHeader("Frequently Asked Questions"); - - $fd = fopen("FAQ.html", "r"); - - /* turn off magic quotes for broken mirrors... */ - set_magic_quotes_runtime(0); - - /* drop everything until it tells us to stop chopping */ - while (!feof($fd)) { - if (ereg("stop chopping", fgets($fd, 1024))) { - break; - } - } - /* now print everything until it tells us to start chopping again */ - while (!feof($fd)) { - if (!ereg("start chopping", $line = fgets($fd, 1024))) { - echo $line; - } else { - break; +<? +require_once 'prepend.inc'; +commonHeader("Frequently Asked Questions"); +?> + +<h1> +PHP Frequently Asked Questions +</h1> + +<!-- The website should stop chopping. --> + +<p> + +This is a list of Frequently Asked Questions about PHP and +their answers. +<!-- +If you have suggestions, corrections or additions, send them to +<a href="mailto:phpdoc@lists.php.net">phpdoc@lists.php.net</a>. +--> +<p> +<? echo hdelim(); ?> + +<ul> +<li><b><a href="#1">1. General Information</a></b> + <ul> + <li><a href="#1.1">1.1. What is PHP?</a></li> + <li><a href="#1.2">1.2. What is the relation between the versions?</a></li> + <li><a href="#1.3">1.3. Can I run several versions of PHP at the same time?</a></li> + <li><a href="#1.4">1.4. What are the differences between PHP 3 and PHP 4?</a></li> + <li><a href="#1.5">1.5. How did you do those pop-out windows for the Search and Mirror buttons?</a></li> + </ul> +<li><b><a href="#2">2. PHP mailing lists</a></b> + <ul> + <li><a href="#2.1">2.1. Is there a PHP mailing list?</a></li> + <li><a href="#2.2">2.2. Help! I can't seem to subscribe/unsubscribe to/from the mailing list!</a></li> + <li><a href="#2.3">2.3. Is there an archive of the mailing list anywhere?</a></li> + <li><a href="#2.4">2.4. What can I ask the mailing list?</a></li> + <li><a href="#2.5">2.5. What information should I include when posting to the mailing list?</a></li> + </ul> +<li><b><a href="#3">3. Obtaining PHP</a></b> + <ul> + <li><a href="#3.1">3.1. Where can I obtain PHP?</a></li> + <li><a href="#3.2">3.2. Are pre-compiled binary versions available?</a></li> + <li><a href="#3.3">3.3. Where can I get libraries needed to compile some of the optional PHP extensions?</a></li> + <li><a href="#3.4">3.4. How do I get these libraries to work?</a></li> + <li><a href="#3.5">3.5. I got the latest version of the PHP source code from the CVS repository on my Windows 95/NT machine, what do I need to compile it?</a></li> + <li><a href="#3.6">3.6. Where do I find the Browser Capabilities File?</a></li> + </ul> +<li><b><a href="#4">4. Connecting to databases</a></b> + <ul> + <li><a href="#4.1">4.1. I heard it's possible to access Microsoft SQL Server from PHP. How?</a></li> + <li><a href="#4.2">4.2. Can I access Microsoft Access databases?</a></li> + <li><a href="#4.3">4.3. I saw PHP offers persistent database connections. What does that mean?</a></li> + <li><a href="#4.4">4.4. I upgraded to php4, and now mysql keeps telling me "Warning: MySQL: Unable to save result set in ...". What's up? + <li><a href="#4.5">4.5. After installing shared mysql support, Apache dumps core as soon as libphp4.so is loaded. Can this be fixed? + </ul> +<li><b><a href="#5">5. Installation</a></b> + <ul> + <li><a href="#5.1">5.1. Where should my php3.ini file be located?</a></li> + <li><a href="#5.2">5.2. I installed PHP using RPMS, but Apache isn't processing the PHP pages! What's going on here?</a></li> + <li><a href="#5.3">5.3. I installed PHP using RPMS, but it doesn't compile with the database support I need! What's going on here?</a></li> + <li><a href="#5.4">5.4. How do I get these libraries to work?</a></li> + </ul> +<li><b><a href="#6">6. Build Problems</a></b> + <ul> + <li><a href="#6.1">6.1. I got the latest version of PHP using the anonymous CVS service, but there's no configure script!</a></li> + <li><a href="#6.2">6.2. I'm having problems configuring PHP to work with Apache. It says it can't find httpd.h, but it's right where I said it is!</a></li> + <li><a href="#6.3">6.3. When I run configure, it says that it can't find the include files or library for GD, gdbm, or some other package!</a></li> + <li><a href="#6.4">6.4. When it is compiling the file language-parser.tab.c, it gives me errors that say 'yytname undeclared'.</a></li> + <li><a href="#6.5">6.5. When I run 'make', it seems to run fine but then fails when it tries to link the final application complaining that it can't find some files.</a></li> + <li><a href="#6.6">6.6. When linking PHP, it complains about a number of undefined references.</a></li> + <li><a href="#6.7">6.7. I can't figure out how to build PHP with Apache 1.3.</a></li> + <li><a href="#6.8">6.8. I have followed all the steps to install the Apache module version on UNIX, and my PHP scripts show up in my browser or I am being asked to save the file.</a></li> + <li><a href="#6.9">6.9. It says to use: --activate-module=src/modules/php3/libphp3.a, but that file doesn't exist, so I changed it to --activate-module=src/modules/php3/libmodphp3.a and it doesn't work!? What's going on?</a></li> + <li><a href="#6.10">6.10. When I try to build Apache with PHP as a static module using --activate-module=src/modules/php3/libphp3.a it tells me that my compiler is not ANSI compliant.</a></li> + <li><a href="#6.11">6.11. When I try to build PHP using --with-apxs I get strange error messages.</a></li> + <li><a href="#6.12">6.12. During 'make', I get errors in microtime, and a lot of 'RUSAGE_' stuff.</a></li> + </ul> +<li><b><a href="#7">7. Using PHP</a></b> + <ul> + <li><a href="#7.1">7.1. I would like to write a generic PHP script that can handle data coming from any form. How do I know which POST method variables are available?</a></li> + <li><a href="#7.2">7.2. I need to convert all single-quotes (') to a backslash followed by a single-quote. How can I do this with a regular expression?</a></li> + <li><a href="#7.3">7.3. When I do the following, the output is printed in the wrong order, what's going on?</a></li> + <li><a href="#7.4">7.4. Hey, what happened to my newlines?</a></li> + <li><a href="#7.5">7.5. I need to access information in the request header directly. How can I do this?</a></li> + <li><a href="#7.6">7.6. When I try to use authentication with IIS I get 'No Input file specified'.</a></li> + <li><a href="#7.7">7.7. I've followed all the instructions, but still can't get PHP and IIS to work together!</a></li> + <li><a href="#7.8">7.8. My PHP script works on IE and Lynx, but on Netscape some of my output is missing. When I do a "View Source" I see the content in IE but not in Netscape.</a></li> + <li><a href="#7.9">7.10. How am I supposed to mix XML and PHP? It complains about my &lt;?xml&gt; tags!</a></li> + <li><a href="#7.10">7.10. How can I use PHP with FrontPage or Dreamweaver or some other HTML editor that insists on moving my code around?</a></li> + <li><a href="#7.11">7.11. Where can I find a complete list of pre-set variables available to me, and why are these not documented in the PHP documentation?</a></li> + <li><a href="#7.12">7.12. Why do I get an error that looks something like this: "Warning: 0 is not a MySQL result index in &lt;file&gt; on line &lt;x&gt;" or "Warning: Supplied argument is not a valid MySQL result resource in &lt;file&gt; on line &lt;x&gt;?</a></li> + <li><a href="#7.13">7.13. I'm trying to use an &lt;input type="image"&gt; tag, but the $foo.x and $foo.y variables aren't available. Where are they?</a></li> + <li><a href="#7.14">7.14. How do I get all the results from a SELECT MULTIPLE HTML tag? </a></li> + </ul> +<li><b><a href="#8">8. PHP and HTML</a></b> + <ul> + <li><a href="#8.1">8.1. How do I create arrays in a HTML &lt;form&gt;?</a></li> + </ul> +<li><b><a href="#9">9. PHP and other languages</a></b> + <ul> + <li><a href="#9.1">9.1. PHP vs. ASP?</a></li> + <li><a href="#9.2">9.2. Is there an ASP to PHP converter?</a></li> + <li><a href="#9.3">9.3. PHP vs. Cold Fusion?</a></li> + <li><a href="#9.4">9.4. PHP vs. Perl?</a></li> + </ul> +<li><b><a href="#10">10. Common Problems</a></b> + <ul> + <li><a href="#10.1">10.1. I installed PHP, but every time I load a document, I get the message 'Document Contains No Data'! What's going on here?</a></li> + <li><a href="#10.2">10.2. I'm trying to access one of the standard CGI variables (such as $DOCUMENT_ROOT or $HTTP_REFERER) in a user-defined function, and it can't seem to find it. What's wrong?</a></li> + <li><a href="#10.3">10.3. I patched Apache with the FrontPage extensions patch, and suddenly PHP stopped working. Is PHP incompatible with the Apache FrontPage extensions?</a></li> + <li><a href="#10.4">10.4. I think I found a bug! Who should I tell?</a></li> + </ul> +<li><b><a href="#11">11. Migrating from PHP3 to PHP4</a></b> + <ul> + <li><a href="#11.1">11.1. General information</a></li> + <li><a href="#11.2">11.2. Incompatible functions</a></li> + </ul> +<li><b><a href="#12">12. Migrating from PHP2 to PHP3</a></b> +</ul> + +<? echo hdelim(); ?> +<a name="1"> +<h2>1. General Information</h2> +</a> + +<dl> + <dt><b> + <a name="1.1">1.1.</a> What is PHP? + </b></dt> + <dd> + From the <A href="http://www.php.net/manual/">manual</a>: + + <blockquote> + <p>PHP is an HTML-embedded scripting language. Much of + its syntax is borrowed from C, Java and Perl with a couple of unique + PHP-specific features thrown in. The goal of the language is to + allow web developers to write dynamically generated pages quickly. + </blockquote> + A nice introduction to PHP by Stig Sæther Bakken can be found <a + href="http://www.zend.com/zend/art/intro.php">here</a> on the Zend + website. + <p> + </dd> + + <dt><b> + <a name="1.2">1.2.</a> What is the relation between the versions? + </b></dt> + <dd> + PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 + is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the latest + generation of PHP, which uses the <? print_Link("http://www.zend.com/", "Zend engine"); ?> + under the hood. + <p> + </dd> + <dt><b> + <a name="1.3">1.3.</a> Can I run several versions of PHP at the same time? + </b></dt> + <dd> + Yes. See the INSTALL file that is included in the PHP 4 source distribution. + <p> + + <dt><b> + <a name="1.4">1.4.</a> What are the differences between PHP 3 and PHP 4? + </b></dt> + <dd> + There are <a href="http://www.zend.com/zend/art/">a couple of articles</a> written on this by the authors of PHP4. Here's a list of some of the more important new features: + <ul> + <li>Extended API module + <li>Generalized build process under UNIX + <li>Generic web server interface that also supports multi-threaded web servers + <li>Improved syntax highlighter + <li>Native HTTP session support + <li>Output buffering support + <li>More powerful configuration system + <li>Reference counting + </ul> + Please see the <a href="http://www.zend.com/zend/whats-new.php">What's new in PHP4 overview</a> for a detailed explanation of these features and more. + <p> + </dd> + + <dt><b> + <a name="1.5">1.5.</a> How did you do those pop-out windows for the Search and Mirror buttons on the PHP site (www.php.net)? + </b></dt> + <dd> + Our site designer, Colin Viebrock (<A href="mailto:cmv@privateworld.com">cmv@privateworld.com</a>), says: + + <BLOCKQUOTE> + <p>Those fancy pop-out layers are done with Dynamic HTML (DHTML), Cascading Style Sheets (CSS) and Javascript (version 1.2).<p> + There are plenty of references on the web about DHTML and CSS, including: + <p><ul> + <li>CSS Level 1 Spec: <a href="http://www.w3.org/TR/REC-CSS1">www.w3.org/TR/REC-CSS1</a> + <li>Macromedia's DHTML Zone: <a href="http://www.dhtmlzone.com/index.html">www.dhtmlzone.com/index.html</a> + <li>Webreference's DHTML Lab: <a href="http://www.webreference.com/dhtml/">www.webreference.com/dhtml/</a> + <li>Guide to Cascading Style Sheets: <a href="http://www.htmlhelp.com/reference/css/">www.htmlhelp.com/reference/css/</a> + <li>Dynamic Duo - Cross-Browser DHTML: <a href="http://www.dansteinman.com/dynduo/">www.dansteinman.com/dynduo/</a> + <li>Netscape's Guide to JS 1.2: <a href="http://developer.netscape.com/docs/manuals/communicator/jsguide/js1_2.htm">developer.netscape.com/docs/manuals/communicator/jsguide/js1_2.htm</a> + </ul> + <p>But your best source of information is to view the source code to the pages on the PHP site. + To see the actual DHTML/Javascript code, use your browser's "View Source" function. To see how this code was + generated dynamically using PHP, click on the "Source" button in the upper-right corner of any PHP page. You + will probably also want to view the source of the "shared.inc" file - there is a link to it at the bottom of every + source page. + </BLOCKQUOTE><p> + + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="2"> +<h2>2. PHP mailing lists</h2> +</a> + +<dl> + <dt><b> + <a name="2.1">2.1.</a> Is there a PHP mailing list? + </b></dt> + <dd> + Of course! To subscribe, send mail to + <code>php-general-subscribe@lists.php.net</code>. You don't need to include + anything special in the subject or body of the message. + + <p>To unsubscribe, send mail to <code>php-general-unsubscribe@lists.php.net</code>. + <p> + </dd> + + <dt><b> + <a name="2.2">2.2.</a> Help! I can't seem to subscribe to the mailing list! + Help! I can't seem to unsubscribe from the mailing list! + </b></dt> + <dd> + If you have problems subscribing to or unsubscribing from the + PHP mailng list, it may be because the mailing list software + can't figure out the correct mailing address to use. If + your email address was <code>joeblow@example.com</code>, + you can send your subscription request to + <code>php-general-subscribe-joeblow=example.com@lists.php.net</code>, + or your unsubscription request to + <code>php-general-unsubscribe-joeblow=example.com@lists.php.net</code>. + <p> + </dd> + + <dt><b> + <a name="2.3">2.3.</a> Is there an archive of the mailing list anywhere? + </b></dt> + <dd> + Yes, you will find a list of archive sites on the <a href="/support.php">Support</a> + page.<p> + </dd> + <dt><b> + <a name="2.4">2.4.</a> What can I ask the mailing list? + </b></dt> + <dd> + Since PHP is growing more and more popular by the day the traffic has increased on the PHP mailing list and as of now the list gets about 150 to 200 posts a day. Because of this it + is in everyones interest that you use the list as a last resort when you have looked everywhere else. + </P><p> + Before you post to the list please have a look in this FAQ and the manual to see if you can find the help there. If there is nothing to be found there try out the mailing list + archives (see above). If you're having problem with installing or configuring PHP please read through all included documentation and README's. If you still can't find any information + that helps you out you're more than welcome to use the mailing list. + </dd> + <p> + <dt><b> + <a name="2.5">2.5.</a> What information should I include when posting to the mailing list? + </b></dt> + <dd> + Posts like "I can't get PHP up and running! Help me! What is + wrong?" are of absolutely no use to anyone. If you're having problems + getting PHP up and running you must include what operating system + you are running on, what version of PHP you're trying to set up, + how you got it (pre-compiled, CVS, RPMs and so on), what you have + done so far, where you got stuck and the exact error message. + <p> + This goes for any other problem as well. You have to include + information on what you have done, where you got stuck, what + you're trying to do and, if applicable, exact error messages. If + you're having problems with your source code you need to include + the part of the code that isn't working. Do not include more code + than necessary though! It makes the post hard to read and a lot of + people might just skip it all together because of this. If you're + unsure about how much information to include in the mail it's better + that you include to much than to little. + <p> + Another important thing to remember is to summarize your problem + on the subject line. A subject like "HELP MEEEE!!!" or "What is the + problem here?" will be ignored by the majority of the readers. + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="3"> +<h2>3. Obtaining PHP</h2> +</a> + +<dl> + <dt><b> + <a name="3.1">3.1.</a> Where can I obtain PHP? + </b></dt> + <dd> + You can download PHP from any of the members of the + PHP network of sites. These can be found at <A + href="http://www.php.net/">http://www.php.net/</a>. + You can also use anonymous CVS to get the absolute latest + version of the source. For more information, go to <A + href="http://cvs.php.net">http://cvs.php.net</a>. + <p> + </dd> + + <dt><b> + <a name="3.2">3.2.</a> Are pre-compiled binary versions available? + </b></dt> + <dd> + Yes, although they are not always up to date. The Windows binary is + generally current, but the Unix binaries lag behind and are only available + for certain platforms. All download are available in the <a href="/downloads.php"> + Downloads</a> section. + <p> + </dd> + + <dt><b> + <a name="3.3">3.3.</a> Where can I get libraries needed to compile some of the optional + PHP extensions? + </b></dt> + <dd> + <b>Note:</b> Those marked with * are not thread-safe libraries, and + should not be used with PHP as a server module in the multi-threaded + Windows web servers (IIS, Netscape). This does not matter in Unix + environments, yet. + + <ul> + <li>LDAP (unix): <a href="ftp://ftp.openldap.org/pub/openldap/openldap-stable.tgz">ftp://ftp.openldap.org/pub/openldap/openldap-stable.tgz</a> + <li>LDAP* (unix): <A href="ftp://terminator.rs.itd.umich.edu/ldap/ldap-3.3.tar.Z">ftp://terminator.rs.itd.umich.edu/ldap/ldap-3.3.tar.Z</a> + <li>LDAP (unix/win): <a href="http://developer.netscape.com/tech/directory/downloads.html" TARGET="_top">Netscape Directory (LDAP) SDK 1.1</a> + There is also a free LDAP server at: <A href="ftp://ftp.critical-angle.com/pub/cai/slapd/">ftp://ftp.critical-angle.com/pub/cai/slapd/</a>. + <li>Berkeley DB2 (Unix/Win): <A href="http://www.sleepycat.com/">http://www.sleepycat.com/</a> + <li>SNMP* (Unix): <A href="http://www.ece.ucdavis.edu/ucd-snmp/">http://www.ece.ucdavis.edu/ucd-snmp/</a> (Note: PHP uses the native SNMP interface in Windows.) + <li>GD* (Unix/Win): <A href="http://www.boutell.com/gd/#buildgd">http://www.boutell.com/gd/#buildgd</a> + <li>mSQL* (Unix): <A href="http://www.hughes.com.au/">http://www.hughes.com.au/</a> + <li>mSQL* (Win) : <a href="http://blnet.com/msqlpc/">MSQL PC Home Page</a> + <li>MySQL (Unix): <A href="http://www.mysql.com/">http://www.mysql.com/</a> + <li>IMAP* (Win/Unix): <a href="ftp://ftp.cac.washington.edu/imap/old/imap-4.5.tar.Z">ftp://ftp.cac.washington.edu/imap/old/imap-4.5.tar.Z</a> + <li>Sybase-CT* (Linux, libc5): <A href="/extra/ctlib-linux-elf.tar.gz">Available locally</a> + <li>FreeType (libttf): <a href="http://www.freetype.org/">http://www.freetype.org/</a> + <li>ZLib (Unix/Win32): <a href="http://www.cdrom.com/pub/infozip/zlib/">http://www.cdrom.com/pub/infozip/zlib/</a> + <li>expat XML parser (Unix/Win32): <a href="http://www.jclark.com/xml/expat.html">http://www.jclark.com/xml/expat.html</a> + <li>PDFLib: <a href="http://www.pdflib.com">http://www.pdflib.com</a> + <li>mcrypt: <a href="ftp://argeas.cs-net.gr/pub/unix/mcrypt/">ftp://argeas.cs-net.gr/pub/unix/mcrypt/</a> + <li>mhash: <a href="http://sasweb.de/mhash/">http://sasweb.de/mhash/</a> + <li>t1lib: <a href="http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/rmz/t1lib/t1lib.html">http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/rmz/t1lib/t1lib.html</a> + <li>dmalloc: <a href="http://www.dmalloc.com/">http://www.dmalloc.com/</a> + <li>aspell: <a href="http://download.sourceforge.net/aspell/aspell-.29.1.tar.gz">http://download.sourceforge.net/aspell/aspell-.29.1.tar.gz</a> + <li>Readline: <a href="ftp://prep.ai.mit.edu/pub/gnu/readline/">ftp://prep.ai.mit.edu/pub/gnu/readline/</a> + </ul> + <p> + </dd> + + <dt><b> + <a name="3.4">3.4.</a> How do I get these libraries to work? + </b></dt> + <dd> + You will need to follow instructions provided with the library. Some of + these libraries are detected automatically when you run the 'configure' + script of PHP (such as the GD library), and others you will have to + enable using '--with-EXTENSION' options to 'configure'. Run 'configure + --help' for a listing of these. + <p> + </dd> + + <dt><b> + <a name="3.5">3.5.</a> I got the latest version of the PHP source code from the CVS + repository on my Windows 95/NT machine, what do I need to compile it? + </b></dt> + <dd> + First, you will need Microsoft Visual C++ v6 (v5 may do + it also, but we do it with v6), and you will need to <A + href="http://www.php.net/extra/win32build.zip">download the + support files</a>. You will need to unzip this file (which + has subdirectories, so make sure your unzip program keeps them) + into the win32 subdirectory of the source distribution. + <p> + </dd> + + <dt><b> + <a name="3.6">3.6.</a> Where do I find the Browser Capabilities File? + </b></dt> + <dd> + You can find a browscap.ini file at <a href="http://www.cyscape.com/asp/browscap/">http://www.cyscape.com/asp/browscap/</a>. + <p> + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="4"> +<h2>4. Connecting to databases</h2> +</a> + +<dl> + <dt><b> + <a name="4.1">4.1.</a> I heard it's possible to access Microsoft SQL Server from PHP. How? + </b></dt> + <dd> + On Windows 95/NT machines, you can simply use the included ODBC support + and the correct ODBC driver. + + <p>A copy of step-by-step ODBC setup can be found <a href="/manual/config-odbc.html">here</a>. + + <p>On Unix machines, you can use the Sybase-CT driver + to access Microsoft SQL Servers because they are (at + least mostly) protocol-compatible. Sybase has made a <A + href="/extra/ctlib-linux-elf.tar.gz">free version of the necessary + libraries for Linux systems</a>. For other Unix operating systems, + you need to contact Sybase for the correct libraries. Also see + the answer to the next question - 4.2. + <p> + </dd> + + <dt><b> + <a name="4.2">4.2.</a> Can I access Microsoft Access databases? + </b></dt> + <dd> + Yes. You already have all the tools you need if you are running + entirely under Windows 95/98 or NT, where you can use ODBC and Microsoft's + ODBC drivers for Microsoft Access databases.<p> + If you are running PHP on a Unix box and want to talk to MS-Access on + a Windows box you will need Unix ODBC drivers. + <A href="http://www.openlinksw.com/">OpenLink Software</a> has Unix-based + ODBC drivers that can do this. There is a free pilot program where you + can download an evaluation copy that doesn't expire and prices start at + $675 for the commercial supported version. + + <p>Another alternative is to use an SQL server that has + Windows ODBC drivers and use that to store the data, which you can + then access from Microsoft Access (using ODBC) and PHP (using the + built-in drivers), or to use an intermediary file format that Access + and PHP both understand, such as flat-files or dBase databases. + On this point Tim Hayes from OpenLink software writes: +<blockquote><blockquote> +Using another database as an intermediary is not a good idea, when you can +use ODBC from PHP straight to your database - i.e. with OpenLink's drivers. If +you do need to use an intermediary file format, OpenLink have now released +Virtuoso (a virtual database engine) for NT, Linux and other unix platforms. +Please visit our +<A href="http://www.openlinksw.com/">website</a> for a free download. +</blockquote></blockquote> + + <p>One option that has proven successful is to use MySQL and its + MyODBC drivers on Windows and synchronizing the databases. Steve Lawrence + writes: +<blockquote><blockquote> +<ol> +<li> Install MySQL on your platform according to instructions with MySQL. +Latest available from www.mysql.org (get it from your mirror!). No special +configuration required except when you set up a database, and configure the +user account, you should put % in the host field, or the host name of the +Windows computer you wish to access MySQL with. Make a note of your server +name, username, and password.<p> + +<li> Download the MyODBC for Windows driver from the MySQL site. Latest +release is myodbc-2_50_19-win95.zip (NT available too, as well as source +code). Install it on your Windows machine. You can test the operation with +the utilities included with this program.<p> + +<li> Create a user or system dsn in your ODBC administrator, located in the +control panel. Make up a dsn name, enter your hostname, user name, password, +port, etc for you MySQL database configured in step 1.<p> + +<li> Install Access with a full install, this makes sure you get the proper +add-ins.. at the least you will need ODBC support and the linked table +manager.<p> + +<li> Now the fun part! Create a new access database. In the table window right +click and select Link Tables, or under the file menu option, select Get +External Data and then Link Tables. When the file browser box comes up, +select files of type: ODBC. Select System dsn and the name of your dsn +created in step 3. Select the table to link, press ok, and presto! you can +now open the table and add/delete/edit data on your MySQL server! You can +also build queries, import/export tables to MySQL, build forms and reports, +etc.<p> +</ol> +<b>Tips and Tricks:</b> +- You can construct your tables in access and export them to MySQL, then +link them back in. That makes table creation quick.<br> +- When creating tables in access, you must have a primary key defined in +order to have write access to the table in access. Make sure you create a +primary key in MySQL before linking in access.<br> +- If you change a table in MySQL, you have to re-link it in access. Go to +tools&gt;add-ins&gt;linked table manager, cruise to your ODBC DSN, and select the +table to re-link from there. you can also move your dsn source around there, +just hit the always prompt for new location checkbox before pressing ok. +</blockquote></blockquote> + <p> + </dd> + + <dt><b> + <a name="4.3">4.3.</a> I saw PHP offers persistent database connections. What does that mean? + </b></dt> + <dd> + Persistent connections are SQL links that do not close when the + execution of your script ends. When a persistent connection is + requested, PHP checks if there's already an identical persistent + connection (that remained open from earlier) - and if it exists, it + uses it. If it does not exist, it creates the link. An 'identical' + connection is a connection that was opened to the same host, with + the same username and the same password (where applicable). + + <p>People who aren't thoroughly familiar with the way web servers + work and distribute the load may mistake persistent connects for what + they're not. In particular, they do <b>not</b> give you an ability + to open 'user sessions' on the same SQL link, they do <b>not</b> + give you an ability to build up a transaction efficently, and they + don't do a whole lot of other things. In fact, to be extremely + clear about the subject, persistent connections don't give you <b>any</b> + functionality that wasn't possible with their non-persistent brothers. + + <p>Why? + + <p>This has to do with the way web servers work. There are three ways + in which your web server can utilize PHP to generate web pages. + + <p>The first method is to use PHP as a CGI "wrapper". When run this + way, an instance of the PHP interpreter is created and destroyed for + every page request (for a PHP page) to your web server. Because it + is destroyed after every request, any resources that it acquires (such + as a link to an SQL database server) are closed when it is destroyed. + In this case, you do not gain anything from trying to use persistent + connections -- they simply don't persist. + + <p>The second, and most popular, method is to run PHP as a module + in a <I>multiprocess</I> web server, which currently only includes + Apache. A multiprocess server typically has one process (the parent) + which coordinates a set of processes (its children) who actually do + the work of serving up web pages. When each request comes in from a a + client, it is handed off to one of the children that is not already + serving another client. This means that when the same client makes + a second request to the server, it may be serviced by a different + child process than the first time. What a persistent connection does + for you in this case it make it so each child process only needs + to connect to your SQL server the first time that it serves a page + that makes us of such a connection. When another page then requires + a connection to the SQL server, it can reuse the connection that + child established earlier. + + <p>The last method is to use PHP as a plug-in for a <I>multithreaded</I> + web server. Currently this is only theoretical -- PHP does not + yet work as a plug-in for any multithreaded web servers. Work is + progressing on support for ISAPI, WSAPI, and NSAPI (on Windows), + which will all allow PHP to be used as a plug-in on multithreaded + servers like Netscape FastTrack, Microsoft's Internet Information + Server (IIS), and O'Reilly's WebSite Pro. When this happens, the + behavior will be essentially the same as for the multiprocess model + described before. + + <p>If persistent connections don't have any added functionality, + what are they good for? + + <p>The answer here is extremely simple -- efficiency. Persistent + connections are good if the overhead to create a link to your SQL + server is high. Whether or not this overhead is really high depends + on many factors. Like, what kind of database it is, whether or + not it sits on the same computer on which your web server sits, + how loaded the machine the SQL server sits on is and so forth. + The bottom line is that if that connection overhead is high, + persistent connections help you considerably. They cause the child + process to simply connect only once for its entire lifespan, instead + of every time it processes a page that requires connecting to the + SQL server. This means that for every child that opened a persistent + connection will have its own open persistent connection to the server. + For example, if you had 20 different child processes that ran a script + that made a persistent connection to your SQL server, you'd have 20 + different connections to the SQL server, one from each child. + + <p>An important summary. Persistent connections were designed to + have one-to-one mapping to regular connections. That means that you + should <b>always</b> be able to replace persistent connections with + non-persistent connections, and it won't change the way your script + behaves. It <b>may</b> (and probably will) change the efficiency + of the script, but not its behavior! + <p> + </dd> + + <dt><b> + <a name="4.4">4.4.</a> I upgraded to php4, and now mysql keeps telling + me "Warning: MySQL: Unable to save result set in ...". What's up? + </b></dt> + <dd> + <p> + Most likely what has happened is, PHP4 was compiled with the '--with-mysql' + option, without specifying the path to mysql. This means PHP is using its + built-in mysql client library. If your system is running applications, + such as php3 as a concurrent Apache module, or auth-mysql, that use other + versions of mysql clients, then there is a conflict between the two + differing versions of those clients. + </p> + <p> + Recompiling php4, and adding the path to mysql to the flag, + '--with-mysql=/your/path/to/mysql' usually solves the problem. + </p> + <p> + </dd> + + <dt><b> + <a name="4.5">4.5.</a> After installing shared mysql support, Apache dumps + core as soon as libphp4.so is loaded. Can this be fixed? + </b></dt> + <dd> + <p> + If your MySQL libs are linked against pthreads this will happen. Check + using ldd. If they are, grab the MySQL tarball and compile from source, + or recompile from the source rpm and remove the switch in the spec file + that turns on the threaded client code. Either of these suggestions will + fix this. Then recompile PHP with the new mysql libs. + </p> + <p> + </p> + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="5"> +<h2>5. Installation</h2> +</a> + +<p>To install PHP, follow the instructions in the <A +href="http://cvsweb.php.net/viewcvs.cgi/php3/INSTALL?rev=1.31&content-type=text/vnd.viewcvs-markup">INSTALL</a> +file located in the distribution. Windows +95 and NT users should also read the <A +href="http://cvsweb.php.net/viewcvs.cgi/php3/README.WIN32?rev=1.6&content-type=text/vnd.viewcvs-markup">README.WIN32</a> +file. There are also some helpful hints for Windows users +<a href="/manual/config-apache-nt.html">here</a>. +<p>If you are trying to install PHP for use with Netscape's web server on +Unix see: <a href="http://www.webgenx.com/php/phpnes.php3">http://www.webgenx.com/php/phpnes.php3</a> +<dl> + <dt><b> + <a name="5.1">5.1.</a> Where should my <i>php3.ini</i> file be located? + </b></dt> + <dd> + By default on UNIX it should be in <i>/usr/local/lib</i>. Most people will want + to change this at compile-time with the --with-config-file-path flag. You would, for + example, set it to something like: + <pre> + --with-config-file-path=/etc + </pre> + And then you would copy <i>php3.ini-dist</i> from the distribution to <i>/etc/php3.ini</i> and + edit it to make any local changes you want. + <p> + </dd> + + <dt><b> + <a name="5.2">5.2.</a> I installed PHP from an RPM, but Apache isn't processing the PHP pages! What's going on here? + </b></dt> + <dd> + <ul> +<li>Assuming you installed both Apache and PHP from RPM packages, you need to uncomment or add some or all of the following lines in your http.conf file:<br> +<PRE> +# Extra Modules +AddModule mod_php.c +AddModule mod_php3.c +AddModule mod_perl.c + +# Extra Modules +LoadModule php_module modules/mod_php.so +LoadModule php3_module modules/libphp3.so /* for PHP 3 */ +LoadModule php4_module modules/libphp4.so /* for PHP 4 */ +LoadModule perl_module modules/libperl.so +</PRE> + +<li>And add:<br> +<PRE> +AddType application/x-httpd-php3 .php3 /* for PHP 3 */ +AddType application/x-httpd-php .php /* for PHP 4 */ +</PRE> +... to the global properties, or to the properties of the VirtualDomain you want to have PHP support added to. +</ul><p></dd> + + <dt><b> + <a name="5.3">5.3.</a> I installed PHP from an RPM, but it doesn't + compile with the database support I need! What's going on here? + </b></dt> + <dd> + Due to the way PHP is currently built, it is not easy to build a + complete flexible PHP RPM. This issue will be addressed in PHP 4. + For PHP, we currently suggest you use the mechanism described in the + INSTALL.REDHAT file in the PHP distribution. If you insist on using + an RPM version of PHP, read on... + <p>Currently the RPM packagers are setting up the RPMS to install + without database support to simplify installations <strong>and</strong> + because RPMS use /usr/ instead of the standard /usr/local/ directory for + files. You need to tell the RPM spec file which databases to support + and the location of the <em>top-level</em> of your database server. + <p>This example will explain the process of adding support for the + popular MySQL database server, using the mod installation for Apache. + <p>Of course all of this information can be adjusted for any database + server that PHP supports. We will assume you installed MySQL and Apache + completely with RPMS for this example as well. + + <ul> + <li>First remove mod_php3<br> + <code>rpm -e mod_php3</code><br> + + <li>Then get the source rpm and INSTALL it, NOT --rebuild<br> + <code>rpm -Uvh mod_php3-3.0.5-2.src.rpm</code><br> + <li>Then edit the /usr/src/redhat/SPECS/mod_php3.spec file<br> + In the %build section add the database support you want, and the path.<br> + For MySQL you would add <code>--with-mysql=/usr \</code><br> + The %build section will look something like this:<br> + + <pre> + ./configure --prefix=/usr \ + --with-apxs=/usr/sbin/apxs \ + --with-config-file-path=/usr/lib \ + --enable-debug=no \ + --enable-safe-mode \ + --with-exec-dir=/usr/bin \ + --with-mysql=/usr \ + --with-system-regex + </pre> + + <li>Once this modification is made then build the binary rpm as follows:<br> + <code>rpm -bb /usr/src/redhat/SPECS/mod_php3.spec </code><br> + <li>Then install the rpm<br> + <code>rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm</code><br> + </ul> + + Make sure you restart Apache, and you now have PHP with MySQL support + using RPM's. Note that it is probably much easier to just build + from the distribution tarball of PHP and follow the instructions in + INSTALL.REDHAT found in that distribution. + <p> + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="6"> +<h2>6. Build Problems</h2> +</a> + +<dl> + <dt><b> + <a name="6.1">6.1.</a> I got the latest version of PHP using the anonymous CVS service, + but there's no configure script! + </b></dt> + <dd> + You have to have the GNU autoconf package installed so you can + generate the configure script from configure.in. Just run + <code>./buildconf</code> in the top-level directory after getting + the sources from the CVS server. (Also, unless you run configure + with the <code>--enable-maintainer-mode</code> option, the + configure script will not automatically get rebuilt when the + configure.in file is updated, so you should make sure to do that + manually when you notice configure.in has changed. One symptom + of this is finding things like @VARIABLE@ in your Makefile after + configure or config.status is run.) + <p> + </dd> + <dt><b> + <a name="6.2">6.2.</a> I'm having problems configuring PHP to work with Apache. It says + it can't find httpd.h, but it's right where I said it is! + </b></dt> + <dd> + You need to tell the configure/setup script the location of the + <EM>top-level</EM> of your Apache source tree. This means that + you want to specify '<code>--with-apache=/path/to/apache</code>' + and <EM>not</EM> '<code>--with-apache=/path/to/apache/src</code>'. + <p> + </dd> + <dt><b> + <a name="6.3">6.3.</a> When I run configure, it says that it can't find the include files or + library for GD, gdbm, or some other package! + </b></dt> + <dd> + You can make the configure script looks for header files and libraries + in non-standard locations by specifying additional flags to pass to + the C preprocessor and linker, such as: +<FONT FACE="monospaced"><pre> + CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure +</pre></FONT> + If you're using a csh-variant for your login shell (why?), it would be: +<FONT FACE="monospaced"><pre> + env CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure +</pre></FONT> + <p> + </dd> + + <dt><b> + <a name="6.4">6.4.</a> When it is compiling the file language-parser.tab.c, it gives me errors + that say 'yytname undeclared'. + </b></dt> + <dd> + You need to update your version of Bison. You can find the latest version + at <A href="ftp://ftp.gnu.org/pub/gnu/bison/">ftp://ftp.gnu.org/pub/gnu/bison/</a>. + <p> + </dd> + + <dt><b> + <a name="6.5">6.5.</a> When I run 'make', it seems to run fine but then fails when it + tries to link the final application complaining that it can't find + some files. + </b></dt> + <dd> + Some old versions of make that don't correctly put the compiled + versions of the files in the functions directory into that same + directory. Try running "<code>cp *.o functions</code>" and then + re-running 'make' to see if that helps. If it does, you should really + upgrade to a recent version of GNU make. + <p> + </dd> + + <dt><b> + <a name="6.6">6.6.</a> When linking PHP, it complains about a number of undefined references. + </b></dt> + <dd> + Take a look at the link line and make sure that all of the appropriate + libraries are being included at the end. Common ones that you might have + missed are '-ldl' and any libraries required for any database support + you included. + <p> + If you're linking with Apache 1.2.x, did you remember to add the + appropriate information to the EXTRA_LIBS line of the Configuration + file and re-rerun Apache's Configure script? See the <A href="http://cvsweb.php.net/viewcvs.cgi/php3/INSTALL?rev=1.31&content-type=text/vnd.viewcvs-markup">INSTALL</a> file that + comes with the distribution for more information. + <p> + Some people have also reported that they had to add '-ldl' immediately + following 'libphp3.a' when linking with Apache. + <p> + </dd> + + <dt><b> + <a name="6.7">6.7.</a> I can't figure out how to build PHP with Apache 1.3. + </b></dt> + <dd> + <p>This is actually quite easy. Follow these steps carefully: + <ul> + <li>Grab the latest Apache 1.3 distribution from <A href="http://www.apache.org/dist/">www.apache.org</a>. + <li>Ungzip and untar it somewhere, for example /usr/local/src/apache-1.3. + <li>Compile PHP by first running ./configure --with-apache=/<i>&lt;path&gt;</i>/apache-1.3 (substitute <i>&lt;path&gt;</i> for the actual path to your apache-1.3 directory. + <li>Type 'make' followed by 'make install' to build PHP and copy the + necessary files to the Apache distribution tree. + <li>Change directories into to your /<i>&lt;path&gt;</i>/apache-1.3/src directory and edit the <i>Configuration</i> file. At the end of the file, add: <tt>AddModule modules/php3/libphp3.a</tt>. + <li>Type: './Configure' followed by 'make'. + <li>You should now have a PHP-enabled httpd binary! + </ul> + <b>Note:</b> You can also use the new Apache ./configure script. See the instructions in the README.configure file + which is part of your Apache distribution. Also have a look at the INSTALL file in the PHP distribution. + <p> + </dd> + <dt><b> + <a name="6.8">6.8.</a> I have followed all the steps to install the Apache module version on UNIX, and my + PHP scripts show up in my browser or I am being asked to save the file. Help! + </b></dt> + <dd> + <p>This means that the PHP module is not getting invoked for some reason. Three things to check before + asking for further help: + <ul> + <li> Make sure that the httpd binary you are running is the actual new httpd binary you just built. To do this, +try running: <i>/path/to/binary/httpd -l</i><br> +If you don't see <b>mod_php3.c</b> listed then you are not running the right binary. Find and install the correct binary. + <li> Make sure you have added the correct Mime Type to one of your Apache .conf files. +It should be: <b><i>AddType application/x-httpd-php3 .php3</i></b> (for PHP 3)<br> +or <b><i>AddType application/x-httpd-php .php</i></b> (for PHP 4)<br> +Also make sure that this AddType line is not hidden away inside a &lt;Virtualhost&gt; or &lt;Directory&gt; block which would +prevent it from applying to the location of your test script. + <li> Finally, the default location of the Apache configuration files changed between Apache 1.2 and Apache 1.3. You +should check to make sure that the configuration file you are adding the AddType line to is actually being read. +You can put an obvious syntax error into your httpd.conf file or some other obvious change that will tell you if +the file is being read correctly. + </ul> + <p> + </dd> + + <dt><b> + <a name="6.9">6.9.</a> It says to use: --activate-module=src/modules/php3/libphp3.a, but that file + doesn't exist, so I changed it to --activate-module=src/modules/php3/libmodphp3.a and it doesn't work!? + What's going on? + </b></dt> + <dd> + Well, you decided to try to outsmart the people who wrote those nice step-by-step instructions for you and you + have now discovered that these people cannot be outsmarted. The libphp3.a file is not supposed to + exist. The Apache build process will create it.<p> + </dd> + + <dt><b> + <a name="6.10">6.10.</a> When I try to build Apache with PHP as a static module using + --activate-module=src/modules/php3/libphp3.a it tells me that my compiler is not ANSI + compliant. + </b></dt> + <dd> + This is a misleading error message from Apache that has been fixed + in more recent versions. + </dd> + <dt><b> + <a name="6.11">6.11.</a> When I try to build PHP using --with-apxs I get strange error messages + </b></dt> + <dd> + There are three things to check here. First, for some reason + when Apache builds the apxs Perl script, it sometimes ends up + getting built without the proper compiler and flags variables. + Edit your apxs (sometimes found in /usr/local/apache/bin/apxs + or /usr/sbin/apxs) and check for these lines: +<pre>my $CFG_CFLAGS_SHLIB = '&nbsp;'; # substituted via Makefile.tmpl +my $CFG_LD_SHLIB = '&nbsp;'; # substituted via Makefile.tmpl +my $CFG_LDFLAGS_SHLIB = '&nbsp;'; # substituted via Makefile.tmpl</pre> + If this is what you see, you have found your problem. Change these lines to say: +<pre>my $CFG_CFLAGS_SHLIB = '-fpic -DSHARED_MODULE'; # substituted via Makefile.tmpl +my $CFG_LD_SHLIB = 'gcc'; # substituted via Makefile.tmpl +my $CFG_LDFLAGS_SHLIB = q(-shared);# substituted via Makefile.tmpl </pre> + The second possible problem should only be an issue on RedHat-6.1/6.2. + The apxs script RedHat ships is broken. Look for this line: +<pre>my $CFG_LIBEXECDIR = 'modules'; # substituted via APACI install</pre> + If you see the above line, change it to this: +<pre>my $CFG_LIBEXECDIR = '/usr/lib/apache'; # substituted via APACI install</pre> + Last, if you reconfigure/reinstall Apache, add a 'make clean' to the process after + './configure' and before 'make'. + <p> + </dd> + <dt><b> + <a name="6.12">6.12.</a>During 'make', I get errors in microtime, and a lot of 'RUSAGE_' stuff. + </b></dt> + <dd> + During the 'make' portion of installation, if you encounter problems that look similar + to this: + <p><pre> + microtime.c: In function `php_if_getrusage': + microtime.c:94: storage size of `usg' isn't known + microtime.c:97: `RUSAGE_SELF' undeclared (first use in this function) + microtime.c:97: (Each undeclared identifier is reported only once + microtime.c:97: for each function it appears in.) + microtime.c:103: `RUSAGE_CHILDREN' undeclared (first use in this function) + make[3]: *** [microtime.lo] Error 1 + make[3]: Leaving directory `/home/master/php-4.0.1/ext/standard' + make[2]: *** [all-recursive] Error 1 + make[2]: Leaving directory `/home/master/php-4.0.1/ext/standard' + make[1]: *** [all-recursive] Error 1 + make[1]: Leaving directory `/home/master/php-4.0.1/ext' + make: *** [all-recursive] Error 1 + </pre></p> + Your system is broken. You need to fix your /usr/include files either by making sure + your /usr/include/linux symlink is pointing to the right place in your kernel sources or + by installing a glibc-devel package that matches your glibc. This has absolutely nothing + to do with PHP. To prove this to yourself, try this simple test: + <p><pre> + $ cat &gt;test.c &lt;&lt;X + #include &lt;sys/resource.h&gt; + X + + $ gcc -E test.c &gt;/dev/null + </pre> + If that spews out errors, you know your include files are messed up. + </p> + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="7"> +<h2>7. Using PHP</h2> +</a> + +<dl> + <dt><b> + <a name="7.1">7.1.</a> I would like to write a generic PHP script + that can handle data coming from any form. How do I know which POST + method variables are available? + </b></dt> + <dd> + Make sure that the <i>track_vars</i> feature is + enabled in your php3.ini file. If you compiled PHP with + &quot;--enable-track-vars&quot; it will be on by default. + Alternatively you can enable it at run-time on a per-script + basis by putting &lt;?php_track_vars?&gt; at the top of your file. + When <i>track_vars</i> is on, it creates three associative arrays. + $HTTP_GET_VARS, $HTTP_POST_VARS and $HTTP_COOKIE_VARS. So, to + write a generic script to handle POST method variables you would + need something similar to the following:<pre> + while (list($var, $value) = each($HTTP_POST_VARS)) { + echo "$var = $value&lt;br&gt;\n"; + }</pre> + <p> + </dd> + + <dt><b> + <a name="7.2">7.2.</a> I need to convert all single-quotes (') + to a backslash followed by a single-quote. How can I do this with + a regular expression? + </b></dt> + <dd> + First off, take a look at the <A href="manual/function.addslashes.php3">addslashes()</a> function. It will do + exactly what you want. You should also have a look at the magic_quotes_gpc directive in your php3.ini + file. + <p> + The ereg_replace magic you're looking for, however, is simply:<pre> + $escaped = ereg_replace(&quot;'&quot;, &quot;\\'&quot;, $input);</pre> + <p> + </dd> + + <dt><b> + <a name="7.3">7.3.</a> When I do the following, the output is printed in the wrong order:<pre> + function myfunc($argument) { + echo $argument + 10; + } + $variable = 10; + echo "myfunc($variable) = " . myfunc($variable); + </pre> + <p>What's going on? + </b></dt> + <dd> + To be able to use the results of your function in an expression (such + as concatenating it with other strings in the example above), you need + to <b>return</b> the value, not echo it. + <p> + </dd> + + <dt><b> + <a name="7.4">7.4.</a> Hey, what happened to my newlines in: +<pre> +&lt;PRE&gt; + 1 &lt;?echo $result[1];?&gt; + 2 &lt;?echo $result[2];?&gt; +</pre> + </b></dt> + <dd> + In PHP, the ending for a block of code is either "?&gt;" <b>or</b> + "?&gt;\n" (where \n means a newline). This means that you need to + insert an extra newline after each block of PHP code in the above + example. + <p> + Why does PHP do this? Because when formatting normal HTML, this + usually makes your life easier because you don't want that newline, + but you'd have to create extremely long lines or otherwise make the + raw page source unreadable to achieve that effect. + <p> + </dd> + + <dt><b> + <a name="7.5">7.5.</a> I need to access information in the request header directly. How can + I do this? + </b></dt> + <dd> + The getallheaders() function will do this if you are running PHP as a + module. So, the following bit of code will show you all the request + headers:<pre> + $headers = getallheaders(); + for(reset($headers); $key = key($headers); next($headers)) { + echo "headers[$key] = ".$headers[$key]."&lt;br&gt;\n"; } - } - /* just close the file, throwing away the rest */ - fclose($fd); - commonFooter(); +</pre> + <p> + </dd> + + <dt><b> + <a name="7.6">7.6.</a> When I try to use authentication with IIS I get 'No Input file specified' + </b></dt> + <dd> + The security model of IIS is at fault here. This is a problem + common to all CGI programs running under IIS. A workaround is + to create a plain HTML file (not parsed by php) as the entry page + into an authenticated directory. Then use a META tag to redirect + to the PHP page, or have a link to the PHP page. PHP will + then recognize the authentication correctly. When the ISAPI + module is ready, this will no longer be a problem. This should + not effect other NT web servers. For more information, see: <A + href="http://support.microsoft.com/support/kb/articles/q160/4/22.asp" + target="_new">http://support.microsoft.com/support/kb/articles/q160/4/22.asp</a>. + <p> + </dd> + + <dt><b> + <a name="7.7">7.7.</a> I've followed all the instructions, but still can't get PHP and IIS + to work together! + </b></dt> + <dd> + Make sure any user who needs to run a PHP script has the rights + to run php.exe! IIS uses an anonymous user which is added at the + time IIS is installed. This user needs rights to php.exe. Also, + any authenticated user will also need rights to execute php.exe. And + for IIS4 you need to tell it that PHP is a script engine. + <p> + </dd> + + <dt><b> + <a name="7.8">7.8.</a> My PHP script works on IE and Lynx, but on Netscape some of my output + is missing. When I do a &quot;View Source&quot; I see the content in IE but not in Netscape. + Even when I telnet to port 80 directly the correct content shows up. How can this be? PHP + is server-side and my browser can't possibly know that the content it is seeing is generated + by PHP, so what is going on? + </b></dt> + <dd> + Very good question! ;) This is a tricky little issue and it has come up twice in the + past month as of this writing. Both times I ended up spending a good 20 minutes trying to + figure out what the heck was going on. The answer is that both IE and Lynx ignore any NULs + (\0) in the HTML stream. Netscape does not. The best way to check for this is to compile + the command-line version of PHP (also known as the CGI version) and run your script from the + command line and pipe it through 'od -c' and look for any \0 characters. (If you are on + Windows you need to find an editor or some other program that lets you look at binary files) + When Netscape sees a NUL in a file it will typically not output anything else on that line + whereas both IE and Lynx will. If this issue has bitten you, congratulations! You are not + alone. + <p> + </dd> + + <dt><b> + <a name="7.9">7.9.</a> How am I supposed to mix XML and PHP? It complains about my &lt;?xml&gt tags! + </b></dt> + <dd> + You need to turn off the short tags by setting short_tags to 0 in your + php3.ini file, or by using the php3_short_tags Apache directive. (You + could even use a &lt;File&gt; section to do this selectively.) You can + also disable and re-enable the short tags in your script using the + short_tags() function. + <p> + </dd> + + <dt><b> + <a name="7.10">7.10.</a> How can I use PHP with FrontPage or Dreamweaver or some other HTML editor that insists on moving my code around? + </b></dt> + <dd> + One of the easiest things to do is to enable using ASP tags in your + PHP code. This allows you to use the ASP-style &lt% and %&gt; code + delimiters. Most of the popular HTML editors handle those more + intelligently (for now). To enable the ASP-style tags, you need + to set the asp_tags php3.ini variable, or use the php3_asp_tags + Apache directive. + <p> + </dd> + + <dt><b> + <a name="7.11">7.11.</a> Where can I find a complete list of pre-set variables available + to me, and why are these not documented in the PHP documentation? + </b></dt> + <dd> + The best way is to stick a &lt;?phpinfo()?&gt; tag on a page and load it up. This will + show you all sorts of information about your PHP setup, including a list of both + environment variables and also special variables set by your web server. This list + can't really be documented in the PHP documentation because it will change from one + server to another. + <p> + </dd> + + <dt><b> + <a name="7.12">7.12.</a>Why do I get an error that looks something like this: +<B><tt>Warning: 0 is not a MySQL result index in &lt;file&gt; on line &lt;x&gt;</tt></B> or +<B><tt>Warning: Supplied argument is not a valid MySQL result resource in &lt;file&gt; on line &lt;x&gt;</tt></B>? +What am I doing wrong? + </b></dt> + <dd> + You are trying to use a result identifier that is 0. The 0 indicates that your query failed + for some reason. You need to check for errors after submitting a query and before you + attempt to use the returned result identifier. The proper way to do this is with code similar + to the following:<pre> + $result = mysql_query("select * from tables_priv"); + if(!$result) { + echo mysql_error(); + exit; + }</pre> + or:<pre> + $result = mysql_query("select * from tables_priv") + or die("Bad query: ".mysql_error());</pre> + <p> + </dd> + + <dt><b> + <a name="7.13">7.13.</a> I'm trying to use an &lt;input + type="image"&gt; tag, but the <I>$foo.x</I> and <I>$foo.y</I> + variables aren't available. Where are they? + </b></dt> + <dd> + When submitting a form, it is possible to use an image instead of + the standard submit button with a tag like: + <pre>&lt;input type="image" SRC="image.gif" NAME="foo"&gt;</pre> + When the user clicks somewhere on the image, the accompanying form + will be transmitted to the server with two additional variables: + foo.x and foo.y. + <p> + Because $foo.x and $foo.y are invalid variable names in PHP, they are + automagically converted to $foo_x and $foo_y. That is, the periods + are replaced with underscores. + <p> + </dd> + <dt><b> + <a name="7.14">7.14.</a> How do I get all the results from a SELECT +MULTIPLE HTML tag? + </b></dt> + <DD> + The SELECT MULTIPLE tag in an HTML construct allows users to select multiple + items from a list. These items are then passed to the action handler for the + form. The problem is that they are all passed with the same widget name. ie. + <PRE> &lt;SELECT NAME="var" MULTIPLE&gt;</PRE> + Each selected option will arrive at the action handler as: + +<PRE> var=option1 + var=option2 + var=option3</PRE> + + Each option will overwrite the contents of the previous $var variable. The +solution is to use PHP's + non-indexed array feature. The following should be used: + +<PRE> &lt;SELECT NAME="var[]" MULTIPLE&gt;</PRE> + + This tells PHP to treat <i>var</i> as an array and each assignment of a + value to var[] adds an item to the array. The first item becomes $var[0], + the next $var[1], etc. The count() function can be used to determine how + many options were selected, and the sort() function can be used to sort + the option array if necessary.<P> + + Note that if you are using JavaScript the <i>[]</i> on the element name + might cause you problems when you try to refer to the element by name. + Use it's numerical form element id instead, or enclose the + variable name in single quotes and use that as the index to the +<I>elements</I> array, for example: + +<PRE> variable = documents.forms[0].elements['var[]']; +</PRE> + + <P> + </DD> +</dl> + +<? echo hdelim(); ?> +<a name="8"> +<h2>8. PHP and HTML</h2> +</a> + +<dl> + <dt><b> + <a name="8.1">8.1.</a> How do I create an array in a HTML &lt;form&gt;? + </b></dt> + <dd> + To get your &lt;form&gt; result sent as an array to your PHP script + you name the &lt;input&gt;, &lt;select&gt; or &lt;textarea&gt; + elements like this: + <pre> + &lt;input name="MyArray[]"&gt; + &lt;input name="MyArray[]"&gt; + &lt;input name="MyArray[]"&gt; + &lt;input name="MyArray[]"&gt; + </pre> + Notice the square brackets after the variable name, that's what + makes it an array. You can group the elements into different arrays + by assigning the same name to different elements: + <pre> + &lt;input name="MyArray[]"&gt; + &lt;input name="MyArray[]"&gt; + &lt;input name="MyOtherArray[]"&gt; + &lt;input name="MyOtherArray[]"&gt; + </pre> + This produces two arrays, MyArray and MyOtherArray, that gets sent + to the PHP script. + <p> + <i>Note that you must not use indices with arrays in HTML!</i> The + array gets filled in the order the elements appear in the form. For + functions you can use to process these arrays once you get them into + your scripts, please see the Arrays section in the manual. + </dd> +</dl> + +<? echo hdelim(); ?> + +<a name="9"> +<h2>9. PHP and other languages</h2> +</a> + +<dl> + <dt><b> + <a name="9.1">9.1.</a> PHP vs. ASP? + </b></dt> + <dd> + ASP is not really a language in itself, it's an acronym for Active + Server Pages, the actual language used to program ASP with is a + script version of Visual Basic. The biggest drawback of ASP is that + it's a proprietary system that is natively used only on Microsofts + Internet Information Server (IIS). This limits it's availability to + Win32 based servers. There are a couple of projects in the works + that allows ASP to run in other environments and webservers; <a + href="http://www.halcyonsoft.com/prods/iasp/iasp.htm">InstantASP</a> + from <a href="http://www.halcyonsoft.com/">Halcyon</a> (commercial), + <a href="http://www.chilisoft.com/chiliasp/default.asp">Chili!Soft + ASP</a> from <a href="http://www.chilisoft.com/">Chili!Soft</a> + (commercial) and <a href="http://www.activescripting.org/">OpenASP + from ActiveScripting.org</a> (free). ASP is said to be a slower + and more cumbersome language than PHP, less stable as well. Some of + the pros of ASP is that since it uses VBScript it's relatively easy + to pick up the language if you're already know how to program in + Visual Basic. ASP support is also enabled by default in the IIS + server making it easy to get up and running. + </dd> + <p> + <dt><b> + <a name="9.2">9.2.</a> Is there an ASP to PHP converter? + </b></dt> + <dd> + Yes, <a href="http://asp2php.naken.cc/">asp2php</a> is the one most often referred to. + </dd> + <p> + <dt><b> + <a name="9.3">9.3.</a> PHP vs. Cold Fusion? + </b></dt> + <dd> + PHP is commonly said to be faster and more efficient for complex + programming tasks and trying out new ideas. PHP is generally referred + to as more stable and less resource intensive as well. Cold Fusion + has better error handling, database abstraction and date parsing + although database abstraction is being addressed in PHP 4. Another + thing that is listed as one of Cold Fusion's strengths is its excellent + search engine, but it has been mentioned that a search engine is not + something that should be included in a web scripting language. PHP + runs on almost every platform there is; Cold Fusion is only available + on Win32, Solaris, Linux and HP/UX. Cold Fusion has a better IDE + and is generally easier to get started with, whereas PHP initially + requires more programming knowledge. + + <p>A great summary by Michael J Sheldon on this topic has + been posted to the PHP mailing list. A copy can be found <a + href="http://marc.theaimsgroup.com/?l=php3-general&m=95602167412542&w=1">here</a>. + </dd> + <p> + <dt><b> + <a name="9.4">9.4.</a> PHP vs. Perl? + </b></dt> + <dd> + The biggest advantage of PHP over Perl is that PHP was designed for + scripting for the web where Perl was designed to do a lot more and can + because of this get very complicated. The flexibility / complexity + of Perl makes it easier to write code that another author / coder + has a hard time reading. PHP has a less confusing and stricter format + without losing flexibility. PHP is easier to integrate into existing + HTML than Perl. PHP has pretty much all the 'good' functionality of + Perl; constructs, syntax and so on, without making it as complicated + as Perl can be. Perl is a very tried and true language, it's been + around since the late eighties, but PHP is maturing very quickly. + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="10"> +<h2>10. Common Problems</h2> +</a> + +<dl> + <dt><b> + <a name="10.1">10.1.</a> I installed PHP, but every time I load + a document, I get the message 'Document Contains No Data'! What's + going on here? + </b></dt> + <dd> + This probably means that PHP is having some sort of problem + and is core-dumping. Look in your server error log to see if + this is the case, and then try to reproduce the problem with + a small test case. If you know how to use 'gdb', it is very + helpful when you can provide a backtrace with your bug report + to help the developers pinpoint the problem. If you are using + PHP as an Apache module try something like: + <ul> + <li> Stop your httpd processes + <li> gdb httpd + <li> &gt; run -X -f /path/to/httpd.conf + <li> Then fetch the URL causing the problem with your browser + <li> If you are getting a core dump, gdb should inform you of this now + <li> type: bt + <li> You should include your backtrace in your bug report. This should be submitted to <a href="http://bugs.php.net">http://bugs.php.net</a> + </ul> + <p> + If your script uses the regular expression functions (<code>ereg()</code> + and friends), you should make sure that you compiled PHP and + Apache with the same regular expression package. (This should + happen automatically with PHP and Apache 1.3.x) + <p> + </dd> + + <dt><b> + <a name="10.2">10.2.</a> I'm trying to access one of the standard CGI + variables (such as $DOCUMENT_ROOT or $HTTP_REFERER) in a user-defined + function, and it can't seem to find it. What's wrong? + </b></dt> + <dd> + Environment variables are now normal global variables, so you must + either declare them as global variables in your function (by using + "<code>global $DOCUMENT_ROOT;</code>", for example) or by using + the global variable array (ie, "<code>$GLOBALS["DOCUMENT_ROOT"]</code>". + <p> + </dd> + + <dt><b> + <a name="10.3">10.3.</a> I patched Apache with the FrontPage extensions patch, and suddenly PHP stopped + working. Is PHP incompatible with the Apache FrontPage extensions? + </b></dt> + <dd> + No, PHP works fine with the FrontPage extensions. + The problem is that the FrontPage patch modifies several Apache structures, + that PHP relies on. + Recompiling PHP (using 'make clean ; make') after the FP patch is applied + would solve the problem. + <p> + </dd> + + <dt><b> + <a name="10.4">10.4.</a> I think I found a bug! Who should I tell? + </b></dt> + <dd> + You should go to the PHP Bug Database and make sure the bug + isn't a known bug. If you don't see it in the database, use + the reporting form to report the bug. It is important to use + the bug database instead of just sending an email to one of the + mailing lists because the bug will have a tracking number assigned + and it will then be possible for you to go back later and check + on the status of the bug. The bug database can be found at <A + href="http://bugs.php.net/">http://bugs.php.net/</a>. + <p> + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="11"> +<h2>11. Migrating from PHP3 to PHP4</h2> +</a> + +<dl> + <dt><b> + <a name="11.1">11.1.</a> General information + </b></dt> + <dd> + PHP 4 was designed to be as compatible with earlier versions of + PHP as possible and very little functionality was broken in the + process. If you're really unsure about compatibility you should + install PHP 4 in a test environment and run your scripts there. + </dd> + <p> + <dt><b> + <a name="11.2">11.2.</a> Incompatible functions + </b></dt> + <dd> + Since PHP 4 is basically a rewrite of the entire PHP engine there + was very few functions that were altered and only then some of + the more exotic ones. + </dd> +</dl> + +<? echo hdelim(); ?> +<a name="12"> +<h2>12. Migrating from PHP2 to PHP3</h2> +</a> +<dl> + <dt><b> + <a name="12.1">12.1. </a>General information + </b></dt> + <dd> + PHP/FI 2.0 is no longer supported. Please see <a + href="http://www.php.net/manual/migration.php">the manual</a> for + information about migration from PHP/FI 2.0. + </dd> +</dl> + +<? echo hdelim(); ?> + +<h2>Credits</h2> + +<p> +This FAQ was originally written by Jim Winstead. It is currently +maintained by the PHP Documentation Team. +</p> + +<? +commonFooter(); ?> Index: phpweb/README.mirror diff -u phpweb/README.mirror:1.36 phpweb/README.mirror:1.37 --- phpweb/README.mirror:1.36 Sat Mar 3 03:23:57 2001 +++ phpweb/README.mirror Wed Mar 7 16:17:34 2001 @@ -39,7 +39,7 @@ </IfModule> ErrorLog logs/error_log TransferLog logs/access_log - DirectoryIndex index.php index.php3 index.html index.htm manual.php manual.php3 manual.html + DirectoryIndex index.php index.html ErrorDocument 404 /error/ ErrorDocument 401 /error/ ErrorDocument 403 /error/ Index: phpweb/anoncvs.php diff -u phpweb/anoncvs.php:1.3 phpweb/anoncvs.php:1.4 --- phpweb/anoncvs.php:1.3 Tue Jan 23 19:32:35 2001 +++ phpweb/anoncvs.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Anonymous CVS Access"); ?> Index: phpweb/books.php diff -u phpweb/books.php:1.86 phpweb/books.php:1.87 --- phpweb/books.php:1.86 Thu Feb 22 09:54:29 2001 +++ phpweb/books.php Wed Mar 7 16:17:34 2001 @@ -1,787 +1,96 @@ <?php -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("PHP Books"); -?> - -<TABLE BORDER=0 CELLPADDING=5> - -<TR VALIGN="middle"> -<TD COLSPAN=2><B>Books in English</B></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565927699/wwwphpnet" -><IMG SRC="/gifs/phppr.s.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="183"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565927699/wwwphpnet" ->PHP Pocket Reference</A><BR> -by <A HREF="http://zend.com/zend/hof/rasmus.php">Rasmus Lerdorf</A><BR> -<SMALL> -O'Reilly & Associates, Jan 2000, ISBN 1-56592-769-9, 114 pages<BR> -<A HREF="http://www.oreilly.com/catalog/phppr/">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1861002963/wwwphpnet" -><IMG SRC="/gifs/2963.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1861002963/wwwphpnet">Professional PHP Programming</A><BR> -by <A HREF="http://zend.com/comm_person.php?id=9">Jesus Castagnetto</A>, Harish Rawat, <A HREF="http://zend.com/zend/hof/sascha.php">Sascha Schumann</A>, Chris Scollo, Deepak Veliath<BR> -<SMALL> -Wrox Press Inc, Dec 1999, ISBN 1-86100-296-3, 909 pages<BR> -<A HREF="http://www.amazon.com/exec/obidos/ASIN/1861002963/wwwphpnet">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0130893986/wwwphpnet" -><IMG SRC="/jpgs/core-book.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="145"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0130893986/wwwphpnet" ->Core PHP Programming</A><BR> -Using PHP to Build Dynamic Web Sites</BR> -by <A HREF="http://zend.com/comm_person.php?id=30">Leon Atkinson</A><BR> -<SMALL> -Foreword by <A HREF="http://www.zend.com/zend/hof/andi.php">Andi Gutmans</A><BR> -Prentice Hall, Second Edition, August 2000, ISBN 0-13-089398-6, 769 pages<BR> -<A HREF="http://www.leonatkinson.com/index.php3?screen=eng_book">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0071353429/wwwphpnet" -><IMG SRC="/gifs/medinets.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="167"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0071353429/wwwphpnet" ->PHP3: Programming Browser-Based Applications</A><BR> -by David Medinets<BR> -<SMALL> -MacGraw-Hill, 2000, ISBN 0-07-135342-9, 552 pages<BR> -<A HREF="http://www.mtolive.com/phpbook">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0201657716/wwwphpnet" -><IMG SRC="/jpgs/hilton-willis.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0201657716/wwwphpnet">Building Database Applications on the Web Using PHP3</A><BR> -by Craig Hilton and Jeff Willis<BR> -<SMALL> -Addison-Wesley, Dec 1999, ISBN 0-2016-5771-6, 624 pages -<!-- <SMALL><A HREF="no information found">no more info</A><BR> --> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/076152729X/wwwphpnet" -><IMG SRC="/jpgs/php_essentials.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="143"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/076152729X/wwwphpnet">PHP Essentials</A><BR> -<SMALL>A Better Way to Learn PHP - Includes Version 4</SMALL><BR> -by <A HREF="http://zend.com/comm_person.php?id=10">Julie C. Meloni</A><BR> -<SMALL> -Prima-Tech, March 2000, ISBN 0-7615-2729-X, 363 pages<BR> -<A HREF="http://www.thickbook.com/">more info</A> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/076153055X/wwwphpnet" -><IMG SRC="/jpgs/php_fe.jpg" BORDER=0 ALIGN="left" WIDTH=111"" HEIGHT="138"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/076153055X/wwwphpnet">PHP Fast & Easy Web Development</A><BR> -by <A HREF="http://zend.com/comm_person.php?id=10">Julie C. Meloni</A><BR> -<SMALL> -Prima-Tech, July 2000, ISBN 0-7615-3055-X, 436 pages<BR> -<A HREF="http://www.thickbook.com/">more info</A> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672318040/wwwphpnet" -><IMG SRC="/jpgs/zandstra.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="138"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672318040/wwwphpnet">SAMS Teach Yourself PHP4 in 24 Hours</A><BR> -by Matt Zandstra<BR> -<SMALL> -Sams, June 2000, ISBN 0-6723-1804-0, 481 pages -<A HREF="http://www.corrosive.co.uk/">more information</A> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0735709971/wwwphpnet" -><IMG SRC="/jpgs/ratschiller_gerken.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="143"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0735709971/wwwphpnet">Web Application Development with PHP 4.0</A><BR> -by <A HREF="http://zend.com/comm_person.php?id=7">Tobias Ratschiller</A> and <A HREF="http://zend.com/comm_person.php?id=11">Till Gerken</A><BR> -<SMALL> -Contains Official Zend API Documentation<BR> -With contributions by Zend Technologies, LTD, <A HREF="http://zend.com/comm_person.php?id=12">Zeev Suraski</A> and <A HREF="http://zend.com/zend/hof/andi.php">Andi Gutmans</A><BR> -New Riders Publishing, July 2000, ISBN 0-7357-0997-1, 384 pages<BR> -<A HREF="http://www.phpwizard.net/book/">more info</A> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/076454716X/wwwphpnet" -><IMG SRC="/jpgs/bible.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/076454716X/wwwphpnet">PHP 4 Bible</A><BR> -by Tim Converse and Joyce Park<BR><SMALL> -IDG Books Worldwide, August 2000, ISBN 0-7645-4716-X<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672317842/wwwphpnet" -><IMG SRC="/jpgs/gilmore.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="137"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672317842/wwwphpnet">PHP and MySQL Web Development</A><BR> -by Luke Welling and Laura Thomson<BR><SMALL> -Sams, October 2000, ISBN 0-6723-1784-2<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0130889032/wwwphpnet" -><IMG SRC="/jpgs/cosentino.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="167"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0130889032/wwwphpnet">Essential PHP for Web Professionals</A><BR> -by Christopher Cosentino<BR> -<SMALL> -Prentice Hall, October 2000, ISBN 0-1308-8903-2, 168 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0789724405/wwwphpnet" -><IMG SRC="/jpgs/maxfield.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="139"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0789724405/wwwphpnet">MySQL and PHP from Scratch</A><BR> -by Wade Maxfield<BR> -<SMALL> -Que, November 2000, ISBN 0-7897-2440-5, 372 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1893115852/wwwphpnet" -><IMG SRC="/jpgs/wjgilmore.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1893115852/wwwphpnet">A Programmer's Introduction to PHP 4.0</A><BR> -by W.J. Gilmore<BR> -<SMALL> -APress, December 2000, ISBN 1-8931-1585-2, 450 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672319241/wwwphpnet" -><IMG SRC="/jpgs/zmievski.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="138"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672319241/wwwphpnet">PHP Developer's Cookbook</A><BR> -by -<A HREF="http://zend.com/zend/hof/sterling.php">Sterling Hughes</A>, with contributions by -<A HREF="http://zend.com/comm_person.php?id=24">Andrei Zmievski</A><BR><SMALL> -Foreword by <A HREF="http://zend.com/zend/hof/rasmus.php">Rasmus Lerdorf</A><BR> -Sams, November 2000, ISBN 0-6723-1924-1, 505 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1861003730/wwwphpnet" -><IMG SRC="/jpgs/beginning_php4.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1861003730/wwwphpnet">Beginning PHP 4</A><BR> -by Jon Blan, Wankyu Choi, Allan Kent, Ganesh Prasad, Chris Ullmann<BR> -<SMALL> -Wrox Press Inc, October 2000, ISBN 1-8610-0373-0, 800 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672320290/wwwphpnet" -><IMG SRC="/jpgs/allen_wyke.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0672320290/wwwphpnet">PHP Developer's Dictionary</A><BR> -by R. Allen Wyke, Michael J. Walker and Robert M. Cox<BR> -<SMALL> -Sams, Dec 2000, ISBN 0-6723-2029-0, 500 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127317/wwwphpnet" -><IMG SRC="/jpgs/schwendiman.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127317/wwwphpnet">PHP 4 Developer's Guide</A><BR> -by Blake Schwendiman<BR> -<SMALL> -Osborne McGraw-Hill, January 2001, ISBN 0-0721-2731-7, 775 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0764535374/wwwphpnet" -><IMG SRC="/jpgs/greenspan.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0764535374/wwwphpnet">MySQL/PHP Database Application</A><BR> -by Jay Greenspan and Brad Bulger<BR> -<SMALL> -Hungry Minds, January 2001, ISBN 0-7645-3537-4, 500 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/073570970X/wwwphpnet" -><IMG SRC="/jpgs/till_gerken.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="167"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/073570970X/wwwphpnet">PHP Functions Essential Reference</A><BR> -by -Landon Bradshaw, -<A HREF="http://zend.com/comm_person.php?id=32">Graeme Merrall</A>, -Stephen Wall (Editor)<BR><SMALL> -New Riders Publishing, January 2001, ISBN 0-7357-0970-X, 500 pages<BR> -</SMALL> -</TD> -</TR> - - -<TR VALIGN="middle"> -<TD COLSPAN=2><B>Other Languages</B></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3897212250/wwwphpnet07" -><IMG SRC="/gifs/rasmus-kug.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="182"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3897212250/wwwphpnet07" ->PHP kurz & gut</A><BR> -by <A HREF="http://zend.com/zend/hof/rasmus.php">Rasmus Lerdorf</A><BR> -<SMALL> -Deutsche &Uuml;bersetzung von <A HREF="http://www.oreilly.de/catalog/phptbger/translator.html">Ingo Marks</A><BR> -in German, O'Reilly, June 2000, ISBN 3-89721-255-0, 111 pages<BR> -<A HREF="http://www.oreilly.de/catalog/phptbger/index.html">weitere Informationen</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3827258774/wwwphpnet07" -><IMG SRC="/jpgs/schmid_cartus.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="164" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3827258774/wwwphpnet07" ->PHP 4. Dynamische Webauftritte professionell realisieren</A><BR> -by <A HREF="http://zend.com/zend/hof/schmid.php">Egon Schmid</A>, Christian Cartus<BR> -Mit einem Vorwort von <A HREF="http://www.zend.com/zend/hof/andi.php">Andi Gutmans</A> und <A HREF="http://www.zend.com/comm_person.php?id=12">Zeev Suraski</A><BR> -Unter Mitarbeit von -<A HREF="http://www.zend.com/comm_person.php?id=38">Wolfgang Drews</A>, -<A HREF="http://www.zend.com/comm_person.php?id=33">Hartmut Holzgraefe</A>, -<A HREF="http://www.zend.com/comm_person.php?id=37">Uwe Steinmann</A> und -Christian Wenz<BR> -<SMALL>in German, Markt+Technik Verlag, new technology, Dec 2000, ISBN 3-8272-5877-4, 639 pages</SMALL><BR> -<SMALL><A HREF="http://www.php-buch.de/">weitere Informationen</A><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.pearsoneducation.nl/php3/boek1test.html?isbn=9043001406" -><IMG SRC="/gifs/book-php-dutch.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="158" -></A><BR> -</TD> -<TD><A HREF="http://www.pearsoneducation.nl/php3/boek1test.html?isbn=9043001406" ->PHP - Dynamische websites professioneel ondersteunen</A><BR> -by <A HREF="http://zend.com/zend/hof/schmid.php">Egon Schmid</A>, Christian Cartus en Richard Blume<BR> -<SMALL>in Dutch, Addison Wesley Longman, April 2000, ISBN 90-430-0140-6, 477 pages</SMALL><BR> -<SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3446215468/wwwphpnet07" -><IMG SRC="/jpgs/joerg_krause.jpg" BORDER=0 ALIGN="left" width="111" height="163" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3446215468/wwwphpnet07" ->PHP 4: Grundlagen und Profiwissen</A><BR> -Webserver-Programmierung unter Windows und Linux<BR> -by J&ouml;rg Krause<BR> -<SMALL>in German, Hanser, Nov 2000, ISBN 3-446-21546-8, 1168 pages<BR> -<A HREF="http://www.php.comzept.de/">weitere Informationen</A></SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3934358632/wwwphpnet07" -><IMG SRC="/gifs/theis.gif" BORDER=0 ALIGN="left" WIDTH="119" HEIGHT="167" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3934358632/wwwphpnet07" ->PHP 4</A><BR> -Webserver-Programmierung für Um- und Einsteiger<BR> -by Thomas Theis<BR> -<SMALL>in German, Galileo Press, May 2000, ISBN 3-934358-63-2, 354 pages</SMALL><BR> -<SMALL><A HREF="http://www.galileo-press.de/katalog/einzel.asp?ID=202">weitere Informationen</A><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3826690044/wwwphpnet07" -><IMG SRC="/jpgs/susanne_wigard.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="160" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3826690044/wwwphpnet07" ->PHP 4</A><BR> -by Dr. Susanne Wigard<BR> -<SMALL>in German, BHV, December 2000, ISBN 3-8266-9004-4, 448 pages<BR> -<A HREF="http://www.bhv.net/bhv/buchreihen/deinst_1110_3.html">weitere Informationen</A></SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3828711103/wwwphpnet07" -><IMG SRC="/gifs/susanne_wigard.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="155" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3828711103/wwwphpnet07" ->Das Einsteigerseminar PHP 4.0</A><BR> -by Dr. Susanne Wigard<BR> -<SMALL>in German, BHV, Juni 2000, ISBN 3-8287-1110-3, 382 pages<BR> -<A HREF="http://www.bhv.net/bhv/buchreihen/deinst_1110_3.html">weitere Informationen</A></SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/381582043X/wwwphpnet07" -><IMG SRC="/gifs/databecker.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="155" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/381582043X/wwwphpnet07" ->PHP 4 + MySQL</A><BR> -by Rolf D. Stoll and Gudrun Anna Leierer<BR> -<SMALL>in German, Data Becker, July 2000, ISBN 3-8158-2043-X, 439 pages<BR> -<A HREF="http://www.databecker.de/">weitere Informationen</A></SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3932311795/wwwphpnet07" -><IMG SRC="/jpgs/klaus_schmidt.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3932311795/wwwphpnet07" ->PHP 4 - Tutorial & Referenz</A><BR> -by Klaus Schmidt<BR> -<SMALL>in German, Computer & Literatur Verlag GmbH, November 2000, ISBN 3-932-1179-5, 832 pages<BR> -<A HREF="http://www.ksweb.de/index.php?page=buch">weitere Informationen</A></SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3827258839/wwwphpnet07" -><IMG SRC="/jpgs/matt_zandstra.jpg" BORDER=0 ALIGN="left" width="111" height="157" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3827258839/wwwphpnet07" ->Jetzt lerne ich PHP 4</A><BR> -by Matt Zandstra<BR> -<SMALL>in German, Markt+Technik Verlag, December 2000, ISBN 3-8272-5883-9, 515 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3827317304/wwwphpnet07" -><IMG SRC="/jpgs/tobias_and_till.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="152" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3827317304/wwwphpnet07" ->Webanwendungen mit PHP 4.0 entwickeln</A><BR> -by <A HREF="http://zend.com/comm_person.php?id=7">Tobias Ratschiller</A> and <A HREF="http://zend.com/comm_person.php?id=11">Till Gerken</A><BR> -<SMALL>in German, Addison-Wesley, Jan 2001, ISBN 3-8273-1730-4, 400 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3826680022/wwwphpnet07" -><IMG SRC="/jpgs/uwe_and_gunther.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="152" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3826680022/wwwphpnet07" ->PHP 4</A><BR> -by Uwe Hess and G&uuml;nther Karl<BR> -<SMALL>in German, bhv, Dec 2000, ISBN 3-8266-8002-2, 764 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3898421163/wwwphpnet07" -><IMG SRC="/jpgs/dittrich.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="157" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3898421163/wwwphpnet07" ->PHP 4 für Profis. Werkzeugkiste und Kochbuch</A><BR> -by Helmut Dittrich and J&uuml;rgen Mellenthin<BR> -<SMALL>in German, Galileo Press, January 2001, ISBN 3-8984-2116-3, 500 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://pagina.se/bok.html?20660" -><IMG SRC="/gifs/ek-eriksson.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="159" -></A><BR> -</TD> -<TD><A HREF="http://pagina.se/bok.html?20660" ->PHP 4 programmering</A><BR> -by Jesper Ek and Ulrika Eriksson<BR> -<SMALL>in Swedish, February 2001, ISBN 9-1636-0660-7, 220 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.AnayaMultimedia.es/" -><IMG SRC="/gifs/esteban_trigo.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="187" -></A><BR> -</TD> -<TD><A HREF="http://www.AnayaMultimedia.es/" ->Gu&iacute;a Pr&aacute;cticas PHP 4</A><BR> -by Esteban Trigos<BR> -<SMALL>in Spanish, Anaya Multimedia, December 2000, ISBN 8-4415-1079-2, 288 pages<BR> -<A HREF="http://www.en-linea.net/">more information</A></SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.fr/exec/obidos/ASIN/2744007099/wwwphpnet0f" -><IMG SRC="/gifs/herellier.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="163" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.fr/exec/obidos/ASIN/2744007099/wwwphpnet0f" ->Pages Web dynamiques avec ASP, PHP, SQL</A><BR> -by Jean-Marc Herellier and Philippe Merigod<BR> -<SMALL>in French</SMALL><BR> -<SMALL><A HREF="http://www.amazon.fr/exec/obidos/ASIN/2744007099/wwwphpnet0f" ->more info</A><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.fr/exec/obidos/ASIN/2744009237/wwwphpnet0f" -><IMG SRC="/gifs/atkinson_fr.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="160" -></A><BR> -</TD> -<TD><A HREF="http://www.amazon.fr/exec/obidos/ASIN/2744009237/wwwphpnet0f" ->Programmation PHP</A><BR> -by <A HREF="http://zend.com/comm_person.php?id=30">Leon Atkinson</A><BR> -<SMALL>French translation of Leon Atkinson's book</SMALL><BR> -<SMALL><A HREF="http://www.amazon.fr/exec/obidos/ASIN/2744009237/wwwphpnet0f">more info</A><BR> -</TD> -</TR> - - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.eyrolles.com/php.informatique/Ouvrages/ouvrage.php3?ouv_ean13=9782212091137" -><IMG SRC="/gifs/lacroix.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="150" -></A><BR> -</TD> -<TD><A HREF="http://www.eyrolles.com/php.informatique/Ouvrages/ouvrage.php3?ouv_ean13=9782212091137" ->Programmation Web avec PHP</A><BR> -by Laurent Lacroix, Christophe Lauer, Nicolas Leprince, Christophe Boggero<BR> -<SMALL>in French, April 2000, ISBN 2-212-09113-3, 364 pages</SMALL><BR> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.kosek.cz/php/index.html" -><IMG SRC="/jpgs/czech-book.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="154"></A><BR> -</TD> -<TD> -PHP tvorba interaktivnich internetovych aplikaci<BR> -<I>(PHP development interactive internet applications)</I><BR> -by Jiri Kosek<BR> -<SMALL>in Czech<BR> -<A HREF="http://www.kosek.cz/php/index.html">more info</A> | -<A HREF="http://fulltext.mia.cz/grada/shop/basket.asp?g_cislo=939&typ=5">purchase</A> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.wowbook.com/wow/book_info/book-info.asp?isbn=ISBN89%2D381%2D0239%2D4" -><IMG SRC="/jpgs/korean-book.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="152"></A><BR> -</TD> -<TD> -PHP Web-DB Programming Guide<BR> -by Jung Jinho<BR> -<SMALL>in Korean<BR> -<A HREF="http://www.wowbook.com/wow/book_info/book-info.asp?isbn=ISBN89%2D381%2D0239%2D4">more info</A> | -<A HREF="http://www.wowbook.com/wow/shoppingcart/xt_orderform_additem.asp?title=PHP+Web%2DDB+Programming+Guide&sku=ISBN89%2D381%2D0239%2D4&list%5Fprice=20000&pubname=%B5%BF%C0%CF%C3%E2%C6%C7%BB%E7&inventory%5Fqty=99624&prdsale%5Ftype=&product%5Ftype=">purchase</A> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.wowbook.com/book/info/book_detail.asp?isbn=ISBN89-87939-26-X" -><IMG SRC="/gifs/korean_book.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="155"></A><BR> -</TD> -<TD> -PHP Web Programming with ORACLE Database<BR> -by Kim Sung-Sik<BR> -<SMALL>in Korean<BR> -<A HREF="http://www.wowbook.com/book/info/book_detail.asp?isbn=ISBN89-87939-26-X">more info</A> | -<A HREF="http://www.wowbook.com/orders/basket/basket.asp?isbn=ISBN89-87939-26-X">purchase</A> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://ychat.pe.kr/" -><IMG SRC="/jpgs/cgiphp.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="142"></A><BR> -</TD> -<TD> -CGI & PHP<BR> -by Youn Sukbum<BR> -<SMALL>in Korean<BR> -<A HREF="http://ychat.pe.kr/">more info</A> -<!-- | -<A HREF="">purchase</A> ---> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://php.wilson.gs/bible" -><IMG SRC="/jpgs/wilson.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="134"></A><BR> -</TD> -<TD> -PHP Bible<BR> -by Wilson Peng<BR> -<SMALL>in Traditional Chinese<BR> -<A HREF="http://php.wilson.gs/bible">more info</A> -<!-- -| <A HREF="http://">purchase</A> ---> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.drmaster.com.tw/information.asp?®Ñ¸¹=DB20023" -><IMG SRC="/gifs/db20023.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="152"></A><BR> -</TD> -<TD> -Using PHP and MySQL (with FreeBSD and Apache)<BR> -by C.C.J.<BR> -<SMALL>in Traditional Chinese, July 1999, ISBN 957-527-168-8<BR> -<A HREF="http://www.drmaster.com.tw/information.asp?®Ñ¸¹=DB20023">more info</A> -| <A HREF="http://www.dw.com.tw/book.html">purchase</A><BR> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.drmaster.com.tw/information.asp?®Ñ¸¹=DB20029" -><IMG SRC="/gifs/db20029.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="148"></A><BR> -</TD> -<TD> -Examples of PHP and MySQL<BR> -by C.C.J.<BR> -<SMALL>in Traditional Chinese, February 2000, ISBN 957-527-224-2<BR> -<A HREF="http://www.dw.com.tw/book.html">more info</A> -| <A HREF="http://www.drmaster.com.tw/information.asp?®Ñ¸¹=DB20029">purchase</A><BR> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://books.softbank.co.jp/bookweb.nsf/7218069992c69510492566350001471a/5ab16e3b3dcf4ef7492566ff0048baac?OpenDocument" -><IMG SRC="/gifs/japanese-book.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="141"></A><BR> -</TD> -<TD> -<A HREF="http://books.softbank.co.jp/bookweb.nsf/7218069992c69510492566350001471a/5ab16e3b3dcf4ef7492566ff0048baac?OpenDocument">PHP tettei kouryaku</A><BR> -by Michihide Hotta, Tatsuo Ishii and <A HREF="http://www.cityfujisawa.ne.jp/%7Elouis/">Rui Hirokawa</A><BR> -<SMALL>in Japanese, Sep 1999, ISBN 4-7973-0865-6<BR></SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.livcultura.com.br/scripts/cultura/resenha/resenha.asp?nitem=320216" -><IMG SRC="/jpgs/fischer.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="209"></A><BR> -</TD> -<TD> -<A HREF="http://www.livcultura.com.br/scripts/cultura/resenha/resenha.asp?nitem=320216">PHP Guia de Consulta R&aacute;pida</A><BR> -by Herbert G. Fischer<BR> -<SMALL>in Portugese, Jan 2000, ISBN 8-5851-8469-8<BR> -<A HREF="http://phpclasses.UpperDesign.com/products.html/id/8585184698">more info</A> | <A HREF="http://www.livcultura.com.br/scripts/cultura/resenha/resenha.asp?nitem=320216">purchase</A> -</SMALL></TD> -</TR> - -<TR VALIGN="middle"> -<TD COLSPAN=2><B>Related Reading</B></TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/3446214135/wwwphpnet07" -><IMG SRC="/jpgs/dehnhardt.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="162"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/3446214135/wwwphpnet07" ->Scriptsprachen f&uuml;r dynamische Webauftritte: JavaScript, VBScript, ASP, Perl, PHP, XML</A><BR> -by Prof. Dr. Wolfgang Dehnhardt<BR> -<SMALL>Hanser Verlag, Dec 2000, ISBN 3-446-21413-5, 452 pages<BR> -in German: <A HREF="http://www.wsite.de/">more info</A> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0201703319/wwwphpnet" -><IMG SRC="/jpgs/postgresql.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0201703319/wwwphpnet" ->PostgreSQL: Introduction and Concepts</A><BR> -by Bruce Momjian<BR> -<SMALL>Addison-Wesley Pub Co, Dec 2000, ISBN 0-2017-0331-9, 462 pages<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565924347/wwwphpnet" -><IMG SRC="/gifs/mysql-book.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="147"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565924347/wwwphpnet" ->MySQL and mSQL (Nutshell Series)</A><BR> -by Randy Jay Yarger, George Reese and Tim King<BR> -<SMALL>O'Reilly & Associates, July 1999, ISBN 1-56592-434-7, 487 pages<BR> -Russian translation: <A HREF="http://www.books.ru/cgi-bin/v3/book_inf_code.cgi?5872">more info</A> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0735709211/wwwphpnet" -><IMG SRC="/jpgs/dubois.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0735709211/wwwphpnet" ->MySQL</A><BR> -by Paul DuBois<BR> -<SMALL> -Foreword by <A HREF="http://zend.com/zend/hof/widenius.php">Michael "Monty" Widenius</A>, MySQL Moderator<BR> -New Riders, December 1999, ISBN 0-7357-0921-1, 756 pages<BR> -<A HREF="http://www.newriders.com/books/title.cfm?isbn=0735709211">more info</A><BR> -French translation: <A HREF="http://www.campuspress.fr/store/book_info.asp?id=882">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.de/exec/obidos/ASIN/382725793X/wwwphpnet07" -><IMG SRC="/jpgs/dubois-de.jpg" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="160"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.de/exec/obidos/ASIN/382725793X/wwwphpnet07" ->MySQL</A><BR> -Entwicklung, Implementierung und Referenz<BR> -by Paul DuBois<BR> -<SMALL> -Vorwort von <A HREF="http://zend.com/zend/hof/widenius.php">Michael "Monty" Widenius</A>, MySQL Moderator<BR> -<A HREF="http://www2.newriders.com/cfm/prod_book.cfm?RecordID=584">more info</A><BR> -in German, Markt&Technik, July 2000, ISBN 3-8272-5793-X, 864 Seiten<BR> -Translation by Dorothea Reder and Judith Muhr<BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565923251/wwwphpnet" -><IMG SRC="/gifs/webmaster-book.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="167"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565923251/wwwphpnet" ->Webmaster in a Nutshell (Nutshell Series)</A><BR> -<SMALL>includes a large chapter on PHP written by <A HREF="http://zend.com/zend/hof/rasmus.php">Rasmus Lerdorf</A></SMALL><BR> -by Stephen Spainhour and Robert Eckstein<BR> -<SMALL> -O'Reilly & Associates, June 1999, 2nd edition, ISBN 1-5659-2325-1, 523 pages<BR> -<A HREF="http://www.oreilly.com/catalog/webmaster2/">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1576104907/wwwphpnet" -><IMG SRC="/gifs/cvsbook.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="140"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1576104907/wwwphpnet" ->Open Source Development with CVS</A><BR> -<SMALL>Learn how to work with Open Source Software</SMALL><BR> -by Karl Franz Fogel<BR> -<SMALL> -Coriolis, 1999, ISBN 1-57610-490-7, 316 pages<BR> -<A HREF="http://cvsbook.red-bean.com/">more info (and many free chapters)</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/0596000030/wwwphpnet" -><IMG SRC="/gifs/cvspr.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="183"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/0596000030/wwwphpnet" ->CVS Pocket Reference</A><BR> -by Gregor N. Purdy<BR> -<SMALL> -O'Reilly, August 2000, ISBN 0-5960-0003-0, 79 pages<BR> -<A HREF="http://www.oreilly.com/catalog/cvspr/">more info</A><BR> -</SMALL> -</TD> -</TR> - -<TR VALIGN="middle"> -<TD ALIGN="center"><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565922573/wwwphpnet" -><IMG SRC="/gifs/regex.s.gif" BORDER=0 ALIGN="left" WIDTH="111" HEIGHT="145"></A><BR> -</TD> -<TD><A HREF="http://www.amazon.com/exec/obidos/ASIN/1565922573/wwwphpnet" ->Mastering Regular Expressions</A><BR> -by Jeffrey E. Friedl and Andy Oram<BR> -<SMALL> -O'Reilly, January 1997, ISBN 1-5659-2257-3, 368 pages<BR> -<A HREF="http://www.oreilly.com/catalog/regex/">more info</A><BR> -</SMALL> -</TD> -</TR> - - -</TABLE> +$langs = array( + 'en' => 'English', + 'de' => 'German', + 'nl' => 'Dutch', + 'es' => 'Spanish', + 'fr' => 'French', + 'cz' => 'Czech', + 'kr' => 'Korean', + 'jp' => 'Japanese', + 'cn' => 'Traditional Chinese', + 'pt' => 'Portugese' +); + +function showBook($title, $title_link, $author, $author_link=false, $image=false, $info=false, $info_link=false, $lang=false) { + + global $langs; + + if (!$lang || !isset($langs[$lang]) ) { + $lang = 'en'; + } + + if (is_array($title)) { + $img_title = $title[0]; + $title = '<h2 class="condensed">' . make_link($title_link, $title[0]) . '</h2>' . $title[1]; + } else { + $img_title = $title; + $title = '<h2 class="condensed">' . make_link($title_link, $title) . '</h2>'; + } + + if (is_array($author)) { + if (!$author_link) { + $temp = $author; + } else { + for ($i=0; $i<count($author); $i++) { + if ($author_link[$i]) { + $temp[] = make_link($author_link[$i],$author[$i]); + } else { + $temp[] = $author[$i]; + } + } + } + $last = array_pop($temp); + $author = join(', ', $temp) . ' &amp; ' . $last; + } + + echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; + + echo "<tr valign=\"top\">\n"; + echo "<td>\n"; + print_link($title_link, make_image("books/".$image, $img_title, false, false, false, 1) ); + echo "<br>\n</td>\n"; + echo "<td>\n"; + echo $title . "\n"; + echo 'by '; + if ($author_link) { + print_link($author_link, $author); + } else { + echo $author; + } + echo "</p>\n<small>\n"; + if ($info || $lang!='en') { + echo "<p>\n"; + if ($lang!='en') { + echo 'in ' . $langs[$lang] . "<BR>\n"; + } + echo $info . "</p>\n"; + } + echo '<p>'; + echo make_link($info_link ? $info_link : $title_link, + make_image('caret-rg.gif','>') . 'more info' ); + echo "<br>\n"; + echo "</p>\n</small>\n"; + echo "</td>\n</tr>\n\n"; +} +?> +<h1> +PHP Books +</h1> <P> -Click on the links above for more information on the books. And remember, if you -buy the book using the above links, you are helping to support PHP development! +Click on a book for more information or (in most cases) to purchase it. +Remember, if you buy the book using the links on this page, you are helping +to support PHP development! </P> <P> -There may be more books available that we don't know of yet! You can search +There may be more books available that we don't know of yet! You can search <A HREF="http://www.amazon.com/exec/obidos/redirect-home/wwwphpnet">Amazon.com</A> -for PHP related stuff by using this form (or go directly to +for PHP related stuff by using this form (or go directly to <A HREF="http://www.amazon.de/exec/obidos/redirect-home/wwwphpnet07" >Amazon.de</A> or <A HREF="http://www.amazon.fr/exec/obidos/redirect-home/wwwphpnet0f" @@ -789,12 +98,11 @@ search there): </P> +<p> <FORM METHOD="get" ACTION="http://www.amazon.com/exec/obidos/external-search"> <INPUT TYPE="hidden" NAME="tag" VALUE="wwwphpnet"> -<TABLE BORDER=0 CELLPADDING=3 cellspacing=0 align="center" BGCOLOR="#E0E0E0"> -<TR VALIGN="middle"> -<TD align="right">Search what:<BR></TD> -<TD><SELECT NAME="mode"> +Search Amazon for +<SELECT NAME="mode"> <OPTION VALUE="blended">All Products <OPTION VALUE="books" SELECTED>Books <OPTION VALUE="music">Popular Music @@ -803,11 +111,8 @@ <OPTION VALUE="toys">Toys <OPTION VALUE="electronics">Electronics </SELECT> -</TD> -</TR> -<TR VALIGN="middle"> -<TD align="right">Search for:<BR></TD> -<TD><SELECT NAME="keyword"> +about +<SELECT NAME="keyword"> <OPTION SELECTED>PHP <OPTION>Apache <OPTION>Linux @@ -824,11 +129,651 @@ <OPTION>ODBC </SELECT> <INPUT TYPE="submit" BORDER=0 VALUE="Search" NAME="Search"> -</TD> -</TR> -</TABLE> </FORM> +</p> + +<P><BR></P> + + +<h1> +Books in English +</h1> + +<TABLE BORDER=0 CELLPADDING=5> + +<? + +showBook( "PHP Pocket Reference", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1565927699/wwwphpnet", #title_link + "Rasmus Lerdorf", #author(s) + "http://zend.com/zend/hof/rasmus.php", #author_link(s) + "phppr.s.gif", #img + "O'Reilly & Associates, Jan 2000, ISBN 1-56592-769-9, 114 pages", #info + "http://www.oreilly.com/catalog/phppr/" #info_link +); + +showBook( "Professional PHP Programming", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1861002963/wwwphpnet", #title_link + array("Jesus Castagnetto", "Harish Rawat", "Sascha Schumann", "Chris Scollo", "Deepak Veliath"), #author(s) + array("http://zend.com/comm_person.php?id=9", false, "http://zend.com/zend/hof/sascha.php", false, false), #author_link(s) + "2963.gif", #img + "Wrox Press Inc, Dec 1999, ISBN 1-86100-296-3, 909 pages", #info + "http://www.amazon.com/exec/obidos/ASIN/1861002963/wwwphpnet" #info_link +); + + +showBook( array("Core PHP Programming", "Using PHP to Build Dynamic Web Sites"), #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0130893986/wwwphpnet", #title_link + "Leon Atkinson", #author(s) + "http://zend.com/comm_person.php?id=30", #author_link(s) + "core-book.jpg", #img + "Foreword by ".make_link("http://www.zend.com/zend/hof/andi.php", "Andi Gutmans")."<BR>". + "Prentice Hall, Second Edition, August 2000, ISBN 0-13-089398-6, 769 pages", #info + "http://www.leonatkinson.com/index.php3?screen=eng_book" #info_link +); + + +showBook( "PHP3: Programming Browser-Based Applications", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0071353429/wwwphpnet", #title_link + "David Medinets", #author(s) + "", #author_link(s) + "medinets.gif", #img + "MacGraw-Hill, 2000, ISBN 0-07-135342-9, 552 pages", #info + "http://www.mtolive.com/phpbook" #info_link +); + + +showBook( "Building Database Applications on the Web Using PHP3", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0201657716/wwwphpnet", #title_link + array("Craig Hilton", "Jeff Willis"), #author(s) + "", #author_link(s) + "hilton-willis.jpg", #img + "Addison-Wesley, Dec 1999, ISBN 0-2016-5771-6, 624 pages", #info + "" #info_link +); + + +showBook( array("PHP Essentials","A Better Way to Learn PHP - Includes Version 4"), #title(s) + "http://www.amazon.com/exec/obidos/ASIN/076152729X/wwwphpnet", #title_link + "Julie C. Meloni", #author(s) + "http://zend.com/comm_person.php?id=10", #author_link(s) + "php_essentials.jpg", #img + "Prima-Tech, March 2000, ISBN 0-7615-2729-X, 363 pages", #info + "http://www.thickbook.com/" #info_link +); + + +showBook( "PHP Fast & Easy Web Development", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/076153055X/wwwphpnet", #title_link + "Julie C. Meloni", #author(s) + "http://zend.com/comm_person.php?id=10", #author_link(s) + "php_fe.jpg", #img + "Prima-Tech, July 2000, ISBN 0-7615-3055-X, 436 pages", #info + "http://www.thickbook.com/" #info_link +); + + +showBook( "SAMS Teach Yourself PHP4 in 24 Hours", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0672318040/wwwphpnet", #title_link + "Matt Zandstra", #author(s) + "", #author_link(s) + "zandstra.jpg", #img + "Sams, June 2000, ISBN 0-6723-1804-0, 481 pages", #info + "http://www.corrosive.co.uk/" #info_link +); + + +showBook( "Web Application Development with PHP 4.0", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0735709971/wwwphpnet", #title_link + array("Tobias Ratschiller", "Till Gerken"), #author(s) + array("http://zend.com/comm_person.php?id=7","http://zend.com/comm_person.php?id=11"), #author_link(s) + "ratschiller_gerken.jpg", #img + "Contains Official Zend API Documentation<BR>" . + "With contributions by Zend Technologies' " . + make_link("http://zend.com/comm_person.php?id=12", "Zeev Suraski") . " and " . + make_link("http://zend.com/zend/hof/andi.php", "Andi Gutmans") . "<BR>\n" . + "New Riders Publishing, July 2000, ISBN 0-7357-0997-1, 384 pages", #info + "http://www.phpwizard.net/book/" #info_link +); + + +showBook( "PHP 4 Bible", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/076454716X/wwwphpnet", #title_link + array("Tim Converse", "Joyce Park"), #author(s) + "", #author_link(s) + "bible.jpg", #img + "IDG Books Worldwide, August 2000, ISBN 0-7645-4716-X", #info + "" #info_link +); + + +showBook( "PHP and MySQL Web Development", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0672317842/wwwphpnet", #title_link + array("Luke Welling","Laura Thomson"), #author(s) + "", #author_link(s) + "gilmore.jpg", #img + "Sams, October 2000, ISBN 0-6723-1784-2", #info + "" #info_link +); + + +showBook( "Essential PHP for Web Professionals", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0130889032/wwwphpnet", #title_link + "Christopher Cosentino", #author(s) + "", #author_link(s) + "cosentino.jpg", #img + "Prentice Hall, October 2000, ISBN 0-1308-8903-2, 168 pages", #info + "" #info_link +); + + +showBook( "MySQL and PHP from Scratch", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0789724405/wwwphpnet", #title_link + "Wade Maxfield", #author(s) + "", #author_link(s) + "maxfield.jpg", #img + "Que, November 2000, ISBN 0-7897-2440-5, 372 pages", #info + "" #info_link +); + + +showBook( "A Programmer's Introduction to PHP 4.0", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1893115852/wwwphpnet", #title_link + "W.J. Gilmore", #author(s) + "", #author_link(s) + "wjgilmore.jpg", #img + "APress, December 2000, ISBN 1-8931-1585-2, 450 pages", #info + "" #info_link +); + + +showBook( "PHP Developer's Cookbook", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0672319241/wwwphpnet", #title_link + array("Sterling Hughes","Andrei Zmievski"), #author(s) + array("http://zend.com/zend/hof/sterling.php","http://zend.com/comm_person.php?id=24"), #author_link(s) + "zmievski.jpg", #img + "Foreword by " . make_link("http://zend.com/zend/hof/rasmus.php", "Rasmus Lerdorf") . "<BR>\n" . + "Sams, November 2000, ISBN 0-6723-1924-1, 505 pages", #info + "" #info_link +); + + +showBook( "Beginning PHP 4", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1861003730/wwwphpnet", #title_link + array("Jon Blan", "Wankyu Choi", "Allan Kent", "Ganesh Prasad", "Chris Ullmann"), #author(s) + "", #author_link(s) + "beginning_php4.jpg", #img + "Wrox Press Inc, October 2000, ISBN 1-8610-0373-0, 800 pages", #info + "" #info_link +); + + +showBook( "PHP Developer's Dictionary", #title(s) + "", #title_link + array("R. Allen Wyke", "Michael J. Walker", "Robert M. Cox"), #author(s) + "", #author_link(s) + "allen_wyke.jpg", #img + "Sams, Dec 2000, ISBN 0-6723-2029-0, 500 pages", #info + "" #info_link +); + + +showBook( "PHP 4 Developer's Guide", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0072127317/wwwphpnet", #title_link + "Blake Schwendiman", #author(s) + "", #author_link(s) + "schwendiman.jpg", #img + "Osborne McGraw-Hill, January 2001, ISBN 0-0721-2731-7, 775 pages", #info + "" #info_link +); + + +showBook( "MySQL/PHP Database Application", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0764535374/wwwphpnet", #title_link + array("Jay Greenspan", "Brad Bulger"), #author(s) + "", #author_link(s) + "greenspan.jpg", #img + "Hungry Minds, January 2001, ISBN 0-7645-3537-4, 500 pages", #info + "" #info_link +); + + +showBook( "PHP Functions Essential Reference", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/073570970X/wwwphpnet", #title_link + array("Landon Bradshaw","Graeme Merrall","Stephen Wall (Editor)"), #author(s) + array(false,"http://zend.com/comm_person.php?id=32",false), #author_link(s) + "till_gerken.jpg", #img + "New Riders Publishing, January 2001, ISBN 0-7357-0970-X, 500 pages", #info + "" #info_link +); + +echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; + +?> +</TABLE> + +<P><BR></P> + +<h1> +Other Languages +</h1> +<TABLE BORDER=0 CELLPADDING=5> + <? + +showBook( "PHP kurz & gut", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3897212250/wwwphpnet07", #title_link + array("Rasmus Lerdorf", "Ingo Marks (Deutsche &Uuml;bersetzung)"), #author(s) + array("http://zend.com/zend/hof/rasmus.php", "http://www.oreilly.de/catalog/phptbger/translator.html"), + #author_link(s) + "rasmus-kug.gif", #img + "O'Reilly, June 2000, ISBN 3-89721-255-0, 111 pages", #info + "http://www.oreilly.de/catalog/phptbger/index.html", #info_link + "de" +); + + +showBook( "PHP 4. Dynamische Webauftritte professionell realisieren", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3827258774/wwwphpnet07", #title_link + array("Egon Schmid", "Christian Cartus"), #author(s) + array("http://zend.com/zend/hof/schmid.php", false), #author_link(s) + "schmid_cartus.jpg", #img + "Mit einem Vorwort von ".make_link("http://www.zend.com/zend/hof/andi.php", "Andi Gutmans") . + " und " . make_link("http://www.zend.com/comm_person.php?id=12", "Zeev Suraski") . "<BR>\n" . + "Unter Mitarbeit von Markt+Technik Verlag<BR>\n" . + "New technology, Dec 2000, ISBN 3-8272-5877-4, 639 pages", #info + "http://www.php-buch.de/", #info_link + "de" #lang +); + + +showBook( "PHP - Dynamische websites professioneel ondersteunen", #title(s) + "http://www.pearsoneducation.nl/php3/boek1test.html?isbn=9043001406", #title_link + array("Egon Schmid", "Christian Cartus", "Richard Blume"), #author(s) + array("http://zend.com/zend/hof/schmid.php", false, false), #author_link(s) + "book-php-dutch.gif", #img + "Addison Wesley Longman, April 2000, ISBN 90-430-0140-6, 477 pages", #info + "", #info_link + "nl" #lang +); + + +showBook( array("PHP 4: Grundlagen und Profiwissen","Webserver-Programmierung unter Windows und Linux"), #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3446215468/wwwphpnet07", #title_link + "J&ouml;rg Krause", #author(s) + "", #author_link(s) + "joerg_krause.jpg", #img + "Hanser, Nov 2000, ISBN 3-446-21546-8, 1168 pages", #info + "http://www.php.comzept.de/", #info_link + "de" #lang +); + + +showBook( array("PHP 4","Webserver-Programmierung f&uuml;r Um- und Einsteiger"), #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3934358632/wwwphpnet07", #title_link + "Thomas Theis", #author(s) + "", #author_link(s) + "theis.gif", #img + "Galileo Press, May 2000, ISBN 3-934358-63-2, 354 pages", #info + "http://www.galileo-press.de/katalog/einzel.asp?ID=202", #info_link + "de" #lang +); + +showBook( "PHP 4", # title(s) + "http://www.amazon.de/exec/obidos/ASIN/3826690044/wwwphpnet07", #title_link + "Dr. Susanne Wigard", #author(s) + "", #author_link(s) + "susanne_wigard.jpg", #img + "BHV, December 2000, ISBN 3-8266-9004-4, 448 pages", #info + "http://www.bhv.net/bhv/buchreihen/deinst_1110_3.html", #info_link + "de" #lang +); + +showBook( "Das Einsteigerseminar PHP 4.0", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3828711103/wwwphpnet07", #title_link + "Dr. Susanne Wigard", #author(s) + "", #author_link(s) + "susanne_wigard.gif", #img + "BHV, Juni 2000, ISBN 3-8287-1110-3, 382 pages", #info + "http://www.bhv.net/bhv/buchreihen/deinst_1110_3.html", #info_link + "de" #lang +); + + +showBook( "PHP 4 + MySQL", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/381582043X/wwwphpnet07", #title_link + array("Rolf D. Stoll", "Gudrun Anna Leierer"), #author(s) + "", #author_link(s) + "databecker.gif", #img + "Data Becker, July 2000, ISBN 3-8158-2043-X, 439 pages", #info + "http://www.databecker.de/", #info_link + "de" #lang +); + + +showBook( "PHP 4 - Tutorial & Referenz", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3932311795/wwwphpnet07", #title_link + "Klaus Schmidt", #author(s) + "", #author_link(s) + "klaus_schmidt.jpg", #img + "Computer & Literatur Verlag GmbH, November 2000, ISBN 3-932-1179-5, 832 pages", #info + "http://www.ksweb.de/index.php?page=buch", #info_link + "de" #lang +); + + +showBook( "Jetzt lerne ich PHP 4", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3827258839/wwwphpnet07", #title_link + "Matt Zandstra", #author(s) + "", #author_link(s) + "matt_zandstra.jpg", #img + "Markt+Technik Verlag, December 2000, ISBN 3-8272-5883-9, 515 pages", #info + "", #info_link + "de" #lang +); + + +showBook( "Webanwendungen mit PHP 4.0 entwickeln", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3827317304/wwwphpnet07", #title_link + array("Tobias Ratschiller","Till Gerken"), #author(s) + array("http://zend.com/comm_person.php?id=7","http://zend.com/comm_person.php?id=11"), #author_link(s) + "tobias_and_till.jpg", #img + "Addison-Wesley, Jan 2001, ISBN 3-8273-1730-4, 400 pages", #info + "", #info_link + "de" #lang +); + + +showBook( "PHP 4", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3826680022/wwwphpnet07", #title_link + array("Uwe Hess", "G&uuml;nther Karl"), #author(s) + "", #author_link(s) + "uwe_and_gunther.jpg", #img + "bhv, Dec 2000, ISBN 3-8266-8002-2, 764 pages", #info + "", #info_link + "de" #lang +); + + +showBook( "PHP 4 f&uuml;r Profis. Werkzeugkiste und Kochbuch", #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3898421163/wwwphpnet07", #title_link + array("Helmut Dittrich","J&uuml;rgen Mellenthin"), #author(s) + "", #author_link(s) + "dittrich.jpg", #img + "Galileo Press, January 2001, ISBN 3-8984-2116-3, 500 pages", #info + "", #info_link + "de" #lang +); + +showBook( "PHP 4 programmering", #title(s) + "http://pagina.se/bok.html?20660", #title_link + "Jesper Ek and Ulrika Eriksson", #author(s) + "", #author_link(s) + "ek-eriksson.gif", #img + "February 2001, ISBN 9-1636-0660-7, 220 pages", #info + "", #info_link + "se" #lang +); + +showBook( "Gu&iacute;a Pr&aacute;cticas PHP 4", #title(s) + "http://www.AnayaMultimedia.es/", #title_link + "Esteban Trigos", #author(s) + "", #author_link(s) + "esteban_trigo.gif", #img + "Anaya Multimedia, December 2000, ISBN 8-4415-1079-2, 288 pages", #info + "http://www.en-linea.net/", #info_link + "es" #lang +); + + +showBook( "Pages Web dynamiques avec ASP, PHP, SQL", #title(s) + "http://www.amazon.fr/exec/obidos/ASIN/2744007099/wwwphpnet0f", #title_link + array("Jean-Marc Herellier","Philippe Merigod"), #author(s) + "", #author_link(s) + "herellier.gif", #img + "", #info + "", #info_link + "fr" #lang +); + + +showBook( "Programmation PHP", #title(s) + "http://www.amazon.fr/exec/obidos/ASIN/2744009237/wwwphpnet0f", #title_link + "Leon Atkinson", #author(s) + "http://zend.com/comm_person.php?id=30", #author_link(s) + "atkinson_fr.gif", #img + "Translation of Leon Atkinson's book", #info + "", #info_link + "fr" #lang +); + + +showBook( "Programmation Web avec PHP", #title(s) + "http://www.amazon.fr/exec/obidos/ASIN/2212091133/wwwphpnet0f", #title_link + array("Laurent Lacroix","Christophe Lauer","Nicolas Leprince","Christophe Boggero"), #author(s) + "", #author_link(s) + "lacroix.gif", #img + "April 2000, ISBN 2-212-09113-3, 364 pages", #info + "", #info_link + "fr" #lang +); + + +showBook( array("PHP tvorba interaktivnich internetovych aplikaci", "(PHP development interactive internet applications)"), #title(s) + "http://www.kosek.cz/php/index.html", #title_link + "Jiri Kosek", #author(s) + "", #author_link(s) + "czech-book.jpg", #img + "", #info + "", #info_link + "cz" #lang +); + + +showBook( "PHP Web-DB Programming Guide", #title(s) + "http://www.wowbook.com/wow/book_info/book-info.asp?isbn=ISBN89%2D381%2D0239%2D4", #title_link + "Jung Jinho", #author(s) + "", #author_link(s) + "korean-book.jpg", #img + "", #info + "", #info_link + "kr" #lang +); + + +showBook( "PHP Web Programming with ORACLE Database", #title(s) + "http://www.wowbook.com/book/info/book_detail.asp?isbn=ISBN89-87939-26-X", #title_link + "Kim Sung-Sik", #author(s) + "", #author_link(s) + "korean_book.gif", #img + "", #info + "", #info_link + "kr" #lang +); + + +showBook( "CGI & PHP", #title(s) + "http://ychat.pe.kr/", #title_link + "Youn Sukbum", #author(s) + "", #author_link(s) + "cgiphp.jpg", #img + "", #info + "", #info_link + "kr" #lang +); + + +showBook( "PHP Bible", #title(s) + "http://php.wilson.gs/bible", #title_link + "Wilson Peng", #author(s) + "", #author_link(s) + "wilson.jpg", #img + "", #info + "", #info_link + "cn" #lang +); + + +showBook( array("Using PHP and MySQL", "With FreeBSD and Apache"), #title(s) + "http://www.drmaster.com.tw/information.asp?®Ñ¸¹=DB20023", #title_link + "C.C.J.", #author(s) + "", #author_link(s) + "db20023.gif", #img + "July 1999, ISBN 957-527-168-8", #info + "http://www.dw.com.tw/book.html", #info_link + "cn" #lang +); + + +showBook( "Examples of PHP and MySQL", #title(s) + "http://www.drmaster.com.tw/information.asp?®Ñ¸¹=DB20029", #title_link + "C.C.J.", #author(s) + "", #author_link(s) + "db20029.gif", #img + "February 2000, ISBN 957-527-224-2", #info + "http://www.dw.com.tw/book.html", #info_link + "cn" #lang +); + + +showBook( "PHP tettei kouryaku", #title(s) + "http://books.softbank.co.jp/bookweb.nsf/7218069992c69510492566350001471a/5ab16e3b3dcf4ef7492566ff0048baac?OpenDocument", #title_link + array("Michihide Hotta","Tatsuo Ishii","Rui Hirokawa"), #author(s) + array(false,false,"http://www.cityfujisawa.ne.jp/%7Elouis/"), #author_link(s) + "japanese-book.gif", #img + "Sep 1999, ISBN 4-7973-0865-6", #info + "", #info_link + "jp" #lang +); + + +showBook( "PHP Guia de Consulta R&aacute;pida", #title(s) + "http://www.livcultura.com.br/scripts/cultura/resenha/resenha.asp?nitem=320216", #title_link + "Herbert G. Fischer", #author(s) + "", #author_link(s) + "fischer.jpg", #img + "Jan 2000, ISBN 8-5851-8469-8", #info + "http://phpclasses.UpperDesign.com/products.html/id/8585184698", #info_link + "pt" #lang +); + + +echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; + +?> +</TABLE> + +<P><BR></P> + +<h1> +Related Reading +</h1> + +<TABLE BORDER=0 CELLPADDING=5> + +<? + +showBook( array("Scriptsprachen f&uuml;r dynamische Webauftritte", "JavaScript, VBScript, ASP, Perl, PHP, XML"), #title(s) + "http://www.amazon.de/exec/obidos/ASIN/3446214135/wwwphpnet07", #title_link + "Prof. Dr. Wolfgang Dehnhardt", #author(s) + "", #author_link(s) + "dehnhardt.jpg", #img + "Hanser Verlag, Dec 2000, ISBN 3-446-21413-5, 452 pages", #info + "http://www.wsite.de/", #info_link + "de" #lang +); + + +showBook( "PostgreSQL: Introduction and Concepts", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0201703319/wwwphpnet", #title_link + "Bruce Momjian", #author(s) + "", #author_link(s) + "postgresql.jpg", #img + "Addison-Wesley Pub Co, Dec 2000, ISBN 0-2017-0331-9, 462 pages", #info + "", #info_link + "" #lang +); + + +showBook( "MySQL and mSQL (Nutshell Series)", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1565924347/wwwphpnet", #title_link + array("Randy Jay Yarger","George Reese","Tim King"), #author(s) + "", #author_link(s) + "mysql-book.gif", #img + "O'Reilly & Associates, July 1999, ISBN 1-56592-434-7, 487 pages<BR>\n" . + "Also available in ".make_link("http://www.books.ru/cgi-bin/v3/book_inf_code.cgi?5872","Russian"), #info + "", #info_link + "" #lang +); + + +showBook( "MySQL", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0735709211/wwwphpnet", #title_link + "Paul DuBois", #author(s) + "", #author_link(s) + "dubois.jpg", #img + "Foreword by ".make_link("http://zend.com/zend/hof/widenius.php", "Michael \"Monty\" Widenius") . + "New Riders, December 1999, ISBN 0-7357-0921-1, 756 pages" . + "Also available in " . + make_link("http://www.amazon.fr/exec/obidos/ASIN/2744008826/wwwphpnet0f", "French") . + " and " . make_link("http://www.amazon.de/exec/obidos/ASIN/382725793X/wwwphpnet07", "German"), #info + "http://www.newriders.com/books/title.cfm?isbn=0735709211", #info_link + "" #lang +); + + +showBook( "Webmaster in a Nutshell (Nutshell Series)", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1565923251/wwwphpnet", #title_link + array("Stephen Spainhour","Robert Eckstein"), #author(s) + "", #author_link(s) + "webmaster-book.gif", #img + "Includes a large chapter on PHP written by ".make_link("http://zend.com/zend/hof/rasmus.php", "Rasmus Lerdorf") . "<BR>\n" . + "O'Reilly & Associates, June 1999, 2nd edition, ISBN 1-5659-2325-1, 523 pages", #info + "http://www.oreilly.com/catalog/webmaster2/", #info_link + "" #lang +); + + +showBook( array("Open Source Development with CVS","Learn how to work with Open Source Software"), #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1576104907/wwwphpnet", #title_link + "Karl Franz Fogel", #author(s) + "", #author_link(s) + "cvsbook.gif", #img + "Coriolis, 1999, ISBN 1-57610-490-7, 316 pages", #info + "http://cvsbook.red-bean.com/", #info_link + "" #lang +); + + +showBook( "CVS Pocket Reference", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/0596000030/wwwphpnet", #title_link + "Gregor N. Purdy", #author(s) + "", #author_link(s) + "cvspr.gif", #img + "O'Reilly, August 2000, ISBN 0-5960-0003-0, 79 pages", #info + "http://www.oreilly.com/catalog/cvspr/", #info_link + "" #lang +); + + +showBook( "Mastering Regular Expressions", #title(s) + "http://www.amazon.com/exec/obidos/ASIN/1565922573/wwwphpnet", #title_link + array("Jeffrey E. Friedl","Andy Oram"), #author(s) + "", #author_link(s) + "regex.s.gif", #img + "O'Reilly, January 1997, ISBN 1-5659-2257-3, 368 pages", #info + "http://www.oreilly.com/catalog/regex/", #info_link + "" #lang +); + +?> + + +</TABLE> + + + +<?php commonFooter(); ?> Index: phpweb/bug-pwd-finder.php diff -u phpweb/bug-pwd-finder.php:1.3 phpweb/bug-pwd-finder.php:1.4 --- phpweb/bug-pwd-finder.php:1.3 Tue Oct 17 17:00:39 2000 +++ phpweb/bug-pwd-finder.php Wed Mar 7 16:17:34 2001 @@ -1,7 +1,8 @@ <? +require_once 'prepend.inc'; + /* See bugs.php for the table layout of bugdb. */ -require("shared.inc"); if (strstr($MYSITE,"bugs.php.net")) { $dbhost="localhost"; $dbuser="nobody"; Index: phpweb/bugs-dos-and-donts.php diff -u phpweb/bugs-dos-and-donts.php:1.2 phpweb/bugs-dos-and-donts.php:1.3 --- phpweb/bugs-dos-and-donts.php:1.2 Mon Jul 24 10:35:12 2000 +++ phpweb/bugs-dos-and-donts.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Bugs Database Dos and Don'ts"); ?> Index: phpweb/bugs-generating-backtrace.php diff -u phpweb/bugs-generating-backtrace.php:1.3 phpweb/bugs-generating-backtrace.php:1.4 --- phpweb/bugs-generating-backtrace.php:1.3 Tue Nov 7 07:58:18 2000 +++ phpweb/bugs-generating-backtrace.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Generating a gdb backtrace"); ?> Index: phpweb/bugs-php3.php diff -u phpweb/bugs-php3.php:1.15 phpweb/bugs-php3.php:1.16 --- phpweb/bugs-php3.php:1.15 Sat Feb 10 11:51:58 2001 +++ phpweb/bugs-php3.php Wed Mar 7 16:17:34 2001 @@ -1,11 +1,11 @@ <? +require_once 'prepend.inc'; if($save && $user && $pw) { SetCookie("MAGIC_COOKIE",base64_encode("$user:$pw"),time()+3600*24*12,'/'); } /* See the end of the script for the table layout. */ -require("shared.inc"); if (strstr($MYSITE,"bugs.php.net")) { $dbhost="localhost"; $dbuser="nobody"; Index: phpweb/bugs.php diff -u phpweb/bugs.php:1.80 phpweb/bugs.php:1.81 --- phpweb/bugs.php:1.80 Sat Feb 10 09:46:52 2001 +++ phpweb/bugs.php Wed Mar 7 16:17:34 2001 @@ -1,4 +1,5 @@ <?php +require_once 'prepend.inc'; if(isset($save) && isset($user) && isset($pw)) { SetCookie("MAGIC_COOKIE",base64_encode("$user:$pw"),time()+3600*24*12,'/'); @@ -11,7 +12,6 @@ if(!isset($pw)) $pw = ''; $destination = "php-dev@lists.php.net"; -require("shared.inc"); if (strstr($MYSITE,"bugs.php.net")) { $dbhost="localhost"; @@ -21,6 +21,10 @@ $dbhost="localhost"; $dbuser="nobody"; $dbpwd=""; +} else if (strstr($MYSITE,"news.php.net")) { + $dbhost="localhost"; + $dbuser="nobody"; + $dbpwd=""; } else { Header("Location: http://bugs.php.net/" . ($QUERY_STRING ? "?$QUERY_STRING" : "")); exit; @@ -30,7 +34,6 @@ $edit = $MAGIC_COOKIE ? 1 : 2; */ -$DISABLE_KICKOUTS=1; commonHeader("Bug Reporting"); echo "<!-- Bug photo by Dexter Sear, IO Vision. http://www.insects.org -->\n"; echo "<font size=-1>\n"; Index: phpweb/bugstats.php diff -u phpweb/bugstats.php:1.15 phpweb/bugstats.php:1.16 --- phpweb/bugstats.php:1.15 Tue Nov 28 06:46:10 2000 +++ phpweb/bugstats.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,6 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; + if(!strstr($MYSITE,"bugs.php.net")) { Header("Location: http://bugs.php.net/bugstats.php"); exit; Index: phpweb/cfp.php diff -u phpweb/cfp.php:1.1 phpweb/cfp.php:1.2 --- phpweb/cfp.php:1.1 Tue Jan 9 11:26:24 2001 +++ phpweb/cfp.php Wed Mar 7 16:17:34 2001 @@ -1,6 +1,6 @@ <? -require("shared.inc"); -commonHeader("Hypertext Preprocessor"); +require_once 'prepend.inc'; +commonHeader("Call For Participation"); ?> <h1>Call for Participation</h1> Index: phpweb/credits.php diff -u phpweb/credits.php:1.1 phpweb/credits.php:1.2 --- phpweb/credits.php:1.1 Mon May 22 11:30:01 2000 +++ phpweb/credits.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("PHP Credits"); phpcredits(); Index: phpweb/cvs-php.php diff -u phpweb/cvs-php.php:1.6 phpweb/cvs-php.php:1.7 --- phpweb/cvs-php.php:1.6 Wed Mar 7 07:37:10 2001 +++ phpweb/cvs-php.php Wed Mar 7 16:17:34 2001 @@ -1,21 +1,28 @@ <?php -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Using CVS for PHP Development"); ?> -<h3>Using CVS for PHP Development</h3> +<h1> +Using CVS for PHP Development +</h1> + <?php if(empty($fullname)){ ?> +<p> All PHP development is done through a distributed revision control system called CVS. This helps us track changes and it makes it possible for people located in all corners of the world to collaborate on a project without having to worry about stepping on each others' toes. -<P> +</p> +<p> Please note that you do <b>not</b> need a CVS account to <b>access</b> the CVS tree. See <a href="http://cvs.php.net">cvs.php.net</a> for details. You only need your own CVS account if you will be regularly committing things to the CVS tree. -<P> +</p> +<p> And once again since people just don't seem to understand this point: -<P> +</p> +<p> <table> <tr><td><b>Does <u>Not</u> Require CVS Account</b></td> <td>&nbsp;</td><td><b>Requires CVS Account</b></td></tr> <tr><td>Learning PHP</td> <td>&nbsp;</td><td>Coding PHP source in C</td></tr> @@ -27,9 +34,10 @@ <tr><td>One-time patch contributions</td> <td>&nbsp;</td><td>&nbsp;</td></tr> <tr><td>Adding notes to documentation</td> <td>&nbsp;</td><td>Authoring PHP documentation</td></tr> <tr><td>Writing web pages with PHP</td> <td>&nbsp;</td><td>Authoring www.php.net web pages</td></tr> - </table> -<P> +</p> + +<p> If you are contributing a patch, a small fix, or another minor change you are not required to obtain a CVS account before submitting it. If you are subscribed to <a href="mailto: php-dev@lists.php.net">php-dev@lists.php.net</a>, @@ -38,20 +46,23 @@ suggested, so the PHP development team can develop a working relationship with you and your code. It is suggested that all PHP developers subscribe to this list. -<P> +</p> +<p> Ok, if you are still reading, I assume you may actually need a CVS account. If you are not previously known to the PHP Development Team, then this is not an automatic process. Your best bet is to send mail to <a href="mailto: group@php.net"> group@php.net</a> and explain what you have in mind and perhaps give a bit of background on yourself. If you were told by a PHP developer to come here and fill out this form, you can skip sending the email to group@php.net. -<P> +</p> +<p> If, you have already established yourself in the above manner you can submit a CVS account request here: (only the encrypted version of the password is sent) In the purpose field, put a couple of words describing what you want to work on. This is mostly to jog our memories and allow us to match the account request with whatever previous correspondence that may taken place. -<P> +</p> +<p> Please note:<br> <b> You do <i>NOT</i> need a CVS account to study PHP. You do <i>NOT</i> need @@ -59,7 +70,8 @@ with PHP. If you are sitting there wondering if you need a CVS account, then you don't! </b> -<P> +</p> +<p> <form action="cvs-php.php" method="POST"> <table> <tr><th>Full Name: </th><td><input type=text size=50 name=fullname></td></tr> @@ -80,14 +92,24 @@ "Purpose: $purpose", 'From: "CVS Account Request" <donotemail@php.net>'); ?> +<p> Thank you. Your request has been sent. -<?php } -elseif ($fullname && $email && $password && $purpose && !$checkread) { ?> +</p> +<?php +} elseif ($fullname && $email && $password && $purpose && !$checkread) { +?> +<p> <blink><H1><font color="#ff0000">PLEASE, read our comments about applying for CVS accounts.</font></H1></blink> -<?php } -else { ?> +</p> +<?php +} else { +?> +<p> <blink><H1><font color="#ff0000">INCOMPLETE FORM. GO BACK AND RESUBMIT.</font></H1></blink> -<?php } ?> +</p> +<?php +} +?> <P> The CVS account, once granted and activated, gives you access to a number of things. First, and most important it gives you access to modify the PHP CVS tree. It also allows you to comment on and close bugs in the PHP bugs interface @@ -98,18 +120,23 @@ <li><a href="http://bugs.php.net/">PHP Bugs Database</a> <li><a href="http://www.php.net/manual/admin-notes.php">Manual Errata Administration</a> </ul> - +</p> +<p> If you are not familiar with CVS, you should have a look at the various documentation resources available at <a href="http://www.cvshome.org/">CVShome.org</a>. This is also where to get the most recent version -of the CVS client.<P> - +of the CVS client. +</p> +<p> All CVS commit messages get sent to the php-cvs mailing list. You should subscribe yourself to this mailing list. Instructions for subscribing are on the <a href="/support.php">Support</a> page. -<P> +</p> +<p> CVS itself is quite easy to use. Follow the steps listed on the <a href="anoncvs.php">anonymous CVS</a> page for checking out your tree. Substitute your own user name and password for the cvsread/phpfi combination listed there. You will not be able to do this until you receive confirmation of your account having been created. -<P> +</p> + +<p> Next, once you have your CVS tree you need to know the following commands. They should all be executed from within the checked out tree. eg. cd php4 <dl> @@ -123,11 +150,17 @@ describe the changes you made. Please provide a good description here as it may help people in the future when looking at your code changes. </dl> -<P> +</p> + +<p> It would probably be a good idea to put the following in your ~/.cvsrc file: <pre>diff -u cvs -z4 update -d -P checkout -P</pre> -<P>Your CVS account also translates into a foo@php.net email address where <b>foo</b> is your CVS user id. +</p> +<p> +Your CVS account also translates into a foo@php.net email address where <b>foo</b> is your CVS user id. +</p> + <?php commonFooter(); ?> Index: phpweb/cvsup.php diff -u phpweb/cvsup.php:1.1 phpweb/cvsup.php:1.2 --- phpweb/cvsup.php:1.1 Tue Jan 23 19:32:35 2001 +++ phpweb/cvsup.php Wed Mar 7 16:17:34 2001 @@ -1,20 +1,25 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Using CVSup to maintain local CVS repository"); ?> -<h3>Using CVSup to maintain local CVS repository</h3> +<h1> +Using CVSup To Maintain A Local CVS Repository +</h1> +<p> In addition to anonymous CVS, we also provide read-only access to our CVS repository by using CVSup. While CVSup is faster at updating large trees, it is not as widely available as the standard cvs client. -We will describe now how you can use CVSup.<p> +We will describe now how you can use CVSup. +</p> +<p> <ol> <li>Download the appropiate binary distribution from <a href="http://www.polstra.com/projects/freeware/CVSup/" >the CVSup homepage</a>. <li>Follow the instructions in the Install file of the binary distribution -<li>Create a php.cvsup file containing the following content:<p> +<li>Create a php.cvsup file containing the following content: <pre> *default host=CVSup.php.net *default base=/usr/src/php @@ -24,15 +29,16 @@ *default delete use-rel-suffix php3 php4 -</pre><p> +</pre> This will cause the php3 and php4 trees to be stored in /usr/src/php (you need to create that directory manually). -<li>At a command prompt, simply type:<p> -<code>cvsup php.cvsup</code> -<li>If you are behind a firewall, you might need to use:<p> -<code>cvsup -P - php.cvsup</code> +<li>At a command prompt, simply type: +<pre>cvsup php.cvsup</pre> +<li>If you are behind a firewall, you might need to use: +<pre>cvsup -P - php.cvsup</pre> <li>To build PHP, you need to install a few utilities (GNU autoconf, libtool, bison). Cd into php3 or php4 and run <code>./buildconf</code>. </ol> +</p> <? commonFooter(); ?> Index: phpweb/docs.php diff -u phpweb/docs.php:1.56 phpweb/docs.php:1.57 --- phpweb/docs.php:1.56 Thu Mar 1 14:49:07 2001 +++ phpweb/docs.php Wed Mar 7 16:17:34 2001 @@ -1,6 +1,6 @@ <?php -require("shared.inc"); -commonHeader("Documentation "); +require_once 'prepend.inc'; +commonHeader("Documentation"); $languages = array( "en" => "English", @@ -17,6 +17,8 @@ ); $formats = array( + "" => array("View Online", "view"), + "html/" => array("View Online (plain)", "view"), "bigmanual.html.gz" => array("Single HTML (compressed)", "html.gz"), "manual_doc.pdb" => array("PalmPilot DOC", "doc.pdb"), "manual_isilo.pdb" => array("PalmPilot iSilo", "isilo.pdb"), @@ -28,13 +30,18 @@ ); ?> -<H1>PHP FAQ</H1> +<H1> +PHP FAQ +</H1> <ul> <li>The <a href="/FAQ.php">PHP FAQ</a> is your first stop for general information and those questions that seem to be on most people's minds. </ul> + +<? echo hdelim(); ?> + <?php $prefix = ($MYSITE=='http://bugs.php.net/') ? 'http://www.php.net' : ''; ?> @@ -48,8 +55,13 @@ same manual in a light-weight, HTML 3.2 version without any bells or whistles. </ul> + + + +<? echo hdelim(); ?> -<H2>PHP Annotated Manuals</H2> + +<H1>PHP Annotated Manuals</H1> <ul> <LI><A href="http://www.php.net/manual/">PHP Annotated Manual</A>. This is the same as the above, except there is a built-in errata/note system @@ -61,8 +73,12 @@ Errata</A>. This is the collected errata from the on-line errata/note system. </ul> + + + +<? echo hdelim(); ?> -<H1>Downloadable PHP Manuals</H1> +<h1>Downloadable PHP Manuals</h1> <p>The PHP manual is also available in a selection of downloadable formats for off-line use. Pick your format and language from the @@ -104,7 +120,8 @@ }?> </table> -<H1>More information</H1> +<h1>More Information</h1> + <ul> <li><a href="http://zugeschaut-und-mitgebaut.de/php/">PHP Function Table</a>. This page has a overview about which pages are translated to the @@ -117,14 +134,24 @@ <li>License questions? See the <a href="/license/#FAQ">License FAQ</a></li> </ul> + + +<? echo hdelim(); ?> + + <H1>CVS Account</H1> <ul> <li><a href="/anoncvs.php">CVS instructions</a></li> <li><A href="/cvs-php.php">Getting a CVS account</a>. If you wish to help out with the development of PHP, read this. </ul> + + + +<? echo hdelim(); ?> + -<H1>Old/unsupported information</H1> +<h1>Old/Unsupported Information</h1> <ul> <li><a href="/manual/phpfi2.html">PHP/FI 2.0 Manual</a>. </ul> Index: phpweb/download-logos.php diff -u phpweb/download-logos.php:1.5 phpweb/download-logos.php:1.6 --- phpweb/download-logos.php:1.5 Fri Jan 19 18:13:23 2001 +++ phpweb/download-logos.php Wed Mar 7 16:17:34 2001 @@ -1,6 +1,6 @@ <? -require("shared.inc"); -commonHeader("Download PHP Logos "); +require_once 'prepend.inc'; +commonHeader("Download PHP Logos"); ?> <P> Index: phpweb/download-php3.php diff -u phpweb/download-php3.php:1.4 phpweb/download-php3.php:1.5 --- phpweb/download-php3.php:1.4 Mon Dec 11 17:59:04 2000 +++ phpweb/download-php3.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; $current = "3.0.18"; $win32_current = "3.0.17"; Index: phpweb/downloads.php diff -u phpweb/downloads.php:1.38 phpweb/downloads.php:1.39 --- phpweb/downloads.php:1.38 Wed Feb 28 17:29:15 2001 +++ phpweb/downloads.php Wed Mar 7 16:17:34 2001 @@ -1,19 +1,18 @@ <? -require("shared.inc"); -commonHeader("Downloads "); +require_once 'prepend.inc'; +commonHeader("Downloads"); $server = ($SERVER_PORT == "81" ? $SERVER_NAME . ":81" : $SERVER_NAME); - -// $server = 'ca.php.net'; ?> + +<h1>Latest version of PHP 4.0</h1> -<h2>Latest version of PHP 4.0</h2><BR> -<b>Complete Source Code</b><BR> +<h2>Complete Source Code</h2> <UL> <li><a href="http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_site=<?php echo $server; ?>">PHP 4.0.4pl1</a> - 11 January 2001</li> </UL> -<b>Win32 Binaries</b><BR> +<h2>Win32 Binaries</h2> <UL> <li><a href="http://www.php.net/do_download.php?download_file=php-4.0.4pl1-Win32.zip&source_site=<?php echo $server; ?>">PHP 4.0.4pl1</a> - 13 January 2001<br>(3.64 Mb CGI binary plus server API versions for Apache, AOL server, ISAPI and NSAPI. MySQL support built-in, many extensions included, packaged as zip)</li> <li><a href="http://www.php.net/do_download.php?download_file=php404pl1-installer.exe&source_site=<?php echo $server; ?>">PHP 4.0.4pl1</a> - 13 January 2001<br>(735 Kb CGI only, MySQL support built-in, packaged as Windows installer to install and configure PHP, and automatically configure IIS, PWS and Xitami, with manual configuration for other servers. N.B. no external extensions included)</li> @@ -33,10 +32,11 @@ --> </UL> + +<? echo hdelim(); ?> -<hr noshade> -<h3>Other Downloads</h3> +<h1>Other Downloads</h1> <UL> <li>For downloadable documentation, go to the <A HREF="docs.php">documentation</A> page @@ -45,12 +45,11 @@ <li><a href="http://www.zend.com/zend/optimizer.php">Zend Optimizer 1.0.0</a> for PHP 4.0.3 and later is available on Zend Technologies' web site. </ul> +<? echo hdelim(); ?> -<hr noshade> +<h1>Older Versions of PHP</h1> -<h3>Older Versions of PHP</h3> - <UL> <li><a href="download-php3.php">PHP 3.0</a> Source code and Win32 binaries <li><A HREF="ftp://ftp.nerosworld.com/pub/php/dist">PHP/FI 2.0</a> Source and related files @@ -59,8 +58,6 @@ <P> <I>Older releases are listed for archeological purposes only. They are no longer supported.</I> </P> - -<hr noshade> <? Index: phpweb/get-user-notes.php diff -u phpweb/get-user-notes.php:1.2 phpweb/get-user-notes.php:1.3 --- phpweb/get-user-notes.php:1.2 Mon Nov 27 14:30:42 2000 +++ phpweb/get-user-notes.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,6 @@ <?php -require('shared-manual.inc'); +require_once 'prepend.inc'; +require_once 'shared-manual.inc'; // a tool for // (on www.php.net) providing manual-notes in serialised form @@ -86,4 +87,4 @@ } -?> \ No newline at end of file +?> Index: phpweb/index.php diff -u phpweb/index.php:1.33 phpweb/index.php:1.34 --- phpweb/index.php:1.33 Wed Mar 7 07:45:57 2001 +++ phpweb/index.php Wed Mar 7 16:17:34 2001 @@ -1,94 +1,194 @@ <?php -header("Last-Modified: ".gmdate("D, d M Y H:i:s",getlastmod())." GMT"); -require("shared.inc"); +require_once 'prepend.inc'; + commonHeader("Hypertext Preprocessor"); echo "\n<!--$MYSITE-->\n"; + ?> -<h3>Announcing PHP-GTK</h3> + +<h1>New Site Design</h1> + +<p>You might notice that things look a little different around +here. We've streamlined the site, with a new design from the +esteemed Colin Viebrock. Bear with us while we shake out the +bugs that are surely lingering behind this new facade. +<br clear="all"> +</p> + +<? echo hdelim(); ?> + +<h1>Announcing PHP-GTK</h1> + +<p>The first release of PHP-GTK is now available. PHP-GTK is +a PHP extension that provides an object-oriented interface +to GTK+ toolkit and enables you to write client-side +cross-platform GUI applications. For more information, visit +<?print_link("http://gtk.php.net/")?>. +<br clear="all"> +</p> -The first release of PHP-GTK is now available. PHP-GTK is a PHP extension that -provides an object-oriented interface to GTK+ toolkit and enables you to write -client-side cross-platform GUI applications. For more information, visit -<a href="http://gtk.php.net/">http://gtk.php.net/</a>. +<? echo hdelim(); ?> -<h3>Patch Level 1 released for PHP 4.0.4</h3> +<h1>Patch Level 1 released for PHP 4.0.4</h1> +<p> Due to two security issues found in the Apache module version of PHP 4.0, PHP 4.0.4pl1 has been released. This bug-fix release also fixes a few party-crashing bugs that were discovered in PHP 4.0.4. +<br clear="all"> +</p> + +<? echo hdelim(); ?> -<h3>New usage stats for February available</h3> + +<h1> +<? print_link("/usage.php", make_image("stats-small.gif", "PHP Usage Stats", "right") ); ?> +New Usage Stats For February Available +</h1> <p> -<a href="/usage.php"><img align=right src="gifs/stats-small.gif" border=0 height=64 width=121 alt="PHP Usage Stats"></a> -<a href="http://www.netcraft.com/">Netcraft</a> and <a -href="http://www.securityspace.com/s_survey/">E-Soft</a> have -published their new results for their Web Server surveys - both -of which continue to show impressive growth for PHP. Check out the <a -href="usage.php">usage page</a>. -<br clear="all"> - -<a href="http://conferences.oreilly.com/oscon2001/"><img src="gifs/osscon.gif" align="right" border=0></a> -<h3>PHP Conference - <a href="cfp.php">Call for Participation</a></h3> -The conference will be part of the <a -href="http://conferences.oreilly.com/oscon2001/">O'Reilly Open Source -Convention</a> alongside the 5th annual Perl Conference at the <a -href="http://www.sheraton.com/property.taf?prop=127&lc=en">Sheraton San -Diego Hotel and Marina</a>, San Diego, California, July 23-27, 2001. All the -details on submitting talks are in the full <a href="cfp.php">CFP</a>. - -<h3>PHP 4.0.4 Released</h3> -Dec 19, 2000. This release includes -improvements for a large number of defects -and numerous enhancements in the PHP core, -the language implementation and -extensions. <a href="downloads.php">Download</a>, -<a href="ChangeLog-4.php">ChangeLog</a>. +<? print_link("http://www.netcraft.com/", "Netcraft"); ?> and +<? print_link("http://www.securityspace.com/s_survey/", "E-Soft" ); ?> have +published the February results for their Web Server surveys - both +of which continue to show impressive growth for PHP. Check out the +<? print_link("/usage.php", "usage page"); ?>. +<br clear="all"> +</p> + + +<? echo hdelim(); ?> -<h3>PHP 3.0.18 released</h3> -October 21, 2000. PHP 3.0.18 was released. This is a bug-fix release, including + +<h1> +<? print_link("http://conferences.oreilly.com/oscon2001/", make_image("osscon.gif", "OSSCon", "right") ); ?> +PHP Conference - Call For Participation +</h1> +<p> +The conference will be part of the <? print_link("http://conferences.oreilly.com/oscon2001/", +"O'Reilly Open Source Convention"); ?> alongside the 5th annual Perl Conference at the +<? print_link("http://www.sheraton.com/property.taf?prop=127&lc=en", +"Sheraton San Diego Hotel and Marina"); ?>, San Diego, California, July 23-27, 2001. +All the details on submitting talks are in the full <? print_link("/cfp.php", "CFP"); ?>. +<br clear="all"> +</p> + +<? echo hdelim(); ?> + + +<h1> +PHP 4.0.4 Released +</h1> +<p> +19-Dec-2000 -- This release includes improvements for a large number of defects +and numerous enhancements in the PHP core, the language implementation and +extensions. <? print_link("/downloads.php", "Download"); ?> and +<? print_link("/ChangeLog-4.php", "ChangeLog"); ?>. +<br clear="all"> +</p> + + +<? echo hdelim(); ?> + + +<h1> +PHP 3.0.18 Released +</h1> +<p> +21-Oct-2000 -- PHP 3.0.18 was released. This is a bug-fix release, including fixes for file uploads and a backported imagetypes() function from PHP 4.0. The -<a href="http://cvs.php.net/viewcvs.cgi/php3/ChangeLog?rev=1.854">ChangeLog</a> -contains a full list of changes. +<? print_link("http://cvs.php.net/viewcvs.cgi/php3/ChangeLog?rev=1.854", "ChangeLog"); ?> contains a full list of changes. +<br clear="all"> +</p> + -<h3>Improve your PHP skills</h3> +<? echo hdelim(); ?> + + +<h1> +Improve Your PHP Skills +</h1> +<p> Looking for clear and useful guides to build dynamic web-sites using -PHP? Our <a href="/books.php">Books Resource Center</a> lists now +PHP? Our <? print_link("/books.php", "Books Resource Center"); ?> lists now more than a dozen books in eight different languages. If you know about more PHP-related books, tell us about them! +<br clear="all"> +</p> -<h3>Manual Search Tip</h3> + +<? echo hdelim(); ?> + + +<h1> +Manual Search Tip +</h1> +<p> You can go directly to PHP manual pages with a URL such as -<a href="http://php.net/strlen">php.net/strlen</a>. +<? print_link("http://www.php.net/strlen", "www.php.net/strlen"); ?>. +<br clear="all"> +</p> + + +<? echo hdelim(); ?> + + +<h1> +Tips and Tricks Section +</h1> +<p> +Check out our <? print_link("/tips.php", "tips"); ?> page for some "neat" things, +PHP-related. It's a little sparse right now, but feel free to make suggestions! +<br clear="all"> +</p> + -<h3>Tips and Tricks Section</h3> -Check out our <A HREF="/tips.php">tips</A> page for some "neat" things, PHP-related. -It's a little sparse right now, but feel free to make suggestions! - -<img src="gifs/ZendOptimizer.gif" align="right"> -<h3>Zend Optimizer Released!</h3> -<a href="http://www.zend.com">Zend Technologies</a> has announced the availability of -the Zend Optimizer for PHP 4.0. The optimizer is available for -<a href="http://www.zend.com/zend/optimizer.php">free download</a>. +<? echo hdelim(); ?> -<h3>What is PHP?</h3> -<P> + +<h1> +<? print_image("ZendOptimizer.gif", "Zend", "right"); ?> +Zend Optimizer Released +</h1> +<p> +<? print_link("http://www.zend.com", "Zend Technologies"); ?> has announced the +availability of the Zend Optimizer for PHP 4.0. The optimizer is available for +<? print_link("http://www.zend.com/zend/optimizer.php", "free download"); ?>. +<br clear="all"> +</p> + + +<? echo hdelim(); ?> + + +<h1> +What Is PHP? +</h1> +<p> PHP is a server-side, cross-platform, HTML embedded scripting language. If you are completely new to PHP and want to get some idea of how it works, -have a look at the <a href="tut.php">Introductory Tutorial</a>. Once you get -beyond that have a look at the example archive sites and some of the other -resources available in the <a href="links.php">Links</a> section. -</P> +have a look at the <? print_link("/tut.php", "Introductory Tutorial"); ?>. +Once you get beyond that, have a look at the example archive sites and some +of the other resources available in the <? print_link("/links.php", "Links"); ?> section. +<br clear="all"> +</p> + + +<? echo hdelim(); ?> + -<h3>So, how much does it cost?</h3> -<P> +<h1> +So, How Much Does It Cost? +</h1> +<p> This may sound a little foreign to all you folks coming from a non-Unix background, but PHP doesn't cost anything. You can use it for commercial and/or non-commercial use all you want. You can give it to your friends, print it out and hang it on your wall or eat it for lunch. Welcome to -the world of <a href="http://www.opensource.org">Open Source</a> software! +the world of <? print_link("http://www.opensource.org", "Open Source"); ?> software! Smile, be happy, the world is good. For the full legalese, see the -official <a href="license.html">license</a>. -</P> +official <? print_link("/license.html", "license"); ?>. +<br clear="all"> +</p> <? commonFooter(); +?> Index: phpweb/license.html diff -u phpweb/license.html:1.3 phpweb/license.html:1.4 --- phpweb/license.html:1.3 Sat May 20 14:49:31 2000 +++ phpweb/license.html Wed Mar 7 16:17:34 2001 @@ -1,5 +1,7 @@ -<HTML><HEAD><TITLE>PHP 3 License</TITLE></HEAD> -<BODY> +<? +require_once 'prepend.inc'; +commonHeader('PHP License'); +?> <PRE> -------------------------------------------------------------------- Copyright (c) 2000 The PHP Development Team. All rights reserved. @@ -57,4 +59,6 @@ For more information on the PHP Development Team and the PHP project, please see <a href="http://www.php.net">www.php.net</a>. </PRE> -</BODY></HTML> +<? +commonFooter(); +?> Index: phpweb/links.php diff -u phpweb/links.php:1.14 phpweb/links.php:1.15 --- phpweb/links.php:1.14 Thu Feb 15 12:50:18 2001 +++ phpweb/links.php Wed Mar 7 16:17:34 2001 @@ -1,9 +1,19 @@ <? - require("shared.inc"); - commonHeader("Links"); +require_once 'prepend.inc'; +commonHeader("Links"); ?> -<h3>Developers and Job Opportunities</h3> +<h1>Projects</h1> + +<p> +An increasing number of projects, both commercial and open +source, are using PHP as their main development tool. There +is <a href="/projects.php">a listing of some of the +open-source PHP applications available</a>, courtesy of <a +href="http://freshmeat.net/">freshmeat</a>. </p> + + +<h1>Developers and Job Opportunities</h1> <P> Brian Schaffner has put up a <A HREF="http://www.schaffner.net/emp">PHP Employment Listing</A> site. PHP developers can post their resumes, and employers can post their job notices. @@ -24,8 +34,11 @@ search sites on the web, take a look at <a href="http://www.dmoz.org/Business/Employment/Job_Search/">dmoz.org's Job Search listings</a>.</p> + +<? echo hdelim(); ?> -<h3>ISPs that support PHP</h3> + +<h1>ISPs that support PHP</h1> <P> Looking for an ISP or hosting service that supports PHP? Try one of the following sites: </P> @@ -35,8 +48,12 @@ (features a searchable directory and comments from users)<BR> <LI>PMCW webservices (<a href="http://pmcw.dhs.org/">http://pmcw.dhs.org/</a>) </UL> + + +<? echo hdelim(); ?> + -<h3>Getting Started</h3> +<h1>Getting Started</h1> <P>On these sites you will find tutorials, articles and example scripts</P> <UL> @@ -77,7 +94,7 @@ German site about PHP with scripts, tips, forums, MyGuestBook, articles, news and more.<BR> <LI><A HREF="http://www.dynamic-webpages.de/">Dynamic-Webpages</A><BR> -German site with installation guides, tips & scripts, BestOfGML, +German site with installation guides, tips &amp; scripts, BestOfGML, WhoIsWho - a view on german PHP-cracks, german manual, book reviews, links and more.<BR> <LI><A HREF="http://www.phpwelt.de/">PHPWelt</A><BR> Index: phpweb/manual-lookup.php diff -u phpweb/manual-lookup.php:1.9 phpweb/manual-lookup.php:1.10 --- phpweb/manual-lookup.php:1.9 Fri Jan 12 14:06:35 2001 +++ phpweb/manual-lookup.php Wed Mar 7 16:17:34 2001 @@ -1,7 +1,7 @@ <?php // -*- C++ -*- -require("shared.inc"); -require("manual-lookup.inc"); +require_once 'prepend.inc'; +require_once 'manual-lookup.inc'; $function = strtolower($function); if (!isset($lang)) $lang = $MIRRORS[$MYSITE][6]; Index: phpweb/mirrors.php diff -u phpweb/mirrors.php:1.2 phpweb/mirrors.php:1.3 --- phpweb/mirrors.php:1.2 Fri Jan 19 17:42:28 2001 +++ phpweb/mirrors.php Wed Mar 7 16:17:34 2001 @@ -1,30 +1,40 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; +if (isset($country)) { + header("Location: http://$country.php.net/"); +} commonHeader("Mirrors Page"); ?> +<h1> +Mirror Sites +</h1> +<p> +Pick a mirror site close to you: +</p> + +<p> <FORM ACTION="redirect.php" METHOD="POST"> -<B>Pick a mirror site close to you:</B><BR> <SELECT NAME="URL"><? $mirror_sites=$MIRRORS; reset($mirror_sites); -while ($site = key($mirror_sites)): +while ($site = key($mirror_sites)) { next($mirror_sites); $country=$mirror_sites[$site][0]; $place=$mirror_sites[$site][1]; $type=$mirror_sites[$site][4]; - if ($type==1 && substr($site,0,7)=="http://"): + if ($type==1 && substr($site,0,7)=="http://") { echo "<OPTION VALUE=\"$site\">$place ($COUNTRIES[$country])\n"; - endif; -endwhile; + } +} ?></SELECT> -<INPUT TYPE="image" SRC="/gifs/b-go.gif" ALIGN=absmiddle WIDTH=36 HEIGHT=21 BORDER=0><BR> +<INPUT TYPE="submit" VALUE=" Go "><BR> </FORM> -<P> -<SMALL> -If you are interested in hosting a mirror of this site, <A HREF="/README.mirror">here's -how</A>. -</SMALL> -<P> +</p> + +<p> +If you are interested in hosting a mirror of this site, +<? print_link("/README.mirror", "here's how"); ?>. +</p> <? commonFooter(); ?> Index: phpweb/news.php diff -u phpweb/news.php:1.15 phpweb/news.php:1.16 --- phpweb/news.php:1.15 Tue Jan 23 01:23:33 2001 +++ phpweb/news.php Wed Mar 7 16:17:34 2001 @@ -1,104 +1,152 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("PHP in the News"); -function makeEntry($title,$subtitle,$url=false,$date="") { - global $FONTFACE; -?> -<TR bgcolor='#D0D0D0' valign=top> -<TD ALIGN=left WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-lefttop.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -<TD ALIGN=left><? - echo "<FONT FACE=\"$FONTFACE\">\n"; - echo "<B>$title</B><BR></FONT>\n"; -?></TD> -<TD ALIGN=right width=200><? - echo "<FONT FACE=\"$FONTFACE\" SIZE=-1>\n"; - echo "<I>$date</I>&nbsp;<BR></FONT>\n"; -?></TD> -<TD ALIGN=right WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-righttop.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -</TR> -<TR VALIGN=bottom bgcolor='#D0D0D0'> -<TD ALIGN=left><IMG alt=" " SRC="/gifs/gcap-leftbot.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -<TD ALIGN=left COLSPAN=2><? - echo "<FONT FACE=\"$FONTFACE\" SIZE=-1>\n"; - echo "$subtitle<BR>\n"; +function makeEntry($title,$author=false,$url=false,$date=false) { + echo '<DT>'; + + echo hdelim(); + + echo '<h2>' . $title . '</h2>'; + if ($author) { + echo 'by ' . $author . '<BR>'; + } if ($url) { - echo "<A HREF=\"".$url."\" TARGET=\"_blank\">".$url."</A><BR></FONT>\n"; - } else { - echo "<I>This article is not available online</I><BR></FONT>\n"; + print_link($url,$url); + echo '<BR>'; } -?></TD> -<TD ALIGN=right><IMG alt=" " SRC="/gifs/gcap-rightbot.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -</TR> -<TR VALIGN=top> -<TD WIDTH=18><BR></TD> -<TD ALIGN=left colspan=2> -<TABLE border=0 cellpadding=5 cellspacing=0 bgcolor="#F0F0F0" width=100%> -<TR><TD><FONT FACE="<? echo $FONTFACE;?>" SIZE=-1> -<? -}; + if ($date) { + echo $date . '<BR>'; + } + echo '</DT>'; + echo '<DD>'; +} function endEntry() { -?> -<BR><BR></TD></TR></TABLE> -</TD> -<TD width=18><BR></TD> -</TR> -<? -}; + echo '</DD>'; +} ?> -<h3>PHP in the News</h3> + +<h1>PHP in the News</h1> -<P> -<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> +<p> +If you have written an article, or spot something on the Net somewhere that +isn't listed here, please send a note to <a href="mailto:core@php.net">core@php.net</a> +and we will be sure to add it to this list. +</p> -<? makeEntry ("Why PHP?", "by <A HREF=\"mailto:the_jalal@yahoo.com\">Jalal Pushman</A>", - "http://www.WebDevelopersJournal.com/articles/why_php.html", "November 7, 2000");?> -According to NetCraft surveys, PHP is now the most popular module for the Apache server and in total running on something like two million Web sites. Here are some of the reasons why PHP is such a popular server side scripting language. + +<DL> + +<? makeEntry ("Why PHP?", + "Jalal Pushman", + "http://www.WebDevelopersJournal.com/articles/why_php.html", + "November 7, 2000"); +?> +According to NetCraft surveys, PHP is now the most popular module for the +Apache server and in total running on something like two million Web sites. +Here are some of the reasons why PHP is such a popular server side scripting language. <? endEntry(); ?> + -<? makeEntry ("The Scoop on PHP - Want a Cure For the ASP Blues? Delve Into the Dynamic Web With This Popular Scripting Language", "by Craig Knudsen", - "http://www.linux-mag.com/online/php_01.html", "September 14, 2000");?> -I first discovered PHP a little over a year ago at Freshmeat.net. Because most non-commercial sites at that time used Perl CGI scripts for dynamic content, I found it interesting that Freshmeat's dynamic pages all ended with .php3 instead of the .pl or .cgi associated with Perl/CGI sites like Slashdot. I did a little exploring, quickly downloaded PHP version 3, and immediately became a PHP fan. +<? makeEntry ("The Scoop on PHP - Want a Cure For the ASP Blues?", + "Craig Knudsen", + "http://www.linux-mag.com/online/php_01.html", + "September 14, 2000" ); +?> +I first discovered PHP a little over a year ago at Freshmeat.net. Because most +non-commercial sites at that time used Perl CGI scripts for dynamic content, +I found it interesting that Freshmeat's dynamic pages all ended with .php3 +instead of the .pl or .cgi associated with Perl/CGI sites like Slashdot. I +did a little exploring, quickly downloaded PHP version 3, and immediately +became a PHP fan. <? endEntry(); ?> + -<? makeEntry( "LinuxTag - some impressions", "by <a href=\"mailto:winni@xpilot.org\">Winfried Tr&uuml;mper</a>", - "http://www.guug.de:8080/fotos/linuxtag/story/index.html", "July, 2000");?> -The literal translation of LinuxTag is LinuxDay. This title is a leftover from ancient times, when the event really lasted one day. This year the event occupied the fair in Stuttgart for four whole days, beginning at thurday with a business congress. For those commercially relevant lectures you had to pay. However, a total of over 100 hours of free lectures followed from friday to sunday, addressing the interests of end-users and developers. During all days companies and free software developers showed their Linux-products on an area of 6.000 m². An estimated number of 17.000 people visited the LinuxTag, making it a big success to be repeated next year. +<? makeEntry( "LinuxTag - some impressions", + "Winfried Tr&uuml;mper", + "http://www.guug.de:8080/fotos/linuxtag/story/index.html", + "July, 2000"); +?> +The literal translation of LinuxTag is LinuxDay. This title is a leftover from ancient +times, when the event really lasted one day. This year the event occupied the fair in +Stuttgart for four whole days, beginning at thurday with a business congress. For +those commercially relevant lectures you had to pay. However, a total of over 100 +hours of free lectures followed from friday to sunday, addressing the interests of +end-users and developers. During all days companies and free software developers +showed their Linux-products on an area of 6.000 m². An estimated number of 17,000 people +visited the LinuxTag, making it a big success to be repeated next year. <? endEntry(); ?> -<? makeEntry ("Brennpunkt WWW", "by <a href=\"mailto:tobias@dnet.it\">Tobias Ratschiller</a>", - "http://www.heise.de/ix/artikel/2000/07/052/", "June 23, 2000");?> -(In German.) Maßgeschneidert für das Web: PHP 4.0. Mit der am 22. Mai freigegebenen Version 4.0 wandelt sich PHP von der Skriptsprache für kleine und mittlere Webanwendungen zur umfangreichen Middleware-Technik. + +<? makeEntry ("Brennpunkt WWW", + "Tobias Ratschiller", + "http://www.heise.de/ix/artikel/2000/07/052/", + "June 23, 2000"); +?> +[in German] Maßgeschneidert für das Web: PHP 4.0. Mit der am 22. Mai freigegebenen +Version 4.0 wandelt sich PHP von der Skriptsprache für kleine und mittlere Webanwendungen +zur umfangreichen Middleware-Technik. <? endEntry(); ?> -<? makeEntry( "Are PHP and MySQL the Perfect Couple?", "by <a href=\"http://www.oreillynet.com/pub/au/77\">Jason Gilmore</a>", - "http://www.oreillynet.com/pub/a/network/2000/06/16/magazine/php_mysql.html", "June 16, 2000");?> -MySQL and PHP have developed a special sort of relationship over the past few years, perhaps due in large part to the fact that they are both freely available for download. The increased popularity of this dynamic duo, coupled with boundless enthusiasm from core developers of both technologies, culminated in a "meeting of the minds" in Israel earlier this year. This resulted in the MySQL library being packaged with the PHP 4.0 distribution, in addition to an agreement to help each other improve the performance quality of product integration whenever the opportunity arises. + +<? makeEntry( "Are PHP and MySQL the Perfect Couple?", + "Jason Gilmore", + "http://www.oreillynet.com/pub/a/network/2000/06/16/magazine/php_mysql.html", + "June 16, 2000"); +?> +MySQL and PHP have developed a special sort of relationship over the past few years, +perhaps due in large part to the fact that they are both freely available for download. +The increased popularity of this dynamic duo, coupled with boundless enthusiasm from core +developers of both technologies, culminated in a "meeting of the minds" in Israel earlier +this year. This resulted in the MySQL library being packaged with the PHP 4.0 distribution, +in addition to an agreement to help each other improve the performance quality of product +integration whenever the opportunity arises. <? endEntry(); ?> -<? makeEntry( "Your SQL Database Might Just Be MySQL", "by <a href=\"http://www.oreillynet.com/pub/au/75\">John Paul Ashenfelter</a>", - "http://www.oreillynet.com/pub/a/network/2000/06/16/magazine/mysql.html", "June 16, 2000");?> -So you need to build a database application that will be delivered over the Web. Your users have the browsers, you've got the web server and application software, but you need a database. What are your choices? + +<? makeEntry( "Your SQL Database Might Just Be MySQL", + "John Paul Ashenfelter", + "http://www.oreillynet.com/pub/a/network/2000/06/16/magazine/mysql.html", + "June 16, 2000"); +?> +So you need to build a database application that will be delivered over the Web. +Your users have the browsers, you've got the web server and application software, +but you need a database. What are your choices? <? endEntry(); ?> + -<? makeEntry( "Student Suspended Over Suspected Use of PHP", "by National News", - "http://bbspot.com/News/2000/6/php_suspend.html", "June 14, 2000");?> -"A teacher overheard him say that he was using PHP, and as part of our Zero-Tolerance policy against drug use, he was immediately suspended. No questions asked," said Principal Clyde Thurlow. "We're not quite sure what PHP is, but we suspect it may be a derivative of PCP, or maybe a new designer drug like GHB." +<? makeEntry( "Student Suspended Over Suspected Use of PHP", + "by National News", + "http://bbspot.com/News/2000/6/php_suspend.html", + "June 14, 2000"); +?> +"A teacher overheard him say that he was using PHP, and as part of our Zero-Tolerance +policy against drug use, he was immediately suspended. No questions asked," said +Principal Clyde Thurlow. "We're not quite sure what PHP is, but we suspect it may +be a derivative of PCP, or maybe a new designer drug like GHB." <? endEntry(); ?> + -<? makeEntry( "Object-Oriented Programming with PHP", "by <a mailto:href=\"mailto:wj@unstrung.com\">Jason Gilmore</a>", - "http://www.webreview.com/2000/06_02/developers/06_02_00_3.shtml", "June 2, 2000");?> +<? makeEntry( "Object-Oriented Programming with PHP", + "Jason Gilmore", + "http://www.webreview.com/2000/06_02/developers/06_02_00_3.shtml", + "June 2, 2000"); +?> Couple Object-Oriented Programming with PHP and you've got features worth inheriting. From foundations to class to inheritance, Jason makes understanding objects within PHP easy--and practical. <? endEntry(); ?> -<? makeEntry( "PHP From an IT Manager's Perspective", "by <a mailto:href=\"mailto:tobias@phpwizard.net\">Tobias Ratschiller</a>", - "http://idm.internet.com/articles/200005/php_05_30_00a.html", "May 31, 2000");?> + +<? makeEntry( "PHP From an IT Manager's Perspective", + "Tobias Ratschiller", + "http://idm.internet.com/articles/200005/php_05_30_00a.html", + "May 31, 2000"); +?> What have sprint.ca, livebid.amazon.com, xoom.com, and mp3.lycos.com in common? All employ one of the Web's hottest server side technologies: PHP, the PHP Hypertext Preprocessor. As this article shows, PHP over the years @@ -106,150 +154,293 @@ features, and provides today a base that can easily stand out in the increasingly crowded server-side application development platform market. <? endEntry(); ?> + -<? makeEntry( "PHP 4.0: Dynamic Content for the Web Warrior", "by <a href=\"mailto:paulferris@linuxtoday.com\">Paul Ferris</a>", - "http://www.linuxplanet.com/linuxplanet/reviews/1891/1/", "May 28, 2000");?> -If you've been cruising the net, looking for the latest and greatest things, you often come across vaporware technologies, and promises that are made and broken. You might find yourself imagining things, like over-hyped proprietary products coming down the pike, where the choices had been open in the past. +<? makeEntry( "PHP 4.0: Dynamic Content for the Web Warrior", + "Paul Ferris", + "http://www.linuxplanet.com/linuxplanet/reviews/1891/1/", + "May 28, 2000"); +?> +If you've been cruising the net, looking for the latest and greatest things, +you often come across vaporware technologies, and promises that are made and +broken. You might find yourself imagining things, like over-hyped proprietary +products coming down the pike, where the choices had been open in the past. <? endEntry(); ?> + -<? makeEntry( "MySQL-Daten mit PHP ins Web bringen", "by <a href=\"mailto:hb@ix.heise.de\">Henning Behme</a>", - "http://www.heise.de/ix/artikel/2000/06/056/", "May 17, 2000");?> -(In German.) Dynamische Websites sind meist von Datenbanken abhängig. Deren Bestände lassen sich `on the fly' vom Server zu Surfer übertragen. PHP ist eine Skriptsprache, die die Integration von DBMS-Daten in HTML-Dateien erleichtert. +<? makeEntry( "MySQL-Daten mit PHP ins Web bringen", + "Henning Behme", + "http://www.heise.de/ix/artikel/2000/06/056/", + "May 17, 2000"); +?> +[in German] Dynamische Websites sind meist von Datenbanken abhängig. Deren +Bestände lassen sich `on the fly' vom Server zu Surfer übertragen. PHP ist +eine Skriptsprache, die die Integration von DBMS-Daten in HTML-Dateien erleichtert. <? endEntry(); ?> + -<? makeEntry( "Evolution of a Super Hero", "by <a href=\"mailto:tobias@dnet.it\">Tobias Ratschiller</a>", - "http://www.webtechniques.com/archives/2000/05/ratschiller/", "April 7, 2000");?> +<? makeEntry( "Evolution of a Super Hero", + "Tobias Ratschiller", + "http://www.webtechniques.com/archives/2000/05/ratschiller/", + "April 7, 2000"); +?> What's that in the sky? Is it Perl? Is it ASP? Is it JSP? No, it's PHP 4.0! Tobias Ratschiller has the inside story on what you can expect from release candidate 1. <? endEntry(); ?> + -<? makeEntry( "PHP and XML, technical or cultural gap?", "by <a href=\"http://www.xmlhack.com/author.php?id=8\">Eric van der Vlist</a>", - "http://www.xmlhack.com/read.php?item=338", "March 14, 2000");?> -Classified as "the most popular Apache module" by E-Soft, PHP is one of the least frequently mentioned languages amongst the XML discussion lists. +<? makeEntry( "PHP and XML: Technical or Cultural Gap?", + "Eric van der Vlist", + "http://www.xmlhack.com/read.php?item=338", + "March 14, 2000"); +?> +Classified as "the most popular Apache module" by E-Soft, PHP is one of the least +frequently mentioned languages amongst the XML discussion lists. <? endEntry(); ?> -<? makeEntry( "Under The Hood of PHP 4", "by Zeev Suraski", - "http://www.zend.com/zend/art/under-php4-hood.php", "February 27, 2000");?> +<? makeEntry( "Under The Hood of PHP 4", + "Zeev Suraski", + "http://www.zend.com/zend/art/under-php4-hood.php", + "February 27, 2000"); +?> Describes the major differences and improvements in the next generation PHP, PHP 4. <? endEntry(); ?> + -<? makeEntry( "PHP: Past, Present, and Future", "by Rasmus Lerdorf, Stig Bakken, Andi Gutmans, and Zeev Suraski", - "http://hotwired.lycos.com/webmonkey/radio/php.html", "February 27, 2000");?> -You may already know that PHP is fast, stable, and easy to learn, but you may not know how it got that way. In this interview, Rasmus Lerdorf, the creator of PHP, talks about the unlikely origins of this open-source product. Then core developers Stig Bakken, Andi Gutmans, and Zeev Suraski explain how they came to work on PHP and discuss the evolution of the language. Plus, you'll hear about the planned support for XML and MySQL and what's going on with Zend. +<? makeEntry( "PHP: Past, Present, and Future", + "Rasmus Lerdorf, Stig Bakken, Andi Gutmans, and Zeev Suraski", + "http://hotwired.lycos.com/webmonkey/radio/php.html", + "February 27, 2000"); +?> +You may already know that PHP is fast, stable, and easy to learn, but you may not +know how it got that way. In this interview, Rasmus Lerdorf, the creator of PHP, +talks about the unlikely origins of this open-source product. Then core developers +Stig Bakken, Andi Gutmans, and Zeev Suraski explain how they came to work on PHP +and discuss the evolution of the language. Plus, you'll hear about the planned +support for XML and MySQL and what's going on with Zend. <? endEntry(); ?> + -<? makeEntry( "Template-Based Web Sites as Easy as P-H-P", "by <a href=\"http://www.webreview.com/pub/au/Gilmore_Jason\">Jason Gilmore</a>", - "http://www.webreview.com/pub/2000/02/11/php/index.html", "February 11, 2000");?> +<? makeEntry( "Template-Based Web Sites as Easy as P-H-P", + "Jason Gilmore", + "http://www.webreview.com/pub/2000/02/11/php/index.html", + "February 11, 2000"); +?> Tutorial for creating template-based Web sites with PHP. <? endEntry(); ?> + -<? makeEntry( "Authenticate and Track Users with PHP", "by <a href=\"mailto:jcm@i2ii.com\">Julie Meloni</a>", - "http://hotwired.lycos.com/webmonkey/00/05/index2a.html", "February 2, 2000");?> -Shows you the basics of PHP-based user authentication, the use of cookies, and a short glimpse (with working examples!) at the session functions of PHP4. The article was written by Julie Meloni, author of <a href="http://www.thickbook.com/">PHP Essentials</a>, a book for the beginning or intermediate PHP user, available in March at a bookstore near you. +<? makeEntry( "Authenticate and Track Users with PHP", + "Julie Meloni", + "http://hotwired.lycos.com/webmonkey/00/05/index2a.html", + "February 2, 2000"); +?> +Shows you the basics of PHP-based user authentication, the use of cookies, and a +short glimpse (with working examples!) at the session functions of PHP4. The +article was written by Julie Meloni, author of <a href="http://www.thickbook.com/">PHP Essentials</a>, +a book for the beginning or intermediate PHP user, available in March at a bookstore near you. <? endEntry(); ?> -<? makeEntry( "What you should know about PHP", "by <a href=\"mailto:gilmore@cob.ohio-state.edu\">Jason Gilmore</a>", - "http://webreview.com/pub/2000/01/21/feature/index.html", "January 21, 2000");?> + +<? makeEntry( "What you should know about PHP", + "Jason Gilmore", + "http://webreview.com/pub/2000/01/21/feature/index.html", + "January 21, 2000"); +?> PHP can help you look like a web-wunderkid while saving you hours of drudgery. <? endEntry(); ?> -<? makeEntry( "PHP: a silent killer", "by <a href=\"mailto:jim.white@sreb.org\">Jim White</a>", - "http://www.osopinion.com/Opinions/JimWhite/JimWhite5.html", "December 22, 1999");?> -PHP is now running over a million web sites and with good reason. PHP is open source, it runs equally well on NT and UNIX, it's well documented. PHP is no doubt stealing market share from Microsoft's Active Server Pages, but the media has been unusually quiet about the issue. Even as Apache's success has become front page news, PHP has gone largely unnoticed. Maybe Microsoft wants to keep it that way. + +<? makeEntry( "PHP: A Silent Killer", + "Jim White", + "http://www.osopinion.com/Opinions/JimWhite/JimWhite5.html", + "December 22, 1999"); +?> +PHP is now running over a million web sites and with good reason. PHP is open source, +it runs equally well on NT and UNIX, it's well documented. PHP is no doubt stealing +market share from Microsoft's Active Server Pages, but the media has been unusually +quiet about the issue. Even as Apache's success has become front page news, PHP has +gone largely unnoticed. Maybe Microsoft wants to keep it that way. <? endEntry(); ?> -<? makeEntry( "Welcome Zend", "by <a href=\"mailto:gmerrall@email.com\">Graeme Merral</a>", - "http://hotwired.lycos.com/webmonkey/99/51/index3a.html", "December 16, 1999");?> + +<? makeEntry( "Welcome Zend", + "Graeme Merral", + "http://hotwired.lycos.com/webmonkey/99/51/index3a.html", + "December 16, 1999"); +?> Optimization - PHP vs. ASP - New Features - Geeky Features <? endEntry(); ?> + -<? makeEntry( "The latest best-kept secret", "by <a href=\"mailto:glyn_moody@cix,co.uk\">Glyn Moody</a>", - "http://www.computerweekly.com/cwarchive/gwfeat/19991209/cwcontainer.asp?name=F1.html", "December 9, 1999");?> +<? makeEntry( "The Latest Best-Kept Secret", + "Glyn Moody", + "http://www.computerweekly.com/cwarchive/gwfeat/19991209/cwcontainer.asp?name=F1.html", + "December 9, 1999"); +?> With the same features as ASP and JSP, PHP is the fastest growing Apache add-on. <? endEntry(); ?> + -<? makeEntry( "Trio informale", "by <a href=\"mailto:nicht_ich@gmx.de\">Dirk Reichelt</a>", - "http://www.zdnet.de/internet/artikel/java/199912/phpdatenbank01_00-wc.html", "November 29, 1999");?> -(In German.) &quot;Redaktionssystem für die Website mit PHP&quot; +<? makeEntry( "Trio Informale", + "Dirk Reichelt", + "http://www.zdnet.de/internet/artikel/java/199912/phpdatenbank01_00-wc.html", + "November 29, 1999"); +?> +[in German] &quot;Redaktionssystem für die Website mit PHP&quot; <? endEntry(); ?> -<? makeEntry( "Interview with the PHP Team", "by <a href=\"mailto:lpdevel@linuxpower.org\">Linuxpower Team</a>", - "http://www.linuxpower.org/display_item.phtml?id=149", "November 17, 1999");?> -An interview with the core PHP development team: Andi, Andrei, Jim, Rasmus, Sascha, Stig, Thies, and Zeev. + +<? makeEntry( "Interview with the PHP Team", + "the Linuxpower Team", + "http://www.linuxpower.org/display_item.phtml?id=149", + "November 17, 1999"); +?> +An interview with the core PHP development team: Andi, Andrei, Jim, Rasmus, Sascha, +Stig, Thies, and Zeev. <? endEntry(); ?> + -<? makeEntry( "Web-Page Generator PHP Gets A Much-Needed Jolt in Version 4", "by Ahmad Abualsamid", - "http://www.techweb.com/se/directlink.cgi?NWC19991101S0014", "November 1, 1999");?> -PHP began as a small project to enhance a single Web site; it eventually became the most popular server-side scripting language for use with Apache. +<? makeEntry( "Web-Page Generator PHP Gets A Much-Needed Jolt in Version 4", + "by Ahmad Abualsamid", + "http://www.techweb.com/se/directlink.cgi?NWC19991101S0014", + "November 1, 1999"); +?> +PHP began as a small project to enhance a single Web site; it eventually became the +most popular server-side scripting language for use with Apache. <? endEntry(); ?> + -<? makeEntry( "PHP-Einf&uuml;hrung", "by <a href=\"mailto:tobias@dnet.it\">Tobias Ratschiller</a>", - "http://www.internetworld.de/iw/magazin_11phpeinfuehrung.htm", "October 20, 1999");?> -(In German.) &quot;Over ten percent of all web servers have the scripting +<? makeEntry( "PHP-Einf&uuml;hrung", + "Tobias Ratschiller", + "http://www.internetworld.de/iw/magazin_11phpeinfuehrung.htm", + "October 20, 1999"); +?> +[in German] &quot;Over ten percent of all web servers have the scripting language PHP installed. Internet World shows you how to create dynamic web pages with PHP.&quot; Introduction to PHP in four parts.&quot; <? endEntry(); ?> + -<? makeEntry( "PHP: One Size Fits All", "by Niels Pollem","http://www.heise.de/ix/artikel/1999/07/076/", "July 19, 1999");?> -(In German.) Dynamisch generierte Web-Seiten zu erstellen geh&ouml;rt +<? makeEntry( "PHP: One Size Fits All", + "Niels Pollem", + "http://www.heise.de/ix/artikel/1999/07/076/", + "July 19, 1999"); +?> +[in German] Dynamisch generierte Web-Seiten zu erstellen geh&ouml;rt l&auml;ngst zum normalen Handwerk. Werkzeuge und Sprachen daf&uuml;r stehen zur Verf&uuml;gung. Das derzeit noch in der Version&nbsp;3 verf&uuml;gbare PHP bietet sich dabei f&uuml;r Anf&auml;nger wie Profis an - und PHP ist Open Source. <? endEntry(); ?> + -<? makeEntry( "Uncovering One of the Web's Secrets: Integrated Scripting with PHP", "by Leon Atkinson","http://webreview.com/wr/pub/1999/07/09/feature/index.html?wwwrrr_19990709.html", "July 9, 1999");?> +<? makeEntry( "Uncovering One of the Web's Secrets: Integrated Scripting with PHP", + "Leon Atkinson", + "http://webreview.com/wr/pub/1999/07/09/feature/index.html?wwwrrr_19990709.html", + "July 9, 1999"); +?> A basic introduction to PHP, by the author of "Core PHP Programming". <? endEntry(); ?> -<? makeEntry( "Treasure trove: PHP offers features that will make your Web apps sparkle", "by Nicholas Petreley","http://www.infoworld.com/articles/op/xml/990621oppetreley.xml", "June 19, 1999");?> + +<? makeEntry( "Treasure Trove: PHP Offers Features That Will Make Your Web Apps Sparkle", + "Nicholas Petreley", + "http://www.infoworld.com/articles/op/xml/990621oppetreley.xml", + "June 19, 1999"); +?> LinuxWorld's editorial director discovers PHP and extols its virtues. <? endEntry(); ?> -<? makeEntry( "Site Navigation with PHP", "by Brad Bulger","http://www.hotwired.com/webmonkey/99/25/index2a.html", "June 16, 1999");?> + +<? makeEntry( "Site Navigation with PHP", + "Brad Bulger", + "http://www.hotwired.com/webmonkey/99/25/index2a.html", + "June 16, 1999"); +?> Another Webmonkey article on using PHP, this time explaining how to use PHP to make it easier for users to navigate your website. <? endEntry(); ?> -<? makeEntry( "PHP/MySQL Tutorial", "by Graeme Merrall","http://www.hotwired.com/webmonkey/99/21/index2a.html?tw=frontdoor", "May 19, 1999");?> + +<? makeEntry( "PHP/MySQL Tutorial", + "Graeme Merrall", + "http://www.hotwired.com/webmonkey/99/21/index2a.html?tw=frontdoor", + "May 19, 1999"); +?> A three-lesson tutorial on using PHP and MySQL together on Windows and Unix systems. <? endEntry(); ?> + -<? makeEntry( "A fun thing happened on the way to the Phorum", "by Joe Barr","http://www.linuxworld.com/linuxworld/lw-1999-05/lw-05-vcontrol2.html", "May 12, 1999");?> +<? makeEntry( "A fun thing happened on the way to the Phorum", + "by Joe Barr", + "http://www.linuxworld.com/linuxworld/lw-1999-05/lw-05-vcontrol2.html", + "May 12, 1999"); +?> Slackware.com uses it. But have you heard of the freely available conferencing software called Phorum? Joe tells the story of Phorum, and how he came to try it out. <? endEntry(); ?> + -<? makeEntry( "Internet Publication System with GNU/Linux", "by &Aacute;lvaro del Castillo","http://www.openresources.com/magazine/publication-system-inet", "May 3, 1999");?> +<? makeEntry( "Internet Publication System with GNU/Linux", + "&Aacute;lvaro del Castillo", + "http://www.openresources.com/magazine/publication-system-inet", + "May 3, 1999"); +?> First in a series dedicated to the analysis, development and implementation of a very complete system for publishing data on the Internet using GNU/Linux software (including PHP 3.0). <? endEntry(); ?> + -<? makeEntry( "Web mail in PHP", "by Bj&#248;rn Borud", "http://www.opensourceit.com/tutorials/990416php.html", "April 28, 1999");?> +<? makeEntry( "Web mail in PHP", + "Bj&#248;rn Borud", + "http://www.opensourceit.com/tutorials/990416php.html", + "April 28, 1999"); +?> Building a simple web-mail interface in PHP using the IMAP extension. <? endEntry(); ?> + -<? makeEntry( "LDAP at Home", "Article in May issue of Webtechniques by Rasmus Lerdorf", "http://www.webtechniques.com/1999/05/lerdorf/junk.shtml", "April. 14, 1999");?> -A very introductory look at LDAP and how to write a PHP interface to an LDAP server. +<? makeEntry( "LDAP at Home", + "Rasmus Lerdorf", + "http://www.webtechniques.com/1999/05/lerdorf/junk.shtml", + "April 14, 1999");?> +A very introductory look at LDAP and how to write a PHP interface to an LDAP server, +from the May, 1999 issue of Webtechniques. <? endEntry(); ?> + -<? makeEntry("Search This","by Colin Viebrock","http://www.devshed.com/Server_Side/PHP/Search_This/","Mar. 15, 1999");?> -&quot;Search This: Searching Your Dynamic Site with PHP and ht://Dig&quot; +<? makeEntry("Search This", + "Colin Viebrock", + "http://www.devshed.com/Server_Side/PHP/Search_This/", + "March 15, 1999"); +?> +Searching Your Dynamic Site with PHP and ht://Dig. <? endEntry(); ?> + -<? makeEntry( "PHP 3 - a Revolution for the Web", "Article in German Internet World by Tobias Ratschiller", false, "Feb. 15, 1999");?> -&quot;Static HTML pages are boring, CGI-scripts too slow, ColdFusion etc to -expensive? The solution is PHP 3.&quot; This German introductory article presents +<? makeEntry( "PHP 3 - a Revolution for the Web", + "Tobias Ratschiller", + false, + "February 15, 1999");?> +[in German] &quot;Static HTML pages are boring, CGI-scripts too slow, ColdFusion etc to +expensive? The solution is PHP 3.&quot; This introductory article presents PHP 3 as a scalable, easy-to-use, high-perfomance solution for server-side -scripting. Features also an interview with Rasmus Lerdorf. +scripting. From the German Internet World. Also features an interview with Rasmus +Lerdorf. <? endEntry(); ?> + -<? makeEntry("PHP 3.0 - Full-power Web Scripting","by Ted Brockwood", "http://nctweb.com/articles/php.html","Jan. 27, 1999");?> +<? makeEntry("PHP 3.0 - Full-power Web Scripting", + "Ted Brockwood", + "http://nctweb.com/articles/php.html", + "Jan. 27, 1999"); +?> Ask most Web application developers their scripting language of choice, and you'll find that most are divided into two camps - the Microsoft Active Server Pages (ASP) folks, and the Cold Fusion users. If you do a @@ -257,62 +448,140 @@ there, and one of these, PHP 3.0, is in much wider use than one would think for an "alternative product". <? endEntry(); ?> + -<? makeEntry("Articles on phpbuilder.com","by Tim Perdue and Rasmus Lerdorf", "http://www.phpbuilder.com","Jan. 24, 1999");?> -&quot;Building Dynamic Web Pages with Search Engines in Mind&quot; and &quot;Creating Dynamic Images with PHP&quot; +<? makeEntry("Articles on phpbuilder.com", + "Tim Perdue and Rasmus Lerdorf", + "http://www.phpbuilder.com", + "Jan. 24, 1999"); +?> +&quot;Building Dynamic Web Pages with Search Engines in Mind&quot; and +&quot;Creating Dynamic Images with PHP&quot; <? endEntry(); ?> -<? makeEntry( "Classified ads with PHP 3 and MySQL", "German article in Internet Pro (Ziff Davis) written by Tobias Ratschiller", "http://www.zdnet.de/internet/artikel/java/199902/php3mysql_00-wf.html", "Jan. 18, 1999"); ?> -&quot;PHP 3 is the most powerful tool on the market for building dynamic, + +<? makeEntry( "Classified ads with PHP 3 and MySQL", + "Tobias Ratschiller", + "http://www.zdnet.de/internet/artikel/java/199902/php3mysql_00-wf.html", + "Jan. 18, 1999"); ?> +[in German] &quot;PHP 3 is the most powerful tool on the market for building dynamic, database-driven websites. Internet Pro shows how to realize a classified ads -site with PHP and MySQL.&quot; +site with PHP and MySQL.&quot; From Internet Pro (Ziff Davis). <? endEntry(); ?> + -<? makeEntry("Apache Gets Down to Business","WEBBuilder Magazine article by Bjørn Borud","http://www.devx.com/upload/free/features/webbuilder/1998/wb1098/bb1098/bb1098.htm","Sept. 24, 1998"); ?> +<? makeEntry("Apache Gets Down to Business", + "Bjørn Borud", + "http://www.devx.com/upload/free/features/webbuilder/1998/wb1098/bb1098/bb1098.htm", + "Sept. 24, 1998"); + ?> &quot;The world's most popular Web server has a reputation for performance and extensibility. You may not be aware of the rich programming environment that surrounds Apache, though. PHP gives you strong SQL connectivity, and mod_perl has powerful application integration facilities. Learn how to exploit these capabilities. Also, see our review of Apache.&quot; +From WEBBuilder Magazine. <? endEntry(); ?> + + +<? makeEntry("PHP/MySQL ... Combination wins Database of the Year Award at Web98", + false, + "http://webreview.com/wr/pub/wtawards", + "June 22, 1998"); +?> +&quot;The substance of the Web is more and more residing in databases, and there +are a variety of methods used to generate Web pages. This year, we selected a +pair of &quot;free software&quot; tools that work together quite nicely as a +platform for building dynamic content. The award is also a tribute to the Open Source +initiative; both products are used, developed and supported by interlocking +communities of people on the Net.&quot; +<? endEntry(); ?> + + +<? makeEntry("PHP Killer Apps & Huge Hit Usage!", + "Dave Garaffa", + "http://browserwatch.internet.com/news/story/news-980610-7.html", + "June 10, 1998"); +?> +"After my initial story I got a wave of email providing links to PHP enabled +web apps. Here is a short list." +<? endEntry();?> + + +<? makeEntry("Notes from a Webmaster", + "Dave Garaffa", + "http://browserwatch.internet.com/news/story/news-980608-7.html", + "June 8, 1998"); +?> +"Boy what a weekend I've had! Why you ask? Well I found PHP 3.0 +on Friday!! For those who already know about PHP 3.0 now you +know why I've been so busy. ;-) For those who don't know about +it... all I can say is AWSOME!" +<? endEntry();?> + + +<? makeEntry("Linux, SQL, and the Web", + "Charles J. Fisher", + "http://cs.sau.edu/~cfisher/uw/018.html", + "1998"); ?> +Charles walks through the steps required to get Linux, PostgreSQL and PHP 3.0 +to talk to each other. From UnixWorld Online. +<? endEntry();?> + + +<? makeEntry("Building A Cross-Platform Web Infrastructure - Part One", + "Brian Platz and Robert Flannigan", + "http://www.performancecomputing.com/unixintegration/9802/9802f1.htm", + "February 1998"); +?> +Brian and Robert take a look at all the options out there and end up +choosing PHP over all the big guys. From UnixIntegration. +<? endEntry();?> + + +<? makeEntry("Building A Cross-Platform Web Infrastructure - Part Two", + "Brian Platz and Robert Flannigan", + "http://www.performancecomputing.com/unixintegration/9803/9803f1.htm", + "March 1998"); +?> +Brian and Robert continue their project by focusing on using PHP as the middleware +between a Web-server process and a back-end relational-database system. +<? endEntry();?> + + +<? makeEntry("A Contact Database using MySQL and PHP", + "Mike Miller", + "http://www.webtechniques.com/archives/1998/01/note/", + "January 1998"); +?> +Mike builds a contact database with MySQL and PHP. From WebTechniques. +<? endEntry();?> + + +<? makeEntry("Dynamic Web Pages with PHP 3", + "Rasmus Lerdorf", + "http://www.webtechniques.com/archives/1998/02/lerdorf/", + "February 1998"); +?> +As PHP gets an upgrade and name change, Rasmus explains its history and shows us some new features +by building a dynamic Web photo album. +<? endEntry();?> + + +<? makeEntry("Clear Ink Announces SpellWeb", + "SpellWeb Press Release", + "http://www.clearink.com/about.htmy?topic=pr_3_23_98", + "March 23, 1998"); +?> +Walnut Creek, CA (March 23, 1998) -- Clear Ink, an independent Internet +strategy, technology and design services agency, announces today a new site +called SpellWeb, <a href="http://www.spellweb.com">http://www.spellweb.com</a>, +designed to detect and compare patterns in word usage throughout the global +online community. +<? endEntry();?> + + +</DL> -<TR bgcolor='#D0D0D0' valign=top> -<TD ALIGN=left WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-lefttop.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -<TD ALIGN=right colspan=2><FONT FACE="tahoma, verdana, arial, helvetica, sans-serif"> -<B>Older News</B><BR></FONT> -</TD> -<TD ALIGN=right WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-righttop.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -</TR> -<TR VALIGN=bottom bgcolor='#D0D0D0'> -<TD ALIGN=left><IMG alt=" " SRC="/gifs/gcap-leftbot.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -<TD ALIGN=right COLSPAN=2><FONT FACE="tahoma, verdana, arial, helvetica, sans-serif" SIZE=-1> -<A HREF="/oldnews.php">Link to older articles</A><BR></FONT> -</TD> -<TD ALIGN=right><IMG alt=" " SRC="/gifs/gcap-rightbot.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -</TR> -<TR VALIGN=top> -<TD WIDTH=18><BR></TD> -<TD ALIGN=left colspan=2> -<TABLE border=0 cellpadding=5 cellspacing=0 bgcolor="#F0F0F0" width=100%> -<TR><TD><FONT FACE="tahoma, verdana, arial, helvetica, sans-serif" SIZE=-1> -<? spc(10,10);?> -<BR></TD></TR></TABLE> -</TD> -<TD width=18><BR></TD> -</TR> - - -<TR bgcolor='#D0D0D0' valign=top> -<TD ALIGN=left WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-lefttop.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -<TD VALIGN=middle ALIGN=left colspan=2 rowspan=2> -If you have written an article, or spot something on the Net somewhere that isn't listed here, please send a note -to <a href="mailto:core@php.net">core@php.net</a> and we will be sure to add it to this list.<BR></TD> -<TD ALIGN=right WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-righttop.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -</TR> -<TR VALIGN=bottom bgcolor='#D0D0D0'> -<TD ALIGN=left><IMG alt=" " SRC="/gifs/gcap-leftbot.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -<TD ALIGN=right><IMG alt=" " SRC="/gifs/gcap-rightbot.gif" WIDTH=18 HEIGHT=18 BORDER=0><BR></TD> -</TR> -</TABLE> <? commonFooter(); ?> Index: phpweb/projects.php diff -u phpweb/projects.php:1.20 phpweb/projects.php:1.21 --- phpweb/projects.php:1.20 Wed Feb 28 14:12:05 2001 +++ phpweb/projects.php Wed Mar 7 16:17:34 2001 @@ -1,34 +1,23 @@ -<? -require("shared.inc"); +<?php +require_once 'prepend.inc'; commonHeader("Projects"); ?> -<h3>Projects using PHP</h3> +<h1> +Projects using PHP +</h1> <p>An increasing number of projects, both commercial and open source, are using PHP as their main development tool. This is a listing of some of the open-source PHP applications available, courtesy of <a href="http://freshmeat.net/">freshmeat</a>. (Last updated: -<?echo date("M d, Y h:ia", filemtime("backend/projects.html"))?>.)</p> +<?echo date("M j, Y h:ia", filemtime("backend/projects.html"))?>.)</p> -<table border="0" cellpadding="0" cellspacing="0" width="100%"> +<?echo hdelim(); ?> <?readfile("backend/projects.html");?> -<tr bgcolor="#d0d0d0" valign="top"> - <td align="left" width="18"><img alt=" " src="/gifs/gcap-lefttop.gif" width="18" height="18" border="0"><br></td> - <td valign="middle" align="left" rowspan="2"> - If you have a project you feel belongs on this list, submit it to - <a href="http://freshmeat.net/">freshmeat</a> and make sure to categorize - it in the "Programming Language : PHP" category. - <br> - </td> - <td align="right" width="18"><img alt=" " src="/gifs/gcap-righttop.gif" width="18" height="18" border="0"><br></td> -</tr> -<tr valign="bottom" bgcolor="#d0d0d0"> - <td align="left"><img alt=" " src="/gifs/gcap-leftbot.gif" width="18" height="18" border="0"><br></td> - <td align="right"><img alt=" " src="/gifs/gcap-rightbot.gif" width="18" height="18" border="0"><br></td> -</tr> +<p>If you have a project you feel belongs on this list, submit it to +<a href="http://freshmeat.net/">freshmeat</a> and make sure to categorize +it in the "Programming Language : PHP" category.</p> -</table> - -<? commonFooter(); ?> +<?php commonFooter(); ?> Index: phpweb/quickref.php diff -u phpweb/quickref.php:1.3 phpweb/quickref.php:1.4 --- phpweb/quickref.php:1.3 Fri Jan 12 23:18:54 2001 +++ phpweb/quickref.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; $NUMACROSS=2; $d = dir("$DOCUMENT_ROOT/manual/en"); Index: phpweb/search.php diff -u phpweb/search.php:1.5 phpweb/search.php:1.6 --- phpweb/search.php:1.5 Wed Feb 14 19:54:21 2001 +++ phpweb/search.php Wed Mar 7 16:17:34 2001 @@ -1,4 +1,6 @@ <? +require_once 'prepend.inc'; + /* You need to grab http://www.php.net/Mirrors-htdig.tgz and follow the directions in there if you want to run the search engine on your @@ -9,7 +11,6 @@ SetCookie("prevsearch",$pattern,0,"",".php.net"); } -require("shared.inc"); $HAVE_SEARCH=$MIRRORS[$MYSITE][5]; if (isset($pattern) && ($pattern)) { @@ -49,33 +50,27 @@ } if (file_exists("configuration.inc")) { - include("configuration.inc"); + include_once 'configuration.inc'; } function makeBar($no,$page,$pages,$baseurl,$firstdisplayed,$lastdisplayed) { - global $FONTFACE; + $last = $next = '&nbsp;'; if ($page>1) { $i=$page-1; - $last="<A HREF=\"$baseurl&page=$i\" onMouseover=\"change('prev$no',1);\" onMouseout=\"hide();\"><IMG SRC='/gifs/b-prev-p.gif' ALT='Previous page' WIDTH=75 HEIGHT=21 VSPACE=7 BORDER=0 NAME='prev$no' align=absmiddle></A>"; - } else { - $last="&nbsp;"; + $last=make_link($baseurl.'&page='.$i, 'prev page'); } if ($page<$pages) { $i=$page+1; - $next="<A HREF=\"$baseurl&page=$i\" onMouseover=\"change('next$no',1);\" onMouseout=\"hide();\"><IMG SRC='/gifs/b-next-p.gif' ALT='Next page' WIDTH=75 HEIGHT=21 VSPACE=7 BORDER=0 NAME='next$no' align=absmiddle></A>"; - } else { - $next="&nbsp;"; + $next=make_link($baseurl.'&page='.$i, 'next page'); } $middle="<B>Displaying results $firstdisplayed to $lastdisplayed</B>"; - echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR='#D0D0D0' CELLPADDING=0 CELLSPACING=0>\n"; + echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR='#cccccc' CELLPADDING=0 CELLSPACING=0>\n"; echo "<TR VALIGN=middle>\n"; - echo "<TD ALIGN=left WIDTH=18><IMG SRC='/gifs/gcap-left.gif' WIDTH=18 HEIGHT=36 BORDER=0><BR></TD>\n"; echo "<TD ALIGN=left WIDTH=75>$last<BR></TD>\n"; - echo "<TD ALIGN=center WIDTH=100%><FONT FACE='$FONTFACE' SIZE=-1>$middle<BR></TD>\n"; + echo "<TD ALIGN=center WIDTH=100%>$middle<BR></TD>\n"; echo "<TD ALIGN=right WIDTH=75>$next<BR></TD>\n"; - echo "<TD ALIGN=right WIDTH=18><IMG SRC='/gifs/gcap-right.gif' WIDT=18 HEIGHT=36 BORDER=0><BR></TD>\n"; echo "</TR></TABLE><BR>\n"; } @@ -84,22 +79,23 @@ commonHeader("Site Search"); $form=$PHP_SELF; ?> +<h1>Search</h1> <FORM ACTION="<?echo $form;?>" METHOD="POST"> <CENTER> <TABLE CELLSPACING=0 CELLPADDING=2> <TR VALIGN=top> -<TD ALIGN=RIGHT><FONT FACE="<? echo $FONTFACE;?>"> +<TD ALIGN=RIGHT> Search for: <BR> -</FONT></TD> +</TD> <TD> <INPUT TYPE="text" NAME="pattern" VALUE="<?echo $prevsearch;?>" SIZE=30> -<INPUT TYPE="image" SRC="/gifs/b-go.gif" ALIGN=absmiddle WIDTH=36 hspace=3 HEIGHT=21 BORDER=0><BR> +<INPUT TYPE="submit" VALUE=" Search "><BR> </FONT></TD> </TR> <TR VALIGN=top> -<TD ALIGN=RIGHT><FONT FACE="<? echo $FONTFACE;?>"> +<TD ALIGN=RIGHT> Restrict the search to: <BR> -</FONT></TD> +</TD> <TD> <SELECT NAME="show"> <OPTION VALUE="nosource" SELECTED>Whole site @@ -118,13 +114,14 @@ </FORM> <? } else { commonHeader("Search Results"); + echo "<h1>Search Results</h1>\n"; if ($HAVE_SEARCH && isset($htsearch_prog)) { $form=$PHP_SELF; } else { $form="http://www.php.net/search.php"; } if (!isset($base)) { - if (ereg("^(.+//[^/]+)/",$HTTP_REFERER,&$reg)) { + if (ereg("^(.+//[^/]+)/",$HTTP_REFERER,$reg)) { $base=$reg[1]; } if ($base==$MYSITE) { @@ -162,7 +159,7 @@ } if (isset($page)) {$off="&page=$page";} else {$off="";} $query="words=$words&config=$config&exclude=$exclude&restrict=$restrict$off"; - exec("$htsearch_prog \"$query\"",&$result); + exec("$htsearch_prog \"$query\"",$result); $rc=count($result); if ($rc<2) { echo "<B>There was an error executing this query.</B><BR><BR>Please try later<BR><BR>"; @@ -196,16 +193,20 @@ } echo "\n"; $i++; + + echo hdelim("#cccccc"); + } echo "<BR>\n"; + makeBar("2",$page,$pages,$baseurl,$firstdisplayed,$lastdisplayed); ?> - <CENTER> - <BR><I>Search results courtesy of</I><BR> - <A HREF="http://htdig.sdsu.edu/"><IMG SRC="/gifs/htdig.gif" BORDER=0 ALT="ht:dig"></A> - </CENTER> + <p> + Search powered by<BR> + <A HREF="http://htdig.sdsu.edu/"><IMG SRC="/gifs/htdig.gif" BORDER=0 ALT="ht:dig"> + </p> <? } commonFooter(); Index: phpweb/source.php diff -u phpweb/source.php:1.1 phpweb/source.php:1.2 --- phpweb/source.php:1.1 Mon May 22 11:30:01 2000 +++ phpweb/source.php Wed Mar 7 16:17:34 2001 @@ -1,30 +1,29 @@ <?php -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Show Source"); -if (!isset($page_url)) { +if (!isset($url)) { echo "No page URL specified."; commonFooter(); exit; } ?> -Source of: <? echo $page_url; ?><BR> -<FONT SIZE=-1> -<B>IMPORTANT:</B> There are some restrictions on your use of the code and graphics on this site.<BR> -You should read the <A HREF="/COPYRIGHT.txt">copyright</A>.<BR> +Source of: <? echo $url; ?><BR> -<hr noshade> <? + +echo hdelim(); + $legal_dirs = array( "/manual" => 1, "/include" => 1, "/stats" => 1); -$dir = dirname($page_url); +$dir = dirname($url); if ($dir && $legal_dirs[$dir]) { - $page_name = $DOCUMENT_ROOT . $page_url; + $page_name = $DOCUMENT_ROOT . $url; } else { - $page_name = basename($page_url); + $page_name = basename($url); } echo("<!-- $page_name -->\n"); @@ -36,14 +35,18 @@ } if (!strstr($page_name,"include/shared.inc")) { + +echo hdelim(); + ?> -<hr noshade> <P> The syntax highlighted source is automatically generated by PHP from the plaintext script.<br> -If you're interested in what's behind the <B>commonHeader()</B> and <B>commonFooter</B> functions, -you can always take a look at the <A HREF="/source.php?page_url=/include/shared.inc"> -source of the shared.inc</A> file. And, of course, if you want to see the source of this page, have -a look <A HREF="/source.php?page_url=/source.php">here</A>. +If you're interested in what's behind the <B>commonHeader()</B> and <B>commonFooter()</B> functions, +you can always take a look at the source of the +<? print_link("/source.php?url=/include/shared.inc", "shared.inc"); ?> and +<? print_link("/source.php?url=/include/layout.inc", "layout.inc"); ?> files. +And, of course, if you want to see the source of this page, have a look +<? print_link("/source.php?url=/source.php", "here"); ?>. </P> <? } Index: phpweb/support.php diff -u phpweb/support.php:1.23 phpweb/support.php:1.24 --- phpweb/support.php:1.23 Sat Mar 3 03:18:56 2001 +++ phpweb/support.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <?php -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Support"); ?> @@ -31,26 +31,35 @@ A request has been entered into the mailing list processing queue. You should receive an email at <?php echo $email;?> shortly describing how to complete your request. +</p> <?php } } else { ?> -<h3>Documentation</h3> +<h1>Documentation</h1> <P> A good place to start is by skimming through the ever-growing <a href="/FAQ.php">FAQ</a>. Then have a look at the online manual and other resources in the <a href="/docs.php">documentation</a> section. </P> + + +<? echo hdelim(); ?> -<h3>Books</h3> + +<h1>Books</h1> <P> <a href="/books.php">Books</a> are convenient resources to begin exploring PHP. <a href="/books.php">The titles listed here</a> will help you to start learning PHP, as well as extending your existing knowledge. </P> + + +<? echo hdelim(); ?> -<h3>Reporting Bugs</h3> + +<h1>Reporting Bugs</h1> <P>If you can't resolve your problem from the available documentation or mailing list archives, and you think it might be a bug, a <a href="http://bugs.php.net">Bug Database</a> has @@ -59,14 +68,23 @@ Please read <a href="http://bugs.php.net/bugs-dos-and-donts.php" >Dos & Don'ts</a> before posting a report. </P> + + +<? echo hdelim(); ?> -<h3>User Groups</h3> +<h1>User Groups</h1> +<p> PHP user groups have started popping up. Christopher R. Moewes-Bystrom is running a PHP user group registry at <a href="http://www.phpusergroups.org/">http://www.phpusergroups.org/</a>. +</p> -<h3>Mailing Lists</h3> + +<? echo hdelim(); ?> + + +<h1>Mailing Lists</h1> <P> One of the best resources is the very friendly and helpful mailing lists. There are many PHP-related mailing lists available. @@ -181,39 +199,47 @@ ?> -<form method="post" action="http://www.php.net/support.php"><table cellspacing="2" cellpadding="3"> +<form method="post" action="http://www.php.net/support.php"> +<p> +<table cellpadding="5" cellspacing="1"> <?php + +while ( list(, $listinfo) = each($mailing_lists)) { + if (!is_array($listinfo)) { - while ( list(, $listinfo) = each($mailing_lists)) { + echo '<tr bgcolor="#cccccc">'; + echo '<th>' . $listinfo . '</th>'; + echo '<th>Moderated</th>'; + echo '<th>Archive</th>'; + echo '<th>Normal</th>'; + echo '<th>Digest</th>'; + echo '</tr>' . "\n"; - if (!is_array($listinfo)) { echo '<tr bgcolor="#D0D0D0"><th colspan="2">' . $listinfo . '</th><th>Moderated</th><th>Archive</th><th>Normal</th><th>Digest</th></tr>' . "\n"; } - else { + } else { - echo '<tr align="center" bgcolor="#F0F0F0"><td><img src="/gifs/blank.gif" width="5" height="5"></td><td align="left"><b>' . $listinfo[1] . '</b><br><small>'. $listinfo[2] . '</small></td><td>'; - if ($listinfo[3]) { echo 'yes'; } else { echo "no"; } - echo '</td><td>'; - if ($listinfo[4]) { echo '<a href="http://marc.theaimsgroup.com/?l=' . $listinfo[0] . '">available</a>'; } - else { echo 'n/a'; } - echo '</td><td><input name="maillist" type="radio" value="' . $listinfo[0] . '"></td><td>'; - if ($listinfo[5]) { echo '<input name="maillist" type="radio" value="' . $listinfo[0] . '-digest">'; } - else { echo 'n/a'; } - echo '</td></tr>' . "\n"; + echo '<tr align="center" bgcolor="#e0e0e0">'; + echo '<td align="left"><b>' . $listinfo[1] . '</b><br><small>'. $listinfo[2] . '</small></td>'; + echo '<td>' . ($listinfo[3] ? 'yes' : 'no') . '</td>'; + echo '<td>' . ($listinfo[4] ? make_link("http://marc.theaimsgroup.com/?l=".$listinfo[0], 'yes') : 'n/a') . '</td>'; + echo '<td><input name="maillist" type="radio" value="' . $listinfo[0] . '"></td>'; + echo '<td>' . ($listinfo[5] ? '<input name="maillist" type="radio" value="'.$listinfo[0].'-digest">' : 'n/a' ) . '</td>'; + echo '</tr>' . "\n"; - } - } + } +} ?> - </table> +</p> + +<p align="center"> +<b>Email:</b> +<input type=text name="email" width=40 value="user@example.com"> +<input type=submit name="action" value="Subscribe"> +<input type=submit name="action" value="Unsubscribe"> +</p> -<p><table align="center"> - <tr> - <td><b>Email:</b></td> - <td><input type=text name="email" width=40 value="user@example.com"></td> - <td><input type=submit name="action" value="Subscribe"></td> - <td><input type=submit name="action" value="Unsubscribe"></td> - </tr> -</table></p></form> +</form> <p> You will be sent a confirmation mail at the address you wish to @@ -249,7 +275,12 @@ on the top-right of every page. </p> -<h3>Newsgroups</h3> + + +<? echo hdelim(); ?> + + +<h1>Newsgroups</h1> <p> The mailing lists hosted at lists.php.net are also gatewayed to newsgroups on the server at <a href="news://news.php.net/">news.php.net</a>. @@ -259,8 +290,13 @@ You can both read and post to the mailing lists through the news interface. </p> + + -<h3>Local Mailing Lists</h3> +<? echo hdelim(); ?> + + +<h1>Local Mailing Lists</h1> <p> There are also some mailing lists that have been set up by others in the community to host local discussions (particularly non-English @@ -279,8 +315,13 @@ <li><a href="mailto:lista-subscribe@phpes.com">Spanish PHP User's Mailing List</a> <li><a href="http://phptr.baslangic.net/">Turkish PHP User's Mailing List</a> </ul> + + + +<? echo hdelim(); ?> -<h3>Sample Code</h3> + +<h1>Sample Code</h1> <P> Looking for some more sample PHP scripts? Our <A HREF="/links.php">links page</A> page lists some archives of sample PHP code - @@ -288,23 +329,35 @@ your searching pleasure! </P> + +<? echo hdelim(); ?> + + <a name="phpkb"></a> -<h3>Knowledge Base</h3> +<h1>Knowledge Base</h1> <P> The knowledge base is a growing collection of PHP related information in a searchable question and answer format. Anyone can contribute, and everyone is encouraged to do so. You can visit the Knowledge Base at <a href="http://www.faqts.com/">http://www.faqts.com/</a>. </P> + -<h3>Getting the Latest Development Version</h3> +<? echo hdelim(); ?> + + +<h1>Getting the Latest Development Version</h1> <P> PHP is developed using CVS, so it's possible to obtain the latest development release at any time. Further instructions can be found in the web interface of the <a href="http://cvs.php.net">PHP CVS tree</a>. </P> + + +<? echo hdelim(); ?> + -<h3>Instant Resource Center</h3> +<h1>Instant Resource Center</h1> <P> Otherwise known as IRC or Internet Relay Chat. Here you can usually find experienced PHP people sitting around doing nothing on the #php channel Index: phpweb/thanks.php diff -u phpweb/thanks.php:1.1 phpweb/thanks.php:1.2 --- phpweb/thanks.php:1.1 Fri Aug 25 03:41:36 2000 +++ phpweb/thanks.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Thanks"); function makeEntry($heading) { Index: phpweb/tips.php diff -u phpweb/tips.php:1.6 phpweb/tips.php:1.7 --- phpweb/tips.php:1.6 Wed Aug 16 10:10:55 2000 +++ phpweb/tips.php Wed Mar 7 16:17:34 2001 @@ -1,5 +1,5 @@ <?php -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Cool PHP Tips"); function tipTitle($title,$author='',$date='') { Index: phpweb/tut.php diff -u phpweb/tut.php:1.2 phpweb/tut.php:1.3 --- phpweb/tut.php:1.2 Fri Sep 15 11:17:03 2000 +++ phpweb/tut.php Wed Mar 7 16:17:34 2001 @@ -1,12 +1,13 @@ <? +require_once 'prepend.inc'; +commonHeader('PHP Tutorial'); + function example($text) { echo "<blockquote><table border=1 cellpadding=3 cellspacing=3><tr bgcolor=#d0d0d0><td>"; highlight_string($text); echo "</td></tr></table></blockquote>"; } ?> -<html><head><title>PHP Tutorial</title></head> -<body> <h1>Introductory Tutorial</h1> PHP is a tool that lets you create dynamic web pages. PHP-enabled web pages are treated just like regular HTML pages and you can create @@ -134,4 +135,5 @@ <li><a href="http://www.htmlwizard.net/resources/tutorials/">phpTidbits</a> <li><a href="http://www.phpbuilder.com/getit/">PHP Builder</a> </ul> -</body></html> + +<? commonfooter(); ?> Index: phpweb/usage.php diff -u phpweb/usage.php:1.11 phpweb/usage.php:1.12 --- phpweb/usage.php:1.11 Wed Mar 7 07:45:58 2001 +++ phpweb/usage.php Wed Mar 7 16:17:34 2001 @@ -1,14 +1,22 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("PHP Usage Stats"); ?> +<h1> +Usage Stats for February 2001 +</h1> + Feb 2001: PHP: 5558363 Domains, 856543 IP Addresses<br> Source: <a href="http://www.netcraft.com/Survey/">Netcraft</a><br> -<img src="gifs/phpstats-200102.gif" width=780 height=350 alt="Graph" -><br clear=left> + +<p> +<? echo print_image("stats/phpstats-200102.gif", "Graph"); ?> +</p> -<p>You can also see how popular PHP is relative to other Apache modules -at <a href="http://www.securityspace.com/s_survey/">E-Soft Inc.'s -web survey</a>. (Spoiler: PHP is the most popular) +<p> +You can also see how popular PHP is relative to other Apache modules +at <? print_link("http://www.securityspace.com/s_survey/", "E-Soft Inc.'s Web Survey"); ?>. +Spoiler: PHP is the most popular. +</p> <? commonFooter(); ?> Index: phpweb/bin/update-slashdot diff -u /dev/null phpweb/bin/update-slashdot:1.2 --- /dev/null Wed Mar 7 16:18:17 2001 +++ phpweb/bin/update-slashdot Wed Mar 7 16:17:35 2001 @@ -0,0 +1,9 @@ +#!/bin/sh + +lynx -source http://slashdot.org/slashdot.xml > backend/slashdot.xml~ +if [ $? -ne 0 ]; then + echo problem getting results from slashdot + exit 1 +fi + +mv backend/slashdot.xml~ backend/slashdot.xml Index: phpweb/bin/projects.xsl diff -u phpweb/bin/projects.xsl:1.2 phpweb/bin/projects.xsl:1.3 --- phpweb/bin/projects.xsl:1.2 Wed Feb 28 13:25:46 2001 +++ phpweb/bin/projects.xsl Wed Mar 7 16:17:35 2001 @@ -28,11 +28,6 @@ <xsl:template match="/search-results"> <!-- Loop through all the matches --> <xsl:for-each select="match"> - <tr bgcolor="#D0D0D0" valign="top"> - <td align="left"><img alt=" " src="/gifs/gcap-lefttop.gif" width="18" - height="18" border="0" /><br /></td> - <td align="left" rowspan="2"> - <font face="tahoma, verdana, arial, helvetica, sans-serif" size="-1"> <xsl:element name="a"> <xsl:attribute name="href"> <xsl:value-of select="url_homepage" /> @@ -45,33 +40,10 @@ License: <xsl:value-of select="license" /> <xsl:text> -- </xsl:text> Updated: <i><xsl:value-of select="date_updated" /></i> - </font> - </td> - <td align="right"><img alt=" " src="/gifs/gcap-righttop.gif" width="18" - height="18" border="0" /><br /></td> - </tr> - <tr valign="bottom" bgcolor="#D0D0D0"> - <td align="left"><img alt=" " src="/gifs/gcap-leftbot.gif" width="18" - height="18" border="0" /><br /></td> - <td align="right"><img alt=" " src="/gifs/gcap-rightbot.gif" width="18" - height="18" border="0" /><br /></td> - </tr> - <tr valign="top"> - <td width="18"><br /></td> - <td align="left"> - <table border="0" cellpadding="5" cellspacing="0" bgcolor="#F0F0F0" width="100%"> - <tr> - <td> - <font face="tahoma, verdana, arial, helvetica, sans-serif" size="-1"> - <xsl:value-of select="desc_full" /> - </font> - <br/> - </td> - </tr> - </table> - </td> - <td width="18"><br /></td> - </tr> + <br /> + <br /> + <xsl:value-of select="desc_full" /> + <hr noshade="1" size="1" color="#000000" /> </xsl:for-each> </xsl:template> Index: phpweb/error/index.php diff -u phpweb/error/index.php:1.20 phpweb/error/index.php:1.21 --- phpweb/error/index.php:1.20 Tue Jan 23 14:06:38 2001 +++ phpweb/error/index.php Wed Mar 7 16:18:05 2001 @@ -1,8 +1,8 @@ <?php +require_once 'prepend.inc'; -require "shared.inc"; if (file_exists("../configuration.inc")) { - include "../configuration.inc"; + include_once "../configuration.inc"; } $lang = $MIRRORS[$MYSITE][6]; @@ -97,7 +97,7 @@ $form=$PHP_SELF; if (!isset($base)) { - if (ereg("^(.+//[^/]+)/",$HTTP_REFERER,&$reg)) { + if (ereg("^(.+//[^/]+)/",$HTTP_REFERER,$reg)) { $base=$reg[1]; } if ($base==$MYSITE) { @@ -134,7 +134,7 @@ } if (isset($page)) {$off="&page=$page";} else {$off="";} $query="words=$words&config=$config&exclude=$exclude&restrict=$restrict$off"; - exec("$htsearch_prog \"$query\"",&$result); + exec("$htsearch_prog \"$query\"",$result); $rc=count($result); if ($rc<2) { echo "<B>There was an error executing this query.</B><BR><BR>Please try later<BR><BR>"; Index: phpweb/gifs/back1.jpg Index: phpweb/gifs/back2.jpg Index: phpweb/gifs/back_big.jpg Index: phpweb/gifs/back_small.jpg Index: phpweb/gifs/box-0.gif Index: phpweb/gifs/box-1.gif Index: phpweb/gifs/caret-l.gif Index: phpweb/gifs/caret-r.gif Index: phpweb/gifs/caret-rg.gif Index: phpweb/gifs/caret-t.gif Index: phpweb/gifs/caret-u.gif Index: phpweb/gifs/checkerboard.gif Index: phpweb/gifs/deleted_images diff -u /dev/null phpweb/gifs/deleted_images:1.2 --- /dev/null Wed Mar 7 16:18:17 2001 +++ phpweb/gifs/deleted_images Wed Mar 7 16:18:06 2001 @@ -0,0 +1,228 @@ +b-about-c.gif +b-about-p.gif +b-addnote-c.gif +b-addnote-p.gif +b-bullet-c.gif +b-bullet-p.gif +b-bullet-w.gif +b-close-c.gif +b-close-p.gif +b-contents-c.gif +b-contents-p.gif +b-credits-c.gif +b-credits-p.gif +b-development-c.gif +b-development-p.gif +b-docs-c.gif +b-docs-p.gif +b-downloads-c.gif +b-downloads-p.gif +b-go.gif +b-links-c.gif +b-links-p.gif +b-mailing-c.gif +b-mailing-p.gif +b-mirror-c.gif +b-mirror-p.gif +b-news-c.gif +b-news-p.gif +b-next-c.gif +b-next-p.gif +b-prev-c.gif +b-prev-p.gif +b-projects-c.gif +b-projects-p.gif +b-quickref-c.gif +b-quickref-p.gif +b-search-c.gif +b-search-p.gif +b-source-c.gif +b-source-p.gif +b-stats-c.gif +b-stats-p.gif +b-top-c.gif +b-top-p.gif +b-up-c.gif +b-up-p.gif +bg-bl.gif +bg-ul.gif +bubbles-down.gif +bubbles-up.gif +cap-bl.gif +cap-left.gif +cap-right.gif +cap-right2.gif +cap-ul.gif +circular_arrow.gif +corner-bl.gif +corner-ul.gif +flag-at.gif +flag-au.gif +flag-br-gray.gif +flag-br.gif +flag-ca.gif +flag-ch.gif +flag-cl.gif +flag-cz-gray.gif +flag-cz.gif +flag-de-gray.gif +flag-de.gif +flag-dk.gif +flag-es-gray.gif +flag-es.gif +flag-fi.gif +flag-fr-gray.gif +flag-fr.gif +flag-hu-gray.gif +flag-hu.gif +flag-id.gif +flag-il.gif +flag-it-gray.gif +flag-it.gif +flag-jp-gray.gif +flag-jp.gif +flag-kr-gray.gif +flag-kr.gif +flag-lv.gif +flag-mx.gif +flag-nl-gray.gif +flag-nl.gif +flag-no.gif +flag-nz.gif +flag-pl.gif +flag-pt.gif +flag-ro.gif +flag-ru.gif +flag-se.gif +flag-sg.gif +flag-sk.gif +flag-tr.gif +flag-ua.gif +flag-uk-gray.gif +flag-uk.gif +flag-us.gif +flag-xx.gif +flag-za.gif +gcap-left.gif +gcap-leftbot.gif +gcap-lefttop.gif +gcap-right.gif +gcap-rightbot.gif +gcap-righttop.gif +gcorn-bl.gif +gcorn-br.gif +gcorn-ul.gif +gcorn-ur.gif +gflag-at.gif +gflag-au.gif +gflag-br.gif +gflag-ca.gif +gflag-ch.gif +gflag-cl.gif +gflag-cz.gif +gflag-de.gif +gflag-dk.gif +gflag-es.gif +gflag-fi.gif +gflag-fr.gif +gflag-id.gif +gflag-il.gif +gflag-it.gif +gflag-jp.gif +gflag-kr.gif +gflag-lv.gif +gflag-mx.gif +gflag-nl.gif +gflag-no.gif +gflag-nz.gif +gflag-pl.gif +gflag-pt.gif +gflag-ro.gif +gflag-ru.gif +gflag-se.gif +gflag-sg.gif +gflag-sk.gif +gflag-tr.gif +gflag-ua.gif +gflag-uk.gif +gflag-us.gif +gflag-xx.gif +gflag-za.gif +kick-bb.gif +kick-bg.gif +kick-bl.gif +kick-br.gif +kick-bt.gif +kick-cbl.gif +kick-cbr.gif +kick-close.gif +kick-ctl.gif +kick-ctr.gif +logo-adgrafix.gif +logo-amerikanclaris.gif +logo-arabnet.gif +logo-bellasf.gif +logo-belnet.gif +logo-besthost.gif +logo-borsen.gif +logo-bug.gif +logo-calinet.gif +logo-chek.gif +logo-cl.gif +logo-comnet.gif +logo-cooper8.gif +logo-directnet.gif +logo-easydns.gif +logo-externet.gif +logo-fast.gif +logo-gds.gif +logo-globe.gif +logo-guardian.gif +logo-happy.gif +logo-hurricane.gif +logo-ibd.gif +logo-indog.gif +logo-inway.gif +logo-inway1.gif +logo-isternet.gif +logo-kimm.gif +logo-lbd.gif +logo-manawatu.gif +logo-mikomtek.gif +logo-montaigne.gif +logo-murl.gif +logo-ndot.gif +logo-nederlandnet.gif +logo-netlife.gif +logo-netswamp.gif +logo-netvision.gif +logo-nic.gif +logo-none.gif +logo-paco.gif +logo-police.gif +logo-pwc.gif +logo-rcis.gif +logo-schlund.gif +logo-squid.gif +logo-sst.gif +logo-sts.gif +logo-sunsite.gif +logo-technion.gif +logo-telenet.gif +logo-tgr.gif +logo-upt.gif +logo-urbano.gif +logo-utilina.gif +logo-webtic.gif +p-cap-left.gif +p-cap-right.gif +canada-small.gif +canada.gif +israel-small.gif +israel.gif +norway-small.gif +norway.gif +uk-small.gif +uk.gif +usa-small.gif +usa.gif Index: phpweb/gifs/php_logo.gif Index: phpweb/gifs/powered_by.jpg Index: phpweb/gifs/sm_faf.jpg Index: phpweb/gifs/sm_search.jpg Index: phpweb/gifs/sm_searchf.jpg Index: phpweb/gifs/sm_top.jpg Index: phpweb/gifs/sm_topf.jpg Index: phpweb/gifs/sm_vs.jpg Index: phpweb/gifs/sm_vsf.jpg Index: phpweb/gifs/small_submit.gif Index: phpweb/gifs/books/2963.gif Index: phpweb/gifs/books/allen_wyke.jpg Index: phpweb/gifs/books/atkinson_fr.gif Index: phpweb/gifs/books/beginning_php4.jpg Index: phpweb/gifs/books/bible.jpg Index: phpweb/gifs/books/book-php-dutch.gif Index: phpweb/gifs/books/cgiphp.jpg Index: phpweb/gifs/books/core-book.jpg Index: phpweb/gifs/books/cosentino.jpg Index: phpweb/gifs/books/cvsbook.gif Index: phpweb/gifs/books/cvspr.gif Index: phpweb/gifs/books/czech-book.jpg Index: phpweb/gifs/books/databecker.gif Index: phpweb/gifs/books/db20023.gif Index: phpweb/gifs/books/db20029.gif Index: phpweb/gifs/books/dehnhardt.jpg Index: phpweb/gifs/books/dittrich.jpg Index: phpweb/gifs/books/dubois-de.jpg Index: phpweb/gifs/books/dubois.jpg Index: phpweb/gifs/books/ek-eriksson.gif Index: phpweb/gifs/books/esteban_trigo.gif Index: phpweb/gifs/books/fischer.jpg Index: phpweb/gifs/books/gilmore.jpg Index: phpweb/gifs/books/greenspan.jpg Index: phpweb/gifs/books/herellier.gif Index: phpweb/gifs/books/hilton-willis.jpg Index: phpweb/gifs/books/japanese-book.gif Index: phpweb/gifs/books/joerg_krause.jpg Index: phpweb/gifs/books/klaus_schmidt.jpg Index: phpweb/gifs/books/korean-book.jpg Index: phpweb/gifs/books/korean_book.gif Index: phpweb/gifs/books/lacroix.gif Index: phpweb/gifs/books/mastregex.jpg Index: phpweb/gifs/books/matt_zandstra.jpg Index: phpweb/gifs/books/maxfield.jpg Index: phpweb/gifs/books/medinets.gif Index: phpweb/gifs/books/mysql-book.gif Index: phpweb/gifs/books/php_essentials.jpg Index: phpweb/gifs/books/php_fe.jpg Index: phpweb/gifs/books/phppr.s.gif Index: phpweb/gifs/books/postgresql.jpg Index: phpweb/gifs/books/rasmus-kug.gif Index: phpweb/gifs/books/ratschiller_gerken.jpg Index: phpweb/gifs/books/regex.s.gif Index: phpweb/gifs/books/schmid_cartus.jpg Index: phpweb/gifs/books/schwendiman.jpg Index: phpweb/gifs/books/susanne_wigard.gif Index: phpweb/gifs/books/susanne_wigard.jpg Index: phpweb/gifs/books/theis.gif Index: phpweb/gifs/books/till_gerken.jpg Index: phpweb/gifs/books/tobias_and_till.jpg Index: phpweb/gifs/books/uwe_and_gunther.jpg Index: phpweb/gifs/books/webmaster-book.gif Index: phpweb/gifs/books/wilson.jpg Index: phpweb/gifs/books/wjgilmore.jpg Index: phpweb/gifs/books/zandstra.jpg Index: phpweb/gifs/books/zmievski.jpg Index: phpweb/gifs/stats/phpstats-200002.gif Index: phpweb/gifs/stats/phpstats-200006.gif Index: phpweb/gifs/stats/phpstats-200007.gif Index: phpweb/gifs/stats/phpstats-200008.gif Index: phpweb/gifs/stats/phpstats-200009.gif Index: phpweb/gifs/stats/phpstats-200010.gif Index: phpweb/gifs/stats/phpstats-200012.gif Index: phpweb/gifs/stats/phpstats-200101.gif Index: phpweb/include/index.php diff -u /dev/null phpweb/include/index.php:1.2 --- /dev/null Wed Mar 7 16:18:18 2001 +++ phpweb/include/index.php Wed Mar 7 16:18:09 2001 @@ -0,0 +1,3 @@ +<? + Header("Location: /"); +?> Index: phpweb/include/layout.inc diff -u /dev/null phpweb/include/layout.inc:1.2 --- /dev/null Wed Mar 7 16:18:18 2001 +++ phpweb/include/layout.inc Wed Mar 7 16:18:09 2001 @@ -0,0 +1,366 @@ +<?php +/* $Id: layout.inc,v 1.2 2001/03/08 00:18:09 jimw Exp $ */ + + +# spacer() +# print a IMG tag for a sized spacer GIF +# + +function spacer($width=1, $height=1, $align=false, $extras=false) { + printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', + $width, + $height, + ($align ? 'align="'.$align.'" ' : ''), + ($extras ? $extras : '') + ); +} + + + +# resize_image() +# tag the output of make_image() and resize it manually +# + +function resize_image($img, $width=1, $height=1) { + $str = preg_replace('/width=\"([0-9]+?)\"/i', '', $img ); + $str = preg_replace('/height=\"([0-9]+?)\"/i', '', $str ); + $str = substr($str,0,-1) . sprintf(' height="%s" width="%s">', $height, $width ); + return $str; +} + + + +# make_image() +# return an IMG tag for a given file (relative to the images dir) +# + +function make_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { + global $HTTP_SERVER_VARS; + if (!$dir) { + $dir = '/gifs'; + } + if ($size = @getimagesize($HTTP_SERVER_VARS['DOCUMENT_ROOT'].$dir.'/'.$file)) { + $image = sprintf('<img src="%s/%s" border="%d" %s ALT="%s" %s%s>', + $dir, + $file, + $border, + $size[3], + ($alt ? $alt : ''), + ($align ? ' align="'.$align.'"' : ''), + ($extras ? ' '.$extras : '') + ); + } else { + $image = sprintf('<img src="%s/%s" border="%d" ALT="%s" %s%s>', + $dir, + $file, + $border, + ($alt ? $alt : ''), + ($align ? ' ALIGN="'.$align.'"' : ''), + ($extras ? ' '.$extras : '') + ); + } + return $image; +} + + + +# print_image() +# print an IMG tag for a given file +# + +function print_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { + print make_image($file, $alt, $align, $extras, $dir); +} + + + +# make_submit() +# - make a submit button image +# +function make_submit($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { + if (!$dir) { + $dir = '/gifs'; + } + $return = make_image($file, $alt, $align, $extras, $dir, $border); + if ($return != "<img>") { + $return = '<input type="image"'.substr($return,4); + } else { + $return = '<input type="submit">'; + } + return $return; +} + + + +# delim() +# print a pipe delimiter +# + +function delim($color=false) { + if (!$color) { + return '&nbsp;|&nbsp;'; + } + return sprintf('<font color="%s">&nbsp;|&nbsp;</font>', $color ); +} + + + +# hdelim() +# print a horizontal delimiter (just a wide line); +# + +function hdelim($color="#000000") { + if (!$color) { + return '<HR noshade size="1">'; + } + return sprintf('<HR noshade size="1" color="%s">', $color ); +} + + + +# make_link() +# return a hyperlink to something, within the site +# + +function make_link ($url, $linktext=false, $target=false, $extras=false) { + return sprintf("<a href=\"%s\"%s%s>%s</a>", + $url, + ($target ? ' target="'.$target.'"' : ''), + ($extras ? ' '.$extras : ''), + ($linktext ? $linktext : $url) + ); +} + + + +# print_link() +# echo a hyperlink to something, within the site +# + +function print_link($url, $linktext=false, $target=false, $extras=false) { + echo make_link($url, $linktext, $target, $extras); +} + + +# download_link() +# print a link for a downloadable file (including filesize) +# + +function download_link($file, $title) { + global $filesizes; + if ($tmp = strrchr($file, "/")) { + $local_file = substr($tmp, 1, strlen($tmp)); + } else { + $file = "distributions/$file"; + $local_file = $file; + } + print_link($file, $title); + $size = @filesize($local_file)/1024; + echo("<!-- file=$file localfile=$local_file size-$size-->\n"); + if ($size) { + printf(" (%dKB)", $size); + } else if (isset($filesizes[$local_file])) { + echo " (".$filesizes[$local_file].")"; + } +} + + + + + +$enclosed = 0; + + +# commonheader() +# +# + +function commonHeader($title="",$dont_enclose=0) { + global $MYSITE, $MIRRORS, $COUNTRIES, $enclosed; + global $SIDEBAR_DATA; + header("Last-Modified: ".gmdate("D, d M Y H:i:s",getlastmod())." GMT"); +?><html> +<head> + <title>PHP<?php if ($title) echo ": $title";?></title> + <link rel="stylesheet" href="/style.css"> +</head> + +<body + topmargin="0" leftmargin="0" + marginheight="0" marginwidth="0" + bgcolor="#ffffff" + text="#000000" + link="#000099" + alink="#0000ff" + vlink="#000099" +><a name="TOP"></a> +<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> + <tr bgcolor="#9999cc"> + <td align="middle" rowspan="2" width="120"> +<?php if ($GLOBALS["REQUEST_URI"] != "/") echo '<a href="/">'; + print_image('php_logo.gif', 'PHP'); + if ($GLOBALS["REQUEST_URI"] != "/") echo '</a>'; +?> + </td> + <td align="right" valign="top"> + <font color="#ffffff"><b> + <?php echo strftime("%A, %B %d, %Y"); ?> + </b>&nbsp;<br> + </font> + </td> + </tr> + + <tr bgcolor="#9999cc"> + <form method="POST" action="/search.php"> + <td align="right" valign="bottom"> + <?php + print_link('/downloads.php','downloads',false,'class="small"'); + echo delim(); + print_link('/docs.php', 'documentation', false, 'class="small"'); + echo delim(); + print_link('/support.php','support',false,'class="small"'); + echo delim(); + print_link('/bugs.php','reporting bugs',false,'class="small"'); + echo delim(); + print_link('/links.php','links',false,'class="small"'); + echo delim(); + print_link('/search.php','search:',false,'class="small"'); + echo ' <input class="small" type="text" name="what" size=10> '; + echo make_submit('small_submit.gif', 'search', 'bottom'); + ?>&nbsp;<br> + </td> + </form> + </tr> + + <tr bgcolor="#333366"><td colspan="2"><?php spacer(1,1);?><br></td></tr> +</table> + +<?php + if (!$dont_enclose): + $enclosed = 1; +?> + +<table align="left" cellpadding="0" cellspacing="0"> + <tr valign="top"> +<?php if (isset($SIDEBAR_DATA)):?> + <td bgcolor="#f0f0f0"> + <table width="149" align="left" cellpadding="4" cellspacing="0"> + <tr valign="top"> + <td><?php echo $SIDEBAR_DATA?></td> + </tr> + </table> + </td> + <td bgcolor="#cccccc" background="/gifs/checkerboard.gif"><?php spacer(1,1);?><br></td> +<?php endif; ?> + <td> + <table width="625" align="left" cellpadding="10" cellspacing="0"> + <tr> + <td valign="top"> +<?php + endif; +} + + + + +# commonfooter() +# +# + +function commonFooter() { + global $SCRIPT_NAME,$MIRRORS,$MYSITE,$COUNTRIES,$LAST_UPDATED,$enclosed; + if ($enclosed) { + echo "</td></tr></table></td></tr></table>\n"; + } +?> + +<br clear="all"> + +<table border="0" cellspacing="0" cellpadding="0" width="100%"> + <tr bgcolor="#333366"><td><?php spacer(1,1);?><br></td></tr> + <tr bgcolor="#9999cc"> + <form method="GET" action="/mirrors.php" onsubmit="return gotomirror(this)"> + <td align="right" valign="bottom"> + <script language="javascript"> + <!-- + function gotomirror(form) { + url = form.country.options[form.country.selectedIndex].value; + window.location.href = url; + return false; + } + //--> + </script> + <input type="hidden" name="REDIRECT" value=1> + <?php + # TODO: should send current url above, so we can redirect to + # the same page on the mirror, and do the same in our javascript. + print_link('/source.php?url='.$SCRIPT_NAME, 'show source', false, 'class="small"'); + echo delim(); + print_link('/credits.php', 'credits', false, 'class="small"'); + echo delim(); + print_link('/mirrors.php', 'mirror sites:', false, 'class="small"'); + echo " <select class=\"small\" name=\"country\" onchange=\"gotomirror(this.form)\">\n"; + echo "<option value=-1>--\n"; + while (list($url,$mirror) = each($MIRRORS)) { + if ($mirror[4] == 1) { /* only list full mirrors here */ + echo "<option value=\"$url\">".$COUNTRIES[$mirror[0]]." ($mirror[1])\n"; + } + } + echo "</select> "; + echo make_submit('small_submit.gif', 'search', 'bottom' ); + ?>&nbsp;<br> + </td> + </form> + </tr> + <tr bgcolor="#333366"><td><?php spacer(1,1); ?><br></td></tr> +</table> + +<table border="0" cellspacing="0" cellpadding="6" width="100%"> + <tr valign="top" bgcolor="#cccccc"> + <td><small> + Copyright &copy; 1998,1999,2000,2001 The PHP Association, Inc.<BR> + All rights reserved.<BR> + </small> + </td> + <td align="right"><small> + This mirror generously provided by: + <a href="<?php echo $MIRRORS[$MYSITE][3];?>"><?php echo $MIRRORS[$MYSITE][1];?></a><BR> + Last updated: <?php echo strftime("%c", $LAST_UPDATED); ?><BR> + </small> + </td> + </tr> +</table> + +<br> + +</body> +</html> +<?php +} + +function sect_to_file($string) { + $string = strtolower($string); + $string = str_replace(' ','-',$string); + $string = str_replace('_','-',$string); + $func = "function.$string.php"; + $chap = "ref.$string.php"; + $feat = "features.$string.php"; + $struct = "control-structures.$string.php"; + if(is_file($func)) return $func; + else if(is_file($chap)) return $chap; + else if(is_file($feat)) return $feat; + else if(is_file($struct)) return $struct; + else return "$string.php"; +} + +function clean_note($text) { + $text = htmlspecialchars($text); + $fixes = array('<br>','<p>','</p>'); + reset($fixes); + while (list(,$f)=each($fixes)) { + $text=str_replace(htmlspecialchars($f), $f, $text); + $text=str_replace(htmlspecialchars(strtoupper($f)), $f, $text); + } + $text = "<tt>".nl2br($text)."</tt>"; + return $text; +} Index: phpweb/include/prepend.inc diff -u /dev/null phpweb/include/prepend.inc:1.2 --- /dev/null Wed Mar 7 16:18:19 2001 +++ phpweb/include/prepend.inc Wed Mar 7 16:18:09 2001 @@ -0,0 +1,19 @@ +<?php // -*- C++ -*- +/* $Id: prepend.inc,v 1.2 2001/03/08 00:18:09 jimw Exp $ */ + +require_once 'site.inc'; +require_once 'layout.inc'; +# this file is generated on rsync.php.net and propogated from there +# it just defines $LAST_UPDATED. +require_once 'last_updated.inc'; + +if($SCRIPT_NAME=="/bugs.php" || $SCRIPT_NAME=="/bugstats.php") { +# $my_logo="/jpgs/logo-bug.jpg"; + $my_logo="/gifs/logo-bug.gif"; + $my_size="WIDTH=130 HEIGHT=67"; +} else { + $my_logo="/gifs/logo.gif"; + $my_size="WIDTH=130 HEIGHT=67"; +} + +?> Index: phpweb/include/email-validation.inc diff -u phpweb/include/email-validation.inc:1.4 phpweb/include/email-validation.inc:1.5 --- phpweb/include/email-validation.inc:1.4 Wed Feb 28 17:07:46 2001 +++ phpweb/include/email-validation.inc Wed Mar 7 16:18:09 2001 @@ -2,7 +2,7 @@ /* * email_validation.inc - * $Id: email-validation.inc,v 1.4 2001/03/01 01:07:46 jmcastagnetto Exp $ + * $Id: email-validation.inc,v 1.5 2001/03/08 00:18:09 jimw Exp $ */ Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.92 phpweb/include/shared-manual.inc:1.93 --- phpweb/include/shared-manual.inc:1.92 Mon Feb 26 15:11:40 2001 +++ phpweb/include/shared-manual.inc Wed Mar 7 16:18:09 2001 @@ -1,13 +1,26 @@ <?php // -*- C++ -*- -require("shared.inc"); +require_once 'prepend.inc'; -$FRAMEMODE="manual"; +$LANGUAGES = array( + 'en' => 'English', + 'pt_BR' => 'Brazilian Portuguese', + 'nl' => 'Dutch', + 'fr' => 'French', + 'de' => 'German', + 'hu' => 'Hungarian', + 'it' => 'Italian', + 'ja' => 'Japanese', + 'kr' => 'Korean', + 'ru' => 'Russian', + 'es' => 'Spanish', +); -$navBarNo = ""; - $NEXT = $PREV = $UP = $HOME = array(false, false); $TOC = array(); +$SIDEBAR_DATA = ''; + + function setupNavigation($data) { global $NEXT, $PREV, $UP, $HOME, $TOC, $tstamp; $HOME = @$data["home"]; @@ -19,254 +32,206 @@ $tstamp = gmdate("D, d M Y",getlastmod()); } -function makeBullet($url,$number,$offtype,$offnum) { - echo "<A HREF=\"$url\" onMouseover=\"hide();changebullet('bullet$number',1)\" \n"; - echo "onMouseout=\"changebullet('bullet$number',$offnum)\">"; - echo "<IMG SRC=\"/gifs/b-bullet-$offtype.gif\" \n WIDTH=10 HEIGHT=10 HSPACE=2 VSPACE=2 BORDER=0 \n ALT=\"*\" NAME=\"bullet$number\">"; - echo "</A>"; -} -function makeBorderTOC($this) -{ - global $NEXT, $PREV, $UP, $HOME, $TOC, $FONTFACEATTR, $PHP_SELF, $DOCUMENT_ROOT; - global $HAVE_STYLE, $HAVE_TD_BG; - $tocfontsize = "-1"; // replace with CSS? +function makeBorderTOC($this) { + global $NEXT, $PREV, $UP, $HOME, $TOC, $PHP_SELF, $DOCUMENT_ROOT; + global $SIDEBAR_DATA, $LANG; + + $SIDEBAR_DATA = '<form method="GET" action="/manual-lookup.php">' . + $SIDEBAR_DATA.= '<table border="0" CELLPADDING="4" CELLSPACING="0">'; + + $SIDEBAR_DATA.= '<tr valign="top"><td><small>' . + '<input type="hidden" name="lang" value="' . $LANG . '">' . + 'lookup: <input type="text" class="small" name="function" size="10"> ' . + make_submit('small_submit.gif', 'lookup', 'bottom') . + '<br></small></td></tr>'; + + $SIDEBAR_DATA.= '<tr bgcolor="#cccccc"><td></td></tr>'; + + $SIDEBAR_DATA.= '<tr valign="top"><td>' . + make_link('./', make_image('caret-t.gif', $HOME[1]) . $HOME[1] ) . + '<br></td></tr>'; + + $SIDEBAR_DATA.= '<tr bgcolor="#cccccc"><td></td></tr>'; + + if (($HOME[1] != $UP[1]) && $UP[1]) { + $SIDEBAR_DATA.= '<tr valign="top"><td>' . + make_link($UP[0], make_image('caret-u.gif', $UP[1]) . $UP[1] ) . + '<br></td></tr>'; + } + + $SIDEBAR_DATA.= '<tr valign="top"><td><small>'; + + for ($i = 0; $i < count($TOC); $i++) { + list($url, $title) = $TOC[$i]; + if (!$url || !$title) { + continue; + } + $img = 'box-0.gif'; + if ($title == $this) { + $img = 'box-1.gif'; + } + if ($UP[0] == 'funcref.php') { + $title = eregi_replace(" functions\$", "", $title); + } + $SIDEBAR_DATA .= '&nbsp;' . + make_link($url, make_image($img, $title) . $title ) . + '<br>'; + } - $FONTCOL = " COLOR=\"#FFFFFF\""; + $SIDEBAR_DATA.= '</small></td></tr>'; + $SIDEBAR_DATA.= '</table></form>'; - echo "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 WIDTH=\"100%\">\n"; - $this = eregi_replace("^Manual: *", "", $this); - - $cur = substr(dirname($PHP_SELF),-3); - $file = basename($PHP_SELF); - echo "<TR VALIGN=top>\n"; - echo "<TD COLSPAN=3>"; - if(substr($file,-5)=='.php3') $file = substr($file,0,-1); - - // manual languages array [directory, flag code, language] - $manual_languages = Array ( - Array("en", "uk", "English"), - Array("de", "de", "German"), - Array("ja", "jp", "Japanese"), - - Array("it", "it", "Italian"), - Array("fr", "fr", "French"), - Array("hu", "hu", "Hungarian"), - - Array("es", "es", "Spanish"), - Array("nl", "nl", "Dutch"), - Array("pt_BR", "br", "Brazilian Portuguese"), - - Array("kr", "kr", "Korean"), - Array("cs", "cz", "Czech") - ); - - while (list($lang_num, $lang_data) = each ($manual_languages)) { - if (@is_file("$DOCUMENT_ROOT/manual/$lang_data[0]/$file")) echo "<a href=\"/manual/$lang_data[0]/$file\"><img src=\"/gifs/flag-$lang_data[1].gif\" valign=bottom height=24 width=45 alt=\"$lang_data[2] version of this page\"></a>"; - else echo "<img src=\"/gifs/blank.gif\" valign=bottom height=24 width=45 alt=\"$lang_data[2] version of this page is not available\">"; - if ($lang_num % 3 == 2) { echo '<br>'; } - } - - echo "</TD></TR>\n"; +} - echo "<TR VALIGN=top>\n"; - echo "<TD WIDTH=10>"; - spc(10, 10); - echo "</TD>\n"; - echo "<TD COLSPAN=2><A HREF=\"$UP[0]\" onMouseover=\"hide();\" CLASS=sidebartoc>"; - echo "<FONT SIZE=\"$tocfontsize\"".$FONTCOL.$FONTFACEATTR.">"; - echo "<B>$UP[1]</B></FONT></A></TD></TR>\n"; - - for ($i = 0; $i < count($TOC); $i++) { - list($url, $title) = $TOC[$i]; - if (!$url || !$title) { - continue; - } - if ($title == $this) { - $type = "w"; - $out = 2; - } else { - $type = "p"; - $out = 0; - } - if ($UP[0] == 'funcref.php') { - $title = eregi_replace(" functions\$", "", $title); - } - echo "<TR VALIGN=top><TD WIDTH=10>"; - spc(10,10); - echo "</TD>\n<TD WIDTH=15><A HREF=\"$url\" "; - echo "onMouseover=\"hide();changebullet('bullet$i',1)\" \n"; - echo "onMouseout=\"changebullet('bullet$i',$out)\">"; - echo "<IMG SRC=\"/gifs/b-bullet-$type.gif\" WIDTH=10 HEIGHT=10 ALT=\"*\" BORDER=0 NAME=\"bullet$i\"></A>\n"; - echo "</TD>\n<TD WIDTH=100%>"; - echo "<A HREF=\"$url\" onMouseover=\"hide();"; - echo "changebullet('bullet$i',1)\" \n "; - echo "onMouseout=\"changebullet('bullet$i',$out)\" \n"; - echo "CLASS=sidebartoc>"; - echo "<FONT SIZE=\"$tocfontsize\"".$FONTCOL.$FONTFACEATTR.">"; - echo "$title</FONT></A></TD></TR>\n"; - } - echo "</TABLE>\n"; -}; +function navigationBar($title,$id,$loc) { + global $NEXT, $PREV, $tstamp, $SERVER_NAME,$SERVER_PORT,$PHP_SELF; -function navigationBar($title) { - global $NEXT, $PREV, $UP, $HOME, $TOC, $FONTFACE, $tstamp; - global $navBarNo; - $no = $navBarNo; - if ($title!="Show Source") { - echo("<!-- start next/prev -->\n"); - echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR='#D0D0D0' CELLPADDING=0 CELLSPACING=0>\n"; - echo "<TR VALIGN=middle>\n"; - echo "<TD ALIGN=left WIDTH=18><IMG SRC='/gifs/gcap-left.gif' ALT=' ' WIDTH=18 HEIGHT=36 BORDER=0><BR></TD>\n"; - if ($PREV[0] && $PREV[1]) { - echo "<TD ALIGN=left WIDTH=75><A HREF=\"$PREV[0]\" onMouseover=\"change('prev$no',1);\" onMouseout=\"hide();\"><IMG SRC='/gifs/b-prev-p.gif' ALT='Previous page' WIDTH=75 HEIGHT=21 VSPACE=7 BORDER=0 NAME='prev$no' align=absmiddle></A><BR></TD>\n"; - } - echo "<TD ALIGN=left WIDTH=44%><FONT FACE='$FONTFACE' SIZE=-1>&nbsp;$PREV[1]<BR></FONT></TD>\n"; - echo "<TD ALIGN=center WIDTH=12% nobr><FONT FACE='$FONTFACE' SIZE=-2>&nbsp;Updated<br>$tstamp<BR></FONT></TD>\n"; - echo "<TD ALIGN=right WIDTH=44%><FONT FACE='$FONTFACE' SIZE=-1>$NEXT[1]&nbsp;<BR></FONT></TD>\n"; - if ($NEXT[0] && $NEXT[1]) { - echo "<TD ALIGN=left WIDTH=75><A HREF=\"$NEXT[0]\" onMouseover=\"change('next$no',1);\" onMouseout=\"hide();\"><IMG SRC='/gifs/b-next-p.gif' ALT='Next page' WIDTH=75 HEIGHT=21 VSPACE=7 BORDER=0 NAME='next$no' align=absmiddle></A><BR></TD>\n"; - } - echo "<TD ALIGN=right WIDTH=18><IMG SRC='/gifs/gcap-right.gif' alt=' ' WIDTH=18 HEIGHT=36 BORDER=0><BR></TD>\n"; - echo "</TR></TABLE>\n"; - echo "<BR>\n"; - $navBarNo = (string)((int)$navBarNo + 2); - } -} + echo '<table border="0" width="620" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4">'; + echo '<tr>'; + echo '<td align="left">'; + if ($PREV[1]) { + echo make_link( $PREV[0] , make_image('caret-l.gif', 'previous') . $PREV[1] ) ; + } + echo '<br></td>'; + + echo '<td align="right">'; + if ($NEXT[1]) { + echo make_link( $NEXT[0] , $NEXT[1] . make_image('caret-r.gif', 'next') ) ; + } + echo '<br></td>'; + echo '</tr>'; + + echo '<tr bgcolor="#cccccc"><td colspan="2">'; + spacer(1,1); + echo '<br></td></tr>'; + + echo '<tr>'; + echo '<td align="right" colspan="2"><small>Last updated: '.$tstamp.'<br>'; + + if ($loc == 'bottom') { + + $back_url = 'http://' . $SERVER_NAME . + (($SERVER_PORT==80) ? '' : ':'.$SERVER_PORT ) . + $PHP_SELF; + print_link('/manual/add-note.php?sect='.$id.'&redirect='.$back_url, 'add note',false,'class="small"'); + echo delim(); + print_link('/manual/about-notes.php', 'about notes',false,'class="small"',false,'class="small"'); + + } else { + + global $LANGUAGES; + $links = array(); + foreach($LANGUAGES as $code=>$name) { + if (file_exists("../$code/$id")) { + $links[] = make_link("../$code/$id", $name); + } + } + $file = substr($id,0,-4); + if (file_exists("html/$file.html")) { + $links[] = make_link("html/$file.html", 'Plain HTML'); + } + if (count($links)) { + echo 'view this page in ' . join (delim(), $links); + } + } -function makeTitle($title) { - global $FONTFACE; -?> -<TR bgcolor='#D0D0D0' valign=middle> -<TD ALIGN=left WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-left.gif" WIDTH=18 HEIGHT=36 BORDER=0><BR></TD> -<TD ALIGN=left><? - echo "<FONT FACE=\"$FONTFACE\">\n"; - echo "<B>$title</B><BR></FONT>\n"; -?></TD> -<TD ALIGN=right WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-right.gif" WIDTH=18 HEIGHT=36 BORDER=0><BR></TD> -</TR> -<? -}; + echo '<br></small></td></tr>'; + echo "</table>\n"; + +} + function makeEntry($date,$name,$blurb,$id=0) { - global $FONTFACE, $MAGIC_COOKIE; + global $MAGIC_COOKIE; ?> -<TR VALIGN=top> -<TD ALIGN=left><? spc(18,18);?><BR></TD> - -<TD ALIGN=left BGCOLOR="#E0E0E0"> -<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=3 WIDTH=100%> -<TR><TD> +<tr valign="top"> +<td align="left" bgcolor="#e0e0e0"> +<table border="0" cellpadding="2" cellspacing="0" width="100%"> +<tr><td> <? - echo "<FONT FACE=\"$FONTFACE\" SIZE=-1>\n"; - $name = htmlspecialchars($name); - if (ereg("(.+)@(.+)\.(.+)",$name)) { - echo "<A HREF=\"mailto:".$name."\">".$name."</A><BR>\n"; - } else { - echo "<B>".$name."</B><BR>\n"; - } - echo date("d-M-Y h:ia",$date)."<BR>\n"; + $name = htmlspecialchars($name); + if (ereg("(.+)@(.+)\.(.+)",$name)) { + echo "<a href=\"mailto:".$name."\">".$name."</a><br>\n"; + } else { + echo "<b>".$name."</b><br>\n"; + } + echo date("d-M-Y h:i",$date); ?> -</TD></TR> -<TR BGCOLOR="#F0F0F0"><TD> -<?echo clean_note($blurb);?><BR> +</td></tr> +<tr bgcolor="#f0f0f0"><td> +<? +echo clean_note($blurb); +?><BR> <?if (isset($MAGIC_COOKIE) && $id):?> <hr noshade size=1> -<A href="/manual/admin-notes.php?action=delete+<?echo $id?>&brief=1&popup=1" target="admin">delete</A> | -<A href="/manual/admin-notes.php?action=reject+<?echo $id?>&brief=1&popup=1" target="admin">reject</A> | -<A href="/manual/admin-notes.php?action=edit+<?echo $id?>&brief=1" target="admin">edit</A> -<BR> +<a href="/manual/admin-notes.php?action=delete+<?echo $id?>&brief=1&popup=1" target="admin">delete</a> | +<a href="/manual/admin-notes.php?action=reject+<?echo $id?>&brief=1&popup=1" target="admin">reject</a> | +<a href="/manual/admin-notes.php?action=edit+<?echo $id?>&brief=1" target="admin">edit</a> <?endif;?> -</TD></TR> -</TABLE> - -</TD> -<TD ALIGN=left bgcolor='#ffffff'><? spc(18,18);?><BR></TD> -</TR> +</td></tr> +</table> +</td> +</tr> <? }; -function makeAddNote() { - global $FONTFACE; -?> -<TR bgcolor='#D0D0D0' valign=middle> -<TD ALIGN=left WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-left.gif" WIDTH=18 HEIGHT=36 BORDER=0><BR></TD> -<TD ALIGN=right WIDTH=100% -><INPUT TYPE=image name="addnote" VALUE="Add Note" SRC="/gifs/b-addnote-p.gif" ALT="Add a Note" -onMouseover="change('addnote',1);" onMouseout="hide();" -WIDTH=100 HEIGHT=21 VSPACE=7 BORDER=0 align=absmiddle -></A ->&nbsp;<A HREF="/manual/about-notes.php" onMouseover="change('abnote',1);" onMouseout="hide();" -><IMG SRC='/gifs/b-about-p.gif' ALT='About Notes' WIDTH=75 HEIGHT=21 VSPACE=7 BORDER=0 NAME='abnote' align=absmiddle -></A><BR> -</TD> -<TD ALIGN=right WIDTH=18><IMG ALT=" " SRC="/gifs/gcap-right.gif" WIDTH=18 HEIGHT=36 BORDER=0><BR></TD> -</TR> -<? -}; - function manualGetUserNotes($title, $id) { - // if we're www.php.net, get it from the local DB - // otherwise look in "/manual/usernotes/$title.txt" (if present) - global $MYSITE; - $notes = array(); - if(strstr($MYSITE,"www.php.net")) { -# if(strstr($MYSITE,"www.php.net") || strstr($MYSITE,"localhost")) { - $host = 'localhost'; -# $host = '127.0.0.1'; - $user = 'nobody'; - $pass = ''; - $db_id = mysql_connect($host, $user, $pass); - $query = "SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE sect = '$title' OR sect = '$id' ORDER BY id"; - $result_id = mysql_db_query("php3", $query, $db_id); - if ($result_id && mysql_num_rows($result_id) > 0) { - while ($row = mysql_fetch_array($result_id)) { - $notes[] = $row; - } - } - } else { - $notes_file = "usernotes/" . urlencode( $title ) . ".txt"; - if ( @file_exists( $notes_file ) ) - { - $fp = @fopen($notes_file,"r"); - if ($fp) { - $body = fread($fp,filesize($notes_file)); - if (strlen($body)) { - $notes = @unserialize($body); - } - fclose($fp); - } - } - } - return $notes; + // if we're www.php.net, get it from the local DB + // otherwise look in "/manual/usernotes/$title.txt" (if present) + global $MYSITE; + $notes = array(); + if(strstr($MYSITE,"www.php.net")) { +# if(strstr($MYSITE,"www.php.net") || strstr($MYSITE,"localhost")) { + $host = 'localhost'; +# $host = '127.0.0.1'; + $user = 'nobody'; + $pass = ''; + $db_id = mysql_connect($host, $user, $pass); + $query = "SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE sect = '$title' OR sect = '$id' ORDER BY id"; + $result_id = mysql_db_query("php3", $query, $db_id); + if ($result_id && mysql_num_rows($result_id) > 0) { + while ($row = mysql_fetch_array($result_id)) { + $notes[] = $row; + } + } + } else { + $notes_file = "../usernotes/" . urlencode( $title ) . ".txt"; + if ( @file_exists( $notes_file ) ) + { + $fp = @fopen($notes_file,"r"); + if ($fp) { + $body = fread($fp,filesize($notes_file)); + if (strlen($body)) { + $notes = @unserialize($body); + } + fclose($fp); + } + } + } + return $notes; } function manualUserNotes($title, $id) { - global $PHP_SELF, $SERVER_NAME, $SERVER_PORT; - $cur = substr(dirname($PHP_SELF),-2); - if($cur=='al') $cur='en'; - echo '<FORM method="POST" action="http://www.php.net/manual/add-note.php">'; - $back_url = "http://$SERVER_NAME".(($SERVER_PORT==80)?"":":".$SERVER_PORT).$PHP_SELF; - echo '<INPUT type="hidden" name="redirect" value="'.$back_url.'">'; - echo '<INPUT type="hidden" name="sect" value="'.$title.'">'; - echo '<INPUT type="hidden" name="lang" value="'.$cur.'">'; - - echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100%>\n"; - - $notes = manualGetUserNotes($title, $id); - $num_notes = count($notes); - if ( $num_notes > 0 ) { - makeTitle("User Contributed Notes: ".$title); - for ($i=0; $i<$num_notes; $i++) { - $note = $notes[$i]; // should use foreach? - makeEntry($note['xwhen'],$note['user'],$note['note'],$note['id']); - } - } - makeAddNote(); - echo "</TABLE></FORM>\n"; + global $PHP_SELF, $SERVER_NAME, $SERVER_PORT; + $cur = substr(dirname($PHP_SELF),-2); + if($cur=='al') $cur='en'; + + echo "<table border=\"0\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\">\n"; + + $notes = manualGetUserNotes($title, $id); + $num_notes = count($notes); + if ( $num_notes > 0 ) { + echo "<tr bgcolor=\"#d0d0d0\"><td><b>User Contributed Notes: $title</b></td></tr>"; + for ($i=0; $i<$num_notes; $i++) { + $note = $notes[$i]; // should use foreach? + makeEntry($note['xwhen'],$note['user'],$note['note'],$note['id']); + } + } + echo "</table>\n"; } function manualLastModified($title, $id) { @@ -291,25 +256,30 @@ } function sendManualHeaders($charset,$lang) { - Header("Content-type: text/html;charset=$charset"); - Header("Content-language: $lang"); + global $LANG; + $LANG = $lang; + Header("Content-type: text/html;charset=$charset"); + Header("Content-language: $lang"); } function manualHeader($title,$id="") { - global $FRAMEMODE, $HTDIG; - manualLastModified($title,$id); - commonHeader("Manual: $title"); - if (!$HTDIG): - navigationBar($title); - endif; + global $HTDIG, $LANGUAGES, $LANG, $SIDEBAR_DATA; + manualLastModified($title,$id); + makeBorderTOC($title); + commonHeader('Manual: '.$title); + # create links to plain html and other languages + if (!$HTDIG) { + navigationBar($title, $id, "top"); + } } function manualFooter($title,$id="") { - global $HTDIG; - if (!$HTDIG): - manualUserNotes($title,$id); - navigationBar($title); - endif; - commonFooter($title); + global $HTDIG; + if (!$HTDIG) { + manualUserNotes($title,$id); + navigationBar($title, $id, "bottom"); + } + commonFooter(); + } ?> Index: phpweb/include/shared-stat.inc diff -u phpweb/include/shared-stat.inc:1.7 phpweb/include/shared-stat.inc:1.8 --- phpweb/include/shared-stat.inc:1.7 Sun Jun 4 13:16:08 2000 +++ phpweb/include/shared-stat.inc Wed Mar 7 16:18:09 2001 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- header("Vary: User-Agent"); -require("site.inc"); +require_once 'prepend.inc'; /* Check that browser! */ Index: phpweb/include/shared.inc diff -u phpweb/include/shared.inc:1.124 phpweb/include/shared.inc:1.125 --- phpweb/include/shared.inc:1.124 Mon Jan 22 12:12:16 2001 +++ phpweb/include/shared.inc Wed Mar 7 16:18:09 2001 @@ -1,846 +1,5 @@ -<?php // -*- C++ -*- -require("site.inc"); +<?php -/* Check that browser! */ +require_once 'prepend.inc'; -$IE4 = false; $IE3 = false; -$NS4 = false; $NS3 = false; -$X11 = false; $HAVE_STYLE = false; -$HTDIG = false; - -$DISABLE_KICKOUTS = false; -if($SCRIPT_NAME=="/bugs.php" || $SCRIPT_NAME=="/bugstats.php") { -# $my_logo="/jpgs/logo-bug.jpg"; - $my_logo="/gifs/logo-bug.gif"; - $my_size="WIDTH=130 HEIGHT=67"; -} else { - $my_logo="/gifs/logo.gif"; - $my_size="WIDTH=130 HEIGHT=67"; -} - -# prevent errors if the user is being paranoid -# they should get the plain version of the site - -if (!isset($HTTP_USER_AGENT)) { - $HTTP_USER_AGENT = "none"; -} - - -if (ereg("MSIE ([0-9]+)",$HTTP_USER_AGENT,$version)): - $ver=(int)$version[1]; - if ($ver>=4): - $IE4=true; - $HAVE_STYLE = true; - elseif($ver==3): - $IE3=true; - endif; -elseif (ereg("Mozilla/([0-9]+)",$HTTP_USER_AGENT,$version)): - $ver=(int)$version[1]; - if ($ver>=4): - $NS4=true; - $HAVE_STYLE=true; - elseif($ver==3): - $NS3=true; - endif; -endif; - -if (strstr($HTTP_USER_AGENT,"Opera")): -# $DISABLE_KICKOUTS = true; - $HAVE_STYLE=true; - $NS4=true; -endif; - -if (strstr($HTTP_USER_AGENT,"X11")): - $X11 = true; -endif; -if (strstr($HTTP_USER_AGENT,"htdig")): - $HTDIG = true; -endif; - -/* Base variables */ - -$FONTFACE = "tahoma, verdana, arial, helvetica, sans-serif"; -$FRAMEMODE = "standard"; -$FONTFACEATTR = " FACE=\"$FONTFACE\""; - -/* Base functions */ - -function preloadImages() { - global $FRAMEMODE; -?> - b_close0 = new Image(); - b_close0.src = "/gifs/b-close-p.gif"; - b_close1 = new Image(); - b_close1.src = "/gifs/b-close-c.gif"; - - b_cred0 = new Image(); - b_cred0.src = "/gifs/b-credits-p.gif"; - b_cred1 = new Image(); - b_cred1.src = "/gifs/b-credits-c.gif"; - - b_top0 = new Image(); - b_top0.src = "/gifs/b-top-p.gif"; - b_top1 = new Image(); - b_top1.src = "/gifs/b-top-c.gif"; - - b_sear0 = new Image(); - b_sear0.src = "/gifs/b-search-p.gif"; - b_sear1 = new Image(); - b_sear1.src = "/gifs/b-search-c.gif"; - - b_sour0 = new Image(); - b_sour0.src = "/gifs/b-source-p.gif"; - b_sour1 = new Image(); - b_sour1.src = "/gifs/b-source-c.gif"; - - b_proj0 = new Image(); - b_proj0.src = "/gifs/b-projects-p.gif"; - b_proj1 = new Image(); - b_proj1.src = "/gifs/b-projects-c.gif"; - - b_mirr0 = new Image(); - b_mirr0.src = "/gifs/b-mirror-p.gif"; - b_mirr1 = new Image(); - b_mirr1.src = "/gifs/b-mirror-c.gif"; - - b_next0 = new Image(); - b_next0.src = "/gifs/b-next-p.gif"; - b_next1 = new Image(); - b_next1.src = "/gifs/b-next-c.gif"; - - b_prev0 = new Image(); - b_prev0.src = "/gifs/b-prev-p.gif"; - b_prev1 = new Image(); - b_prev1.src = "/gifs/b-prev-c.gif"; - - b_next20 = new Image(); - b_next20.src = "/gifs/b-next-p.gif"; - b_next21 = new Image(); - b_next21.src = "/gifs/b-next-c.gif"; - - b_prev20 = new Image(); - b_prev20.src = "/gifs/b-prev-p.gif"; - b_prev21 = new Image(); - b_prev21.src = "/gifs/b-prev-c.gif"; - - b_qref0 = new Image(); - b_qref0.src = "/gifs/b-quickref-p.gif"; - b_qref1 = new Image(); - b_qref1.src = "/gifs/b-quickref-c.gif"; - - b_stat0 = new Image(); - b_stat0.src = "/gifs/b-stats-p.gif"; - b_stat1 = new Image(); - b_stat1.src = "/gifs/b-stats-c.gif"; - -<? if ($FRAMEMODE == "manual"): ?> - b_cont0 = new Image(); - b_cont0.src = "/gifs/b-contents-p.gif"; - b_cont1 = new Image(); - b_cont1.src = "/gifs/b-contents-c.gif"; - - b_up0 = new Image(); - b_up0.src = "/gifs/b-up-p.gif"; - b_up1 = new Image(); - b_up1.src = "/gifs/b-up-c.gif"; - - b_addnote0 = new Image(); - b_addnote0.src = "/gifs/b-addnote-p.gif"; - b_addnote1 = new Image(); - b_addnote1.src = "/gifs/b-addnote-c.gif"; - - b_abnote0 = new Image(); - b_abnote0.src = "/gifs/b-about-p.gif"; - b_abnote1 = new Image(); - b_abnote1.src = "/gifs/b-about-c.gif"; - - b_bullet0 = new Image(); - b_bullet0.src = "/gifs/b-bullet-p.gif"; - b_bullet1 = new Image(); - b_bullet1.src = "/gifs/b-bullet-c.gif"; - b_bullet2 = new Image(); - b_bullet2.src = "/gifs/b-bullet-w.gif"; -<? else: ?> - b_down0 = new Image(); - b_down0.src = "/gifs/b-downloads-p.gif"; - b_down1 = new Image(); - b_down1.src = "/gifs/b-downloads-c.gif"; - - b_docs0 = new Image(); - b_docs0.src = "/gifs/b-docs-p.gif"; - b_docs1 = new Image(); - b_docs1.src = "/gifs/b-docs-c.gif"; - - b_mail0 = new Image(); - b_mail0.src = "/gifs/b-mailing-p.gif"; - b_mail1 = new Image(); - b_mail1.src = "/gifs/b-mailing-c.gif"; - - b_dev0 = new Image(); - b_dev0.src = "/gifs/b-development-p.gif"; - b_dev1 = new Image(); - b_dev1.src = "/gifs/b-development-c.gif"; - - b_news0 = new Image(); - b_news0.src = "/gifs/b-news-p.gif"; - b_news1 = new Image(); - b_news1.src = "/gifs/b-news-c.gif"; - - b_link0 = new Image(); - b_link0.src = "/gifs/b-links-p.gif"; - b_link1 = new Image(); - b_link1.src = "/gifs/b-links-c.gif"; -<? endif; -} - - -function spc($width, $height) { - echo "<IMG SRC=\"/gifs/spacer.gif\" WIDTH=$width HEIGHT=$height BORDER=0>"; -} - -function kickHeader($offset,$side,$width) { - global $FONTFACEATTR; - $off=abs($offset); - $innerwidth=$width-40; - $innerwidth2=$innerwidth+21; - $tablewidth=$width; - if ($side=="left"): - $tablewidth=$tablewidth+50; - endif; - if ($side=="none"): - $tablewidth=$tablewidth+1; - endif; - echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n"; - if ($side=="left" || $side=="none"): - echo "<TR>\n"; - if ($offset>=0): - if ($side=="left"): - echo "<TD valign=top rowspan=3 width=30>"; - spc(1,$off); - echo "<BR><IMG SRC=\"/gifs/bubbles-up.gif\" WIDTH=50 HEIGHT=50 BORDER=0><BR></TD>\n"; - else: - echo "<TD valign=top rowspan=3 width=1>"; - spc(1,1); - echo "<BR></TD>\n"; - endif; - else: - echo "<TD valign=bottom rowspan=3 width=30><IMG SRC=\"/gifs/bubbles-up.gif\" WIDTH=50 HEIGHT=50 BORDER=0><BR>"; - spc(1,$off); - echo "<BR></TD>\n"; - endif; - else: - if ($offset>=0): - echo "<TR>\n<TD colspan=4 align=left>"; - spc($off,1); - echo "<IMG SRC=\"/gifs/bubbles-down.gif\" WIDTH=50 HEIGHT=50 BORDER=0><BR></TD></TR>\n"; - else: - echo "<TR><TD colspan=4 align=right width=$width><IMG SRC=\"/gifs/bubbles-down.gif\" WIDTH=50 HEIGHT=50 BORDER=0>"; - spc($off,1); - echo "<BR></TD>\n</TR>\n"; - endif; - echo "<TR VALIGN=top>\n"; - endif; - echo "<TD width=9><IMG SRC=\"/gifs/kick-ctl.gif\" WIDTH=9 HEIGHT=10 BORDER=0><BR></TD>\n"; - echo "<TD colspan=2 BACKGROUND=\"/gifs/kick-bt.gif\">"; - spc(1,10); - echo "<BR></TD>\n<TD width=10><IMG SRC=\"/gifs/kick-ctr.gif\" WIDTH=10 HEIGHT=10 BORDER=0><BR></TD>\n"; - echo "</TR>\n"; - echo "<TR VALIGN=top><TD BACKGROUND=\"/gifs/kick-bl.gif\" width=9>"; - spc(9,1); - echo "<BR></TD>\n<TD BGCOLOR=\"#EFEF52\" width=$innerwidth><FONT $FONTFACEATTR SIZE=2>\n"; -} - -function kickFooter($kickname,$buttname,$width) { - $innerwidth=$width-40; - $innerwidth2=$innerwidth+21; - echo "</FONT></TD>\n<TD BACKGROUND=\"/gifs/kick-bg.gif\" width=21 VALIGN=top>"; - echo "<A HREF=\"javascript:popUp('$kickname',false);change('$buttname',0);\"><IMG SRC=\"/gifs/kick-close.gif\" ALT=\"Close this window\" WIDTH=21 HEIGHT=21 BORDER=0></A><BR>"; - echo "</TD>\n<TD BACKGROUND=\"/gifs/kick-br.gif\" width=10>"; - spc(10,1); - echo "<BR></TD>\n</TR>\n<TR VALIGN=top>\n"; - echo "<TD width=9><IMG SRC=\"/gifs/kick-cbl.gif\" WIDTH=9 HEIGHT=10 BORDER=0><BR></TD>\n"; - echo "<TD colspan=2 BACKGROUND=\"/gifs/kick-bb.gif\">"; - spc(1,10); - echo "<BR></TD>\n<TD width=10><IMG SRC=\"/gifs/kick-cbr.gif\" WIDTH=10 HEIGHT=10 BORDER=0><BR></TD>\n"; - echo "</TR>\n</TABLE>\n"; -} - -function download_link($file, $title) { - global $filesizes; - if ($tmp = strrchr($file, "/")) { - $local_file = substr($tmp, 1, strlen($tmp)); - } else { - $file = "distributions/$file"; - $local_file = $file; - } - echo("<a href=\"$file\">$title</a>"); - $size = @filesize($local_file)/1024; - echo("<!-- file=$file localfile=$local_file size-$size-->\n"); - if ($size) { - printf(" (%dKB)", $size); - } elseif (isset($filesizes[$local_file])) { - echo " (".$filesizes[$local_file].")"; - } -} - -function gifurl($img) { - global $root_url; - return $root_url . "/gifs/" . $img; -} - -function jpgurl($img) { - global $root_url; - return $root_url . "/jpgs/" . $img; -} - -function makeSideButton($url,$button,$kick,$gif,$width,$height,$vspace,$hspace,$alt,$br) { - if ($url): - echo "<A HREF=\"$url\" onMouseover=\"change('$button',1);"; - if ($kick): - echo " popUp('$kick',true);\" \n >"; - else: - echo "\" \n onMouseout=\"hide();\">"; - endif; - endif; - echo "<IMG SRC=\"/gifs/b-$gif-p.gif\" \n ALT=\"$alt\" \n WIDTH=$width HEIGHT=$height BORDER=0 \n NAME=\"$button\" \n HSPACE=$hspace VSPACE=$vspace>"; - if ($url): - echo "</A>"; - endif; - echo $br; -} - -function commonHeader($title) { - global $NS4, $NS3, $IE3, $IE4, $X11, $FRAMEMODE, $FONTFACEATTR, $HTDIG; - global $PHP_SELF, $HTTP_REFERER, $FONTFACE, $COUNTRIES, $MIRRORS, $MYSITE; - global $HAVE_STYLE,$HAVE_SEARCH; - global $NEXT, $PREV, $UP, $HOME, $TOC; - global $DISABLE_KICKOUTS, $DOCUMENT_ROOT; - $HAVE_SEARCH=$MIRRORS[$MYSITE][5]; - - Header("Vary: User-Agent"); - $lang = strtolower(substr(dirname($PHP_SELF),-2)); - switch($lang) { - case 'kr': - case 'ja': - Header("Content-Type: text/html; charset=utf-8"); - Header("Content-language: $lang"); - break; - case 'hu': - Header("Content-Type: text/html; charset=iso-8859-2"); - Header("Content-language: hu"); - break; - default: - Header("Content-Type: text/html; charset=iso-8859-1"); - Header("Content-language: $lang"); - break; - } - -?> -<HTML> -<HEAD> -<TITLE>PHP: <? echo $title;?></TITLE> - -<? if ($HAVE_STYLE): ?> -<LINK REL="stylesheet" HREF="/php-style.css" TYPE="text/css"> -<? endif; ?> - -<SCRIPT LANGUAGE="JavaScript"> -<!-- - -if (window != top) top.location.href = location.href; - -NS4 = (document.layers) ? 1 : 0; -IE4 = (document.all) ? 1 : 0; -DOM = (document.getElementById) ? 1 : 0; -ver4 = (NS4 || IE4) ? 1 : 0; - -/* -<? readfile($DOCUMENT_ROOT."/COPYRIGHT.txt"); ?> -*/ - -/* -Debugging: - $IE4 = <? echo $IE4; ?> - $IE3 = <? echo $IE3; ?> - $NS4 = <? echo $NS4; ?> - $NS3 = <? echo $NS3; ?> - $X11 = <? echo $X11; ?> - $HAVE_STYLE = <? echo $HAVE_STYLE; ?> -*/ - -var loaded = 0; -var gotlayers = 0; -var lastbutton='top'; - -// --> -</SCRIPT> - -<? if (($NS4 || $IE4) && (!$DISABLE_KICKOUTS)): /* Kick Outs */ ?> -<SCRIPT LANGUAGE="JavaScript1.2"> -<!-- - -function moveLayers() { - if (gotlayers) { - if (NS4) { - screenWidth = window.innerWidth; -<? if ($FRAMEMODE!="manual"): ?> - document.layers['mirrorsKick'].left = 140; - document.layers['mirrorsKick'].top = 215; -<? endif; ?> - document.layers['qrefKick'].left = 140; - document.layers['qrefKick'].top = 80; - document.layers['searchKick'].left = screenWidth-350; - document.layers['searchKick'].top = 36; - } else if (DOM) { - screenWidth = (document.body.clientWidth ? document.body.clientWidth : window.innerWidth) + 18; -<? if ($FRAMEMODE!="manual"): ?> - document.getElementById('mirrorsKick').style.left = 140; - document.getElementById('mirrorsKick').style.top = 215; -<? endif; ?> - document.getElementById('qrefKick').style.left = 140; - document.getElementById('qrefKick').style.top = 80; - document.getElementById('searchKick').style.left = screenWidth-350; - document.getElementById('searchKick').style.top = 36; - } else { - screenWidth = document.body.clientWidth + 18; -<? if ($FRAMEMODE!="manual"): ?> - document.all['mirrorsKick'].style.pixelLeft = 140; - document.all['mirrorsKick'].style.pixelTop = 215; -<? endif; ?> - document.all['qrefKick'].style.pixelLeft = 140; - document.all['qrefKick'].style.pixelTop = 80; - document.all['searchKick'].style.pixelLeft = screenWidth-350; - document.all['searchKick'].style.pixelTop = 36; - } - } -} - -function popUp(menuName,on) { - if (gotlayers) { - if (on) { - moveLayers(); - if (NS4) { - document.layers[menuName].visibility = "show"; - } else if (DOM) { - document.getElementById(menuName).style.visibility = "visible"; - } else { - document.all[menuName].style.visibility = "visible"; - } - } else { - if (NS4) { - document.layers[menuName].visibility = "hide"; - } else if (DOM) { - document.getElementById(menuName).style.visibility = "hidden"; - } else { - document.all[menuName].style.visibility = "hidden"; - } - } - } -} - -<? else: ?> -<SCRIPT LANGUAGE="JavaScript1.1"> -<!-- -function popUp(menuName,on) { -} -function moveLayers() { -} -<? endif; /* Kick outs */ ?> -// --> -</SCRIPT> - -<SCRIPT LANGUAGE="JavaScript1.1"> -<!-- -<? if ($NS4 || $NS3 || $IE4): /* OnOvers */ ?> -function LoadImgs () { - if (document.images) { -<? preloadImages(); ?> - loaded = 1; - } -} - -function change(Name,No) { - if (document.images && (loaded == 1) && (document[Name])) { - document[Name].src = eval("b_" + Name + No + ".src"); - } - if (No == 1) { - if (gotlayers) { -<? if ($FRAMEMODE!="manual"): ?> - popUp('mirrorsKick',false); -<? endif; ?> - popUp('qrefKick',false); - popUp('searchKick',false); - } -<? if ($FRAMEMODE!="manual"): ?> - if (Name != 'mirr') { - change('mirr',0); - } -<? endif; ?> - if (Name != 'qref') { - change('qref',0); - } - if (Name != 'sear') { - change('sear',0); - } - lastbutton = Name; - } -} - -function changebullet(Name,No) { - if (document.images && (loaded == 1)) { - document[Name].src = eval("b_bullet" + No + ".src"); - } -} - -function hide() { - if (document.images && (loaded == 1)) { - change(lastbutton,0); - } -} -<? else: /* OnOvers */ ?> - -function change(Name,No) { -} -function changebullet(Name,No) { -} -function hide() { -} - -<? endif; /* OnOvers */ - -if ($IE4): - echo "LoadImgs();\n"; -endif; -?> - -// --> -</SCRIPT> - -</HEAD> - -<BODY MARGINHEIGHT=3 MARGINWIDTH=3 TOPMARGIN=3 LEFTMARGIN=3 BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#5B69A6" VLINK="#5B69A6" ALINK="#00FF00" -<? if ($NS4 || $NS3): - echo " OnLoad=\"LoadImgs();\""; -endif; ?> -><A NAME="tOpOfpAgE"> -<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> - <TR valign=top> - <TD ALIGN=left width=150 BGCOLOR="#5B69A6"> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="150"> - <TR VALIGN=top> - <TD ALIGN=left> - <IMG SRC="/gifs/cap-ul.gif" WIDTH=9 HEIGHT=9 BORDER=0><BR> - <?spc(15,67);?><A HREF="/index.php"><IMG SRC="<?echo $GLOBALS["my_logo"]?>" ALT="PHP Home Page" <?echo $GLOBALS["my_size"]?> BORDER=0></A><BR> - <?spc(1,10);?><BR> - </TD> - </TR> - <TR VALIGN=top> - <TD ALIGN=left> - <? if ($FRAMEMODE == "manual"): - makeSideButton("$HOME[0]","cont","","contents",129,30,0,10,"Manual Table of Contents","<BR>\n"); - if ($UP[0] && $UP[1]): - makeSideButton($UP[0],"up","","up",129,30,0,10,"Up to $UP[1]","<BR>\n"); - endif; - makeSideButton("/quickref.php","qref","qrefKick","quickref",129,30,0,10,"Quick Reference","<BR>\n"); - if (!$HTDIG): - makeBorderTOC($title); - endif; - else: - $lastnews=filemtime($DOCUMENT_ROOT."/news.php"); - if ($lastnews): - $lastnews="PHP News last updated: ".date("M d, Y",$lastnews); - else: - $lastnews="PHP in the News"; - endif; - makeSideButton("/downloads.php","down","","downloads",129,30,0,10,"Downloads","<BR>\n"); - makeSideButton("/docs.php","docs","","docs",129,30,0,10,"Documentation","<BR>\n"); - makeSideButton("/quickref.php","qref","qrefKick","quickref",129,30,0,10,"Quick Reference","<BR>\n"); - makeSideButton("/support.php","dev","","development",129,30,0,10,"Getting Help","<BR>\n"); - makeSideButton("/news.php","news","","news",129,30,0,10,$lastnews,"<BR>\n"); - makeSideButton("/projects.php","proj","","projects",129,30,0,10,"Projects using PHP","<BR>\n"); - makeSideButton("/links.php","link","","links",129,30,0,10,"PHP Links","<BR>\n"); - makeSideButton("/mirrors.php","mirr","mirrorsKick","mirror",129,30,0,10,"Mirror sites","<BR>\n"); - endif; ?> - </TD> - </TR> - - <TR><TH align=left><br>&nbsp;&nbsp;<a href="/thanks.php" class=blacklink>Thanks to:</a></TH></TR> - <TR><TD>&nbsp;<a href="http://chek.com" class=whitelink>Chek.com</a></TD></TR> - <TR><TD>&nbsp;<a href="http://www.easydns.com/?V=698570efeb62a6e2" class=whitelink>easyDNS</a></TD></TR> - <TR><TD>&nbsp;<a href="http://valinux.com" class=whitelink>VA Linux Systems</a></TD></TR> - - <TR><TH align=left><br>&nbsp;&nbsp;Related sites:</TH></TR> - <TR><TD><a href="http://www.apache.org" class=whitelink>Apache</a></TD></TR> - <TR><TD><a href="http://www.mysql.com" class=whitelink>MySQL</a></TD></TR> - <TR><TD><a href="http://www.postgresql.org" class=whitelink>PostgreSQL</a></TD></TR> - <TR><TD><a href="http://www.zend.com" class=whitelink>Zend Tech.</a></TD></TR> - - <TR><TH align=left><br>&nbsp;&nbsp;Community:</TH></TR> - <TR><TD><a href="http://www.linuxfund.org" class=whitelink>LinuxFund.org</a></TD></TR> - <TR><TD><a href="http://www.osdn.org" class=whitelink>OSDN</a></TD></TR> - - </TABLE> - </TD> - <TD align=left width="100%"> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width="100%"> - <TR VALIGN=middle BGCOLOR="#5B69A6"> - <TD ALIGN=left> - <? - spc(5,1); - echo "<FONT${FONTFACEATTR} SIZE=4><B>$title</B></FONT><BR>\n"; - ?> - </TD> - <TD ALIGN=right> - <? - if($title=="Show Source"): - makeSideButton("","sour","","source",1,1,0,0,"",""); - makeSideButton("javascript:history.go(-1);","close","","close",75,30,9,5,"Close this source page",""); - else: - makeSideButton("","close","","close",1,1,0,0,"",""); - makeSideButton("/source.php?page_url=$PHP_SELF","sour","","source",75,30,9,5,"View the source code for this page",""); - endif; - makeSideButton("/search.php","sear","searchKick","search",75,30,9,5,"Search the site",""); - ?><IMG SRC="/gifs/cap-right.gif" WIDTH=24 HEIGHT=48 BORDER=0><BR></TD> - </TR> - </TABLE> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width="100%"> - <TR VALIGN=top BGCOLOR="#FFFFFF"> - <TD ALIGN=left WIDTH="12"> - <IMG SRC="/gifs/corner-ul.gif" WIDTH=12 HEIGHT=12 BORDER=0><BR> - </TD> - <TD ALIGN=left WIDTH="100%"> - <? if ($FONTFACEATTR): ?> - <FONT<? echo $FONTFACEATTR;?>> - <? endif; ?> - <BR CLEAR=ALL> - <!-- start body --> -<? -} - -function sect_to_file($string) { - $string = strtolower($string); - $string = str_replace(' ','-',$string); - $string = str_replace('_','-',$string); - $func = "function.$string.php"; - $chap = "ref.$string.php"; - $feat = "features.$string.php"; - $struct = "control-structures.$string.php"; - if(is_file($func)) return $func; - else if(is_file($chap)) return $chap; - else if(is_file($feat)) return $feat; - else if(is_file($struct)) return $struct; - else return "$string.php"; -} - -function clean_note($text) { - $text = htmlspecialchars($text); - $fixes = array('<br>','<p>','</p>'); - reset($fixes); - while (list(,$f)=each($fixes)) { - $text=str_replace(htmlspecialchars($f), $f, $text); - $text=str_replace(htmlspecialchars(strtoupper($f)), $f, $text); - } - $text = "<tt>".nl2br($text)."</tt>"; - return $text; -} - -function commonFooter() { - global $NS4, $NS3, $IE3, $IE4, $X11, $HAVE_STYLE, $FRAMEMODE, $FONTFACEATTR, $HTTP_USER_AGENT, $HTDIG; - global $MIRRORS, $MYSITE, $COUNTRIES; - global $NEXT, $PREV, $UP, $HOME, $TOC; - global $DISABLE_KICKOUTS, $DOCUMENT_ROOT; - $country=$MIRRORS[$MYSITE][0]; - $HAVE_SEARCH=$MIRRORS[$MYSITE][5]; -?> - <!-- end body --> - </TD> - </TR> - </TABLE> - </TD> - </TR> - <TR valign=bottom BGCOLOR="#5B69A6"> - <TD ALIGN=left width="150"> -<? - spc(150,1); - echo "<BR>\n"; - if (file_exists($DOCUMENT_ROOT."/stats/index.php")): - makeSideButton("/stats/index.php","stat","","stats",129,30,0,10,"Site Statistics","<BR>\n"); - endif; -?></TD> - <TD ALIGN=left width="100%" BGCOLOR="#FFFFFF"> - <IMG SRC="/gifs/corner-bl.gif" WIDTH=12 HEIGHT=12 BORDER=0><BR> - </TD> - </TR> - <TR valign=top> - <TD ALIGN=left width="150" BGCOLOR="#5B69A6"> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="150"> - <TR VALIGN=bottom> - <TD ALIGN=left> - <? - spc(1,3); - echo "<BR>\n"; - makeSideButton("/credits.php","cred","","credits",129,30,0,10,"Who's responsible for this?","<BR>\n"); - makeSideButton("#tOpOfpAgE","top","","top",129,30,0,10,"Top of this page","<BR>\n"); - ?> - <IMG SRC="/gifs/cap-bl.gif" WIDTH=9 HEIGHT=9 BORDER=0><BR> - </TD> - </TR> - </TABLE> - </TD> - <TD align=left width="100%"> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width="100%"> - <TR VALIGN=middle> - <TD ALIGN=center BGCOLOR="#5B69A6"> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0> - <TR VALIGN=middle> - <TD align=right> - <FONT<? echo $FONTFACEATTR ?> SIZE=1> - <I>Site<BR>Hosting:</I><BR> - </FONT> - </TD> - <TD> - <? spc(5,1);?><BR> - </TD> - <TD> - <A HREF="<? echo $MIRRORS[$MYSITE][3]; ?>"><IMG SRC="/gifs/logo-<? echo $MIRRORS[$MYSITE][2]; ?>.gif" WIDTH=190 HEIGHT=48 BORDER=0 vspace=12></A><BR> - </TD> - </TR> - </TABLE> - </TD> - <TD ALIGN=right BGCOLOR="#5B69A6"> - <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0> - <TR VALIGN=middle> - <TD align=center> -<? if (!$HTDIG): - echo "<FONT $FONTFACEATTR SIZE=2>\n"; - echo "<FONT SIZE=1><I>Located in</I></FONT><BR>".$COUNTRIES[$country]; - endif; ?> - </TD> - <TD><? spc(5,1);?></TD> - <TD> - <IMG SRC="/gifs/flag-<? echo $country; ?>.gif" BORDER=0></TD> - <TD> - <IMG SRC="/gifs/cap-right2.gif" WIDTH=24 HEIGHT=72 BORDER=0></TD> - </TR> - </TABLE> - </TD> - </TR> - </TABLE> - </TD> - </TR> - -<TR> -<TD ALIGN="right" COLSPAN=3> -<FONT SIZE=-2> -Elements of this website are subject to <A HREF="/COPYRIGHT.txt">copyright</A>.<BR> -Questions about installing or using PHP should be directed to one of the <A HREF="/support.php">mailing lists</A>.<BR> -Only questions about the website should be directed to <A HREF="mailto:webmaster@php.net">webmaster@php.net</A>.<BR> -</FONT> -</TD> -</TR> - -</TABLE> - - -<? if (($NS4 || $IE4) && !$DISABLE_KICKOUTS): /* Kick outs */ ?> - -<DIV ID="mirrorsKick" STYLE="POSITION: absolute; Z-INDEX: 20; VISIBILITY: hidden; TOP: 0px; LEFT: 0px;"> -<? kickHeader(-20,'left',400);?> -<FORM ACTION="/redirect.php" METHOD="POST"> -<B>Pick a mirror site close to you:</B><BR> -<SELECT NAME="URL"> -<? -$mirror_sites=$MIRRORS; -reset($mirror_sites); -while ($site = key($mirror_sites)): - next($mirror_sites); - $country=$mirror_sites[$site][0]; - $place=$mirror_sites[$site][1]; - $type=$mirror_sites[$site][4]; - if ($type==1 && substr($site,0,7)=="http://"): - echo "<OPTION VALUE=\"$site\">$COUNTRIES[$country] ($place)\n"; - endif; -endwhile; -?> -</SELECT> -<INPUT TYPE="image" SRC="/gifs/b-go.gif" ALIGN=absmiddle WIDTH=36 hspace=5 HEIGHT=21 BORDER=0> -</FORM> -<? kickFooter("mirrorsKick","mirr",400);?> -</DIV> - -<DIV ID="qrefKick" STYLE="POSITION: absolute; Z-INDEX: 20; VISIBILITY: hidden; TOP: 0px; LEFT: 0px;"> -<? kickHeader(30,'left',400);?> -<FORM ACTION="/manual-lookup.php" METHOD="POST"> -<FONT SIZE=+1><B>Quick Function Reference</B></FONT><BR> -Type in a PHP function name or feature to<BR> -jump to that page of the online manual:<BR> -<FONT SIZE=3><INPUT NAME="function" TYPE="text" SIZE=25></FONT> -<INPUT TYPE="image" SRC="/gifs/b-go.gif" ALIGN=absmiddle WIDTH=36 hspace=5 HEIGHT=21 BORDER=0> -</FORM> -or click on this button to get an alphabetical listing of all<BR> -PHP functions. -<? if ($FRAMEMODE != "manual"): ?> -(You can still click on the <B>documentation</B><BR> -button on the left for other documentation resources.) -<? endif;?><BR> -<? kickFooter("qrefKick","qref",400);?> -</DIV> - -<? -if ($HAVE_SEARCH): - $form="/search.php"; -else: - $form="http://uk.php.net/search.php"; -endif; -?> - -<DIV ID="searchKick" STYLE="POSITION: absolute; Z-INDEX: 20; VISIBILITY: hidden; TOP: 0px; LEFT: 0px;"> -<? kickHeader(-35,'top',300); -if (!isset($prevsearch)): - $prevsearch[0]=""; -endif; -?> -<FORM ACTION="/search.php" METHOD="POST"> -<B>What are you searching for:</B><BR> -<input type="text" name="pattern" size=20 VALUE="<? echo $prevsearch[0];?>"><BR> -<B>Where do you want to look:</B><BR> -<SELECT NAME="show"> -<OPTION VALUE="nosource" SELECTED>Whole site -<OPTION VALUE="manual">Documentation only -<OPTION VALUE="maillist">PHP General Mailing List -<OPTION VALUE="devlist">PHP Developers' List -<OPTION VALUE="phplib">PHPLIB Mailing List -<OPTION VALUE="phplib-dev">PHPLIB Developers' List -<OPTION VALUE="php-kb">PHP Knowledge Base -<OPTION VALUE="source">Source code only -</SELECT><INPUT TYPE="image" SRC="/gifs/b-go.gif" ALIGN=absmiddle WIDTH=36 HSPACE=5 HEIGHT=21 BORDER=0><BR> -</FORM> -<? kickFooter("searchKick","sear",300);?> -</DIV> - -<SCRIPT LANGUAGE="JavaScript1.2"> -<!-- -if (NS4) { - gotlayers = (document.layers.length == 3) ? 1 : 0; -} -if (IE4) { - gotlayers = 1; -} - -// --> -</SCRIPT> - -<SCRIPT LANGUAGE="JavaScript1.3"> -<!-- - gotlayers = 1; -// --> -</SCRIPT> - -<? -endif; /* Kick outs */ -?> -</BODY> -</HTML> -<? -} ?> Index: phpweb/include/site.inc diff -u phpweb/include/site.inc:1.146 phpweb/include/site.inc:1.147 --- phpweb/include/site.inc:1.146 Mon Mar 5 17:42:54 2001 +++ phpweb/include/site.inc Wed Mar 7 16:18:09 2001 @@ -11,9 +11,9 @@ $MIRRORS = array( "http://au.php.net:81/" => array("au", "Flinders University of South Australia", "rcis", "http://www.nisu.flinders.edu.au/", 1, 1, "en"), -# "http://au2.php.net/" => array("au", "Planet Mirror", "", "http://www.planetmirror.com/", 1, 0, "en"), + "http://au2.php.net/" => array("au", "Planet Mirror", "", "http://www.planetmirror.com/", 1, 0, "en"), "http://at.php.net/" => array("at", "Goodie Domain Service", "gds", "http://gd.tuwien.ac.at/", 1, 0, "de"), -# "http://bg.php.net/" => array("bg", "Bulgaria Online", "", "http://online.bg/", 1, 0, "en"), + "http://bg.php.net/" => array("bg", "Bulgaria Online", "", "http://online.bg/", 1, 0, "en"), "http://br.php.net/" => array("br", "SST Internet", "sst", "http://www.sst.com.br/", 1, 0, "pt_BR"), # "http://br2.php.net/" => array("br", "Lune Networks", "", "http://www.lunenetworks.com.br/", 1, 0, "pt_BR"), "http://ca.php.net/" => array("ca", "easyDNS", "easydns", "http://www.easydns.com/", 1, 0, "en"), @@ -41,7 +41,7 @@ "http://no.php.net/" => array("no", "Fast Search &amp; Transfer ASA", "fast", "http://www.fast.no/", 1, 0, "no"), "http://pl.php.net/" => array("pl", "TGR", "tgr", "http://www.tgr.com.pl/", 1, 0, "pl"), "http://pt.php.net/" => array("pt", "Telenet", "telenet", "http://www.telenet.pt/", 1, 1, "pt"), -# "http://pt2.php.net/" => array("pt", "SONET", "", "http://www.sonet.pt/", 1, 0, "pt"), + "http://pt2.php.net/" => array("pt", "SONET", "", "http://www.sonet.pt/", 1, 0, "pt"), "ftp://ftp.utt.ro/mirrors/php3/" => array("ro", "University of Timisoara","upt", "http://www.utt.ro/", 0, 0, "ro"), "http://ru.php.net/" => array("ru", "Direct Internet", "directnet", "http://www.dn.ru/", 1, 0, "ru"), "http://se.php.net/" => array("se", "Chalmers Lindholmen", "cl", "http://www.chl.chalmers.se/", 1, 1, "se"), @@ -63,6 +63,7 @@ "http://bugs.php.net/" => array("us", "chek.com", "chek", "http://www.chek.com/", 2, 1, "en"), "http://php.he.net/" => array("us", "Hurricane Electric", "hurricane", "http://he.net/", 1, 0, "en"), "http://za.php.net/" => array("za", "CSIR Mikomtek", "mikomtek", "http://www.mikom.csir.co.za/", 1, 0, "en"), + "http://news.php.net/" => array("us", "VA Linux", "va", "http://www.valinux.com/", 2, 1, "en"), "" => array("xx", "Unknown", "none", "/", 1, 0, "en") ); Index: phpweb/license/index.php diff -u phpweb/license/index.php:1.1 phpweb/license/index.php:1.2 --- phpweb/license/index.php:1.1 Fri Jan 19 18:42:45 2001 +++ phpweb/license/index.php Wed Mar 7 16:18:11 2001 @@ -1,5 +1,5 @@ <?php -require("shared.inc"); +require_once "prepend.inc"; commonHeader("License Information"); ?> Index: phpweb/manual/phpfi2.php diff -u /dev/null phpweb/manual/phpfi2.php:1.2 --- /dev/null Wed Mar 7 16:18:19 2001 +++ phpweb/manual/phpfi2.php Wed Mar 7 16:18:11 2001 @@ -0,0 +1,5441 @@ +<? +require_once 'prepend.inc'; +commonHeader('PHP/FI Version 2.0 Documentation'); +?> + +<!-- +Documentation is like sex: when it is good, it is very, very good; and +when it is bad, it is better than nothing. + ++ Dick Brandon +--> + +<H1 ALIGN="CENTER">PHP/FI Version 2.0</H1> +<H1>Table of Contents</H1> +<OL> + <LI><A HREF="#history">Brief History</A> + <LI><A HREF="#install">Installation Instructions</A> + <LI><A HREF="#starting">So, what can I do with PHP/FI?</A> + <LI><A HREF="#redirect">CGI Redirection</A> + <LI><A HREF="#security">Security Issues</A> + <LI><A HREF="#safemode">Safe Mode</A> + <LI><A HREF="#commandline">Running PHP/FI from the Command Line</A> + <LI><A HREF="#http_auth">HTTP Authentication</A> + <LI><A HREF="#requestvars">Apache Request Variables</A> + <LI><A HREF="#module">Apache Module Notes</A> + <LI><A HREF="#directives">Apache Module Configuration Directives</A> + <LI><A HREF="#fastcgi">FastCGI Support</A> + <LI><A HREF="#access">Access Control</A> + <LI><A HREF="#logging">Access Logging</A> + <LI><A HREF="#relative">Relative vs. Absolute URL's - or, Why do my Images Break?</A> + <LI><A HREF="#getpost">How PHP/FI handles GET and POST method data</A> +<UL> + <LI><A HREF="#selmul"><TT>SELECT MULTIPLE</TT> and PHP</A> + <LI><A HREF="#imagecoord"><TT>IMAGE SUBMIT</TT> and PHP</A> +</UL> + <LI><A HREF="#gd_support">GD (a graphics library for GIF creation) Support in PHP</A> + <LI><A HREF="#virtual_hosts">PHP/FI and Virtual Hosts</A> + <LI><A HREF="#upload">File Upload Support</A> + <LI><A HREF="#cookies">Cookie Support</A> + <LI><A HREF="#msql_support">mSQL Support</A> + <LI><A HREF="#pg95_support">Postgres95/PostgreSQL Support</A> + <LI><A HREF="#mysql_support">mysql Support</A> + <LI><A HREF="#solid_support">Solid Support</A> + <LI><A HREF="#sybase_support">Sybase Support</A> + <LI><A HREF="#oracle_support">Oracle Support</A> + <LI><A HREF="#illustra_support">Illustra Support</A> + <LI><A HREF="#adabas_support">Adabas Support</A> + <LI><A HREF="#regexp">Regular Expressions</A> + <LI><A HREF="#escapes">Escape Characters</A> + <LI><A HREF="#octal">Octal notation of Unix file permissions</A> + <LI><A HREF="#script">PHP/FI Script Language</A> +<UL> + <LI><A HREF="#syntax">Syntax</A> + <LI><A HREF="#vars">Variables</A> + <LI><A HREF="#assoc">Associative Arrays</A> + <LI><A HREF="#varvars">Variable Variables</A> + <LI><A HREF="#lang">Language Constructs</A> + <LI><A HREF="#user_funcs">User-Defined Functions</A> + <LI><A HREF="#scope">Scope of Variables</A> + <LI><A HREF="#math">Mathematical Expressions</A> + <LI><A HREF="#while">While Loops</A> + <LI><A HREF="#switch">Switch Construct</A> + <LI><A HREF="#secure">Secure Variables - Defeating GET method hacks</A> + <LI><A HREF="#overload">Overloaded Operators and dealing with variable types</A> + <LI><A HREF="#quiet">Suppressing Errors from function calls</A> + <LI><A HREF="#funcs">Internal Functions</A> +</UL> + <LI><A HREF="#addfunc">Adding your own functions to PHP/FI</A> + <LI><A HREF="#hacknotes">Notes for Code Hacks</A> +</OL> + +<HR> +<H2><A NAME="history">Brief History</A></H2> +<P> +PHP began life as a simple little cgi wrapper written in Perl. I +wrote it in an afternoon during a period between contracts when +I needed a quick tool to get an idea of who was reading +my online resume. It was never intended to go beyond my own +private use. The web server where I had my resume was extremely +overloaded and had constant problems forking processes. I rewrote +the Perl wrapper in C to get rid of the considerable overhead of +having to fork Perl each time my resume was accessed.<P> + +<P> +Eventually other people on the same web server came across my +wrapper and asked if they could use it. Then, as inevitably +happens, they started asking for more features. I added more +features and finally put together a semi-complete distribution +along with documentation, a mailing-list and a FAQ. The name +of this first package was Personal Home Page Tools, which +later became Personal Home Page Construction Kit.<P> + +<P> +At the same time I started playing with databases and wrote a +tool to easily embed SQL queries into web pages. It was +basically another CGI wrapper that parsed SQL queries and made +it easy to create forms and tables based on these queries. This +tool was named FI (Form Interpreter).<P> + +<P> +PHP/FI version 2.0 is a complete rewrite of these two packages +combined into a single program. It has now evolved to +the point where it is a simple programming language embedded +inside HTML files. The original acronym, PHP, has stuck. It +isn't really appropriate any longer. PHP/FI is used more for +entire web sites today than for small Personal Home Page +setups. By whatever name, it eliminates the need for numerous small Perl +cgi programs by allowing you to place simple scripts directly in your +HTML files. This speeds up the overall performance of your web pages +since the overhead of forking Perl several times has been eliminated. +It also makes it easier to manage large web sites by placing all +components of a web page in a single html file. By including support +for various databases, it also makes it trivial to develop database +enabled web pages. Many people find the embedded nature much easier +to deal with than trying to create separate HTML and CGI files.<P> + +<P> +PHP Version 3.0 is yet another rewrite. If you are just starting out +with PHP, I suggest that you start with Version 3.0 instead of +continuing with 2.0 at this point. PHP3 is quickly going to replace +PHP/FI 2.0 and all development efforts are now focused on PHP3. Any +remaining bugs in PHP/FI 2.0 are unlikely to be fixed unless they +are straightforward. More information on PHP3 can be found at +<a href="http://www.lerdorf.on.ca/php3/">http://www.lerdorf.on.ca/php3</a>. + +<P> +Throughout this documentation any references to PHP, FI or PHP/FI +all refer to the same thing. The difference between PHP and FI +is only a conceptual one. Both are built from the same source +distribution. When I build the package without any access logging +or access restriction support, I call my binary FI. When I build +with these options, I call it PHP.<P> + +<HR> +<H2><A NAME="install">Installation Instructions</A></H2> + +<DL> +<DT><FONT SIZE="+1">Before You Begin</FONT> + +<DD><P>If you have absolutely no Unix experience, you may want to ask around +for someone with a little bit of Unix knowledge to help you through +this installation. Every attempt has been made to make it as simple +as possible, but since the software is quite involved and relies on a +number of different components, it is not realistic to assume it will +go smoothly on all systems. You will probably need someone around who +knows the particulars of the destination system well.<P></DD> + +<DT><FONT SIZE="+1">Things You Need To Know Before Installing</FONT> + +<DD><P>- Can you run both get and post method cgi programs on your server?<BR> +<EM>This is not relevant if you installing the Apache module version.</EM> + + If not, you can not use this package. On many public ISP's CGI + programs are either disallowed or severely restricted. If this is + the case on your system, talk to your system administrator and ask + him/her to have a look at this package and see if they will install + it for you.<P></DD> + +<DD><P>- If you have mSQL installed on your system, you need to know the + base directory of this installation.<P></DD> + +<DD><P>- If you have Postgres95 or PostgreSQL installed on your system, you need to + know the base directory of this installation.<P></DD> + +<DD><P>- If you are going to be storing log and access configuration files +in an NFS-mounted directory and your system does not provide NFS file locking +then you will need to define the NFS_HACK variable manually in the src/Makefile +and you may want to use a slightly modified version of the gdbm library. See +the <STRONG>nfs_hack.txt</STRONG> file in the doc directory for more information +on this.<P></DD> + +<DD><P>- Note that if you are not interested in using PHP to track accesses to your +pages, do not compile this option into the binary. You should also leave out +the access restriction code. There is considerable overhead in including these +options.<P></DD> + +<DD><P>- If you are installing the Apache module version, you will need to know +the Apache src code directory location.<P></DD> + +<DT><FONT SIZE="+1">Installation Steps</FONT> + +<DD> +<P><EM><STRONG>Step 1.</STRONG></EM> +<P> +<P> + Run the install program: <TT>./install</TT> +<P> +<P> + You will be asked a number of questions. If you do not understand + what is being asked, simply hit return. The default choice should + be safe on most systems. This doesn't apply for the questions + asking you to specify a directory for your configuration and log + files however. Choose any directory to which the httpd (usually &quot;nobody&quot;) + has write privileges. You may create this directory manually + somewhere and simply <STRONG><TT>chown nobody directory</TT></STRONG>.<P> +<P> +<EM><STRONG>Step 2.</STRONG></EM><P> +<P> + Go into the src directory: <TT>cd src</TT><P> + Have a look at the php.h file. There are a number of compile-time + options that can be set here. +<P> +<EM><STRONG>Step 3.</STRONG></EM><P> +<P> + type: <TT>make</TT> +<P> +<P> + This will create the actual executable program file named <EM>php.cgi</EM> + by default, or if you are installing the Apache module, it will create + a <EM>libphp.a</EM> file.<P> + +<P> +<EM><STRONG>Step 4. (if you are <STRONG>not</STRONG> installing the Apache module +version)</STRONG></EM><P> + +<P> + Copy the <STRONG>php.cgi</STRONG> binary to your system's cgi-bin directory. If you + do not have access to do this and wish to install it in your own + personal directory, you may do so, but you should set the setuid + bit on the executable with: <TT>chmod u+s /path/php.cgi</TT><P> +<P> + If you do not make set the setuid bit on the binary then any files + created by the binary will be owned by the user id under which the + web server runs. If this is acceptable, then you can safely leave + the setuid bit off.<P> + +<P> +<EM><STRONG>Step 4. (if you are installing the Apache module version)</STRONG></EM><BR> + Change to your Apache src directory where the <EM>mod_php.c</EM> and <EM>mod_php.h</EM> + files should have been copied to. If they weren't which usually happens + because of permission problems, copy these two files there manually. + Edit your Apache Configuration file and add the EXTRA_LIBS line which was + produced at the end of <STRONG>Step 3</STRONG>. And add:<P> +<P> +<TT><STRONG>Module php_module mod_php.o</STRONG></TT><P> +<P> + to the very end of the file. Then type: <STRONG>./Configure</STRONG> and then +<STRONG>make</STRONG> + to rebuild your Apache httpd binary. Install this binary.<P> + +<P> + Next you need to edit your Apache conf/srm.conf file and add a line like:<P> +<P> +<TT><STRONG>AddType application/x-httpd-php .phtml</STRONG></TT><P> +<P> + This defines a new MIME, application/x-httpd-php, which will trigger the PHP + module to parse any file ending with the <EM>.phtml</EM> extension. You can + pick any extension you like for this.<P> +<P>You may not want to enable everyone + to run PHP parsed files. You can place the above AddType line within + &lt;Location /path&gt;....&lt;/Location&gt; directives in the <EM>access.conf</EM> + file to only allow PHP-parsed documents in certain directories on your server.<P> +<P> + Now you are ready to restart your httpd server. See the <A HREF="#module">Apache + Module Notes</A> for more details on configuring the PHP Module.<P> + +<DT><FONT SIZE="+1">Testing the software</FONT> + +<DD> +<P>Once installed you can test to see if your executable works by + entering a URL similar to the following in your browser:<P> +<P> + <TT>http://your.site.domain/cgi-bin/php.cgi</TT><P> +<P> + This should show you a page which contains the version number along + with various other useful information. <P> +<P> + To test the Apache module version, create any file with a .phtml + extension and put a tag like: &lt;?phpinfo()&gt; in the file and see if + it gets parsed.<P> + +<DT><FONT SIZE="+1">Using the software</FONT> + +<DD> +<P>To actually use the software on an existing HTML file, you can + simply append the path to your file to the above URL. ie.<P> +<P> + <TT>http://your.site.domain/cgi-bin/php.cgi/path/file.html</TT><P> +<P> +You should have a look at the <A HREF="#redirect">CGI Redirection</A> +section of this documentation. Running PHP/FI through a redirect +means you can automatically have a URL like <EM>http://your.site.domain/file.phtml</EM> +be parsed by PHP/FI.<P> +<P> +This does not apply to Apace module users.<P> +</DL> + +<HR> +<H2><A NAME="starting">So, what can I do with PHP/FI?</A></H2> +<P> +The first thing you will notice if you run a page through PHP/FI is that +it adds a footer with information about the number of times your page +has been accessed (if you have compiled access logging into the binary). +This is just a very small part of what PHP/FI can +do for you. It serves another very important role as a form interpreter +cgi, hence the FI part of the name. For example, if you create a form +on one of your web pages, you need something to process the information +on that form. Even if you just want to pass the information to another +web page, you will have to have a cgi program do this for you. PHP/FI +makes it extremely easy to take form data and do things with it.<P> +<P> +<EM><STRONG>A simple example</STRONG></EM><P> +<P> +Suppose you have a form:<P> +<P> +<TT>&lt;FORM ACTION="/cgi-bin/php.cgi/~userid/display.html" METHOD=POST&gt;<BR> +&lt;INPUT TYPE="text" name="name"&gt;<BR> +&lt;INPUT TYPE="text" name="age"&gt;<BR> +&lt;INPUT TYPE="submit"&gt;<BR> +&lt;/FORM&gt;</TT><P> +<P> +Your display.html file could then contain something like:<P> +<P> +<TT>&lt;?echo "Hi $name, you are $age years old!&lt;p&gt;"&gt;</TT><P> +<P> +It's that simple! PHP/FI automatically creates a variable for each +form input field in your form. You can then use these variables in +the ACTION URL file.<P> +<P> +The next step once you have figured out how to use variables is to start +playing with some logical flow tags in your pages. For example, if you wanted +to display different messages based on something the user inputs, you would +use if/else logic. In our above example, we can display different things +based on the age the user entered by changing our display.html to:<P> +<P> +<PRE>&lt;? + if($age>50); + echo "Hi $name, you are ancient!&lt;p&gt;"; + elseif($age&gt;30); + echo "Hi $name, you are very old!&lt;p&gt;"; + else; + echo "Hi $name."; + endif; +&gt;</PRE><P> +<P> +PHP/FI provides a very powerful scripting language which will do much more +than what the above simple example demonstrates. See the section on the <A HREF="#script"> +PHP/FI Script Language</A> for more information.<P> +<P> +You can also use PHP/FI to configure who is allowed to access your pages. +This is done using a built-in configuration screen. With this you could +for example specify that only people from certain domains would be allowed +to see your pages, or you could create a rule which would password protect +certain pages. See the <A HREF="#access">Access Control</A> section for more +details.<P> +<P> +PHP/FI is also capable of receiving file uploads from any RFC-1867 +compliant web browser. This feature lets people upload both text and binary +files. With PHP/FI's access control and logical functions, you have full +control over who is allowed to upload and what is to be done with the +file once it has been uploaded. See the <A HREF="#upload">File Upload</A> +section for more details.<P> +<P> +PHP/FI has support for a database package called mSQL. This allows you to put +information into a database and access this information through simple embedded +SQL queries right in your .HTML files. Adding a database back-end to a web page +has never been easier. See the section on <A HREF="#msql_support">mSQL Support</A> +for more information.<P> +<P> +PHP/FI has support for the Postgres95/PostgreSQL database package. It supports +embedded SQL queries in your .HTML files. See the section on +<A HREF="#pg95_support">Postgres95/PostgreSQL Support</A> for more information.<P> +<P> +PHP/FI also has support for the mysql database package. It supports +embedded SQL queries in your .HTML files. See the section on +<A HREF="#mysql_support">mysql Support</A> for more information.<P> +<HR> +<H2><A NAME="redirect">CGI Redirection</A></H2> + +<DL> +<DT><STRONG>Apache 1.0.x Notes</STRONG> +<DD> +<P>A good way to run PHP/FI is by using a cgi redirection module +with the Apache server. Please note that you do not need to worry +about redirection modules if you are using the Apache module version +of PHP/FI. There are two of these redirection modules available. One +is developed by Dave Andersen &lt;angio@aros.net&gt; and it is available at +<A +HREF="ftp://ftp.aros.net/pub/util/apache/mod_cgi_redirect.c">ftp://ftp.aros.net/pub/util/apache/mod_cgi_redirect.c</A> +and the other comes bundled with Apache and is called +mod_actions.c. The modules are extremely similar. They differ slightly in their +usage. Both have been tested and both work with PHP/FI.<P> +<P> +One large caveat at the time of this writing (Apr.20/96) is that the current +official Apache release (1.0.5) has a severe limitation which prevents +cgi redirected requests from having any post-method data associated with +them. I have tracked this down and fixed it in my version of Apache, and there +is an official patch available in the <A HREF="http://php.iquest.net/files/"> +File Archives</A> on the <A HREF="http://php.iquest.net/">PHP Home Page</A>.<P> +<P>A second rather large caveat with Apache 1.0.x is that it does not align +double types correctly on most architectures. You may find yourself getting +strange bus errors from your httpd when using mod_php, either upgrade to +Apache 1.1 or edit the <i>alloc.c</i> Apache source file. In this file you will +find the following piece of code:<P> +<PRE> union align + { + /* Types which are likely to have the longest RELEVANT alignment + * restrictions... we don't do much with doubles. + */ + + char *cp; + void (*f)(); + long l; + FILE *fp; + };</PRE> +<P>You will need to add a double to this line and recompile your Apache server. +The correct block of code is:<P> +<PRE> union align + { + /* Types which are likely to have the longest RELEVANT alignment + * restrictions... we don't do much with doubles. + */ + + char *cp; + void (*f)(); + long l; + FILE *fp; + double d; + };</PRE> +<P>These problems have all been fixed in later versions of Apache. + +<P>Check the Apache documentation on how to add a module. Generally you +add the module name to a file called <EM>Configuration</EM>. +The line to be added if you want to use the mod_actions module is:<P> +<P> +<TT>Module action_module mod_actions.o</TT><P> +<P> +If you are using the mod_cgi_redirect.c module add this line:<P> +<P> +<TT>Module cgi_redirect_module mod_cgi_redirect.o</TT><P> +<P> +Then compile your httpd and install it. To configure the cgi redirection +you need to either create a new mime type in your <EM>mime.types</EM> file +or you can use the <STRONG>AddType</STRONG> command in your <EM>srm.conf</EM> +file to add the mime type. The mime type to be added should be something +like this:<P> +<P> +<TT>application/x-httpd-php phtml</TT><P> +<P> +If you are using the mod_actions.c module you need to add the following +line to your <EM>srm.conf</EM> file:<P> +<P> +<TT>Action application/x-httpd-php /cgi-bin/php.cgi</TT><P> +<P> +If you are using mod_cgi_redirect.c you should add this line to +<EM>srm.conf</EM>:<P> +<P> +<TT>CgiRedirect application/x-httpd-php /cgi-bin/php.cgi</TT><P> +<P> +Don't try to use both mod_actions.c and mod_cgi_redirect.c at the same +time.<P> +<P> +Once you have one of these cgi redirection modules installed and +configured correctly, you will be able to specify that you want a +file parsed by php/fi simply by making the file's extension +<STRONG>.phtml</STRONG>. Furthermore, if you add <STRONG>index.phtml</STRONG> +to your <STRONG>DirectoryIndex</STRONG> configuration line in your +<EM>srm.conf</EM> file then the top-level page in a directory will be +automatically parsed by php if your index file is called index.phtml.<P> + +<DT><STRONG>Netscape HTTPD</STRONG> +<DD> +<P> +You can automatically redirect requests for files with a given +extension to be handled by PHP/FI by using the Netscape Server +CGI Redirection module. This module is available in the +<A HREF="http://php.iquest.net/files/">File Archives</A> on the +<A HREF="http://php.iquest.net/">PHP/FI Home Page</A>. The README +in the package explicitly explains how to configure it for use with +PHP/FI.<P> + +<DT><STRONG>NCSA HTTPD</STRONG> +<DD> +<P> +NCSA does not currently support modules, so in order to do cgi +redirection with this server you need to modify your server source +code. A patch to do this with NCSA 1.5 is available in the +<A HREF="http://php.iquest.net/files/">PHP/FI file archives</A>. +</DL> +<HR><P> +<H2><A NAME="security">Security Issues</A></H2> +<P> +The CGI version of PHP/FI does <STRONG>not</STRONG> read any +<EM>.htaccess</EM> files which may be present in a directory. This +means that if you have files that are protected using the standard .htaccess +server-based access control feature, people could potentially circumvent +this security by loading the page through PHP/FI. Note that this is not +an issue for the Apache module version of PHP/FI.<P> +<P> +A second problem with the CGI version is that if it is placed in the system's +cgi-bin directory it can be used to view any file on your system as long as +the user id it runs as has access to it. +<P> +There are a couple of different solutions to this problem. The easiest +is probably to use the <STRONG>PATTERN_RESTRICT</STRONG> feature found +in <EM>php.h</EM>. This lets you define an extension (or a pattern of +extensions) which are allowed to be parsed by PHP/FI. If a file does +not have this extension and someone tries to load it with PHP/FI, an +<EM>access denied</EM> message will appear.<P> +<P> +Another solution is to use the PHP/FI access control mechanism to mimic the +access control setup you have in your .htaccess file. Keeping this information +in two places can be tedious though, and the two systems don't share all +of the same features.<P> +<P> +The problem can also be solved using file permissions. PHP/FI can be set +up to run setuid as any user you wish. Then files that are to be read +by PHP/FI can be given appropriate permissions and files not to be read +by PHP/FI should be owned by another user id and have their permissions +changed accordingly.<P> +<P> +For additional security options related to sites which provide shared access +to PHP, see the <a href="#safemode">Safe Mode</a> section.<P> +<HR> +<H2><A NAME="safemode">Safe Mode</A></H2> +<P> +PHP's Safe Mode tries to solve the common problem faced by many ISP's regarding +letting all their users run CGI programs. The common mechanism for making +shared CGI access more secure is to use a cgi wrapper like the su_exec +utility that comes with Apache. This will not work for PHP when it is running +as a module because it is not a separate process that can be setuid'ed. +<P> +It is based on a file permission scheme. Simply put, if a file is either owned +by the same user id as the script that is trying to access it, or if the file is +in a directory that is owned by the same user as the script that is trying to +access it, then the access is allowed. One caveat here is that you must make sure +that your OS does not allow non-root user to chown away the ownership on one of their +files. Many older SysV systems allow this. The most common one is Irix. It is +possible to change this behaviour at the OS level on Irix. +<P> +Safe Mode applies to each function which could possibly be a security risk. +Below is the current list of checks applied to each relevant function. In +the following list, PHP UID refers to the user id of the owner of the current +file being parsed by PHP, and HTTP UID refers to the user id the httpd process +is running as (usually nobody). +<dl> +<dt>Include, ReadFile, Fopen, File, Link, Unlink, Symlink, Rename, RmDir, ChMod, ChOwn, ChGrp +<dd>Owner of file to be included must either be the PHP UID or the directory in which the +file resides must be owned by the PHP UID. +<dt>Exec, System, PassThru and Popen +<dd>Executables to be forked and executed must reside in the directory +defined by the PHP_SAFE_MODE_EXEC_DIR #define in php.h when PHP is compiled. +<dt>Mysql_Connect +<dd>This function takes an optional username to use to connect to an MySQL +database. When in safe mode, this username must either be the username of +the owner of the current file being parsed, or the name of the httpd user +(usually nobody). +<dt>HTTP Authentication +<dd>The numerical user id of the owner of the script containing the HTTP Authentication +code will be prepended to the authentication realm. This is to prevent someone from +writing a password grabbing script which spoofs another authenticated page on the +same server. +</dl><P> + +<HR> +<H2><A NAME="commandline">Running PHP/FI from the command line</A></H2> +<P> +If you build the CGI version of PHP/FI, you can use it from the command line +simply typing: <tt> php.cgi filename</tt> where filename is the file you want +to parse. You can also create standalone PHP/FI scripts by making the first +line of your script look something like: +<PRE> #!/usr/local/bin/php.cgi -q</PRE> +The &quot;-q&quot; suppresses the printing of the HTTP headers. You can leave +off this option if you like. +<P> +<HR> +<H2><A NAME="http_auth">HTTP Authentication</A></H2> +<P> +The HTTP Authentication hooks in PHP/FI are only available when it is running +as an Apache module. In an Apache module PHP/FI script, it is possible to +use the Header() command to send an &quot;Authentication Required&quot; message +to the client browser causing it to pop up a Username/Password input window. +Once the user has filled in a username and a password, the URL containing +the PHP/FI script will be called again with the variables, $PHP_AUTH_USER, +$PHP_AUTH_PW and $PHP_AUTH_TYPE set to the user name, password and +authentication type respectively. Only &quot;Basic&quot; authentication is +supported at this point.<P> +<P>An example script fragment which would force client authentication on a +page would be the following:<P> +<PRE> &lt;? + if(!$PHP_AUTH_USER) { + Header(&quot;WWW-authenticate: basic realm=\&quot;My Realm\&quot;&quot;); + Header(&quot;HTTP/1.0 401 Unauthorized&quot;); + echo &quot;Text to send if user hits Cancel button\n&quot; + exit; + } else { + echo &quot;Hello $PHP_AUTH_USER.&lt;P&gt;&quot;; + echo &quot;You entered $PHP_AUTH_PW as your password.&lt;P&gt;&quot;; + } + &gt;</PRE> +<P> +Instead of simply printing out the $PHP_AUTH_USER and $PHP_AUTH_PW, you would +probably want to check the username and password for validity. Perhaps by +sending a query to a database, or by looking up the user in a dbm file.<P> +<P> +Watch out for buggy Internet Explorer browsers out there. They seem very +picky about the order of the headers. Sending the <b>WWW-authenticate</b> +header before the <b>HTTP/1.0 401</b> header seems to do the trick for now.<P> +<P> +In order to prevent someone from writing a script which reveals the password for +a page that was authenticated through a traditional external mechanism, the +PHP_AUTH variables will not be set if external authentication is enabled for +that particular page.<P> +<P> +Note however that the above does not prevent someone who controls a +non-authenticated URL from stealing passwords from authenticated URL's on the +same server. The PHP_AUTH_VARS define in <em>php.h</em> can be undefined to +make sure that these variables will never be set and thus disable anybody +from using mod_php to try to steal passwords.<P> +<HR> +<H2><A NAME="requestvars">Apache Request Variables</A></H2> +<P> +When running PHP as an Apache module, you may access the request header +variables sent by the remote browser by prepending <B>$req_</B> to the +beginning of the header value you would like to use. If the request name +contains a <b>-</b> character such as User-Agent, then you need to map the +- to _ (an underscore). ie. reference it as $req_User_Agent. +The <a href="#phpinfo"> +phpinfo()</a> function can be used to display all the request headers.<P> +eg. +<PRE> &lt; + echo "$req_connection&lt;br&gt;"; + echo "$req_host&lt;br&gt;"; + &gt;</PRE> +The above simple script might output: +<PRE> Keep-Alive + www.host.com</PRE> + +<HR> +<H2><A NAME="module">Apache Module Notes</A></H2> +<P> +Running PHP/FI as an Apache module is the most efficient way of using the +package. Running it as a module means that the PHP/FI functionality is +combined with the Apache server's functionality in a single program. There +are a number of advantages to running it as a module:<P> +<DL> +<DT><STRONG>Performance</STRONG> +<DD> +<P>Performance-wise it is a lot faster than traditional CGI programs. In fact, +when running PHP/FI as a module, there is no CGI involved. The script code +in the HTML files is executed directly by the Apache web server process.<P> + +<DT><STRONG>Security</STRONG> +<DD> +<P>When running as a module, the normal httpd-based access restriction rules +defined either in the Apache conf files or in private .htaccess files are first +applied before the module is allowed to parse the file. Alternatively, you +can also create PHP/FI scripts that control the normal httpd-based +authentication. See <A HREF="#http_auth">HTTP Authentication</A>.<P> + +<DT><STRONG>Configurability</STRONG> +<DD> +<P>Since the parser is always active inside the httpd process, it can be configured +on startup using the same configuration files used to configure the httpd process. +The module can even be configured on a per-directory basis by placing the +<A HREF="#directives">PHP configuration directives</A> in the <EM>.htaccess</EM> files.<P> + +<DT><STRONG>Basis for custom server-based function</STRONG> +<DD> +<P>For C programmers interested in accessing their functions from within +Apache, the PHP/FI framework provides a very simple interface to Apache +and to PHP itself. It is much easier to add a function to PHP and call that +from a parsed page than it is to write an entire Apache module from scratch. +See the <a href="#addfunc">Adding your own internal functions to PHP/FI</a> +sections at the end of this document for further details. +</DL> + +<H2><A NAME="directives">Apache Module Configuration Directives</A></H2> +<P> +The following directives can be placed either in the <EM>srm.conf</EM> file, or +within &lt;Directory&gt;...&lt;/Directory&gt; tags in <EM>access.conf</EM> or in +&lt;Location /path&gt;...&lt/Location&gt; tags in <EM>access.conf</EM> or in +individual <EM>.htaccess</EM> files. In order for the directives to work in +.htaccess files, the Options override must be set on the AllowOverride Apache +directive, with the exception of the phpEngine directive which is only +available in the *.conf files.<P> +<DL> +<DT><STRONG>phpShowInfo <EM>on</EM>|<EM>off</EM></STRONG> +<DD>Turn the PHP info footers on or off. Default is on.<P> +<DT><STRONG>phpLogging <EM>on</EM>|<EM>off</EM></STRONG> +<DD>Turn logging on or off. Default is on.<P> +<DT><STRONG>phpDebug <EM>on</EM>|<EM>off</EM></STRONG> +<DD>Turn automatic ?info debug screen on or off. Default is off.<P> +<DT><STRONG>phpUploadTmpDir <EM>directory</EM></STRONG> +<DD>Set the directory where form-uploaded files will be placed.<P> +<DT><STRONG>phpDbmLogDir <EM>directory</EM></STRONG> +<DD>Set the directory where dbm-based logging files will be written.<P> +<DT><STRONG>phpSQLLogDB <EM>database</EM></STRONG> +<DD>Set name of SQL database to use for logging. Default is &quot;phpfi&quot;<P> +<DT><STRONG>phpSQLLogHost <EM>hostname</EM></STRONG> +<DD>Set hostname where SQL database to use for logging is found. Default is localhost.<P> +<DT><STRONG>phpAccessDir <EM>directory</EM></STRONG> +<DD>Set the directory where PHP-internal access control files are stored.<P> +<DT><STRONG>phpMaxDataSpace <EM>KiloBytes</EM></STRONG> +<DD>Max size a sub-pool can grow to within the PHP module. Setting this value +to a low number will minimize the impact that mod_php will have on your system, +but it may also limit people from writing complex scripts. The default is 8K.<P> +<DT><STRONG>phpIncludePath <EM>colon-separated path</EM></STRONG> +<DD>A colon-separated list of directories where php will look for +files in when running <A HREF="#include">include()</A>. The default +is to look only in the current directory. +<P> +<DT><STRONG>phpAutoPrependFile <EM>file name</EM></STRONG> <DD>Before +the actual PHP/FI file is parsed, you may give a file name here that +is parsed before the "main file", using PHP's Include() function +(which means phpIncludePath applies for the file name). Keep in mind +that you can make it difficult for yourself to use the Header() +function in the main file if you write HTML from an auto-prepended +file. +<P> +<DT><STRONG>phpAutoAppendFile <EM>file name</EM></STRONG> +<DD>The name of a file parsed (using PHP's Include() function)after +the actual PHP/FI file has been parsed, similar to phpAutoPrependFile. +<P> +<DT><STRONG>phpAdaDefDB <EM>database</EM></STRONG> +<DD>Default Adabas database to use. No default value +<P> +<DT><STRONG>phpAdaUser <EM>username</EM></STRONG> +<DD>Default Adabas database user. No default value +<P> +<DT><STRONG>phpAdaPW <EM>password</EM></STRONG> +<DD>Default Adabas database password. No default value +<P> +<DT><STRONG>phpEngine <EM>on</EM>|<EM>off</EM></STRONG> +<DD>Turn the PHP parsing engine on or off. The default is <em>on</em> and +this directive is only useful for sites that wish to allow directives from the AllowOverride Options +list of directives to function in .htaccess files while at the same time restricting mod_php access. +The common way to handle per-virtual host php installs is to enable the PHP mime type with an AddType +directive on a per virtual host basis and then put &quote;phpEngine off&quot; in the non-PHP virtual +host blocks. If a non PHP customer tries to circumvent things by placing the PHP mime type in +their .htaccess, the phpEngine off setting restricts the PHP parser from functioning. +<DT><STRONG>phpLastModified <EM>on</EM>|<EM>off</EM></STRONG> +<DD>Since php pages are dynamic, they are processed and sent to the browser each +time you access them. +But sometimes, when you use php for basic includes, the parsed page does not +change as long as the source doesn't. It that case, you may want to avoid page +regeneration/reloading. +If phpLastModified is turned on Apache will send the Last-Modified tag to the browser, so that +the page will only be reloaded when it changes. +(not that if you are using page logging, multiple accesses will not be logged!) +</DL> +<P> +All of these directives are optional. If a directive is not specified anywhere, +the compile-time default will be used.<P> + +<HR> +<H2><A NAME="fastcgi">FastCGI Support</A></H2> +<P> +PHP/FI can be compiled with FastCGI support. +You will need fetch and compile +<A HREF="http://www.fastcgi.com">FCGI Development Kit</A> for your platform before +compiling PHP/FI. You will also need to get <A HREF="#redirect">CGI Redirection</A> working. +Then follow the instructions in the FastCGI documentation for configuring FastCGI +for your platform. If you are using the mod_fastcgi module with the Apache server, here +are the step-by-step instructions:<P> +<P><UL> +<LI>Edit your Apache Configuration file and add the mod_fastcgi module, then recompile Apache. +<LI>Edit your <EM>srm.conf</EM> file and add lines similar to:<br> +<TT> +AddType application/x-httpd-fcgi .fcgi<br> +AppClass /usr/local/etc/httpd/fcgi-bin/php.fcgi -processes 4<br> +AddType application/x-httpd-fphp .fhtml<br> +Action application/x-httpd-fphp /fcgi-bin/php.fcgi<br> +</TT> +<LI>Copy your <EM>php.cgi</EM> binary to <EM>/usr/local/etc/httpd/fcgi-bin/php.fcgi</EM> +</UL><P> +<P> +Now, any pages with the .fhtml extension will be handed off to the FastCGI php.fcgi +process which is already running. The php.fcgi binary will still work as a normal +CGI binary, so you could just create a symbolic link from php.cgi to php.fcgi.<P> +<P>If you are not using Apache, the above steps will be similar, but not identical. +CGI Redirection mechanisms are available for NCSA and Netscape servers at the +<A HREF="http://php.iquest.net/files/">PHP/FI File Archive</A>.<P> +<HR> +<H2><A NAME="access">Access Control</A></H2> +<P> +Note that the built-in PHP/FI based access control is likely to be discontinued +in future versions. You should seriously consider using the security mechanism +that comes with your web server instead. +<P> +If you chose to include access control when you compiled the package, you +may append <EM>?config</EM> to any URL to edit the access control file. ie.<P> +<P> +<TT>http://your.machine.domain/cgi-bin/php.cgi/path/file.html?config</TT><P> +<P> +Your configuration password will initially be set to your user id. If your user +id does not work as your password, it probably means that PHP could not read +the /etc/passwd file to locate your user id. If this is the case, the initial +password will be set to "<STRONG>php</STRONG>". It is a good idea to change this password. +Note that multiple users may maintain their own personal configuration files +through a single PHP/FI binary.<P> +<P> +Access Control can be quite confusing initially. The ?config screen is divided up +into a number of sections. The top section is for changing the password used to +make sure that only people who know this password can change access control +characteristics. In a system-wide installation, each user has his or her own +configuration screen with his or her own password.<P> +<P> +The second section of the ?config screen consists of a number of tables. Each +table defines a rule-set. The first rule-set is always the default rule-set. +This default rule-set is used if a page does not have a rule-set defined specifically +for it. After the default rule-set, any number of specific rule-set tables will +follow.<P> +<P> +To add a rule-set for a specific file, enter the URL of the file in your browser and +add <EM><STRONG>?config</STRONG></EM> to the end of the URL. On the ?config screen that comes +up you will see that a rule-set has been added for this page, if it wasn't already +there. When a new rule-set is added, it is initially set to be the same as the +default rule-set. The following picture shows two simple rule-sets. First a +default rule-set which just indicates that hits from all domains should be +logged, and second, for the file /~rasmus/test.html and only that file, any +users coming from a &quot;<EM>.edu</EM>&quot; domain will not be granted access.<P> +<P> +<IMG SRC="gifs/config.gif" alt="[Image of ?config screen]"><P> +<P> +To edit a rule-set modify the fields until the desired configuration is +reached within a rule-set and then hit the &quot;<EM>Submit Changes</EM>&quot; +button. If more rules are needed, hit the &quot;<EM>Add Rule</EM>&quot; +button and then edit the added rule.<P> +<P> +To delete a rule, select the checkbox to the right of the rule and +hit the &quot;<EM>Submit Changes</EM>&quot; button. The screen will +redraw and the rule should disappear.<P> +<P> +Note that you need to enter a regular expression in the pattern field. +See the section on regular expressions in this documentation for more +details.<P> +<HR> +<H2><A NAME="logging">Access Logging</A></H2> +<P> +Access Logging is another optional feature which can be enabled at compile-time +by answering <EM>Yes</EM> to the question in the install script. You may either +store your access log data in dbm files, in an mSQL database, or in an mysql +database. The latter two are more powerful, but is also a bit more difficult +to set up.<P> +<P> +To use dbm files for storing your access logs, you will need to specify a +directory in which log files can be written. PHP will try to create this +directory if it doesn't exist, but to make sure it has the proper +permissions, you may want to create this directory yourself before running +PHP for the first time. The permissions on the directory should be such +that the user id under which the PHP cgi program will run can write to the +directory.<P> +<P> +To use an mSQL or mysql database for storing your access log data, you need +to first make sure you have mSQL or mysql installed and running on your +system. Then you need to create a database. The default name is +&quot;phpfi&quot; although this can be changed in <EM>src/php.h</EM>. +To create this database for mSQL, type:<P> +<P> +<PRE> msqladmin create phpfi</PRE><P> +or for mysql type: +<PRE> mysqladmin create phpfi</PRE><P> +<P> +Then for mSQL, edit your <EM>msql.acl</EM> file and make sure the permissions +on the database are correct. Something like the following should suffice:<P> +<P> +<PRE> database=phpfi + read=* + write=nobody,&lt;your user id&gt; + access=local</PRE><P> +<P> +For mysql, you need to make sure the httpd user (usually &quot;nobody&quot;) +has access to the database. Unlike mSQL, mysql stores access control data +in a database. Assuming default permissions, you should be able to simply +execute the following command:<P> +<PRE> echo "INSERT INTO user VALUES ('localhost','nobody','','Y','Y','Y','Y','Y','Y','Y','Y','Y');" | mysql mysql</PRE><P> +Don't forget to load this new configuration with:<P> +<PRE> mysqladmin reload</PRE><P> +For each user id for whom you want to store log data, you need to create two +tables. The <EM>msqllog</EM> shell script in the scripts directory will do +this for you. Simply type:<P> +<P> +<PRE> msqllog &lt;user id&gt; </PRE><P> +or for mysql, type: +<PRE> mysqllog &lt;user id&gt; </PRE><P> +<P> +and the script will create the appropriate tables. You may need to edit the +script to make it reflect where things are stored on your system.<P> +<P> +You may want to have a look at this script. It defines the field sizes of your +log tables. If, for example, you know that your file paths exceed 64 +characters, you need to bump up the filename size in both the <EM>logN</EM> +and the <EM>lastN</EM> tables in this <EM>msqllog</EM> or <EM>mysqllog</EM> +file.<P> +<P> +Access logging stores information about each &quot;hit&quot; on a page. This +information can then be summarized by examining these log files. An example +log file summarizing script is included in the package. It is the +<TT>log.html</TT> file in the <TT>examples</TT> directory. This is the dbm +log file analyzer. The mSQL log file analyzer is called <TT>mlog.html</TT>. +And the mysql log file analyzer is called <TT>mylog.html</TT>. +To run it, copy it and the other mlog.* files to a directory accessible from +your web server and type:<P> +<PRE> http://your.machine.domain/cgi-bin/php.cgi/path/mlog.html</PRE><P> +Or, if you are using the Apache module version, you can give the script +a &quot;.phtml&quot; extension and call it with:<P> +<PRE> http://your.machine.domain/path/mlog.phtml</PRE> +<P> +By default, if you have compiled PHP with access logging enabled, then your +pages will appear with a footer containing some access information. +You may not want to see this footer, but still log hits. You can turn off this +footer with a &quot;phpShowInfo off&quot; line in your Apache httpd.conf or +.htaccess files if you are running Apache. If you are not running Apache, +you may turn these log footers off either by creating a rule in the +<A HREF="#access">?config</A> section for the page, or by adding a tag like this +to your page:<P><P><TT>&lt;?setshowinfo(0)&gt;</TT><P> + +<HR><H2><A NAME="relative">Relative vs. Absolute URL's - or, Why do my Images Break?</A></H2> +<P>A problem common to all CGI wrappers is that the HTTPD program changes the current +directory to the directory where whatever it is loading is stored. In the case +of a CGI program, the current directory is set to the directory where the CGI +program resides. This is normally not a problem, except when it comes to relative +URL's.<P> +<P> +A relative URL is a URL which relies upon the current directory being the same +as the directory where the current HTML file is located. So, for example, if +I had the URL:<P> +<P> +<PRE> http://my.machine/~rasmus/file.html</PRE><P> +<P> +the actual HTML file might be:<P> +<P> +<PRE> ~rasmus/public_html/file.html</PRE><P> +<P> +If within the <TT>file.html</TT> file I had the tag:<P> +<P> +<PRE> &lt;IMG SRC=&quot;pic.gif&quot;&gt;</PRE><P> +<P> +when loaded normally this file gif file is expected to be in +<TT>~rasmus/public_html/pic.gif</TT>. However, when loaded through a CGI +wrapper with a URL like:<P> +<P> +<PRE> http://my.machine/cgi-bin/php.cgi/~rasmus/file.html</PRE><P> +<P> +then HTTPD sets the current directory to <TT>/cgi-bin</TT> +(or wherever the ScriptAlias might point) +and subsequently when the page is loaded the <TT>pic.gif</TT> file is expected to be +in: <TT>/cgi-bin/pic.gif</TT> which is usually not the desired effect.<P> +<P> +The quick way around this problem is to use absolute URL's. In the above example +if the image tag had been:<P> +<PRE> &lt;IMG SRC=&quot;/~rasmus/pic.gif&quot;&gt;</PRE> +<P> +then there would have been no problem. Using absolute URL's is not always +desirable as it makes pages less portable. An obvious question you may have at +this point is, &quot;Why doesn't PHP just change the current directory to the right +place?&quot;. The answer is that PHP actually does change the current directory +to the location of the HTML file it is displaying. Any file paths used inside +PHP Script tags, can be relative. The problem is that tags outside of PHP's +control such as &lt;img &gt; and &lt;a href &gt; will not be passed through +PHP. When they are parsed, PHP is no longer active and the current working +directory has been set back to the directory specified by the HTTP Daemon.<P> +<P> +<STRONG>The Solution</STRONG> is a compromise. PHP provides a variable called +<STRONG>PATH_DIR</STRONG>. +It contains the directory portion of the current HTML file at all times. If this +PATH_DIR variable is used in the &lt;img &gt; and &lt;a href &gt; tags then the +effect of a relative URL can be achieved, although to the server it will look like +an absolute URL when parsed. From our above example, the only change we +would need to make would be to change the img tag to: +<PRE> &lt;IMG SRC=&quot;&lt;?echo $PATH_DIR&gt;/pic.gif&quot;&gt;</PRE> +By using the above, you can move the file containing this tag around, and the +tag will always refer to a <TT>pic.gif</TT> file in the same directory as +the source HTML file.<P> +<P> +Another way to handle this is to use the traditional &lt;BASE HREF=...&gt; in +the HTML file.<P> +<HR> +<H2><A NAME="getpost">How PHP handles GET and POST method data</A></H2> +<P> +PHP will detect both GET and POST method data coming from HTML forms. +One important point to understand is that POST method data is always +treated first if both are present. If a PHP variable is defined by the POST +method data, or if the variable is defined by the HTTP daemon in the Unix +environment, then GET method data cannot overwrite it. This is to prevent +somebody from adding <EM>?REMOTE_HOST=some.bogus.host</EM> to their URL's +and thus tricking the PHP logging mechanism into recording this alternate +data. POST method data is however allowed to overwrite these variables.<P> +<P> +Any component of the GET data (the data following a '?' in the URL) which is +of the form, <EM>word=something</EM> will define the variable <EM>$word</EM> to +contain the value <EM>something</EM>. Even if the data is not of this form, +it can be accessed with the $argv built-in array. For example, in a URL like:<P> +<PRE> /cgi-bin/php.cgi/file.html?abc+def+EMAIL_ADDR=rasmus@lerdorf.on.ca&amp;var=value</PRE> +The relevant components of the PHP symbol table will be:<P> +<PRE> $argc = 4 + $argv[0] = abc + $argv[1] = def + $argv[2] = EMAIL_ADDR=rasmus@lerdorf.on.ca&amp;var=value + $EMAIL_ADDR = rasmus@lerdorf.on.ca + $var = value</PRE> +<P> +Notice how the EMAIL_ADDR part of the data shows up both as $argv[2] where it is +unparsed, and the $EMAIL_ADDR variable is created to contain <EM>rasmus@lerdorf.on.ca</EM>.<P> +<P> +The $EMAIL_ADDR variable was used as an example in the above because it +is a useful variable if you are using the logging features of PHP. By adding:<P> +<PRE> ?EMAIL_ADDR=</PRE> +<P> +to any links on a page where the user's email address is known, you may propagate +it to the next page. The PHP logging system will automatically look for this +variable and record its value as the user's e-mail address in the logs. For +any users of PHP1, the above serves the same function as adding +<EM>?&lt;!--$email--&gt;</EM> to the URL used to do in PHP1. It looks a little +bit more complex now, but it is also completely general allowing you to +build your own complex pages.<P> +<P> +In the above example you can also see how multiple variables can be defined +right in the GET method data by separating each with the &quot;&amp;&quot; character. This +&quot;&amp;&quot; separated list of variables must be the last (or only) component of the +GET method data for it to be valid.<P> +<P> +<A NAME="selmul"><STRONG><TT>SELECT MULTIPLE</TT> and PHP</STRONG></A><P> +<P> +The SELECT MULTIPLE tag in an HTML construct allows users to select +multiple items from a list. These items are then passed to the action +handler for the form. The problem is that they are all passed with the +same widget name. ie.<P> +<PRE> &lt;SELECT NAME=&quot;var&quot; MULTIPLE&gt;</PRE> +<P> +Each selected option will arrive at the action handler as:<P> +<P> +var=option1<BR> +var=option2<BR> +var=option3<P> +<P> +Each option will overwrite the contents of the previous $var variable. +The solution is to use PHP/FI's non-indexed array feature. The following +should be used:<P> +<P> +<PRE> &lt;SELECT NAME=&quot;var[]&quot; MULTIPLE&gt;</PRE><P> +<P> +This tells PHP/FI to treat <EM>var</EM> as an array an each assignment of +a value to var[] adds an item to the array. The first item becomes $var[0], +the next $var[1], etc. The <A HREF="#count">count()</A> function can be +used to determine how many options were selected, and the <A HREF="#sort"> +sort()</A> function can be used to sort the option array if necessary.<P> +<HR> +<A NAME="imagecoord"><STRONG><TT>IMAGE SUBMIT</TT> and PHP</STRONG></A><P> +<P> +When submitting a form, it is possible to use an image instead of the standard +submit button with a tag like:<P> +<P> +<PRE> &lt;input type=image src=image.gif name=sub&gt;</PRE><P> +<P> +When the user clicks somewhere on the image, the accompanying form will be +transmitted to the server with two additional variables, <EM>sub_x</EM> and +<EM>sub_y</EM>. These contain the coordinates of the user click within the +image. The experienced may note that the actual variable names sent by the +browser contains a period rather than an underscore, but PHP converts the +period to an underscore automatically. +<P> +<HR> +<P> +<H2><A NAME="gd_support">GD (a graphics library for GIF creation) Support in PHP</A></H2> +PHP supports the GD library version 1.2 written by Thomas Boutell. There is no GD +code in PHP itself. If you wish to use the GD support in PHP/FI, you must obtain the +GD library from <A HREF="http://www.boutell.com/gd/http/gd1.3.tar.gz"> +http://www.boutell.com/gd/http/gd1.3.tar.gz</A>, install it, and then re-install PHP.<P> +Not all of the GD features are supported by PHP. For a list of supported functions see +the <A HREF="#funcs">Alphabetical List of Functions</A>. All the GD functions +start with the word, <EM>Image</EM>.<P> More information on the GD package is available at: +<A HREF="http://www.boutell.com/gd/">http://www.boutell.com/gd/</A>.<P> +<P> +<EM>GD 1.2 is copyright 1994, 1995 Quest Protein Database Center, Cold Springs Harbor Labs.</EM><P> +<HR> +<P> +<H2><A NAME="virtual_hosts">PHP/FI and Virtual Hosts</A></H2> +PHP works fine on virtual host setups supported by some http daemons. The one +problem that may occur on such a setup is related to an inconsistency in the +way httpd sets the SCRIPT_NAME environment variable. Normally it is set to the +path of the current CGI program in relation to the top-level ROOT_DIR on the +httpd server. However, when a virtual domain is used, some httpd's do not +correctly set the SCRIPT_NAME variable as the relative path from the virtual +domain's top level directory as it should. If the ?config screen gives you +an invalid URL error message, you know that this problem exists on your setup. +You will need to edit the <EM>php.h</EM> file and set the VIRTUAL_PATH #define to +the path to your <EM>php.cgi</EM> binary relative to your top-level directory.<P> +<HR> +<H2><A NAME="upload">File Upload Support</A></H2> +<P> +PHP/FI will automatically detect a file upload from a browser which supports the +form-based file upload features as proposed by +<A HREF="mailto:nebel@xsoft.sd.xerox.com">E. Nebel</A> +and <A HREF="mailto:masinter@parc.xerox.com">L. Masinter</A> from Xerox and described in +<A HREF="ftp://ds.internic.net/rfc/rfc1867.txt">RFC 1867</A>.<P> +A file upload screen can be built by creating a special form which looks +something like this:<P> +<P> +<BLOCKQUOTE> + + &lt;FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST&gt; + +<BR>&lt;INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000"&gt; + +<BR>Send this file: &lt;INPUT NAME="userfile" TYPE="file"&gt; + +<BR>&lt;INPUT TYPE="submit" VALUE="Send File"&gt; + +<BR>&lt;/FORM&gt; + +</BLOCKQUOTE> +<P> +<P> +The _URL_ should point to a php html file. The MAX_FILE_SIZE hidden +field must precede the file input field and its value is the maximum filesize +accepted. The value is in bytes. In this destination file, the following +variables will be defined upon a successful upload:<P> + +<DL> +<DT><STRONG>$userfile</STRONG> +<DD> +<P>The temporary filename in which the uploaded file was stored on the server machine.<P> +<DT><STRONG>$userfile_name</STRONG> +<DD> +<P>The original name of the file on the sender's system.<P> +<DT><STRONG>$userfile_size</STRONG> +<DD> +<P>The size of the uploaded file in bytes.<P> +<DT><STRONG>$userfile_type</STRONG> +<DD> +<P>The mime type of the file if the browser provided this information. An example would +be "image/gif".<P> +</DL> +<P>The <EM><STRONG>$userfile</STRONG></EM> basename of the above variables will match the +NAME field in the upload form.<P> +<P> +Files will by default be stored in the server's default temporary directory. This +can be changed by setting the environment variable TMPDIR in the environment in which +PHP/FI runs. Setting it using a PutEnv() call from within a PHP/FI script will not +work though. Alternatively, you may hard-code in a temporary directory by editing +<EM>php.h</EM> and defining the <STRONG>UPLOAD_TMPDIR</STRONG> variable.<P> +<P> +The PHP/FI script which receives the uploaded file should implement whatever +logic is necessary for determining what should be done with the uploaded file. +You can for example use the $file_size variable to throw away any files that are +either too small or too big. You could use the $file_type variable to throw away +any files that didn't match a certain type criteria. Whatever the logic, you should +either delete the file from the temporary directory or move it elsewhere.<P> +<P> +Please note that the CERN httpd seems to strip off everything starting at +the first whitespace in the content-type mime header it gets from the +client. As long as this is the case, CERN httpd will not support the +file upload feature.<P> + +<HR> +<H2><A NAME="cookies">Cookie Support</A></H2> +<P>PHP/FI transparently supports HTTP cookies as defined by +<A HREF="http://www.netscape.com/newsref/std/cookie_spec.html">Netscape's Spec</A>. +Cookies are a mechanism for storing data in the remote browser and thus tracking +or identifying return users. +You can set cookies using the <A HREF="#setcookie">SetCookie()</A> function. Cookies are part of the HTTP header, so the SetCookie() function must be +called before any output is sent to the browser. This is the same +restriction as for the Header() function.<P> +Any cookies sent to you from the client will automatically be turned into a PHP/FI +variable just like GET and POST method data.<P> +<P>If you wish to assign multiple values to a single cookie, just add <b>[]</b> +to the cookie name. For example:<P> +<PRE> SetCookie("MyCookie[]","Rasmus Lerdorf", time()+3600);</PRE> +Note that a cookie will replace a previous cookie by the same name in your browser +unless the path or domain is different. So, for a shopping cart application you may +want to keep a counter and pass this along. ie.<P> +<PRE> + $Count++; + SetCookie("Count",$Count, time()+3600); + SetCookie("Cart[$Count]",$item, time()+3600);</PRE> +<HR> +<H2><A NAME="msql_support">mSQL Support</A></H2> +<P>mSQL stands for mini-SQL and is a small and simple SQL database engine written +by David Hughes. It is available from <A HREF="ftp://ftp.bond.edu.au/pub/Minerva/msql"> +ftp://ftp.bond.edu.au/pub/Minerva/msql</A><P> +<P> +PHP/FI supports has a rich set of mSQL support functions: +<P> +<DL> +<DT><A HREF="#msql">msql()</A> +<DT><A HREF="#msql_close">msql_Close()</A> +<DT><A HREF="#msql_connect">msql_Connect()</A> +<DT><A HREF="#msql_createdb">msql_CreateDB()</A> +<DT><A HREF="#msql_dbname">msql_dbName()</A> +<DT><A HREF="#msql_dropdb">msql_DropDB()</A> +<DT><A HREF="#msql_fieldflags">msql_FieldFlags()</A> +<DT><A HREF="#msql_fieldlen">msql_FieldLen()</A> +<DT><A HREF="#msql_fieldname">msql_FieldName()</A> +<DT><A HREF="#msql_fieldtype">msql_FieldType()</A> +<DT><A HREF="#msql_freeresult">msql_FreeResult()</A> +<DT><A HREF="#msql_listdbs">msql_ListDBs()</A> +<DT><A HREF="#msql_listfields">msql_Listfields()</A> +<DT><A HREF="#msql_listtables">msql_ListTables()</A> +<DT><A HREF="#msql_numfields">msql_NumFields()</A> +<DT><A HREF="#msql_numrows">msql_NumRows()</A> +<DT><A HREF="#msql_regcase">msql_RegCase()</A> +<DT><A HREF="#msql_result">msql_Result()</A> +<DT><A HREF="#msql_tablename">msql_TableName()</A> +</DL> +<P> +In addition to these functions, PHP/FI can also be compiled to automatically +escape any forward single quote ( ' ) characters found in GET or POST data. +If the MAGIC_QUOTES variable is defined in the <EM>php.h</EM> file then +these quotes will be automatically escaped making it easier to pass +form data directly to msql queries.<P> +<HR> +<H2><A NAME="pg95_support">Postgres95/PostgreSQL Support</A></H2> +<P> +Postgres95/PostgreSQL is a powerful public domain database that implements a significant +subset of the SQL language. It supports many datatypes and commands that +are not available in mSQL. More information about Postgres and the software +itself can be found at this URL: +<A HREF="http://www.postgreSQL.org/"> +http://www.postgreSQL.org/</A>.<P> +<P> +The following PHP functions are available for Postgres95:<P> +<DL> +<DT><A HREF="#pg_connect">pg_Connect()</A> +<DT><A HREF="#pg_close">pg_Close()</A> +<DT><A HREF="#pg_host">pg_Host()</A> +<DT><A HREF="#pg_port">pg_Port()</A> +<DT><A HREF="#pg_options">pg_Options()</A> +<DT><A HREF="#pg_tty">pg_tty()</A> +<DT><A HREF="#pg_dbname">pg_DBname()</A> +<DT><A HREF="#pg_exec">pg_Exec()</A> +<DT><A HREF="#pg_result">pg_Result()</A> +<DT><A HREF="#pg_freeresult">pg_FreeResult()</A> +<DT><A HREF="#pg_getlastoid">pg_GetLastOid()</A> +<DT><A HREF="#pg_numrows">pg_NumRows()</A> +<DT><A HREF="#pg_numfields">pg_NumFields()</A> +<DT><A HREF="#pg_fieldnum">pg_FieldNum()</A> +<DT><A HREF="#pg_fieldname">pg_FieldName()</A> +<DT><A HREF="#pg_fieldtype">pg_FieldType()</A> +<DT><A HREF="#pg_fieldsize">pg_FieldSize()</A> +<DT><A HREF="#pg_fieldprtlen">pg_FieldPrtLen()</A> +<DT><A HREF="#pg_errorMessage">pg_errorMessage()</A> +</DL> +<P> +<STRONG>Note:</STRONG> Binary cursors are not supported. +<P> +<P> +In addition to these functions, PHP/FI can also be compiled to automatically +escape any forward single quote ( ' ) and double quote ( &quot; ) characters +found in GET or POST data. If the MAGIC_QUOTES variable is defined in the +<EM>php.h</EM> file then these quotes will be automatically escaped making +it easier to pass form data directly to Postgres queries.<P> +<P> +Here is a sample script that connects to Postgres database on localhost +called 'mydb' and retrieves the names and ages of people in a table:<P> +<P> +<PRE> +&lt;? + $conn = pg_Connect("localhost", "5432", "", "", "mydb"); + if (!$conn) { + echo "An error occured.\n"; + exit; + } + + $result = pg_Exec($conn, "select * from table1"); + if (!$result) { + echo "An error occured.\n"; + exit; + } + + $num = pg_NumRows($result); + $i = 0; + + while ($i &lt; $num) { + echo "name: "; + echo pg_Result($result, $i, "name"); + echo " age: "; + echo pg_Result($result, $i, "age"); + echo "&lt;BR&gt;"; + $i++; + } + + pg_FreeResult($result); + pg_Close($conn); +&gt; +</PRE><P> + +<HR> +<H2><A NAME="mysql_support">mysql Support</A></H2> +<P>mysql is an clone of the mSQL package. You can get a copy from +<A HREF="http://www.tcx.se/">http://www.tcx.se/</A><P> +<P> +PHP/FI supports has a rich set of mysql support functions: +<P> +<DL> +<DT><A HREF="#mysql">mysql()</A> +<DT><A HREF="#mysql_close">mysql_Close()</A> +<DT><A HREF="#mysql_connect">mysql_Connect()</A> +<DT><A HREF="#mysql_createdb">mysql_CreateDB()</A> +<DT><A HREF="#mysql_dbname">mysql_dbName()</A> +<DT><A HREF="#mysql_dropdb">mysql_DropDB()</A> +<DT><A HREF="#mysql_fieldflags">mysql_FieldFlags()</A> +<DT><A HREF="#mysql_fieldlen">mysql_FieldLen()</A> +<DT><A HREF="#mysql_fieldname">mysql_FieldName()</A> +<DT><A HREF="#mysql_fieldtype">mysql_FieldType()</A> +<DT><A HREF="#mysql_freeresult">mysql_FreeResult()</A> +<DT><A HREF="#mysql_listdbs">mysql_ListDBs()</A> +<DT><A HREF="#mysql_listfields">mysql_Listfields()</A> +<DT><A HREF="#mysql_listtables">mysql_ListTables()</A> +<DT><A HREF="#mysql_numfields">mysql_NumFields()</A> +<DT><A HREF="#mysql_numrows">mysql_NumRows()</A> +<DT><A HREF="#mysql_result">mysql_Result()</A> +<DT><A HREF="#mysql_tablename">mysql_TableName()</A> +</DL> +<P> +In addition to these functions, PHP/FI can also be compiled to automatically +escape any forward single quote ( ' ) characters found in GET or POST data. +If the MAGIC_QUOTES variable is defined in the <EM>php.h</EM> file then +these quotes will be automatically escaped making it easier to pass +form data directly to mysql queries.<P> +<HR> +<H2><A NAME="solid_support">Solid Support</A></H2> +<P> +The Solid server is a high-volume SQL server. It supports the ANSI SQL2, ODBC, +SAG CLI and X/Open SQL standards. More information about the Solid server is +available at <A HREF="http://www.solidtech.com/">www.solidtech.com</A>. +The Solid interface to PHP was developed by +<a href="http://solid.digiface.nl/">DigiFace Internet Services</a>. +<P> +The following PHP functions are available for the Solid Server:<P> +<DL> +<DT><A HREF="#solid_connect">Solid_Connect()</A> +<DT><A HREF="#solid_close">Solid_Close()</A> +<DT><A HREF="#solid_exec">Solid_Exec()</A> +<DT><A HREF="#solid_result">Solid_Result()</A> +<DT><A HREF="#solid_freeresult">Solid_FreeResult()</A> +<DT><A HREF="#solid_numrows">Solid_NumRows()</A> +<DT><A HREF="#solid_numfields">Solid_NumFields()</A> +<DT><A HREF="#solid_fieldnum">Solid_FieldNum()</A> +<DT><A HREF="#solid_fieldname">Solid_FieldName()</A> +</DL> +<P> +In addition to these functions, PHP/FI can also be compiled to automatically +escape any forward single quote ( ' ) characters found in GET or POST data. +If the MAGIC_QUOTES variable is defined in the <EM>php.h</EM> file then +these quotes will be automatically escaped making it easier to pass +form data directly to Solid queries.<P> +<P> +Here is the same script that was shown in the Postgres section, adapted for +the Solid server. +<P> +<PRE> +&lt;? + $conn = Solid_Connect("", "username", "password"); + if (!$conn) { + echo "An error occured.\n"; + exit; + } + + $result = Solid_Exec($conn, "select * from table1"); + if (!$result) { + echo "An error occured.\n"; + exit; + } + + while (Solid_FetchRow($result)) { + echo "name: "; + echo Solid_Result($result, "name"); + echo " age: "; + echo Solid_Result($result, "age"); + echo "&lt;BR&gt;"; + } + + Solid_FreeResult($result); + Solid_Close($conn); +&gt; +</PRE><P> + +<HR> +<H2><A NAME="sybase_support">Sybase Support</A></H2> +The supporting functions uses Sybase DB library API calls. Therefore +you must have sybase API libraries and headers files installed in your +system in order to compile PHP/FI with sybase support. +<p> +The following PHP/FI functions are available for Sybase. <P> +<DL> +<DT><A HREF="#sybsql_checkconnect">SybSQL_CheckConnect()</A> +<DT><A HREF="#sybsql_connect">SybSQL_Connect()</A> +<DT><A HREF="#sybsql_DBuse">SybSQL_DBuse()</A> +<DT><A HREF="#sybsql_Exit">SybSQL_Exit()</A> +<DT><A HREF="#sybsql_fieldname">SybSQL_Fieldname()</A> +<DT><A HREF="#sybsql_getfield">SybSQL_GetField()</A> +<DT><A HREF="#sybsql_isrow">SybSQL_IsRow()</A> +<DT><A HREF="#sybsql_nextrow">SybSQL_NextRow()</A> +<DT><A HREF="#sybsql_numfields">SybSQL_NumFields()</A> +<DT><A HREF="#sybsql_numrows">SybSQL_NumRows()</A> +<DT><A HREF="#sybsql_query">SybSQL_Query()</A> +<DT><A HREF="#sybsql_result">SybSQL_Result()</A> +<DT><A HREF="#sybsql_result_all">SybSQL_Result_All()</A> +<DT><A HREF="#sybsql_seek">SybSQL_Seek()</A> +</DL><P> +For a complete example, see the example following the +<A HREF="#sybsql_result">sybSQL_Result()</A> function.<P> + +<HR> +<H2><A NAME="oracle_support">Oracle Support</A></H2> +The PHP/FI interface to Oracle uses the Oracle Call Interface (OCI). +You need the OCI libraries on your system to compile PHP/FI with +Oracle support. +<P> +The following PHP/FI functions are available for Oracle: <P> +<DL> +<DT><A HREF="#ora_bind">Ora_Bind()</A> +<DT><A HREF="#ora_close">Ora_Close()</A> +<DT><A HREF="#ora_commit">Ora_Commit()</A> +<DT><A HREF="#ora_commitoff">Ora_CommitOff()</A> +<DT><A HREF="#ora_commiton">Ora_CommitOn()</A> +<DT><A HREF="#ora_exec">Ora_Exec()</A> +<DT><A HREF="#ora_fetch">Ora_Fetch()</A> +<DT><A HREF="#ora_getcolumn">Ora_GetColumn()</A> +<DT><A HREF="#ora_logoff">Ora_Logoff()</A> +<DT><A HREF="#ora_logon">Ora_Logon()</A> +<DT><A HREF="#ora_open">Ora_Open()</A> +<DT><A HREF="#ora_parse">Ora_Parse()</A> +<DT><A HREF="#ora_rollback">Ora_Rollback()</A> +</DL><P> +An example PHP/FI Oracle application: +<PRE> +&lt;? +PutEnv(&quot;ORACLE_HOME=path_to_your_oracle_home&quot; +PutEnv(&quot;ORACLE_SID=database&quot; + +/* Establish a connection between PHP and Oracle. */ +$conn = Ora_Logon(&quot;username&quot; &quot;password&quot; + +if ($conn &lt; 0) { + echo(&quot;Could not connect to Oracle.\n&quot; + exit; +} + +/* Open a cursor in Oracle. */ +$cursor = Ora_Open($conn); + +if ($cursor &lt; 0) { + echo(&quot;Could not open a cursor.\n&quot; + Ora_Logoff($conn); + exit; +} + +/* Turn off autocommit. */ +Ora_CommitOff($conn); + +/* This is the SQL query. */ +$query = &quot;SELECT * FROM some_table&quot; + +if (Ora_Parse($cursor, $query) &lt; 0) { + echo(&quot;Parse failed!\n&quot; + Ora_Logoff($conn); + exit; +} + +/* Execute the SQL statement associated with $cursor and + prepare storage for select-list items. */ +$ncols = Ora_Exec($cursor); + +echo &quot;lt;P&gt;\n&quot; +echo &quot;lt;TABLE BORDER=1 CELLSPACING=0&gt;\n&quot; + +/* Retrieve all rows from the database one after another. */ +while (Ora_Fetch($cursor) == 1) { + $i = 0; + echo &quot;lt;TR&gt;\n&quot; + while ($i &lt; $ncols) { + /* Get data for a single column of currently fetched row. */ + $col = Ora_GetColumn($cursor, $i); + echo(&quot;lt;TD&gt;$col&lt;/TD&gt;\n&quot; + $i++; + } + echo(&quot;lt;/TR&gt;\n&quot; +} + +echo &quot;&lt;/TABLE&gt;\n&quot;; + +/* Close the Oracle connection. */ +Ora_Close($cursor); + +/* Disconnect the logon data area. */ +Ora_Logoff($conn); +&gt; +</PRE> +<P> +<HR> +<H2><A NAME="illustra_support">Informix Illustra Support</A></H2> +<P> +Illustra is a commercial database sold by Informix. It has several features that +are not fully supported by this interface (yet). The main claim to fame for +Illustra is that it is an object-relational database capable of being extended +in an object-orientated fashion. For example, it is possible to have an Image +as a base type within the database. More information can be obtained from +<A HREF="http://www.illustra.com/">The illustra home page</A>.<P> +<P> +The following PHP functions are available for Illustra:<P> +<DL> +<DT><A HREF="#mi_connect">mi_Connect()</A> +<DT><A HREF="#mi_close">mi_Close()</A> +<DT><A HREF="#mi_dbname">mi_DBname()</A> +<DT><A HREF="#mi_exec">mi_Exec()</A> +<DT><A HREF="#mi_result">mi_Result()</A> +<DT><A HREF="#mi_numrows">mi_NumRows()</A> +<DT><A HREF="#mi_numfields">mi_NumFields()</A> +<DT><A HREF="#mi_fieldnum">mi_FieldNum()</A> +<DT><A HREF="#mi_fieldname">mi_FieldName()</A> +</DL> +<P> +<STRONG>Note:</STRONG> Type operations are not yet supported. +<P> +<P> +Here is a sample script that connects to the illustra database on localhost +called 'mydb' and retrieves the names and ages of people in a table:<P> +<P> +<PRE> +&lt;? + $conn = mi_Connect("mydb", "username", "password"); + if ($conn&lt;0) { + echo "An error occured on connection.\n"; + exit; + } + + $result = mi_Exec($conn, "select * from table1"); + if ($result &lt; 0) { + echo "An error occured.\n"; + exit; + } + + $num = mi_NumRows($result); + $i = 0; + + while ($i &lt; $num) { + echo "name: "; + echo mi_Result($result, $i, "name"); + echo " age: "; + echo mi_Result($result, $i, "age"); + echo "&lt;BR&gt;"; + $i++; + } + + mi_Close($conn); +&gt; +</PRE><P> +<HR> +<H2><A NAME="adabas_support">Adabas Support</A></H2> +<P> +Adabas D is an advanced RDBMS that is available on many platforms. A special version, +the so called Personal Edition is available for Linux and Win32 at no cost. +It is resticted to 5 simulataneous users and 100 MB of data. +For more information on Adabas D refer to +<A HREF="http://www.softwareag.com">http://www.softwareag.com</A>. +<P> +The following PHP functions are available for accessing Adabas databases:<P> +<DL> +<DT><A HREF="#ada_connect">Ada_Connect()</A> +<DT><A HREF="#ada_close">Ada_Close()</A> +<DT><A HREF="#ada_exec">Ada_Exec()</A> +<DT><A HREF="#ada_result">Ada_Result()</A> +<DT><A HREF="#ada_resultall">Ada_ResultAll()</A> +<DT><A HREF="#ada_freeresult">Ada_FreeResult()</A> +<DT><A HREF="#ada_numrows">Ada_NumRows()</A> +<DT><A HREF="#ada_numfields">Ada_NumFields()</A> +<DT><A HREF="#ada_numrows">Ada_NumRows()</A> +<DT><A HREF="#ada_numfields">Ada_NumFields()</A> +<DT><A HREF="#ada_fieldnum">Ada_FieldNum()</A> +<DT><A HREF="#ada_fieldname">Ada_FieldName()</A> +<DT><A HREF="#ada_fieldtype">Ada_FieldType()</A> +</DL> +Here is the same script that was shown in the Postgres and Solid sections, adapted for +Adabas D. +<P> +<PRE> +&lt;? + $conn = Ada_Connect("node:db", "username", "password"); + if (!$conn) { + echo "An error occured.\n"; + exit; + } + + $result = Ada_Exec($conn, "select * from table1"); + if (!$result) { + echo "An error occured.\n"; + exit; + } + + while (Ada_FetchRow($result)) { + echo "name: "; + echo Ada_Result($result, "name"); + echo " age: "; + echo Ada_Result($result, "age"); + echo "&lt;BR&gt;"; + } + + Ada_FreeResult($result); + Ada_Close($conn); +&gt; +</PRE><P> + +<HR> +<H2><A NAME="regexp">Regular Expressions</A></H2> +<P> +Regular expressions are used for complex string manipulation in PHP/FI. +The script interface to the regular expression support is through the following +functions: +<A HREF="#ereg">EReg()</A>, +<A HREF="#eregi">ERegi()</A>, +<A HREF="#ereg_replace">EReg_Replace()</A>, +<A HREF="#eregi_replace">ERegi_Replace()</A>, +<A HREF="#reg_match">Reg_Match()</A>, +<A HREF="#reg_replace">Reg_Replace()</A>, and +<A HREF="#reg_search">Reg_Search()</A>. +The first argument to all three functions is a regular expression string. +The EReg functions use the Posix Extended regular expressions as defined +by POSIX 1003.2, while the Reg functions implement Basic regular +expressions. For a complete description of regular expressions see your +regex(7) man page. If you do not have this page, the regex(7) man page +written by Henry Spencer can be found in the src/regex directory in the +PHP/FI distribution. Ask your system administrator to install this +man page for you.<P> +Some examples of regular expressions and what they do:<p> +<blockquote> +<dl> +<dt><tt>ereg("abc",$string);</tt> +<dd>Returns true if &quot;abc&quot; is found anywhere in $string.<P> +<dt><tt>ereg("^abc",$string);</tt> +<dd>Returns true if &quot;abc&quot; is found at the beginning of $string.<P> +<dt><tt>ereg("abc$",$string);</tt> +<dd>Returns true if &quot;abc&quot; is found at the end of $string.<P> +<dt><tt>eregi("(ozilla.[23]|MSIE.3)",$HTTP_USER_AGENT);</tt> +<dd>Returns true if client browser is Netscape 2, 3 or MSIE 3.<P> +<dt><tt>ereg("([[:alnum:]]+) ([[:alnum:]]+) ([[:alnum:]]+)",$string,$regs);</tt><br> +<dd>Places three space separated words into $regs[1], $regs[2] and $regs[3].<P> +<dt><tt>ereg_replace("^","&lt;BR&gt;",$string)</tt> +<dd>Put a &lt;BR&gt; tag at the beginning of $string.<P> +<dt><tt>ereg_replace("$","&lt;BR&gt;",$string)</tt> +<dd>Put a &lt;BR&gt; tag at the end of $string.<P> +<dt><tt>ereg_replace(10,"",$string);</tt> +<dd>Get rid of any linefeed characters in $string.<P> +<dt><tt>ereg_replace(13,"&lt;BR&gt;",$string);</tt> +<dd>Replace all carriage returns with a &lt;BR&gt; tag in $string.<P> +</dl> +</blockquote> +<HR> +<H2><A NAME="escapes">Escape Characters</A></H2> +<P> +The following escape sequences are supported in most places where a +quoted string argument is used: +<blockquote> +<pre> \a --&gt; bell + \b --&gt; backspace + \n --&gt; linefeed + \r --&gt; carriage return + \t --&gt; tab + \nnn --&gt; octal char + \xXX --&gt; hex char</pre> +</blockquote><P> +<HR> +<H2><A NAME="octal">Octal Notation of Unix file permissions</a></H2> +<P> +A couple of functions in the PHP/FI script language epxect octal arguments +to denote Unix-style permission parameters. +In this octal notation 3 bits are used to represent the values 0-7. Each bit of +the three represents a specific permission. Octal is traditionally noted +in some contexts by a leading 0, such as 0755. You do not need to use this +leading 0 in PHP since the functions that expect octal parameters are will +simplyassume that the parameter is octal. Using the leading 0 is however good +practise to remind yourself that you are no longer dealing with a base 10 value. +<P><B>Bit Description</B> +<PRE> xxx + ^^^ + ||+----1 bit (execute permission) + |+-----2 bit (write permission) + +------4 bit (read permission)</PRE> + +These three bits are repeated three times for owner, group, and world. +Thus 0755 means: + +<PRE> owner: r,w,x + group: r, ,x + world: r, ,x</PRE> + +Note that the execute bit on a directory means 'access', not 'execute'. +There are also the extended bits in the fourth octal nibble, like 0?755: +<PRE> 4: suid bit (set userid) + 2: sgid bit (set group id) + 1: sticky bit (on a directory, only the owner can delete a file)</PRE> +<P> +<HR> +<H2><A NAME="script">PHP/FI Script Language</A></H2> +<P> +The PHP script language is similar in syntax to the C language in many ways. +It supports variables, arrays, function calls, different variable types +and most things you might need to write complex cgi programs.<P> +<P> +Each PHP/FI function is described in the following section and can be quickly +found by simply appending #function_name to the url for this document since +each function description has been tagged with its name. <P> + +<H3><A NAME="syntax">Syntax</A></H3> +<P> +Each PHP instruction starts with <STRONG>&lt;?</STRONG> and ends with a +<STRONG>&gt;</STRONG>. Or, instructions may be grouped inside a single +<STRONG>&lt;? &gt;</STRONG> pair and separated by <STRONG>;</STRONG> characters.<P> +<P> +Variables are supported and are indicated by preceding the +variable name with a <STRONG>$</STRONG>. So, for example, to set a +variable to 5 and then display this variable, the following +is valid:<P> +<P> +<PRE> &lt;?$a = 5&gt; + &lt;?echo $a&gt;</PRE><P> +<P> +This is the same as writing:<P> +<P> +<PRE> &lt?; $a = 5; echo $a &gt;</PRE> +<P> +Or even:<P> +<P> +<PRE> &lt?; + $a = 5; + echo $a; + &gt;</PRE><P> +<P> +Extra white space characters such as spaces, tabs and new-lines +are ignored. This fact should be used to format the PHP script +blocks to make them easier to read. Case is relevant in variable +names, but not in function calls. In the functional overview later +on in this documentation, case is only used to make the function +names easier to read. In the actual script language you can use +any case you wish. +<P> +<P> +Comments are supported. A comment is written just like comments in +the C language. <STRONG>/*</STRONG> starts a comment and <STRONG>*/</STRONG> ends a +comment. Comments can be placed anywhere within the <STRONG>&lt;? ... &gt;</STRONG> +block.<P> +<HR> +<H3><A NAME="vars">Variables</A></H3> +<P> +Three types of variables are supported. <STRONG>Long integer</STRONG>, +<STRONG>Double precision floating point</STRONG> and <STRONG>character strings</STRONG>. +They are automatically detected. For example:<P> +<P> +<PRE> &lt;?$a = 5&gt;</PRE><P> +<P> +causes $a to become a variable of type INTEGER.<P> +<P> +<PRE> &lt;?$a = 5.0&gt;</PRE><P> +causes $a to become a variable of type DOUBLE.<P> +<P> +<PRE> &lt;?$a = "5"&gt;</PRE><P> +<P> +causes $a to become a variable of type STRING.<P> +<P> +The type of the variable is not generally important. Every variable +regardless of its type is converted to all three types internally and +the various functions will try to use the correct type. There are +only a few functions affected by the type of the variable.<P> +<P> +All three variable types may also be treated as arrays by appending +<STRONG>[value]</STRONG> to their names. Unlike C, these are actually +associative arrays similar to those used in Perl. The following would +be valid:<P> +<P> +<PRE> &lt;? + $a[0] = 5; + $a["hello"] = 6; + echo $a[0]; + echo $a["hello"]; + &gt;</PRE><P> + <P> +Note that if a variable is used both as an array and as a normal variable, +the normal variable is synonymous with the index &quot;0&quot; entry in +the array. ie.<P> +<P> +<PRE> $a = 1;</PRE><P> +<P> +Is the same as writing:<P> +<P> +<PRE> $a[0] = 1;</PRE><P> +<P> +PHP/FI also supports non-indexed arrays. A non-indexed array will generate +its own index as items are added to it. For example:<P> +<P> +<PRE> $a[] = "Hello"; + $a[] = "There";</PRE><P> + <P> +The first item inserted into a non-indexed array always gets assigned +index 0, the second index 1, etc. Therefore the above items may be +printed out with:<P> +<P> +<PRE> echo $a[0]; + echo $a[1]; + </PRE><P> +Arrays can be copied by a simple assignment. If $b is an array, then +all the values can be copied to a new array named $a with:<P> +<PRE> $a = $b;</PRE><P> +<P>Please not that if PHP does not force you to define variables before +using them. If in the above statement, $b was undefined, then $a would +be set to an empty string (&quot;&quot;).</P> +<P> +The [] notation is also used to indicate that arrays are to be appended. +If $a and $b are both arrays, then $b can be appended to $a by:<P> +<PRE> $a[] = $b;</PRE><P> +<P> +In the above, there will be a difference between associative arrays and +normal numbered arrays. Numbered arrays will be renumbered such that all +elements from $b will come after the original elements from $a. While with +associative arrays, elements in $b will be merged with elements in $a. +Any elements (items with the same index name) which already exist in $a +will be overwritten by $b elements.<P> +You can use the <A HREF="#count">count()</A> function to determine the +number of items in any array.<P> +<P> +Also inherent to the language is the fact that the type of the variable +determines how certain basic operations will be carried out. For example:<P> +<P> +<PRE> $a = $b + $c;</PRE><P> +<P> +can do a couple of different things. If $b is a number, the numerical +value of $c is added to $b and the sum is stored in $a. In this case +the type of $c is irrelevant. The operation is guided by the type of +the first variable. If $b is a string, then the string value of +$c is appended to $b and the resultant string is placed in $a. +This also leads to some caveats. You should read the +section on <A HREF="#overload">overloaded operators</A> to get a +better understanding of how to deal with them.<P> +<HR> +<H3><A NAME="assoc">Associative Arrays</A></H3> +<P> +The previous section introduced associative arrays. An associative array is an +array in which the index need not be a numerically sequential value. The array +index can be any number or string. PHP/FI provides a set of functions to +manipulate these associative arrays. These include, <A HREF="#next">Next()</A>, +<A HREF="#prev">Prev()</A>,<A HREF="#reset">Reset()</A>,<A HREF="#end">End()</A>, +and <A HREF="#key">Key()</A>.<P> +<HR> +<H3><A NAME="varvars">Variable Variables</A></H3> +<P> +Sometimes it is convenient to be able to have variable variable names. +That is, a variable name which can be set and used dynamically. +A normal variable is set with a statement such as:<P> +<P> +<PRE> $a = "hello";</PRE><P> +<P> +A variable variable takes the value of a variable and treats that as the +name of a variable. In the above example, <STRONG>hello</STRONG>, can +be used as the name of a variable by using two dollar signs. ie.<P> +<P> +<PRE> $$a = "world";</PRE><P> +<P> +At this point two variables have been defined and stored in the PHP/FI +symbol tree:<P> +<P> +<PRE> Variable Name Variable Content + <EM>a</EM> <EM>hello</EM> + <EM>hello</EM> <EM>world</EM></PRE><P> + <P> +Therefore, this statement:<P> +<P> +<PRE> echo "$a $$a";</PRE><P> +<P> +produces the exact same output as:<P> +<P> +<PRE> echo "$a $hello";</PRE><P> +<P> +ie. they both produce: <STRONG>hello world</STRONG><P> +<HR> +<H3><A NAME="lang">Language Constructs</A></H3> +<P> +As far as language constructs are concerned, the PHP language is +quite simple. The following commands are used to guide the control +flow through a file:<P> +<P> +<UL> + <LI>if (condition) + <LI>else + <LI>elseif (condition) + <LI>endif + <LI>switch(expression) + <LI>case expression + <LI>default + <LI>break + <LI>endswitch + <LI>while + <LI>endwhile + <LI>include + <LI>exit +</UL><P> +<P> +The syntax of conditions are similar to that of the C language. +<STRONG>==</STRONG> tests for equality. <STRONG>!=</STRONG> means not equal. Also +supported are: <STRONG>&gt;</STRONG>, <STRONG>&lt;</STRONG>, <STRONG>&gt;=</STRONG>, +<STRONG>&lt;=</STRONG>. +Conditional AND is <STRONG>&&</STRONG>, conditional OR is <STRONG>||</STRONG>.<P> + +Examples: +<P> +<PRE> &lt;? + if($a==5 && $b!=0 ); + $c = 100 + $a / $b; + endif; + &gt;</PRE><P> +<P>The above may also be written in standard C syntax:<BR> +In this case, there is no need for a semicolon after the closing curly brace. +<P> +<PRE> &lt;? + if($a==5 && $b!=0) { + $c = 100 + $a / $b; + } + &gt;</PRE><P> + <P> +There is no difference between the two syntaxes. I personally like to +use endif, endswitch and endwhile so I explicitly know which construct +I am ending. However, these ending constructs can always be replaced with +a closing curly brace.<P><P> +It is important to note that the flow of the language is not dependent +on the organization of the script blocks within the code. You can +start an if expression in one block and have the end of the expression +in another. For example:<P> +<P> +<PRE> &lt;?if($a==5 && $b!=0)> + &lt;b&gt;Normal html text&lt;/b&gt; + &lt;?endif&gt;</PRE><P> +<P>In this example it is easy to see why it is sometimes more desirable to use +the <TT>endif</TT> keyword as opposed to a closing brace. The above is much more readable +than the following:<P> +<P> +<PRE> &lt;?if($a==5 && $b!=0) {> + &lt;b&gt;Normal html text&lt;/b&gt; + &lt;? } &gt;</PRE><P> +<P>Both version are valid and they will do exactly the same thing.<P> +<HR> +<H3><A NAME="user_funcs">User-Defined Functions</A></H3> +<P>You may define a function within a PHP script with the following syntax:<P> +<PRE> &lt;? + Function Test ( + echo "This is a test\n"; + ); + &gt;</PRE><P> + <P> +This function can now be called from anywhere in the script as long as +the call comes after the function definition. A sample call might be:<P> +<P> +<PRE> &lt;? + Test(); + &gt;</PRE><P> + <P> +User defined functions like this act exactly like PHP's internal functions +in that you can pass arguments to them and have them return a value. Here +is the syntax for a function definition of a function which takes 3 arguments +and returns the sum of these arguments:<P> +<P> +<PRE> &lt;? + Function Sum $a,$b,$c ( + return($a+$b+$c); + ); + + echo Sum($a,$b,$c); + &gt;</PRE><P> + <P> +The <EM>return</EM> statement is used to return a value from the function. Only +a single value can be returned using this mechanism, however, if more values +need to be communicated back and forth between the main code and functions, +global variables can be used. This brings us to the section on the scope of +variables.<P> + +<HR> +<H3><A NAME="scope">Scope of Variables</A></H3> +<P> +The scope of a variable is the context within which it is defined. For the +most part all PHP/FI variables only have a single scope. However, within +user-defined functions a local function scope is introduced. Any variable +used inside a function is by default limited to the local function scope. +For example:<P> +<P> +<PRE> $a=1; /* global scope */ + Function Test ( + echo $a; /* reference to local scope variable */ + ); + Test();</PRE><P> + <P> +This script will not produce any output because the <EM>echo</EM> +statement refers to a local version of the <EM>$a</EM> variable, and it has +not been assigned a value within this scope. You may notice that this is +a little bit different from the C language in that global variables in C +are automatically available to functions unless specifically overridden by a local +definition. This can cause some problems in that people may inadvertently +change a global variable. In PHP/FI global variables must be declared global +inside a function if they are going to be used in that function. An example:<P> +<P> +<PRE> $a=1; + $b=2; + Function Sum $first,$second ( + global $a,$b; + + $b = $a + $b; + ); + Sum(); + echo $b;</PRE><P> + <P> +The above script will output &quot;3&quot;. By declaring $a and $b global within +the function, all references to either variable will refer to the global version. +There is no limit to the number of global variables that can be manipulated by a +function. However, the variable must exist in the global scope prior to the +function being called. You cannot create new global variables from within a function.<P> +<P> +Another important feature of variable scoping is the <EM>static</EM> variable. +A static variable exists only in a local function scope, but it does not lose +its value when program execution leaves this scope. Consider the following +example:<P> +<P> +<PRE> Function Test ( + $a=0; + echo $a; + $a++; + );</PRE><P> + <P> +This function is quite useless since every time it is called it sets $a to 0 and +prints &quot;0&quot;. The $a++ which increments the variable serves no purpose +since as soon as the function exits the $a variable disappears. To make a useful +counting function which will not lose track of the current count, the $a variable +is declared static:<P> +<P> +<PRE> Function Test ( + static $a=0; + echo $a; + $a++; + );</PRE><P> + <P> +Now, every time the Test() function is called it will print the value of $a and +increment it.<P> +<P> +Static variables are also essential when functions are called recursively. +A recursive function is one which calls itself. Care must be taken when writing +a recursive function because it is possible to make it recurse indefinitely. You +must make sure you have an adequate way of terminating the recursion. The +following simple function recursively counts to 10:<P> +<PRE> Function Test ( + static $count=0; + + $count++; + echo $count; + if($count < 10) { + Test(); + } + );</PRE><P> + +<HR> +<H3><A NAME="math">Mathematical Expressions</A></H3> +<P> +PHP supports full mathematical operations anywhere an expression is +expected. Order of operations are taken into account. The following +are the valid operators:<P> +<P> +<PRE> &lt;? $a = 2 + 1 &gt; <EM>Addition</EM> + &lt;? $a = 2 - 1 &gt; <EM>Subtraction</EM> + &lt;? $a = 2 * 1 &gt; <EM>Multiplication</EM> + &lt;? $a = 2 / 1 &gt; <EM>Division</EM> + &lt;? $a = 2 % 1 &gt; <EM>Modulus</EM> + &lt;? $a = 2 ^ 1 &gt; <EM>Bit-wise Exclusive OR</EM></PRE><P> +<P> +Both bracketing and order of operations is supported, so the following +is valid:<P> +<P> +<PRE> &lt;?$a = (2+1)*3+6/3&gt;</PRE><P> +<P> +The C-like incremental operators <TT>+=</TT> and <TT>-=</TT> are +supported. ie.<P> +<P> +<PRE> &lt;? $a += $b&gt;</PRE><P> +<P> +This is equivalent to:<P> +<P> +<PRE> &lt;? $a = $a + $b&gt;</PRE><P> +<P> +The C-like bit-wise operators <TT>&amp;=</TT>, <TT>|=</TT> and <TT>^=</TT> are +supported. ie.<P> +<P> +<PRE> &lt;? $a &= 4&gt;</PRE> +This is equivalent to:<P> +<P> +<PRE> &lt;? $a = $a & 4&gt;</PRE><P> +<HR> +<H3><A NAME="while">While Loops</A></H3> +<P> +You can loop within a PHP script by using the <EM>while(); endwhile;</EM> construct.<P> +<P> +<PRE> &lt;? + $a=0; + while($a&lt;100) { + $a++; + echo $list[$a]; + } + &gt;</PRE><P> +<P> +The above example shows the use of a while loop to display the contents of +an array. <STRONG>WARNING</STRONG> although the PHP language supports incremental +operators such as <STRONG>++</STRONG> and <STRONG>-<!>-</STRONG> to increment and decrement +a variable, they are not treated exactly like they would be in the +C language. The variable is incremented right away. There is no +concept of incrementing the variable before or after the operation +as there is in C. +<P>As explained in the <A HREF="#lang">Language Constructs</A> section above, +the same can be obtained with <EM>while(); endwhile;</EM>. +<P> +<HR> +<H3><A NAME="switch">Switch Construct</A></H3> +<P> +PHP supports a switch construct very similar to the C equivalent.<P> +<P> +<PRE> &lt;? + $a=0; + switch($a) { + case 1; + echo "a is 1"; + break; + case "hello"; + echo "a is hello"; + break; + default; + echo "a is unknown"; + break; + } + &gt;</PRE><P> +<P> +The above is an example of a switch construct. It is similar to a +series of if/elseif/else constructs but easier to read. The only +difference between the PHP switch construct and that of the C +language is that semi-colons are used to terminate every line. There +are no colons.<P> +As explained in the <A HREF="#lang">Language Constructs</A> section above, +the same can be obtained with <EM>switch(); endswitch;</EM>. +<P> +All of these constructs can of course be nested and used +inside each other just like C. The various files in the <EM>examples</EM> +directory of the PHP distribution should provide a good starting point +for learning the language.<P> +<HR> +<H3><A NAME="secure">Secure Variables - Defeating GET method hacks</A></H3> +<P> +A previous section talked about GET and POST method data and variables. +If you think about it, you may be able to envision a security issue. For example, +if on a web page I have obtained some data from a database and I pass this +data along in a variable called &quot;data&quot; in a POST method form. In the +ensuing page I can access this variable and do something with it. However, if +someone accessed this second page directly and put a &quot;?data=something&quot + +right in the URL thereby doing a GET method variable set, they have effectively +circumvented the original POST method form.<P> +<P> +PHP provides a <EM>SecureVar()</EM> function which is used to mark variables +names as being secure variables. These secure variables can only be set +directly in a PHP script, or they can come from a POST method form. They +cannot be set using the GET method variable definition mechanism. From our +above scenario, if we placed the line:<P> +<P> +<PRE> &lt;?SecureVar("data")&gt;</PRE><P> +<P> +Near the beginning of our second page, then the GET method trick would +not work. The &quot;data&quot; variable would appear to be empty unless +it came directly from the POST method form on the first page.<P> +<P> +The <EM>SecureVar()</EM> actually takes a regular expression as its +argument, so you can mark patterns of variable names that should be +treated in this secure manner. For example,<P> +<P> +<PRE> &lt;?SecureVar(".*data.*")&gt;</PRE><P> +Would mark any variable with the word &quot;data&quot; anywhere in their +name as being secure.<P> +Please note that POST-method forms are not intrinsically secure. People can +emulate the posting of any data to a form by simply telnetting to the HTTP +port on your system. You need to take appropriate security measures to +stop people from doing this if in fact security is a concern.<P> + +<HR> +<H3><A NAME="overload">Overloaded Operators and dealing with variable types</A></H3> + +An overloaded operator is an operator like '+' for example which can do different things +based on the types of the expressions it is asked to operate on.<P> + +The problem is that PHP understands 3 variable types. Integer, +Double and String. When a variable is first assigned, PHP +automatically figures out the variable type.<P> +<P> +ie. +<P> +<P> +<PRE> $a = 1; Type would be integer + $b = 1.5; Type would be double + $c = "1"; Type would be string</PRE><P> +<P> +Now, what happens when you do something like:<P> +<P> +<PRE> $d = $a + $c;</PRE><P> +<P> +The parser looks at the first part of the +arithmetic expression and uses that to type the result and thus +also the nature of the arithmetic that is to be done. In the +above case since $a is an integer, $d will be an integer and +an integer addition is done giving the result:<P> +<P> +<PRE> $d = 2 Type is integer</PRE><P> +<P> +Therefore:<P> +<P> +<PRE> $d = $c + $a</PRE><P> +<P> +Results in:<P> +<P> +<PRE> $d = "11" Type is string</PRE><P> +<P> +The above makes sense to me, and once you understand it, it is probably +workable. However, when more complex expressions are used it can +get extremely confusing.<P> +<P> +The solution is a simple type casting mechanism. + +In reality all variables are automatically converted to all +3 types, and an internal flag just marks what type the variable +actually is. So, when I say:<P> + +<PRE> $a = 1;</PRE><P> +<P> +Internally in the symbol table I store 3 versions. +<P> +<P> +<PRE> Integer: 1 &lt;-- flag + Double : 1.0 + String : "1"</PRE><P> +<P> +The <EM>SetType()</EM> function can move this flag indicating the type of the variable. +<P> +<P> +<PRE> SetType($a,"double");</PRE><P> +<P> +This would force $a to be treated as a double from then on.<P> +<P> +The <EM>GetType()</EM> function returns the type. + +<TT>GetType($a)</TT> would return &quot;double&quot; in this case.<P> +<P> +Functions also exist to return the 3 various types without moving the type flag. +<P> +<P> +<PRE> IntVal($a) returns 1 + DoubleVal($a) returns 1.0 + StrVal($a) returns "1"</PRE><P> +<P> +This doesn't change the overloaded operator nature of the PHP variables, +but it does give you some tools to better deal with them. PHP is not +not a full-fledged Perl look-alike. It +has to be small and fast. Perl deals with the overloaded operator +pitfall by forcing something like the '+' operator to only +work on numbers. If you want to add strings, you must use the +'.' operator. Once you start having separate operators for each type +you start making the language much more complex. ie. you can't use +'==' for stings, you now would use 'eq'. I don't see the point, +especially for something like PHP where most of the scripts will +be rather simple and in most cases written by non-programmers who +want a language with a basic logical syntax that doesn't have too +high a learning curve.<P> +<HR> +<H3><A NAME="quiet">Suppressing Errors from function calls</A></H3> +<P> +It may be desirable in certain circumstances to ignore fatal +errors which may be reported by specific PHP functions. For example, +you may want to ignore errors from a dbmopen() call and simply +check the return value of the call without having error messages +appear on the web screen. This can be done by putting the &quot;@&quot; +character in front of the function call. ie.<P> +<P> +<PRE> $err_code = @dbmopen($filename,"w");</PRE><P> +<P> +The actual error message that would have been printed can be checked +by looking at the PHP internal variable, <STRONG>$phperrmsg</STRONG>.<P> +<P> +A more general approach to suppress error message printing is to use the +<A HREF="#seterrorreporting">SetErrorReporting()</A> function. With +this function error printing can be disabled for entire blocks of code +by preceding the block with a call like:<P> +<P> +<PRE> SetErrorReporting(0);</PRE><P> +<P> +This turns off all errors. They can then be re-enabled later with:<P> +<P> +<PRE> SetErrorReporting(1);</PRE><P> +<HR> +<H3><A NAME="funcs">Internal Functions</A></H3><A HREF="function"> </A> +<P> +PHP has a number of built-in functions. Functions are called in +the same manner as they are called in the C language. Some take +one or more arguments, and some return values which can then be +assigned to a variable or used as an argument to another function. +For example:<P> +<P> +<PRE> &lt;?$t=time()&gt;</PRE><P> +<P> +This assigns the return value of the <EM>time()</EM> function to the +<EM>t</EM> variable.<P> +<H3>Alphabetical List of Functions</H3> +<DL> + +<DT><A NAME="abs"><FONT SIZE="+1">Abs(arg)</FONT></A> +<DD> +<P>Abs returns the absolute value of arg.<P> + +<DT><A NAME="ada_close"><FONT SIZE="+1">Ada_Close(connection_id)</FONT></A> +<DD> +<P>Ada_Close will close down the connection to the Adabas server associated +with the given connection identifier.<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_connect"><FONT SIZE="+1">$connection = Ada_Connect(data source name, username, password)</FONT></A> +<DD> +<P>Ada_Connect opens a connection to a Adabas server. Each of the arguments +should be a quoted string. The first parameter (data source name) is a string +in the form "servername:databasename". The servername (but not the colon) can be omitted if you want to +access a local database. This function returns a connection_id. This identifier is needed by other +Adabas functions. You can have multiple connections open at once. This function +will return <STRONG>0</STRONG> on error. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_exec"><FONT SIZE="+1">$result = Ada_Exec(connection_id, query_string)</FONT></A> +<DD> +<P>Ada_Exec will send an SQL statement to the Adabas server specified by +the connection_id. The connection_id must be a valid identifier +that was returned by Ada_Connect or the special value <STRONG>0</STRONG>. +If connection_id is 0, ada_exec tries to establish or to use a connection +with the parameters given with the <A HREF="#directives">configuration directives</A> +<EM>phpAdaDefDB, phpAdaUser</EM> and <EM>phpAdaPW</EM>.<BR> +The return value of this function +is an identifier to be used to access the results by other Adabas functions. +This function will return <STRONG>0</STRONG> on error. It will return +<STRONG>1</STRONG> when the command executed correctly but is not expected to +return data (insert or update commands, for example). Note that selects which +return no data will still return a valid result greater than 1. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_fetchrow"><FONT SIZE="+1">Ada_FetchRow(result_id [,row_number])</FONT></A> +<DD> +<P>Ada_FetchRow fetches a row of the data that was returned by Ada_Exec. +After Ada_FetchRow is called, the fields of that row can be access with +Ada_Result. If no rownumber is given, Ada_FetchRow will try to fetch the next +row in the result set. Every time Ada_FetchRow is called a new row can be accessed by +Ada_Result. If Ada_FetchRow was succesful (there was a row), +<STRONG>1</STRONG> is returned, if there are no more rows, Ada_FetchRow will +return <STRONG>0</STRONG>. The return value of Ada_FetchRow can be used as +the condition of a while loop. Calls to Ada_FetchRow() with and without rownumber +can be mixed. To step through the result more than once, you can call Ada_FetchRow() +with rownumber 1 and then continue with Ada_FetchRow() without rownumber to review the +result. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_fieldname"><FONT SIZE="+1">Ada_FieldName(result_id, field_number)</FONT></A> +<DD> +<P>Ada_FieldName will return the name of the field occupying the given column +number in the given Adabas result identifier. Field numbering starts from 0. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_fieldnum"><FONT SIZE="+1">Ada_FieldNum(result_id, field_name)</FONT></A> +<DD> +<P>Ada_FieldNum will return the number of the column slot that corresponds to +the named field in the given Adabas result identifier. Field numbering starts at +0. This function will return <STRONG>-1</STRONG> on error. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_fieldtype"><FONT SIZE="+1">Ada_FieldType(result_id, field_name|field_number)</FONT></A> +<DD> +<P>Ada_FieldType will return the SQL type of the field referecend by name or number +in the given Adabas result identifier. Note: Field numbering starts from 0. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_freeresult"><FONT SIZE="+1">Ada_FreeResult(result_id)</FONT></A> +<DD> +<P>Ada_FreeResult only needs to be called if you are worried about using too +much memory while your script is running. All result memory will automatically +be freed when the script is finished. But, if you are sure you are not going to +need the result data anymore in a script, you may call Ada_FreeResult with +the result identifier as an argument and the associated result memory will be +freed. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_numfields"><FONT SIZE="+1">Ada_NumFields(result_id)</FONT></A> +<DD> +<P>Ada_NumFields will return the number of fields (columns) in a Adabas +result. The argument is a valid result identifier returned by Ada_Exec. +This function will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_numrows"><FONT SIZE="+1">Ada_NumRows(result_id)</FONT></A> +<DD> +<P>Ada_NumRows will return the number of rows in a Adabas result. The argument +is a valid result identifier returned by Ada_Exec. This function will return +<STRONG>-1</STRONG> on error. For INSERT, UPDATE, DELETE statements Ada_NumRows() +returns the number of rows affected. For a SELECT clause this is the number of +rows available. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_result"><FONT SIZE="+1">Ada_Result(result_id, field name | index)</FONT></A> +<DD> +<P>Ada_Result will return values from a result identifier produced by +Ada_Exec. The field name specify what cell in the row to return. Instead of +naming the field, you may use the field index as an unquoted number. Field +indices start from 0. If the requested field is of code type BYTE (binary) +or is longer than 4096 bytes, the contents is sent directly to the client. +Hint: [VAR]CHAR BYTE fields can be returned into a php variable by using +the HEX() db function; e. g. SELECT HEX(SYSKEY) SYSKEY FROM MYTABLE. +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="ada_resultall"><FONT SIZE="+1">Ada_ResultAll(result_id [,format])</FONT></A> +<DD> +<P>Ada_ResultAll will print all rows from a result identifier produced by +Ada_Exec. The result is printed in HTML table format. With the optional formatstring +additional overall table formatting can be done (e. g. bgcolor= will set background +color, &gt;caption&gt; &lt;/caption to set caption). Note: The contents of &quot;format&quot; will +be inserted into the HTML table tag like this &lt;table format &gt;... +<P> +This function is only available if Adabas support has been enabled in PHP.<P> + +<DT><A NAME="addslashes"><FONT SIZE="+1">AddSlashes(arg)</FONT></A> +<DD> +<P>Escapes any $ \ or ' (if MAGIC_QUOTES is set) with a backslash. See +also <a href="#stripslashes">StripSlashes()</a>.<P> + +<DT><A NAME="asort"><FONT SIZE="+1">ASort(array)</FONT></A> +<DD> +<P>Sort is used to sort a PHP associative array in ascending order. Use ARSort() +for descending order. Unlike the +<a href="#sort">Sort()</a> function, ASort() maintains index-value pairings. +It understands the three variable types and will sort alphabetically if the array +contains strings, and numerically if the array contains numbers. In +the case of an array which contains a mixture of types, the first type +in the array will specify the sort method. Note that if you are going to +sort a non-associative array, you should use the <a href="#sort">Sort()</a> +function.<P> + +<DT><A NAME="bindec"><FONT SIZE="+1">BinDec(binary_string)</FONT></A> +<DD> +<P>BinDec returns the decimal equivalent of the binary number +represented by the binary_string argument. +The largest number that can be converted is +31 bits long or 4294967295 in decimal. See also the +<A HREF="#decbin">DecBin()</A> function.<P> + +<DT><A NAME="ceil"><FONT SIZE="+1">Ceil(value)</FONT></A> +<DD> +<P>Ceil() rounds a floating point value up to the next integer. +The return value is of type double (floating point) such that +it can be used properly in complex equations. To get an integer +type back, use: <tt>$new = IntVal(Ceil($value));</tt><br> +See also <a href="#floor">Floor()</a>.<P> + +<DT><A NAME="chdir"><FONT SIZE="+1">ChDir(dir)</FONT></A> +<DD> +<P>ChDir changes the current working directory to the directory +specified in the argument.<P> + +<DT><A NAME="chgrp"><FONT SIZE="+1">ChGrp(file,group)</FONT></A> +<DD> +<P>ChGrp changes the group id of the specified file.<P> + +<DT><A NAME="chmod"><FONT SIZE="+1">ChMod(file,perms)</FONT></A> +<DD> +<P>ChMod changes the file permissions of the specified file. The +<EM>perms</EM> parameter must be specified in <a href="#octal">octal</a> +notation. eg. ChMod($filename,0755)<P> + +<DT><A NAME="chown"><FONT SIZE="+1">ChOwn(file,owner)</FONT></A> +<DD> +<P>ChOwn changes the specified file to be owned by the specified owner. Note +that this will only work if the PHP/FI binary is running as root (which is not +generally a good idea).<P> + +<DT><A NAME="chop"><FONT SIZE="+1">Chop(string)</FONT></A> +<DD> +<P>Chop removes all trailing whitespaces including new-lines, tabs and +spaces and returns the new string.<P> + +<DT><A NAME="chr"><FONT SIZE="+1">Chr(arg)</FONT></A> +<DD> +<P>Chr returns the ASCII character represented by the integer argument.<P> + +<DT><A NAME="clearstack"><FONT SIZE="+1">ClearStack()</FONT></A> +<DD> +<P>The ClearStack() function is a hack/workaround for a deficiency in the +PHP parser. This dificiency is that PHP only has a single expression stack. +When inside a user-defined function this expression stack is never cleared +because its contents may be needed within a complex expression in the +context from which the user-defined function was called. This means that +if you have a while loop with a lot of iterations inside a user-defined +function, you may be chewing up a lot of stack space. You may even be +hitting the max data space limit. You can put a call to ClearStack() inside +your while loop to prevent this memory consumption, but the trade-off is that +you cannot use your function within any sort of context. ie. you have to +assign the output of the function to a temporary variable and then use this +temporary variable in whatever context you need.<P> + +<DT><A NAME="clearstatcache"><FONT SIZE="+1">ClearStatCache()</FONT></A> +<DD> +<P>The stat() system call is normally an expensive operation on most +operating systems. In order to make sure that repeated calls to the +various File* functions like <a href="#fileperms">FilePerms()</a>, +<a href="#fileinode">FileInode()</a>, etc. the result of the last stat() +call is always cached. If one of the File* functions is called again +with the same argument, the cached stat() result will be used. In order +to force a new stat() system call this ClearStatCache() function may be +called to clear the cached stat() result.<P> + +<DT><A NAME="closedir"><FONT SIZE="+1">closeDir()</FONT></A> +<DD> +<P>closeDir closes a directory opened using the <A HREF="#opendir"> +openDir</A> function.<P> + +<DT><A NAME="closelog"><FONT SIZE="+1">CloseLog()</FONT></A> +<DD> +<P> +CloseLog() closes the descriptor Syslog() uses to write to the system +logger. See the closelog(3) UNIX man page for more details. See also <a +href="#syslog">Syslog()</a>, <a href="#openlog">OpenLog()</a> and <a +href="#initsyslog">InitSyslog()</a>. +<P> + +<DT><A NAME="cos"><FONT SIZE="+1">Cos(arg)</FONT></A> +<DD> +<P>Cos returns the cosine of arg in radians. See also <A HREF="#sin">Sin()</A> +and <A HREF="#tan">Tan()</A><P> + +<DT><A NAME="count"><FONT SIZE="+1">Count(array)</FONT></A> +<DD> +<P>Count returns the number of items in an array variable. If the +variable is not an array, the return value will be 1 (because a normal +variable is similar to an array with only one item). If the variable +is not defined, the return value will be 0.<P> + +<DT><A NAME="crypt"><FONT SIZE="+1">Crypt(string,[salt])</FONT></A> +<DD> +<P>Crypt will encrypt a string using the standard Unix DES +encryption method. Arguments are a string to be encrypted and an optional +two-character salt string to base the encryption on. See the Unix man page for +your crypt function for more information. If you do not have a crypt function +on your Unix system, you can use Michael Glad's public domain UFC-Crypt package +which was developed in Denmark and hence not restricted by US export laws as long +as you ftp it from an non-US site.<P> + +<DT><A NAME="date"><FONT SIZE="+1">Date(format,time)</FONT></A> +<DD> +<P>The Date function is used to display times and dates in various +ways. The function takes a format string and a time as arguments. If the +time argument is left off, the current time and date will be used. The time +argument is specified as an integer in number of seconds since the Unix +Epoch on Jan.1 1970. The format string is used to indicate which date/time +components should be displayed and how they should be formatted. The following +characters are recognized within the format string. Any unrecognized +character is printed verbosely:<P> + +<UL> + <LI><TT>Y - Year eg. 1995</TT> + <LI><TT>y - Year eg. 95</TT> + <LI><TT>M - Month eg. Oct</TT> + <LI><TT>m - Month eg. 10</TT> + <LI><TT>F - Month eg. October</TT> + <LI><TT>D - Day eg. Fri</TT> + <LI><TT>l - Day eg. Friday</TT> + <LI><TT>d - Day eg. 27</TT> + <LI><TT>z - Day of the year eg. 299</TT> + <LI><TT>H - Hours in 24 hour format eg. 13</TT> + <LI><TT>h - Hours in 12 hour format eg. 1</TT> + <LI><TT>i - Minutes eg. 5</TT> + <LI><TT>s - Seconds eg. 40</TT> + <LI><TT>U - Seconds since epoch eg. 814807830</TT> + <LI><TT>A - AM/PM</TT> + <LI><TT>a - am/pm</TT> +</UL><P> +See also the <a href="#mktime">MkTime()</a> function. +<P> + +<DT><A NAME="dblist"><FONT SIZE="+1">dbList()</FONT></A> +<DD> +<P>dbList outputs information about the db support compiled into PHP.<P> + +<DT><A NAME="dbmclose"><FONT SIZE="+1">dbmClose(filename)</FONT></A> +<DD> +<P>dbmClose simply closes the specified dbm file. It will also +unlock any lock files, so it is important to close any dbm files that +have been opened.<P> + +<DT><A NAME="dbmdelete"><FONT SIZE="+1">dbmDelete(filename,key)</FONT></A> +<DD> +<P>dbmDelete will delete the key/content pair specified by the given key argument.<P> + +<DT><A NAME="dbmexists"><FONT SIZE="+1">dbmExists(filename,key)</FONT></A> +<DD> +<P>dbmExists will return 1 if the key exists and 0 otherwise.<P> + +<DT><A NAME="dbmfetch"><FONT SIZE="+1">dbmFetch(filename,key)</FONT></A> +<DD> +<P>dbmFetch will return the content string associated with the given key.<P> + +<DT><A NAME="dbmfirstkey"><FONT SIZE="+1">dbmFirstKey(filename)</FONT></A> +<DD> +<P>dbmFirstKey returns the first key in the dbm file. Note that no particular +order is guaranteed since the order depends on hash table values calculated within the +dbm implementation. You may use the <A HREF="#sort">Sort</A> function to sort arrays of data +from the dbm file if necessary.<P> + +<DT><A NAME="dbminsert"><FONT SIZE="+1">dbmInsert(filename,key,content)</FONT></A> +<DD> +<P>dbmInsert inserts a new key/content data pair into a dbm file. If the +key already exists, the insert will fail.<P> + +<DT><A NAME="dbmnextkey"><FONT SIZE="+1">dbmNextKey(filename,key)</FONT></A> +<DD> +<P>dbmNextKey returns the next key after the specified key. By calling +<STRONG>dbmfirstkey()</STRONG> +followed by successive calls to <STRONG>dbmnextkey()</STRONG> it is possible to visit every +key/content +pair in the dbm file.<P> + +<DT><A NAME="dbmopen"><FONT SIZE="+1">dbmOpen(filename,mode)</FONT></A> +<DD> +<P>dbmOpen() opens a dbm file. The first argument is the full-path filename +of the dbm file to be opened and the second is the file open mode which is one +of <B>&quot;r&quot;</B>, <B>&quot;n&quot;</B> or <B>&quot;w&quot;</B> for +read, new (implies write) and write respectively. If ndbm support is used, ndbm +will actually create <EM>filename.dir</EM> and <EM>filename.pag</EM> files. gdbm +only uses one file, as does the internal flat ascii file support, and +Berkeley's libdb create a <EM>filename.db</EM> file. Note that +PHP does its own file locking in addition to any file locking that may be +done by the dbm library itself. PHP does not delete the <EM>.lck</EM> +files it creates. It uses these files simply as fixed inodes on which +to do the file locking. For more information on dbm files, see your +Unix man pages, or obtain GNU's gdbm from +<A HREF="ftp://prep.ai.mit.edu/pub/gnu">ftp://prep.ai.mit.edu/pub/gnu</A>.<P> + +<DT><A NAME="dbmreplace"><FONT SIZE="+1">dbmReplace(filename,key,content)</FONT></A> +<DD> +<P>dbmReplace is similar to the <STRONG>dbminsert()</STRONG> function, the only +difference being that if the key already exists, the old content string will +be replaced with the new.<P> + +<DT><A NAME="decbin"><FONT SIZE="+1">DecBin(number)</FONT></A> +<DD> +<P>DecBin returns a string containing a binary representation of the +given number argument. The largest number that can be converted is +31 bits long or 4294967295 in decimal. See also the +<A HREF="#bindec">BinDec()</A> function.<P> + +<DT><A NAME="dechex"><FONT SIZE="+1">DecHex(number)</FONT></A> +<DD> +<P>DecHex converts a decimal number to a hexadecimal string. See also +the <A HREF="#hexdec">HexDec()</A> function.<P> + +<DT><A NAME="decoct"><FONT SIZE="+1">DecOct(number)</FONT></A> +<DD> +<P>DecOct converts a decimal number to an octal number. See also +<A HREF="#octdec">OctDec()</A>.<P> + +<DT><A NAME="doubleval"><FONT SIZE="+1">doubleval(variable)</FONT></A> +<DD> +<P>doubleval returns the double (floating point) value of the variable. +See also the <A HREF="#strval">strval()</A> and <A HREF="#intval">intval()</A> +functions.<P> + +<DT><A NAME="echo"><FONT SIZE="+1">Echo [format_string] expression [, expression [,...]]</FONT></A> +<DD> +<P>Echo is not a function. ie. you do not put brackets around the +arguments to it. It is used to display results of +PHP functions or PHP variables. See the <a href="#escapes">Escape Character Section</a> for a list of special characters supported. +The format_string is +optional and if not present, no output formatting will be done. +The format string is similar to the format string of the C <EM>printf</EM> +function. See the man page for <EM>printf</EM> for more details. +Up to 5 expressions can be printed with a single echo command. If you try +to print more you will get a parser error. Note that the types of the +expressions are not relevant. The expressions are automagically converted to +the appropriate types as specified by the format string if one is present. +If you want to format something and assign +the formatted string to a variable instead of displaying it, use the +<A HREF="#sprintf">sprintf()</A> function.<P> +<P>The following conversions are supported,<P> +<BLOCKQUOTE> +<P> +<DL> +<DT>%d %i</DT> +<DD>Print a signed decimal number.</DD> +<DT>%o</DT> +<DD>Print an octal number.</DD> +<DT>%u</DT> +<DD>Print an unsigned decimal number.</DD> +<DT>%x %X</DT> +<DD>Print a hexadecimal number.</DD> +<DT>%f</DT> +<DD>Print a floating-point number.</DD> +<DT>%e %E</DT> +<DD>Print a floating-point number in scientific notation.</DD> +<DT>%g %G</DT> +<DD>Print a floating-point number in scientific notation or normal notation, +as appropriate.</DD> +<DT>%c</DT> +<DD>Print a single character.</DD> +<DT>%s</DT> +<DD>Print a string of characters.</DD> +<DT>%%</DT> +<DD>Print a literal percent-sign.</DD> +</DL> +<P> +The following flags are accepted. +<DL> +<DT>'-'</DT> +<DD>Left-justify the output within the field-width.</DD> +<DT>'+'</DT> +<DD>Ensure that all integers are signed (with a plus/minus sign).</DD> +<DT>' '</DT> +<DD>Similar to '+', but uses a space instead of a plus-sign.</DD> +<DT>'#'</DT> +<DD>Print prefixes in front of hex and octal numbers designating them as +such.</DD> +<DT>'''</DT> +<DD>Separate the digits into groups (usually comma-separated groups of +three).</DD> +<DT>'0'</DT> +<DD>Pad the field-width with zeros.</DD> +</DL> +<P> +All of these flags are dependent upon whether or not your C library's printf +function supports them (the ''', for example, is a GNU extension).<P> +<P> +Most conversions will accept a field width and a precision, as shown in +the <TT>demo_echo.html</TT> file in the directory /examples. It is not +necessary to specify any type modifiers, and, in fact, PHP will complain +if the type modifier does not make sense (which is almost always the +case). PHP will complain about (and refuse to accept) anything that it +does not recognize. Any extra arguments given that are not required +by the format-string are ignored.<P> +</BLOCKQUOTE> + +<DT><A NAME="end"><FONT SIZE="+1">End(variable)</FONT></A> +<DD> +<P>End moves the internal array pointer for the given variable to the +last item of the array and returns the value of this item. +This is useful for traversing an associative +array in reverse order. See also <A HREF="#reset">Reset()</A> and +<A HREF="#prev">Prev()</A>. The following example would traverse an +associative array in reverse order:<P> +<P> +<PRE> &lt;? + Reset($array); + $first_key = key($array); + End($array); + $k = key($array); + while($k != $first_key); + echo $array[$k]; + prev($array); + $k = key($array); + endwhile; + echo $array[$k]; + &gt;</PRE><P> + +<DT><A NAME="ereg"><FONT SIZE="+1">ereg(expr,arg[,regs])</FONT></A> +<DD> +<P>ereg returns non-zero if the regular expression is matched +in the argument string. For example, the condition, <TT>&lt;?if (ereg(&quot;^This.*&quot;, +&quot;This is an example string&quot;)&gt;</TT> would be true since the &quot;^This.*&quot; +expression says to match the word <STRONG>This</STRONG> at the beginning of the string and then +match any characters afterwards. If the <EM>regs</EM> argument is present, then match +registers are filled into positions 0-10 in the array named by the <EM>regs</EM> +argument. Register 0 will always contain the full matched string. +For more information on regular expressions, see +the <A HREF="#regexp">regular expression section</A> of this document.<P> + +<DT><A NAME="eregi"><FONT SIZE="+1">eregi(expr,arg[,regs])</FONT></A> +<DD> +<P>eregi is identical to the <a href="#ereg">ereg()</a> function except +for the fact that the regular expression is applied such that upper/lower +case is ignored.<P> + +<DT><A NAME="ereg_replace"><FONT SIZE="+1">ereg_replace(expr,replace,arg)</FONT></A> +<DD> +<P>ereg_Replace scans the entire argument string and replaces any portions +of the string matched by the given expression with the replacement string. For +example, in the string, <TT>&quot;This is an example string&quot;</TT> we could +very easily replace every space with a dash with the command: +<STRONG>ereg_replace(" ","-","This is an example string")</STRONG>.For more information on regular +expressions, see the <A HREF="#regexp">regular expression section</A> +of this document.<P> + +<DT><A NAME="eregi_replace"><FONT SIZE="+1">eregi_replace(expr,replace,arg)</FONT></A> +<DD> +<P>eregi_replace is identical to the <a href="#ereg_replace">ereg_replace()</a> +function except for the fact that the regular expression is applied such that +upper/lower case is ignored.<P> + +<DT><A NAME="escapeshellcmd"><FONT SIZE="+1">EscapeShellCmd(string)</FONT></A> +<DD><P>EscapeShellCmd escapes any characters in a string that might be used to +trick a shell command into executing arbitrary commands. This function should +be used to make sure that any data coming from user input is escaped before +this data is passed to the <A HREF="#exec">Exec()</A> or <A HREF="#system">System()</A> +functions. A standard use would be:<P> +<P> +<PRE> &lt;?system(EscapeShellCmd($cmd))&gt;</PRE><P> + +<DT><A NAME="eval"><FONT SIZE="+1">Eval(string)</FONT></A> +<DD> +<P>Eval takes the contents of the string argument and treats it like a mini +PHP/FI script. It will execute it as a separate PHP/FI script. Any variables +set or accessed from inside the eval will be from the global reference frame +in the current context of the eval statement in the script. Variable substitution +is done on the string arguments, so if variables are to be used in the string +expression they should be escaped. Some examples:<P> +<P> +<PRE> $a = "echo phpversion();"; + eval($a); + + eval("echo phpversion();"); + + eval("\$a=1; echo \$a;");</PRE><P> + +<DT><A NAME="exec"><FONT SIZE="+1">Exec(command_string [, array [,return_var]])</FONT></A> +<DD> +<P>Exec executes the given unix command, however it does not +output anything. It simply returns the last line from the result of the command. +If you need to execute a command and have all the data from the command passed +directly back without any interference, use the <a href="#passthru">PassThru()</a> +function. +If the array argument is present, then the specified array will be filled +with every line of output from the unix command starting at the end of the +array. Make sure you <a href="#unset">UnSet</a> the array before the call if +your array already contains elements and you want to start filling it at +array element 0. If the return_var argument is present along with the array +argument, then the return status of the executed unix command will be written to this +variable. Note that if you are going to allow data coming from user input to be +passed to this Exec function, then you should be using the +<A HREF="#escpapeshellcmd">EscapeShellCmd()</A> function +to make sure that users cannot trick the system into executing arbitrary commands. +See also the <A HREF="#system">system()</A> function.<P> + +<DT><A NAME="exit"><FONT SIZE="+1">Exit</FONT></A> +<DD> +<P>The Exit command is used to terminate parsing right away as soon +as this tag is parsed.<P> + +<DT><A NAME="exp"><FONT SIZE="+1">Exp(arg)</FONT></A> +<DD> +<P>Exp returns e raised to the power of arg. See also <a href="#pow">pow()</a><P> + +<DT><A NAME="fclose"><FONT SIZE="+1">fclose($fd)</FONT></A> +<DD> +<P>fclose() closes a file opened by <A HREF="#fopen">fopen()</A>. +The argument is a file pointer index as returned by the fopen() +call.<P> + +<DT><A NAME="feof"><FONT SIZE="+1">feof($fd)</FONT></A> +<DD> +<P>Feof returns true if the file referred to by the file pointer index +argument has hit end-of-file.<P> + +<DT><A NAME="fgets"><FONT SIZE="+1">fgets($fd,bytes)</FONT></A> +<DD> +<P>fgets() reads a line from a file opened by <A HREF="#fopen">fopen()</A>. +Arguments are a file pointer index as returned by fopen() and the max number of +bytes to read. Reading ends when max number of bytes have been read, +or on an end of line. This is similar to the C fgets() call. +See also <A HREF="#fputs">fputs()</A>.<P> + +<DT><A NAME="fgetss"><FONT SIZE="+1">fgetss($fd,bytes)</FONT></A> +<DD> +<P>Identical to the fgets() function, except this one tries to strip +off any HTML tags or PHP/FI script tags as it is reading the file.<P> + +<DT><A NAME="file"><FONT SIZE="+1">$array = File(filename)</FONT></A> +<DD> +<P>File reads the entire file and returns an array with each array element +containing a line of the file starting with array index <STRONG>0</STRONG>.<P> + +<DT><A NAME="fileatime"><FONT SIZE="+1">fileAtime(filename)</FONT></A> +<DD> +<P>fileAtime returns the time of last data access. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileAtime and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="filectime"><FONT SIZE="+1">fileCtime(filename)</FONT></A> +<DD> +<P>fileCtime returns the time of last status change. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileCtime and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="filegroup"><FONT SIZE="+1">fileGroup(filename)</FONT></A> +<DD> +<P>fileGroup returns the group id of the owner of the file. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileGroup and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="fileinode"><FONT SIZE="+1">fileInode(filename)</FONT></A> +<DD> +<P>fileInode returns the file's inode. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileInode and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="filemtime"><FONT SIZE="+1">fileMtime(filename)</FONT></A> +<DD> +<P>fileMtime returns the time of last data modification. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileMtime and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="fileowner"><FONT SIZE="+1">fileOwner(filename)</FONT></A> +<DD> +<P>fileOwner returns the uid of the owner of the file. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileOwner and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="fileperms"><FONT SIZE="+1">filePerms(filename)</FONT></A> +<DD> +<P>filePerms returns the permission bits of the file. This is the +<EM>st_mode</EM> field of the Unix C stat structure. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to filePerms and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="filesize"><FONT SIZE="+1">fileSize(filename)</FONT></A> +<DD> +<P>fileSize returns the size of the file in bytes. If the file does +not exist, or if it for some other reason could not be accessed, +this function returns -1. If repeated calls to fileSize and the rest +ofthe file* functions are to be made and the file being accessed might +change or disappear, the <a href="#clearstatcache">ClearStatCache()</a> +should be called before the call to the file* function.<P> + +<DT><A NAME="filetype"><FONT SIZE="+1">fileType(filename)</FONT></A> +<DD> +<P>fileType returns the type of the file. The return values are one of: +&quot;dir&quot;, &quot;file&quot;,&quot;fifo&quot;,&quot;char&quot;, +&quot;block&quot;, or &quot;link&quot;. These are for, directory, +regular file, fifo special, character special, block special and symbolic +link, respectively.<P> + +<DT><A NAME="floor"><FONT SIZE="+1">Floor(value)</FONT></A> +<DD> +<P>Floor() rounds a floating point value down to the previous integer. +The return value is of type double (floating point) such that +it can be used properly in complex equations. To get an integer +type back, use: <tt>$new = IntVal(Floor($value));</tt><br> +See also <a href="#ceil">Ceil()</a>.<P> + +<DT><A NAME="flush"><FONT SIZE="+1">Flush()</FONT></A> +<DD> +<P>The Flush() function is used to Flush the output buffer. For the Apache module, +it flushes Apache's output buffer, and for the CGI version it simply flushes stdout. +When running as a CGI under Apache, the server will buffer the CGI script's output, so +this Flush() function won't help much there. Look at running your script as an nph- script +if you are running the CGI version of PHP under the Apache web server. Or, alternatively, +run the Apache module version of PHP.<P> + +<DT><A NAME="fopen"><FONT SIZE="+1">$fp = fopen(filename,mode)</FONT></A> +<DD> +<P>fopen() opens a file and returns a file pointer index. If the file +could not be opened the function returns -1. It is +similar to the C fopen() call. The filename argument is the +relative or absolute path to the file to be opened, and the mode +argument is one of, "r", "r+", "w", "w+", "a", "a+". See the +Unix man page on the fopen() call for more information. See also +the <A HREF="#popen">popen()</A> function description. See also the + <A HREF="#fclose">fclose()</A> function description.<P> +<P>Example:<P> +<PRE> $fp = fopen("/home/rasmus/file.txt","r");</PRE> + +<DT><A NAME="fputs"><FONT SIZE="+1">fputs(fp,string)</FONT></A> +<DD> +<P>fputs() writes a line to a file opened by <A HREF="#fopen">fopen()</A>. +Arguments are a file pointer index as returned by fopen() and the string to +write. Note that the string argument may contain the special escape characters, +<STRONG>\n</STRONG>, <STRONG>\r</STRONG> and <STRONG>\t</STRONG> to output newlines, carriage returns +and tabs +respectively. See also <A HREF="#fgets">fgets()</A>.<P> + +<DT><A NAME="fpassthru"><FONT SIZE="+1">FPassThru(fp)</FONT></A> +<DD> +<P>FPassThru() outputs all remaining data on <I>fp</I> directly. It +is different from <A HREF="#readfile">ReadFile()</A> in that it can +also handle files opened with <A HREF="#fsockopen">fsockopen()</A>. +It differs from <A HREF="#passthru">PassThru()</A> in that it does not +handle commands, but opened files. FPassThru() returns the number of +bytes read and written.<P> + +<DT><A NAME="fseek"><FONT SIZE="+1">fseek(fp,pos)</FONT></A> +<DD> +<P>fseek() positions a file pointer identified by the +$fd argument which is the return value of the <A HREF="#fopen">fopen()</A> +call. The file pointer is positioned at the beginning of the file plus +the offset specified by the <STRONG>pos</STRONG> argument. See also +<A HREF="#ftell">ftell()</A> and <A HREF="#rewind">rewind()</A>.<P> + +<DT><A NAME="fsockopen"><FONT SIZE="+1">fp = fsockopen(hostname,port)</FONT></A> +<DD> +<P>fsockopen() opens a socket connection and returns a file +pointer index. This file pointer index can be used by +<A HREF="#fgets">fgets</A>, <A HREF="#fputs">fputs</A> and +<A HREF="#fclose">fclose</A>. Arguments are a hostname and a port number. +Return values are: -3 if the socket couldn't be created, -4 if the dns +lookup on the hostname failed, -5 if the connection was refused or it timed +out, -6 if the actual fdopen() call failed or -7 if the setvbuf() call failed. +If the port number is 0, then the hostname argument will be treated as a filename +of a Unix domain socket if your operating system support Unix domain sockets.<P> + +<DT><A NAME="ftell"><FONT SIZE="+1">pos = ftell(fp)</FONT></A> +<DD> +<P>ftell() returns the position of a file pointer identified by the +fp argument which is the return value of the <A HREF="#fopen">fopen()</A> +call. The position can later be used as an argument to fseek(). +See also <A HREF="#fseek">fseek()</A> and <A HREF="#rewind">rewind()</A>.<P> + +<DT><A NAME="getaccdir"><FONT SIZE="+1">getAccDir()</FONT></A> +<DD> +<P>getAccDir returns the directory where PHP access configuration files +are kept. The access configuration filenames come from the numerical user +id of the user whose access configurations they represent.<P> + +<DT><A NAME="getenv"><FONT SIZE="+1">GetEnv(string)</FONT></A> +<DD> +<P>GetEnv returns the value of the environment value specified by <EM>string</EM>. +Normally this function is not used because environment variables are available +to PHP/FI directly. If a reference is made to a variable which is not found in +the internal symbol table, then the environment space is automatically searched. +GetEnv should be used when it is necessary to ensure that an environment variable +has not been overwritten by normal PHP/FI variable. Security mechanisms that +rely on http server-defined variables like REMOTE_ADDR and REMOTE_HOST should load +these variables using GetEnv as opposed to referencing them directly as $REMOTE_ADDR +to avoid someone making up a fake form and posting the data to your server and +thereby bypassing whatever security mechanism you might have.<P> + +<DT><A NAME="gethostbyname"><FONT SIZE="+1">getHostByName(domain_name)</FONT></A> +<DD> +<P>getHostByName converts the given domain name into an IP address +in nnn.nnn.nnn.nnn format.<P> + +<DT><A NAME="gethostbyaddr"><FONT SIZE="+1">getHostByAddr(ip_address)</FONT></A> +<DD> +<P>getHostByAddr converts the given IP address in nnn.nnn.nnn.nnn +format into a fully qualified domain name.<P> + +<DT><A NAME="getimagesize"><FONT SIZE="+1">GetImageSize(filename)</FONT></A> +<DD> +<P>The GetImageSize() function takes either a full path filename, or a +relative path relative to the location of the calling script. It returns a +3 element array consisting of width, height and type. Width and height are +in pixels, and a type of 1 means GIF, a 2 indicates a JPG file and a 3 +indicates a PNG file. Other file types are not supported. The fourth element +in the returned array is a string containing, &quot;width=x height=y&quot; that +is suitable for using directly in an IMG tag. It is important to +note that the GD image library is not needed to use this function. An example +follows:</P> +<P><PRE> &lt;? + $result = GetImageSize("img/flag.jpg"); + &gt; + &lt;IMG SRC=&quot;img/flag.jpg&quot; ?echo $result[3]&gt; &gt;</PRE></P> + +<DT><A NAME="getlastaccess"><FONT SIZE="+1">getLastAccess()</FONT></A> +<DD> +<P>getLastAccess returns the date and time in unix time format of +the last time the current page was access. This value can be passed to +the <A HREF="#date">Date()</A> function for formatting. <BR>This function is +only available if PHP was compiled with Access Logging enabled.<P> + +<DT><A NAME="getlastbrowser"><FONT SIZE="+1">getLastbrowser()</FONT></A> +<DD> +<P>getLastBrowser returns the identification string of browser the +last user to access the current page used. <BR>This function is only +available if PHP was compiled with Access Logging enabled.<P> + +<DT><A NAME="getlastemail"><FONT SIZE="+1">getLastEmail()</FONT></A> +<DD> +<P>getLastEmail returns the E-Mail address of the last user to access the +current page. <BR>This function is only available if PHP was compiled +with Access Logging enabled.<P> + +<DT><A NAME="getlasthost"><FONT SIZE="+1">getLastHost()</FONT></A> +<DD> +<P>getLastHost returns the hostname of the last user to access the +current page. <BR>This function is only available if PHP was compiled +with Access Logging enabled.<P> + +<DT><A NAME="getlastmod"><FONT SIZE="+1">getLastMod()</FONT></A> +<DD> +<P>getLastMod returns the date and time in unix time format of +the last time the current page was modified. This value can be passed to +the <A HREF="#date">Date()</A> function for formatting. <BR>This function is +only available if PHP was compiled with Access Logging enabled.<P> + +<DT><A NAME="getlastref"><FONT SIZE="+1">getLastref()</FONT></A> +<DD> +<P>getLastRef returns the URL of the referring document of the +last user to access the current page. <BR>This function is only available if +PHP was compiled with Access Logging enabled.<P> + +<DT><A NAME="getlogdir"><FONT SIZE="+1">getLogDir()</FONT></A> +<DD> +<P>getLogDir returns the top-level directory under which PHP log +files can be found. The actual log files are in directories +under this directory. Each subdirectory is the numerical user id +of the user to whom the log files belong. Then within each directory +a series of dbm log files are found, each with the numerical inode +of the file they represent as the primary component of the filename.<P> + +<DT><A NAME="getmyinode"><FONT SIZE="+1">getMyInode()</FONT></A> +<DD> +<P>getMyInode returns the numerical inode of the current HTML file.<P> + +<DT><A NAME="getmypid"><FONT SIZE="+1">getMyPid()</FONT></A> +<DD> +<P>getMyPid() returns the current process id of the PHP parsing +process.<P> + +<DT><A NAME="getmyuid"><FONT SIZE="+1">getMyUid()</FONT></A> +<DD> +<P>getMyUid returns the numerical user id of the owner of the current +HTML file.<P> + +<DT><A NAME="getrandmax"><FONT SIZE="+1">getRandMax()</FONT></A> +<DD> +<P>getRandMax returns the maximum random number the <A HREF="#rand">Rand</A> +function will return. If the value returned does not seem to be accurate, +have a look in the php.h source file in the PHP distribution for more information.<P> + +<DT><A NAME="getstartlogging"><FONT SIZE="+1">getStartLogging()</FONT></A> +<DD> +<P>getStartLogging returns the time and date in Unix time format when +logging commenced on the current page. This is more accurate when mSQL-based +logging is used since a timestamp is kept in each log file. For dbm-logging +the time returned is the time the user's log directory was created.<P> + +<DT><A NAME="gettoday"><FONT SIZE="+1">getToday()</FONT></A> +<DD> +<P>getToday returns the total number of hits the current page has +had since 12 midnight local time. <BR>This function is only available if +PHP was compiled with Access Logging enabled.<P> + +<DT><A NAME="gettotal"><FONT SIZE="+1">getTotal()</FONT></A> +<DD> +<P>getTotal returns the total number of hits the current page has +had since access logging was started on the page. <BR>This function is +only available if PHP was compiled with Access Logging enabled.<P> + +<DT><A NAME="gettype"><FONT SIZE="+1">GetType(variable)</FONT></A> +<DD> +<P>GetType returns the type of the variable. The return value is a string +and it is one of, &quot;integer&quot;, &quot;double&quot; or &quot;string&quot;. +See also the <A HREF="#settype">SetType()</A> function<P> + +<DT><A NAME="gmdate"><FONT SIZE="+1">gmDate(format,time)</FONT></A> +<DD> +<P>gmDate is identical to the <A HREF="#date">Date</A> function +except for the fact that it uses Greenwich Mean Time instead of the current +local time.<P> + +<DT><A NAME="header"><FONT SIZE="+1">Header(header_string)</FONT></A> +<DD> +<P>The Header command is used at the top of an HTML file to send +raw HTTP header strings. See the +<A HREF="http://www.w3.org/Protocols/rfc2068/rfc2068"> +HTTP Specification</A> for more information on raw http headers. Remember that the +Header() command must be used before any actual output is sent either by normal +HTML tags or by PHP echo commands.<BR> +Usage examples can be found in the <A HREF="#http_auth">HTTP Authentication</A> +section.<P> + +<DT><A NAME="hexdec"><FONT SIZE="+1">HexDec(hex_string)</FONT></A> +<DD> +<P>HexDec converts a hexadecimal string to a decimal number. See also +the <A HREF="#dechex">DecHex()</A> function.<P> + +<DT><A NAME="htmlspecialchars"><FONT SIZE="+1">HtmlSpecialChars(string)</FONT></A> +<DD> +<P>HtmlSpecialChars converts any characters with ascii codes in the string +argument between 160 and 255 inclusive to their corresponding HTML Entity names. +The function returns the converted string. The <b>&lt;</b>, <b>&gt;</b>, +<b>&amp;</b> and <b>&quot;</b> are also converted.<P> + +<DT><A NAME="imagearc"><FONT SIZE="+1">ImageArc(im, cx, cy, w, h, s, e, col)</FONT></A> +<DD> +<P>ImageArc draws a partial ellipse centered at cx,cy (top left is 0,0) in the +image represented by <A HREF="#imagecreate">im</A>. +w and h specifies the ellipse's width and height respectively +while the start and end points are specified in degrees indicated by the s and e arguments. +<BR>This function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagechar"><FONT SIZE="+1">ImageChar(im, size, x, y, c, col)</FONT></A> +<DD> +<P>ImageChar draws the character c in the image identified by +<A HREF="#imagecreate">im</A> at coordinates x,y (top left is 0,0) in colour col. The +size argument can be 1, 2, 3, 4 or 5 indicating the size of the font to be used. 1 is +the smallest and 5 is the largest. <BR>This function is only available if GD support +has been enabled in PHP.<P> + +<DT><A NAME="imagecharup"><FONT SIZE="+1">ImageCharUp(im, size, x, y, c, col)</FONT></A> +<DD> +<P>ImageCharUp draws the character c vertically in the image identified by +<A HREF="#imagecreate">im</A> at coordinates x,y (top left is 0,0) in colour col. The +size argument can be 1, 2, 3, 4 or 5 indicating the size of the font to be used. 1 is +the smallest and 5 is the largest. <BR>This function is only available if GD support +has been enabled in PHP.<P> + +<DT><A NAME="imagecolorallocate"><FONT SIZE="+1">col = ImageColorAllocate(im, red, green, +blue)</FONT></A> +<DD> +<P>ImageColorAllocate returns a colour identifier representing the colour composed of the +given RGB components. The im argument is the return from the <A HREF="#imagecreate"> +ImageCreate</A> function. ImageColorAllocate must be called to create each colour that +is to be used in the image represented by im. <BR>This function is only available if +GD support has been enabled in PHP.<P> + +<DT><A NAME="imagecolortransparent"><FONT SIZE="+1">ImageColorTransparent(im, col)</FONT></A> +<DD> +<P>ImageColorTransparent sets the transparent colour in the im image to col. im is +the image identifier returned by <A HREF="#imagecreate">ImageCreate</A> and col is the +colour identifier returned by <A HREF="#imagecolorallocate">ImageColorAllocate</A>. This +function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagecopyresized"><FONT SIZE="+1">ImageCopyResized(dst_im, src_im, dstX, +dstY, srcX, srcY, dstW, dstH, srcW, srcH )</FONT></A> +<DD> +<P>ImageCopyResized copies a rectangular portion of one image to another image. +<EM>dst_im</EM> is the destination image, <EM>src_im</EM> is the source image identifier. +If the source and destination coordinates and width and heights differ, appropriate +stretching or shrinking of the image fragment will be performed. The coordinates +refer to the upper left corner. This function can be used to copy regions within the +same image (if <EM>dst_im</EM> is the same as <EM>src_im</EM>) but if the regions +overlap the results will be unpredictable. <BR>This function is only available if +GD support has been enabled in PHP.<P> + +<DT><A NAME="imagecreate"><FONT SIZE="+1">im = ImageCreate(x_size, y_size)</FONT></A> +<DD> +<P>ImageCreate returns an image identifier representing a blank image of size +x_size by y_size. <BR>This function is only available if GD support has been +enabled in PHP.<P> + +<DT><A NAME="imagecreatefromgif"><FONT SIZE="+1">im = ImageCreateFromGif(filename)</FONT></A> +<DD> +<P>ImageCreateFromGif returns an image identifier representing the image obtained +from the given <EM>filename</EM>. <BR>This function is only available if GD support +has been enabled in PHP.<P> + +<DT><A NAME="imagedestroy"><FONT SIZE="+1">ImageDestroy(im)</FONT></A> +<DD> +<P>ImageDestroy frees any memory associated with image im. im is the image +identifier returned by the <A HREF="#imagecreate">ImageCreate</A> function. This +function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagefill"><FONT SIZE="+1">ImageFill(im, x, y, col)</FONT></A> +<DD> +<P>ImageFill performs a flood fill starting at coordinate x,y (top left is 0,0) with +colour col in image im. <BR>This function is only available if GD support has been +enabled in PHP.<P> + +<DT><A NAME="imagefilledpolygon"><FONT SIZE="+1">ImageFilledPolygon(im, points, num_points, +col)</FONT></A> +<DD> +<P>ImageFilledPolygon creates a filled polygon in image +<A HREF="#imagecreate">im</A>. points is a +PHP array containing the polygon's vertices. ie. points[0] = x0, points[1] = y0, points[2] = +x1, points[3] = y1, etc. num_points is the total number of vertices. <BR>This function is +only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagefilledrectangle"><FONT SIZE="+1">ImageFilledRectangle(im, x1, y1, x2, y2, +col)</FONT></A> +<DD> +<P>ImageFilledRectangle creates a filled rectangle of colour col in image im starting at upper left +coordinate x1,y1 and ending at bottom right coordinate x2,y2. 0,0 is the top left +corner of the image. <BR>This function is only available if GD support has been +enabled in PHP.<P> + +<DT><A NAME="imagefilltoborder"><FONT SIZE="+1">ImageFillToBorder(im, x, y, border, col)</FONT></A> +<DD> +<P>ImageFillToBorder performs a flood fill whose border colour is defined by border. The +starting point for the fill is x,y (top left is 0,0) and the region is filled with colour +col. <BR>This function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagegif"><FONT SIZE="+1">ImageGif(im [,filename])</FONT></A> +<DD> +<P>ImageGif creates the GIF file in filename from the image im. The im argument is +the return from the <A HREF="#imagecreate">ImageCreate</A> function. The filename +argument is optional, and if left off, the raw image stream will be returned directly. +By sending an <em>image/gif</em> content-type using the <a href="#header">Header()</a> +function, you can create a PHP/FI script which returns GIF images directly using this +function. <BR>This function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imageinterlace"><FONT SIZE="+1">ImageInterlace(im, interlace)</FONT></A> +<DD> +<P>ImageInterlace turns the interlace bit on or off. If interlace is 1 the im image +will be interlaced, and if interlace is 0 the interlace bit is turned off. This functions +is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imageline"><FONT SIZE="+1">ImageLine(im, x1, y1, x2, y2, col)</FONT></A> +<DD> +<P>ImageLine draws a line from x1,y1 to x2,y2 (top left is 0,0) in image +<A HREF="#imagecreate">im</A> of colour <A HREF="#imagecolorallocate">col</A>. +<BR>This function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagepolygon"><FONT SIZE="+1">ImagePolygon(im, points, num_points, col)</FONT></A> +<DD> +<P>ImagePolygon creates a polygon in image <A HREF="#imagecreate">im</A>. points is a +PHP array containing the polygon's vertices. ie. points[0] = x0, points[1] = y0, points[2] = +x1, points[3] = y1, etc. num_points is the total number of vertices. <BR>This function is +only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagerectangle"><FONT SIZE="+1">ImageRectangle(im, x1, y1, x2, y2, col)</FONT></A> +<DD> +<P>ImageRectangle creates a rectangle of colour col in image im starting at upper left coordinate +x1,y1 and ending at bottom right coordinate x2,y2. 0,0 is the top left +corner of the image. <BR>This function is only available if GD support has been +enabled in PHP.<P> + +<DT><A NAME="imagesetpixel"><FONT SIZE="+1">ImageSetPixel(im, x, y, col)</FONT></A> +<DD> +<P>ImageSetPixel draws a pixel at x,y (top left is 0,0) in image +<A HREF="#imagecreate">im</A> of colour <A HREF="#imagecolorallocate">col</A>. +<BR>This function is only available if GD support has been enabled in PHP.<P> + +<DT><A NAME="imagestring"><FONT SIZE="+1">ImageString(im, size, x, y, s, col)</FONT></A> +<DD> +<P>ImageString draws the string s in the image identified by +<A HREF="#imagecreate">im</A> at coordinates x,y (top left is 0,0) in colour col. The +size argument can be 1, 2, 3, 4 or 5 indicating the size of the font to be used. 1 is +the smallest and 5 is the largest. <BR>This function is only available if GD support +has been enabled in PHP.<P> + +<DT><A NAME="imagestringup"><FONT SIZE="+1">ImageStringUp(im, size, x, y, s, col)</FONT></A> +<DD> +<P>ImageStringUp draws the string s vertically in the image identified by +<A HREF="#imagecreate">im</A> at coordinates x,y (top left is 0,0) in colour col. The +size argument can be 1, 2, 3, 4 or 5 indicating the size of the font to be used. 1 is +the smallest and 5 is the largest. <BR>This function is only available if GD support +has been enabled in PHP.<P> + +<DT><A NAME="imagesx"><FONT SIZE="+1">ImageSX(im)</FONT></A> +<DD> +<P>ImageSX returns the width of the image identified by <em>im</em>.<P> + +<DT><A NAME="imagesy"><FONT SIZE="+1">ImageSY(im)</FONT></A> +<DD> +<P>ImageSY returns the height of the image identified by <em>im</em>.<P> + +<DT><A NAME="include"><FONT SIZE="+1">Include(filename)</FONT></A> +<DD> +<P>The Include command can be used to insert other files into the current +html file. This is extremely handy for headers and footers which may need +to be included in hundreds of HTML files. By using an include command you then +only need to modify the header or footer file in one place when it needs to be +changed. Since full PHP parsing is done on the included file, you can also +use the include command to include common PHP scripts you may have +written. Sort of like having a primitive shared library of scripts +you can call from your HTML file. You can place such common library +files in one directory and set PHP's include path and not have to +refer to the files with pathnames. For Apache module users this can be +configured with the <STRONG>phpIncludePath</STRONG> directive, for CGI +users with the PHP_INCLUDE_PATH environment variable. This path is +colon-separated just like <CODE>$PATH</CODE> is in your UNIX shell. +eg.<PRE> &lt;?include(&quot;/path/filename.txt&quot;)&gt;</PRE> +<P> + +<DT><A NAME="initsyslog"><FONT SIZE="+1">InitSyslog()</FONT></A> +<DD> +<P> +InitSyslog() defines some PHP variables that you need when using +OpenLog() and Syslog(). These variables are not defined by default +for efficiency reasons. The variables are named in the same way as in +the &lt;syslog.h&gt; C include file (such as $LOG_LOCAL0). See your +syslog(3) UNIX manual page for more details. See also <a +href="#initsyslog">InitSyslog()</a>, <a href="#syslog">Syslog()</a> +and <a href="#closelog">CloseLog()</a>. +<P> + +<DT><A NAME="intval"><FONT SIZE="+1">intval(variable)</FONT></A> +<DD> +<P>intval returns the long integer value of the variable. See also +the <A HREF="#strval">strval()</A> and <A HREF="#doubleval">doubleval()</A> +functions.<P> + +<DT><A NAME="isset"><FONT SIZE="+1">IsSet(variable)</FONT></A> +<DD> +<P>The IsSet function returns 1 if the given variable is defined, +and 0 if it isn't.<P> + +<DT><A NAME="key"><FONT SIZE="+1">Key(variable)</FONT></A> +<DD> +<P>Key returns the key of the current array item. The current item is +determined by the position of the array pointer for the given variable. +This array pointer may be manipulated with the <A HREF="#reset">Reset()</A>, +<A HREF="#end">End()</A>, <A HREF="#next">Next()</A>, and <A HREF="#prev">Prev()</A> +functions. This function is mainly used for determining the key value for +an item in an associative array, although it will work for normal array as well.<P> + +<DT><A NAME="link"><FONT SIZE="+1">Link(target,link)</FONT></A> +<DD> +<P>Link() creates a hard link. See the <a href="#symlink">Symlink()</a> +function for creating symbolic links (soft) links. See also <a href="#readlink"> +ReadLink</A> and <A HREF="#LinkInfo">LinkInfo</A> functions.<P> + +<DT><A NAME="linkinfo"><FONT SIZE="+1">LinkInfo(path)</FONT></A> +<DD> +<P>LinkInfo returns the st_dev field of the UNIX C +stat structure returned by the lstat system call. This +function is used to verify if a link (pointed to by path) really exists +(using the same method as the S_ISLNK macro defined in stat.h). +Returns -1 in case of error.<P> + +<DT><A NAME="log"><FONT SIZE="+1">Log(arg)</FONT></A> +<DD> +<P>Log returns the natural logarithm of arg.<P> + +<DT><A NAME="log10"><FONT SIZE="+1">Log10(arg)</FONT></A> +<DD> +<P>Log10 returns the base-10 logarithm of arg.<P> + +<DT><A NAME="logas"><FONT SIZE="+1">LogAs(filename)</FONT></A> +<DD> +<P>The LogAs() function will treat the hit on the current page as if it +as actually received on the argument filename.<P> + +<DT><A NAME="mail"><FONT SIZE="+1">Mail(to,subject,message[,headers])</FONT></A> +<DD> +<P>Mail automatically mails the message specified in the message argument +to the receiver specified in the to argument. Multiple recipients can +be specified by spaces between them in the to argument.<P> +eg. <PRE> mail(&quot;rasmus@lerdorf.on.ca&quot;, + &quot;My Subject&quot;, + &quot;Line 1\nLine 2\nLine 3&quot;);</PRE> + +If a fourth string argument is passed, this string is inserted at the +end of the header, example: <PRE> + mail(&quot;ssb@guardian.no&quot;, &quot;the subject&quot;, $message, + &quot;X-Mailer: PHP/FI &quot; + phpversion()); +</PRE> + +<DT><A NAME="max"><FONT SIZE="+1">Max(array)</FONT></A> +<DD> +<P>Max returns the maximum value of a PHP array. ie. it will search through +the entire array looking for the max element. If it is an array of strings, +the returned string is the string which would be alphabetically last in the +array if it were sorted.<P> + +<DT><A NAME="md5"><FONT SIZE="+1">Md5(message)</FONT></A> +<DD> +<P>Md5 returns the MD5 hash of a string value.<P> + +<DT><A NAME="mi_close"><FONT SIZE="+1">mi_Close(connection_id)</FONT></A> +<DD> +<P>mi_Close will close down the connection to an Illustra database +associated with the given connection identifier.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_connect"><FONT SIZE="+1">$connection = mi_Connect(database, username, password)</FONT></A> +<DD> +<P>mi_Connect opens a connection to an Illustra database. Each +of the arguments should be a quoted string. +This function returns a connection_id. This identifier is needed by other +Illustra functions. You can have multiple connections open at once. +The host to connect to is governed by the MI_PARAMS file on the machine +running the PHP executable. No support as yet for remote invocation +This function will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_dbname"><FONT SIZE="+1">mi_DBname(connection_id)</FONT></A> +<DD> +<P>mi_DBname will return the name of the database that the given +Illustra connection identifier is connected to.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_exec"><FONT SIZE="+1">$result = mi_Exec(connection_id, query_string)</FONT></A> +<DD> +<P>mi_Exec will send an SQL statement to the Illustra database specified by +the connection_id. The connection_id must be a valid identifier +that was returned by mi_Connect. The return value of this function +is an identifier to be used to access the results from other +Illustra functions. This function will return <STRONG>-1</STRONG> on error. + +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_fieldname"><FONT SIZE="+1">mi_FieldName(connection_id, result_id, field_number)</FONT></A> +<DD> +<P>mi_FieldName will return the name of the field occupying the +given column number with the given Illustra result and connection identifiers. +Field numbering starts from 0.<P>This function will return <STRONG>-1</STRONG> +on error.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_fieldnum"><FONT SIZE="+1">mi_FieldNum(connection_id, result_id, field_name)</FONT></A> +<DD> +<P>mi_FieldNum will return the number of the column slot that +corresponds to the named field in the given Illustra result identifier. Field +numbering starts at 0. This function +will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_numfields"><FONT SIZE="+1">mi_NumFields(connection_id, result_id)</FONT></A> +<DD> +<P>mi_NumFields will return the number of fields (columns) in +an Illustra result. The argument is a valid result identifier returned +by mi_Exec. This function will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_numrows"><FONT SIZE="+1">mi_NumRows(connection_id, result_id)</FONT></A> +<DD> +<P>mi_NumRows will return the number of rows in an Illustra result. The argument +is a valid result identifier returned by mi_Exec. This function will return +<STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + +<DT><A NAME="mi_result"><FONT SIZE="+1">mi_Result(connection_id, result_id, row_number, field name/index)</FONT></A> +<DD> +<P>mi_Result will return values from a result identifier +produced by mi_Exec. The row_number and field name specify what +cell in the table of results to return. Row numbering starts from +0. Instead of naming the field, you may use the field index as +an unquoted number. Field indices start from 0.<P> +<P> +All values returned from the database are in String form, since no type-detection +is available at the present. +<P> +This function is only available if Illustra support has been enabled in PHP.<P> + + +<DT><A NAME="microtime"><FONT SIZE="+1">Microtime()</FONT></A> +<DD> +<P>Microtime() returns a string "msec sec" where sec is number of seconds +since 00:00 GMT, Jan 1, 1970, and msec is the microseconds part (as fraction of +seconds). Ex "0.87633900 825010464". <BR>This function is only available on +operating systems that support the gettimeofday() system call.<P> + +<DT><A NAME="min"><FONT SIZE="+1">Min(array)</FONT></A> +<DD> +<P>Min returns the minimum value of a PHP array. ie. it will search through +the entire array looking for the min element. If it is an array of strings, +the returned string is the string which would be alphabetically first in the +array if it were sorted.<P> + +<DT><A NAME="mkdir"><FONT SIZE="+1">MkDir(dir,mode)</FONT></A> +<DD> +<P>MkDir creates a directory. The <EM>mode</EM> parameter must be +given in <a href="#octal">octal</a> notation. eg. MkDir("DirName",0755);<P> + +<DT><A NAME="mktime"><FONT SIZE="+1">MkTime(hour,min,sec,mon,day,year)</FONT></A> +<DD> +<P>MkTime returns a time in Unix timestamp (long integer) format which +corresponds to the date and time specified by the arguments. Arguments may be +left out in which case the given component is set to the current value +according to the current local time and date. These left out arguments may only +be left out from right to left. ie. <TT>MkTime(hour,min,sec)</TT> is valid, +but <TT>MkTime(mon,day,year)</TT> is not valid. Note that this function can +be very handy as a tool for doing both date arithmetic and date validation. +You can feed it invalid parameters, such as a month greater than 12, or a day +greater than 31 and it will figure out the right date anyway. It will also +generate an error message if any of the parameters are outside the normal +values. Use the <a href="#seterrorreporting">SetErrorReporting(0)</a> +function to turn this error reporting off before calling the function and you +may then check the $phperrmsg for any errors that may have occurred.<P> +eg.<PRE> SetErrorReporting(0); + $a = MkTime(0,0,0,13,1,1997); + SetErrorReporting(1); + echo $phperrmsg;</PRE> + +<DT><A NAME="msql"><FONT SIZE="+1">$result = msql($database,$query)</FONT></A> +<DD> +<P>msql sends an mSQL query. Arguments are the database name and the query +string. ie. <STRONG><TT>&lt;?msql(&quot;MyDatabase&quot; , &quot;select * from +table&quot;)&gt;</TT></STRONG>. +The return value from this function is a result identifier to be used to access the results +from the other msql_ functions. A result identifier is a positive integer. The function +returns <STRONG>0</STRONG> when no result identifier is created. This is the case with +any queries that do not return anything, such as <EM>create</EM>, <EM>update</EM>, +<EM>drop</EM>, <EM>insert</EM> and +<EM>delete</EM>. The function will return <STRONG>-1</STRONG> if an error occurs. A string +describing the error will be placed in $phperrmsg, and unless the function was called +as <STRONG>@msql()</STRONG> then this error string will also be printed out. +For mSQL 2.0, the $result variable will contain the number of rows affected by +the SQL command performed. If you want your application to be portable to mSQL 1.0, +do not rely on this. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_close"><FONT SIZE="+1">msql_close()</FONT></A> +<DD> +<P>msql_Close closes the socket connection to the msql daemon, if an open +connection exists. Note, since only one concurrent mSQL session can be open +at any one time, this function does not take an argument.<P> + +<DT><A NAME="msql_connect"><FONT SIZE="+1">msql_connect($hostname)</FONT></A> +<DD> +<P>msql_Connect specifies the host name or IP on which the mSQL database +engine resides. This is equivalent to the msqlConnect() function in the mSQL C +API. The one difference between this function and the C API equivalent is that +if the function isn't called, a connection to the local host is made by default +on the first call to the msql() function. And, there is no need for an msql_close +function since only one connection may be active at any one time. If a second call +to msql_connect() is made in a file, then the connection to the first host is +automatically closed. To explicitly connect to the msql daemon on the local host, use: +<STRONG><TT>&lt;?msql_connect(&quot;localhost&quot;)&gt;</TT></STRONG><BR>This function is only +available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_createdb"><FONT SIZE="+1">msql_CreateDB($database)</FONT></A> +<DD> +<P>msql_CreateDB creates the given database. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_dbname"><FONT SIZE="+1">msql_dbName($result,$i)</FONT></A> +<DD> +<P>msql_dbName returns the database name stored in position <EM>$i</EM> of +the result pointer returned from the <A HREF="#msql_listdbs">msql_ListDbs()</A> +function. The <A HREF="#msql_numrows">msql_NumRows()</A> function can +be used to determine how many database names are available. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_dropdb"><FONT SIZE="+1">msql_DropDB($database)</FONT></A> +<DD> +<P>msql_DropDB deletes the given mSQL database. Use this with caution +as all data in the database will be lost. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_fieldflags"><FONT SIZE="+1">msql_FieldFlags($result,$i)</FONT></A> +<DD> +<P>msql_FieldFlags returns the field flags of the specified field. +Currently this is either, "not null", "primary key", a combination +of the two or "" (an empty string). +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_fieldlen"><FONT SIZE="+1">msql_FieldLen($result,$i)</FONT></A> +<DD> +<P>msql_FieldLen returns the length of the specified field. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_fieldname"><FONT SIZE="+1">msql_FieldName($result,$i)</FONT></A> +<DD> +<P>msql_FieldName returns the name of the specified field. Arguments to the +function is the result identifier and the field index. ie. <TT>msql_FieldName($result,2);</TT> +will return the name of the second field in the result associated with the result +identifier. <BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_fieldtype"><FONT SIZE="+1">msql_FieldType($result,$i)</FONT></A> +<DD> +<P>msql_FieldType is similar to the msql_FieldName() function. The arguments are +identical, but the field type is returned. This will be one of "int", "char" or "real". +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_freeresult"><FONT SIZE="+1">msql_FreeResult($result)</FONT></A> +<DD> +<P>msql_FreeResult only needs to be called if you are worried about using +too much memory while your script is running. All result memory will automatically +be freed when the script is finished. But, if you are sure you are not going to +need the result data anymore in a script, you may call msql_freeresult with the +result identifier as an argument and the associated result memory will be freed. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_listdbs"><FONT SIZE="+1">$result = msql_ListDBs()</FONT></A> +<DD> +<P>msql_ListDBs will return a result pointer containing the databases +available from the current mSQL daemon. Use the <A HREF="#msql_dbname"> +msql_dbName()</A> function to traverse this result pointer. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_listfields"><FONT SIZE="+1">$result = msql_Listfields($database,$tablename)</FONT></A> +<DD> +<P>msql_listfields retrieves information about the the given tablename. +Arguments are the database name and the table name. +A result pointer is returned which can be used with msql_fieldflags, +msql_fieldlen, msql_fieldname, msql_fieldtype. A result identifier is a +positive integer. The function returns -1 if a error occurs. A string +describing the error will be placed in $phperrmsg, and unless the function +was called as @msql() then this error string will also be printed out. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_listtables"><FONT SIZE="+1">$result = msql_ListTables($database)</FONT></A> +<DD> +<P>msql_ListTables takes a database name and result pointer much like the +<A HREF="#msql">msql()</A> function. The <A HREF="#msql_tablename">msql_TableName()</A> +function should be used to extract the actual table names from the result pointer. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_numfields"><FONT SIZE="+1">msql_NumFields($result)</FONT></A> +<DD> +<P>msql_NumFields returns the number of fields in a result. The argument is +the result identifier returned by the msql() function. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_numrows"><FONT SIZE="+1">msql_NumRows($result)</FONT></A> +<DD> +<P>msql_NumRows simply returns the number of rows in a result. The argument +is the result identifier returned by the msql() function. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_regcase"><FONT SIZE="+1">msql_RegCase(string)</FONT></A> +<DD> +<P>msql_RegCase takes a string argument and converts it to the regular +expression needed to send to mSQL in order to get a case insensitive +match. This turns a string like &quot;abc&quot into &quot;[Aa][Bb][Cc]&quot;. +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_result"><FONT SIZE="+1">msql_Result($result,$i,field)</FONT></A> +<DD> +<P>msql_Result displays a field from a returned record. Arguments are the result +identifier returned by the msql() function, an integer which is the index of the record +to be viewed and a field name. The field argument supports the &quot;table.field&quot; +syntax for handling results from a join. This function is perhaps best illustrated with +a complete example:<P> +<P> +<PRE> + &lt;? + $name = &quot;bob&quot;; + $result = msql($database,&quot;select * from table where firstname='$name'&quot;); + $num = msql_numrows($result); + echo &quot;$num records found!&lt;p&gt;&quot;; + $i=0; + while($i<$num); + echo msql_result($result,$i,&quot;fullname&quot;); + echo &quot;&lt;br&gt;&quot;; + echo msql_result($result,$i,&quot;address&quot;); + echo &quot;&lt;br&gt;&quot;; + $i++; + endwhile; + &gt;</PRE><P> +<P> +The above script connects to the mSQL engine on the local machine, sets the <EM>name</EM> +variable to <EM>bob</EM> and sends a query which asks for all the fields from a +table where the <EM>firstname</EM> field is set to <EM>bob</EM>. It then displays the +number of records it found after which it loops through each of the found +records and displays the <EM>fullname</EM> and <EM>address</EM> fields for each record. +As you can see, it would be trivial to add HTML markup tags around the printed +fields to format the results in a table or in whatever manner is desired. Note +that there is no msql_connect() call. msql_connect need only be called if a connection +to a remote database is desired.<P> +<P> +This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="msql_tablename"><FONT SIZE="+1">msql_TableName($result,$i)</FONT></A> +<DD> +<P>msql_TableName takes a result pointer returned by the <A HREF="#msql_listtables"> +msql_ListTables()</A> function as well as an integer index and returns the name of +a table. The <A HREF="#msql_numrows">msql_NumRows()</A> function may be used to +determine the number of tables in the result pointer. An example would be:<P> +<P> +<PRE> + &lt;? + $result = msql_listtables(&quot;dbname&quot;); + $i=0; + while($i < msql_numrows($result)); + $tb_names[$i]=msql_tablename($result, $i); + echo $tb_names[$i]; + echo "&lt;BR&gt;"; + $i++; + endwhile; + &gt;</PRE> +<BR>This function is only available if mSQL support has been enabled in PHP.<P> + +<DT><A NAME="mysql"><FONT SIZE="+1">$result = mysql($database,$query)</FONT></A> +<DD> +<P>mysql sends a mysql query. Arguments are the database name and the query +string. ie. <STRONG><TT>&lt;?mysql(&quot;MyDatabase&quot; , &quot;select * from +table&quot;)&gt;</TT></STRONG>. +The return value from this function is a result identifier to be used to access the results +from the other mysql_ functions. A result identifier is a positive integer. The function +returns <STRONG>0</STRONG> when no result identifier is created. This is the case with +any queries that do not return anything, such as <EM>create</EM>, <EM>update</EM>, +<EM>drop</EM>, <EM>insert</EM> and +<EM>delete</EM>. The function will return <STRONG>-1</STRONG> if an error occurs. A string +describing the error will be placed in $phperrmsg, and unless the function was called +as <STRONG>@mysql()</STRONG> then this error string will also be printed out. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_affected_rows"><FONT SIZE="+1">mysql_affected_rows()</FONT></A> +<DD> +<P>mysql_affected_rows() returns number of rows affected by the last INSERT, UPDATE +or DELETE query.<P> + +<DT><A NAME="mysql_close"><FONT SIZE="+1">mysql_close()</FONT></A> +<DD> +<P>mysql_Close closes the socket connection to the mysql daemon, if an open +connection exists.<P> + +<DT><A NAME="mysql_connect"><FONT SIZE="+1">mysql_connect($hostname [,username [,password]])</FONT></A> +<DD> +<P>mysql_Connect specifies the host name or IP on which the mysql database +engine resides. This is equivalent to the mysqlConnect() function in the mysql C +API. The one difference between this function and the C API equivalent is that +if the function isn't called, a connection to the local host is made by default +on the first call to the mysql() function. And, there is no need for an mysql_close +function since only one connection may be active at any one time. If a second call +to mysql_connect() is made in a file, then the connection to the first host is +automatically closed.<P> +An optional username and password may be provided. Note that when PHP is compiled to run in <a href="#safemode">SAFE MODE</a> then the username must either +be the same as the owner of the file being processed, or the owner of the httpd +process (usually nobody). Any other username will fail.<P> +To explicitly connect to the mysql daemon on the local host, use: +<STRONG><TT>&lt;?mysql_connect(&quot;localhost&quot;)&gt;</TT></STRONG><BR>This function is only +available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_createdb"><FONT SIZE="+1">mysql_CreateDB($database)</FONT></A> +<DD> +<P>mysql_CreateDB creates the given database. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_dbname"><FONT SIZE="+1">mysql_dbName($result,$i)</FONT></A> +<DD> +<P>mysql_dbName returns the database name stored in position <EM>$i</EM> of +the result pointer returned from the <A HREF="#mysql_listdbs">mysql_ListDbs()</A> +function. The <A HREF="#mysql_numrows">mysql_NumRows()</A> function can +be used to determine how many database names are available. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_dropdb"><FONT SIZE="+1">mysql_DropDB($database)</FONT></A> +<DD> +<P>mysql_DropDB deletes the given mysql database. Use this with caution +as all data in the database will be lost. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_fieldflags"><FONT SIZE="+1">mysql_FieldFlags($result,$i)</FONT></A> +<DD> +<P>mysql_FieldFlags returns the field flags of the specified field. +Currently this is either, "not null", "primary key", a combination +of the two or "" (an empty string). +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_fieldlen"><FONT SIZE="+1">mysql_FieldLen($result,$i)</FONT></A> +<DD> +<P>mysql_FieldLen returns the length of the specified field. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_fieldname"><FONT SIZE="+1">mysql_FieldName($result,$i)</FONT></A> +<DD> +<P>mysql_FieldName returns the name of the specified field. Arguments to the +function is the result identifier and the field index. ie. <TT>mysql_FieldName($result,2);</TT> +will return the name of the second field in the result associated with the result +identifier. <BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_fieldtype"><FONT SIZE="+1">mysql_FieldType($result,$i)</FONT></A> +<DD> +<P>mysql_FieldType is similar to the mysql_FieldName() function. The arguments are +identical, but the field type is returned. This will be one of "int", "char" or "real". +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_freeresult"><FONT SIZE="+1">mysql_FreeResult($result)</FONT></A> +<DD> +<P>mysql_FreeResult only needs to be called if you are worried about using +too much memory while your script is running. All result memory will automatically +be freed when the script is finished. But, if you are sure you are not going to +need the result data anymore in a script, you may call mysql_freeresult with the +result identifier as an argument and the associated result memory will be freed. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_insert_id"><FONT SIZE="+1">mysql_insert_id()</FONT></A> +<DD> +<P>mysql_insert_id() returns the ID generated for an AUTO_INCREMENT field. This function +takes no arguments. It will return the auto-generated ID returned by the last INSERT query +performed.<P> + +<DT><A NAME="mysql_listdbs"><FONT SIZE="+1">$result = mysql_ListDBs()</FONT></A> +<DD> +<P>mysql_ListDBs will return a result pointer containing the databases +available from the current mysql daemon. Use the <A HREF="#mysql_dbname"> +mysql_dbName()</A> function to traverse this result pointer. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_listfields"><FONT SIZE="+1">$result = mysql_Listfields($database,$tablename)</FONT></A> +<DD> +<P>mysql_listfields retrieves information about the the given tablename. +Arguments are the database name and the table name. +A result pointer is returned which can be used with mysql_fieldflags, +mysql_fieldlen, mysql_fieldname, mysql_fieldtype. A result identifier is a +positive integer. The function returns -1 if a error occurs. A string +describing the error will be placed in $phperrmsg, and unless the function +was called as @mysql() then this error string will also be printed out. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_listtables"><FONT SIZE="+1">$result = mysql_ListTables($database)</FONT></A> +<DD> +<P>mysql_ListTables takes a database name and result pointer much like the +<A HREF="#mysql">mysql()</A> function. The <A HREF="#mysql_tablename">mysql_TableName()</A> +function should be used to extract the actual table names from the result pointer. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_numfields"><FONT SIZE="+1">mysql_NumFields($result)</FONT></A> +<DD> +<P>mysql_NumFields returns the number of fields in a result. The argument is +the result identifier returned by the mysql() function. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_numrows"><FONT SIZE="+1">mysql_NumRows($result)</FONT></A> +<DD> +<P>mysql_NumRows simply returns the number of rows in a result. The argument +is the result identifier returned by the mysql() function. +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_result"><FONT SIZE="+1">mysql_Result($result,$i,field)</FONT></A> +<DD> +<P>mysql_Result displays a field from a returned record. Arguments are the result +identifier returned by the mysql() function, an integer which is the index of the record +to be viewed and a field name. The field argument supports the &quot;table.field&quot; +syntax for handling results from a join. One difference between mSQL 1.0 and mysql is +that mysql supports functions that can act on the result data. These functions can +be applied in this function. This function is perhaps best illustrated with +a complete example:<P> +<P> +<PRE> + &lt;? + $name = &quot;bob&quot;; + $result = mysql($database,&quot;select * from table where firstname='$name'&quot;); + $num = mysql_numrows($result); + echo &quot;$num records found!&lt;p&gt;&quot;; + $i=0; + while($i<$num); + echo mysql_result($result,$i,&quot;lcase(fullname)&quot;); + echo &quot;&lt;br&gt;&quot;; + echo mysql_result($result,$i,&quot;address&quot;); + echo &quot;&lt;br&gt;&quot;; + $i++; + endwhile; + &gt;</PRE><P> +<P> +The above script connects to the mysql engine on the local machine, sets the <EM>name</EM> +variable to <EM>bob</EM> and sends a query which asks for all the fields from a +table where the <EM>firstname</EM> field is set to <EM>bob</EM>. It then displays the +number of records it found after which it loops through each of the found +records and displays the <EM>fullname</EM> and <EM>address</EM> fields for each record. +The lcase() call in the result function changes the returned string to lower case. +For a complete set of functions that can be applied to the result data, see your +mysql documentation. +As you can see, it would be trivial to add HTML markup tags around the printed +fields to format the results in a table or in whatever manner is desired. Note +that there is no mysql_connect() call. mysql_connect need only be called if a connection +to a remote database is desired.<P> +<P> +This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="mysql_tablename"><FONT SIZE="+1">mysql_TableName($result,$i)</FONT></A> +<DD> +<P>mysql_TableName takes a result pointer returned by the <A HREF="#mysql_listtables"> +mysql_ListTables()</A> function as well as an integer index and returns the name of +a table. The <A HREF="#mysql_numrows">mysql_NumRows()</A> function may be used to +determine the number of tables in the result pointer. An example would be:<P> +<P> +<PRE> + &lt;? + $result = mysql_listtables(&quot;dbname&quot;); + $i=0; + while($i < mysql_numrows($result)); + $tb_names[$i]=mysql_tablename($result, $i); + echo $tb_names[$i]; + echo "&lt;BR&gt;"; + $i++; + endwhile; + &gt;</PRE> +<BR>This function is only available if mysql support has been enabled in PHP.<P> + +<DT><A NAME="next"><FONT SIZE="+1">Next(variable)</FONT></A> +<DD> +<P>Next moves the internal array pointer to the next item in the array. +This happens automatically when an array is accessed using the non-indexed +method ($array[]). The function returns the value of the new item. +This function can be used to move the pointer forward +without having to access the array explicitly. One use would be to traverse +an associative array and only printing out the keys of the array and not +the actual contents.<P> +<P> +<PRE> &lt;? + Reset($array); + $i=0; + while($i &lt; count($array)); + echo key($array); + next($array); + $i++; + endwhile; + &gt;</PRE><P> + +<DT><A NAME="octdec"><FONT SIZE="+1">OctDec(octal_number)</FONT></A> +<DD> +<P>OctDec converts an octal number to a decimal number. See also +<A HREF="#decoct">DecOct()</A>.<P> + +<DT><A NAME="opendir"><FONT SIZE="+1">openDir(directory)</FONT></A> +<DD> +<P>openDir opens the specified directory and places an internal +pointer to the beginning of the directory. Directory entries +are read using the <A HREF="#readdir">readDir</A> function, and an +opened directory should be closed with the <A HREF="#closedir"> +closeDir</A> function.<P> + +<DT><A NAME="openlog"><FONT SIZE="+1">OpenLog(ident,options,facility)</FONT></A> +<DD> +<P> +OpenLog() initializes the system for further Syslog() calls. See the +openlog(3) UNIX man page for more details. See also <a +href="#initsyslog">InitSyslog()</a>, <a href="#syslog">Syslog()</a> and <a +href="#closelog">CloseLog()</a>. +<P> + +<DT><A NAME="ora_bind"><FONT SIZE="+1">Ora_Bind(cursor_ind, +php_variable_name, sql_variable_name, size)</FONT></A><BR> +<DD>Ora_Bind() performs binding of PHP variables with Oracle ones.<BR><BR> +Function parameters are:<BR> +<DT><DD><VAR>cursor_id</VAR> - oracle cursor id for _parsed_ SQL query or PL/SQL block;<BR> +<VAR>php_variable_name</VAR> - variable name in PHP script without leading '$'<BR> +<VAR>sql_variable_name</VAR> - variable name in SQL with leading colon<BR> +<VAR>size</VAR> - maximal number of bytes to be taken into account at binding<BR><BR> +</DT> +<B>Notes:</B> <BR> +1) PHP variable <B>SHOULD</B> be initialised with at least <B>size</B> bytes +length string even it is return-only variable.<BR> +2) Ora_Bind() <B>SHOULD</B> be used after Ora_Parse and before Ora_Exec. +In case of re-parsing the SQL sentence, all used variables have +to be re-bound.<BR><BR> +Ora_Bind() returns 0 upon success, -1 upon failure.<BR> +<P> +There is an example of Ora_Bind() usage:<BR> +<PRE> + + /* This is the PHP variable to be bound */ + $rc = "12345"; + + /* This is the SQL query. */ + $query = "SELECT * FROM my_table where my_index = :indiana"; + + ........ + + if (Ora_Parse($cursor, $query) < 0) { + echo("Parse failed!\n" + Ora_Logoff($conn); + exit; + } + + if (Ora_Bind($cursor, "rc", ":indiana", strlen($rc)) < 0) { + echo("Binding failed!\n" + Ora_Logoff($conn); + exit; + } + + /* Execute the SQL statement associated with $cursor and + prepare storage for select-list items. */ + $ncols = Ora_Exec($cursor); + + ...... + +</PRE> +<P> + +<DT><A NAME="ora_close"><FONT SIZE="+1">Ora_Close(conn_ind)</FONT></A> +<DD>Ora_Close() closes the Oracle connection identified by +<var>conn_ind</var>. Returns 0 upon success, -1 upon failure. +<P> + +<DT><A NAME="ora_commit"><FONT SIZE="+1">Ora_Commit(conn_ind)</FONT></A> +<DD>Commits the current transaction on <var>conn_ind</var>. The +current transaction starts from the <A +HREF="#ora_logon">Ora_Logon()</A> call or from the last Ora_Commit() +or <A HREF="#ora_rollback">Ora_Rollback()</A>, and lasts until an +Ora_Commit(), <A HREF="#ora_rollback">Ora_Rollback()</A> or <A +HREF="#ora_logoff">Ora_Logoff()</A> call is issued. Ora_Commit() +returns -1 (and an error message) upon failure. <P> + +<DT><A NAME="ora_commitoff"><FONT SIZE="+1">Ora_CommitOff(conn_ind)</FONT></A> +<DD>Ora_CommitOff() turns off autocommit (automatic commit of every +SQL data manipulation statement) on the Oracle connection +<var>conn_ind</var>. <P> + +<DT><A NAME="ora_commiton"><FONT SIZE="+1">Ora_CommitOn(conn_ind)</FONT></A> +<DD>Ora_CommitOff() turns on autocommit (automatic commit of every +SQL data manipulation statement) on the Oracle connection +<var>conn_ind</var>. <P> + +<DT><A NAME="ora_exec"><FONT SIZE="+1">Ora_Exec(cursor_ind)</FONT></A> +<DD>Ora_Exec() executes the SQL statement associated with +<var>cursor_ind</var> and prepares storage for select-list items. +The return value is the number of columns for selects, or -1 on +error. <P> + +<DT><A NAME="ora_fetch"><FONT SIZE="+1">Ora_Fetch(cursor_ind)</FONT></A> +<DD>Ora_Fetch() retrieves a row from the database. Returns 1 if a +column was retrieved, 0 if there are no more columns to retrieve or -1 +on error. <P> + +<DT><A NAME="ora_getcolumn"><FONT SIZE="+1">Ora_GetColumn(cursor_ind, +column)</FONT></A> +<DD>Ora_GetColumn() fetches data for a single column in a returned +row. <A HREF="ora_fetch">Ora_Fetch()</A> must have been called prior +to Ora_GetColumn().<P> + +<DT><A NAME="ora_logoff"><FONT +SIZE="+1">Ora_Logoff(conn_ind)</FONT></A> +<DD>Ora_Logoff() disconnects the logon data area belonging to +<var>conn_ind</var> and frees used Oracle resources. <P> + +<DT><A NAME="ora_logoff"><FONT +SIZE="+1">Ora_Logon(userid, password)</FONT></A> +<DD>Ora_Logon() establishes a connection between PHP and an Oracle +database with the given user id and password. Returns 0 on success +and -1 on failure. +<P> + +<DT><A NAME="ora_open"><FONT SIZE="+1">Ora_Open(conn_ind)</FONT></A> +<DD>Ora_Open() opens a cursor in Oracle that maintains state +information about the processing of a SQL statement. Returns a cursor +index or -1 on error. <P> + +<DT><A NAME="ora_parse"><FONT SIZE="+1">Ora_Parse(cursor_ind, +sql_statement [, defer])</FONT></A> +<DD>Ora_Parse() parses a SQL statement or PL/SQL block and associates +it with a cursor. An optional third argument can be set to 1 to defer +the parse. Returns 0 on success or -1 on error. <P> + +<DT><A NAME="ora_rollback"><FONT +SIZE="+1">Ora_Rollback(cursor_ind)</FONT></A> +<DD>Ora_Rollback() rolls back the current transaction. See <A +HREF="#ora_commit">Ora_Commit()</A> for a definition of the current +transaction. <P> + +<DT><A NAME="ord"><FONT SIZE="+1">Ord(arg)</FONT></A> +<DD> +<P>Ord returns the ASCII value of the first character of arg.<P> + +<DT><A NAME="parse_str"><FONT SIZE="+1">Parse_Str(arg)</FONT></A> +<DD> +<P>Parse_str takes a string identical to a regular URL encoded +string and extracts variables and their values.<br> +ex. +<PRE> &lt;? parse_str("a[]=hello+world&amp;a[]=second+variable"); + echo $a[],"&lt;br&gt;"; + echo $a[],"&lt;br&gt;"; + &gt; + +produces + +hello world +second variable</PRE> + +<DT><A NAME="passthru"><FONT SIZE="+1">PassThru(command_string [,return_var])</FONT></A> +<DD> +<P>The PassThru() function is similar to the <a href="#exec">Exec()</a> function +in that it executes a Unix command. If the return_var argument is present, the +return status of the Unix command will be placed here. This command should be used in place of +Exec or System when the output from the Unix command is binary data which needs to +be passed directly back to the browser. A common use for this is to execute something +like the pbmplus utilities that can output an image stream directly. By setting +the content-type to <em>image/gif</em> and then calling a pbmplus program to output +a gif, you can create PHP/FI scripts that output images directly. <P> + +<DT><A NAME="pclose"><FONT SIZE="+1">pclose(fp)</FONT></A> +<DD> +<P>Pclose closes a pipe opened using the <A HREF="#popen">popen()</A> +function.<P> + + +<DT><A NAME="pg_close"><FONT SIZE="+1">pg_Close(connection_id)</FONT></A> +<DD> +<P>pg_Close will close down the connection to a Postgres database +associated with the given connection identifier.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_connect"><FONT SIZE="+1">$connection = pg_Connect(host, port, options, tty, +dbname)</FONT></A> +<DD> +<P>pg_Connect opens a connection to a Postgres database. Each +of the arguments should be a quoted string, including the port number. +The options and tty arguments are optional and can be empty strings. +This function returns a connection_id. This identifier is needed by other +Postgres functions. You can have multiple connections open at once. +This function will return <STRONG>0</STRONG> on error.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_dbname"><FONT SIZE="+1">pg_DBname(connection_id)</FONT></A> +<DD> +<P>pg_DBname will return the name of the database that the given +Postgres connection identifier is connected to.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_errorMessage"><FONT SIZE="+1">pg_ErrorMessage(connection_id)</FONT></A> +<DD> +<P> +If an error occured on the last database action for which a valid connection +exists, this function will return a string containing the error message +generated by the back-end server. +<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_exec"><FONT SIZE="+1">$result = pg_Exec(connection_id, query_string)</FONT></A> +<DD> +<P>pg_Exec will send an SQL statement to the Postgres database specified by +the connection_id. The connection_id must be a valid identifier +that was returned by pg_Connect. The return value of this function +is an identifier to be used to access the results from other +Postgres functions. This function will return <STRONG>0</STRONG> on error. +It will return <STRONG>1</STRONG> when the command executed correctly but +are not expected to returned data (insert or update commands, for +example). Note that selects which return no data will still return a +valid result greater than 1.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_fieldname"><FONT SIZE="+1">pg_FieldName(result_id, field_number)</FONT></A> +<DD> +<P>pg_FieldName will return the name of the field occupying the +given column number in the given Postgres result identifier. Field numbering +starts from 0.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_fieldprtlen"><FONT SIZE="+1">pg_FieldPrtLen(result_id, row_number, +field_name)</FONT></A> +<DD> +<P>pg_FieldPrtLen will return the actual printed length (number of +characters) of a specific value in a Postgres result. Row numbering starts at 0. This function +will return <STRONG>-1</STRONG> on an error.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_fieldnum"><FONT SIZE="+1">pg_FieldNum(result_id, field_name)</FONT></A> +<DD> +<P>pg_FieldNum will return the number of the column slot that +corresponds to the named field in the given Postgres result identifier. Field +numbering starts at 0. This function +will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_fieldsize"><FONT SIZE="+1">pg_FieldSize(result_id, field_name)</FONT></A> +<DD> +<P>pg_FieldSize will return the internal storage size (in bytes) of +the named field in the given Postgres result. A field size of 0 indicates +a variable length field. This function +will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_fieldtype"><FONT SIZE="+1">pg_FieldType(result_id, field_number)</FONT></A> +<DD> +<P>pg_FieldType will return a string containing the type name of +the given field in the given Postgres result identifier. Field numbering starts at 0.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_freeresult"><FONT SIZE="+1">pg_FreeResult(result_id)</FONT></A> +<DD> +<P>pg_FreeResult only needs to be called if you are worried about using +too much memory while your script is running. All result memory will +automatically be freed when the script is finished. But, if you are +sure you are not going to need the result data anymore in a script, +you may call pg_freeresult with the result identifier as an +argument and the associated result memory will be freed.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_getlastoid"><FONT SIZE="+1">pg_GetLastOid()</FONT></A> +<DD> +<P>pg_GetLastOid can be used to retrieve the Oid assigned to an +inserted tuple if the last command sent via pg_Exec was an +SQL Insert. This function will return a positive integer if +there was a valid Oid. It will return <STRONG>-1</STRONG> if an error +occured or the last command sent via pg_Exec was not an Insert.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_host"><FONT SIZE="+1">pg_Host(connection_id)</FONT></A> +<DD> +<P>pg_Host will return the host name the the given Postgres +connection identifier is connected to.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_numfields"><FONT SIZE="+1">pg_NumFields(result_id)</FONT></A> +<DD> +<P>pg_NumFields will return the number of fields (columns) in +a Postgres result. The argument is a valid result identifier returned +by pg_Exec. This function +will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_numrows"><FONT SIZE="+1">pg_NumRows(result_id)</FONT></A> +<DD> +<P>pg_NumRows will return the number of rows in a Postgres result. The argument +is a valid result identifier returned by pg_Exec. This function +will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_options"><FONT SIZE="+1">pg_Options(connection_id)</FONT></A> +<DD> +<P>pg_Options will return a string containing the options specified +on the given Postgres connection identifier.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_port"><FONT SIZE="+1">pg_Port(connection_id)</FONT></A> +<DD> +<P>pg_Port will return the port number that the given Postgres +connection identifier is connected to.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_result"><FONT SIZE="+1">pg_Result(result_id, row_number, field name/index)</FONT></A> +<DD> +<P>pg_Result will return values from a result identifier +produced by pg_Exec. The row_number and field name specify what +cell in the table of results to return. Row numbering starts from +0. Instead of naming the field, you may use the field index as +an unquoted number. Field indices start from 0.<P> +<P> +Postgres has many built in types and only the basic ones are +directly supported here. All forms of integer, boolean and oid +types are returned as integer values. All forms of float, and real +types are returned as double values. All other types, including +arrays are returned as strings formatted in the same default Postgres +manner that you would see in the 'monitor' or 'psql' programs.<P> +<P> +Support for returning PHP arrays of numerical and string data +from a Postgres result is planned for a later date.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="pg_tty"><FONT SIZE="+1">pg_tty(connection_id)</FONT></A> +<DD> +<P>pg_tty will return the tty name that server side debugging output +is sent to on the given Postgres connection identifier.<P> +<P> +This function is only available if Postgres support has been enabled in PHP.<P> + +<DT><A NAME="phpinfo"><FONT SIZE="+1">phpInfo()</FONT></A> +<DD> +<P>phpInfo prints the same page you get when adding &quot;?info&quot; +to a PHP/FI parsed URL or when you run the php.cgi binary by itself. It +is especially useful for debugging scripts in the Apache module version since +it displays a number of useful internal data.<P> + +<DT><A NAME="phpversion"><FONT SIZE="+1">phpVersion()</FONT></A> +<DD> +<P>phpVersion returns the version number of PHP/FI currently running.<P> + +<DT><A NAME="popen"><FONT SIZE="+1">fp = popen(command,mode)</FONT></A> +<DD> +<P>Popen opens a pipe to a command and returns a file pointer index. +This file pointer index can be used by +<A HREF="#fgets">fgets</A>, <A HREF="#fputs">fputs</A> and +<A HREF="#fclose">fclose</A>. Arguments are the command to run and +the mode. The mode can be either &quot;r&quot; for read or &quot;w&quot; +for write. See the UNIX C library popen man page for more details. +Any file opened with popen() should be closed using the +<A HREF="#pclose">pclose()</A> function.<P> + +<DT><A NAME="pos"><FONT SIZE="+1">pos(var)</FONT></A> +<DD> +<P>The Pos() function returns the numerical position of an array element within +that array. This is not very useful for normal arrays, but for associative +arrays it can be handy.</P> + +<DT><A NAME="pow"><FONT SIZE="+1">pow(x,y)</FONT></A> +<DD> +<P>Evaluates x raised to the power of y. See also <a href="#exp">Exp()</a><P> + +<DT><A NAME="prev"><FONT SIZE="+1">Prev(variable)</FONT></A> +<DD> +<P>Prev moves the internal array pointer for the given variable to the +previous item in the array. If already at the beginning of the list, +the pointer will point to the first item. The function returns the value +of the new item. This function is useful for +traversing an associative array in reverse order. See the example +in the <A HREF="#end">End()</A> definition. Also see <A HREF="#next">Next()</A>.<P> + +<DT><A NAME="putenv"><FONT SIZE="+1">PutEnv(string)</FONT></A> +<DD> +<P>PutEnv puts the given string in the environment. Not extremely useful +since the local environment variables are wiped out when PHP is done with +a page, but in some cases it is useful if other things called from within +a PHP script checks environment variables. For example, if you want to +run multiple mSQL daemon processes, you will need to use PutEnv to switch +back and forth between the different sockets.<P> + +<DT><A NAME="quotemeta"><FONT SIZE="+1">QuoteMeta(arg)</FONT></A> +<DD> +<P>QuoteMeta returns a string composed of arg with any regular expression +special characters escaped with a backslash.<P> + +<DT><A NAME="rand"><FONT SIZE="+1">Rand()</FONT></A> +<DD> +<P>Rand returns a random number between 0 and RANDMAX. <B>Remember</B> to +seed your random number generator with a call to <a href="#srand">srand()</a> +before calling rand(). You only need to seed the random number generator +once. RANDMAX can be determined with the <A HREF="#getrandmax">getRandMax</A> +function. Normally a specific range is chosen by simply using the modulus +operator on the result.<P> + +<DT><A NAME="readdir"><FONT SIZE="+1">readDir()</FONT></A> +<DD> +<P>readDir reads the next entry from the currently open +directory structure. Once an entry is read, the pointer is +advanced to the next entry in the directory and the +next call to this function will return the next entry in the +directory. Use the <A HREF="#opendir">openDir</A> +function to open a directory before calling this function.<P> + +<DT><A NAME="readfile"><FONT SIZE="+1">ReadFile(filename)</FONT></A> +<DD> +<P>$size = ReadFile(Filename) - Reads the file filename and simply outputs +it directly. It returns the number of bytes actually read. It is different +from the File() command in that it does not store the file in memory, and it is +safe for use on binary files. This function is generally used where one might +otherwise do a PassThru("cat filename"). Using ReadFile is more efficient.<P> + +<DT><A NAME="readlink"><FONT SIZE="+1">ReadLink(path)</FONT></A> +<DD>ReadLink does the same as the readlink C function +and returns the contents of the symbolic link path or -1 +in case of error. See also <A HREF="#linkinfo">LinkInfo</A>.<P> + +<DT><A NAME="reg_match"><FONT SIZE="+1">reg_Match(expr,arg[,regs])</FONT></A> +<DD> +<P><b>This function has been replaced by the <a href="#ereg">ereg()</a> +function. It is however still available for backwards compatibility.</b><br> +reg_Match returns non-zero if the regular expression is matched +in the argument string. For example, the condition, <TT>&lt;?if (reg_match(&quot;^This.*&quot;, +&quot;This is an example string&quot;)&gt;</TT> would be true since the &quot;^This.*&quot; +expression says to match the word <STRONG>This</STRONG> at the beginning of the string and then +match any characters afterwards. If the <EM>regs</EM> argument is present, then match +registers are filled into positions 0-10 in the array named by the <EM>regs</EM> +argument. Register 0 will always contain the full matched string. +For more information on regular expressions, see +the <A HREF="#regexp">regular expression section</A> of this document.<P> + +<DT><A NAME="reg_replace"><FONT SIZE="+1">reg_replace(expr,replace,arg)</FONT></A> +<DD> +<P><b>This function has been replaced by the <a href="#ereg_replace">ereg_replace()</a> +function. It is however still available for backwards compatibility.</b><br> +reg_Replace scans the entire argument string and replaces any portions +of the string matched by the given expression with the replacement string. For +example, in the string, <TT>&quot;This is an example string&quot;</TT> we could +very easily replace every space with a dash with the command: +<STRONG>reg_replace(" ","-","This is an example string")</STRONG>.For more information on regular +expressions, see the <A HREF="#regexp">regular expression section</A> +of this document.<P> + +<DT><A NAME="reg_search"><FONT SIZE="+1">reg_Search(expr,arg[,regs])</FONT></A> +<DD> +<P><b>This function has been replaced by the <a href="#ereg">ereg()</a> +function. It is however still available for backwards compatibility.</b><br> +reg_Search will scan the entire argument string for any matches to +the given regular expression. If a match is found, it will return the portion +of the string starting at where the match occurred. If no match is found a +zero-length string is returned. If the <EM>regs</EM> argument is present, then match +registers are filled into positions 0-10 in the array named by the <EM>regs</EM> +argument. Register 0 will always be assigned the full matched string. +For more information on regular expressions, see +the <A HREF="#regexp">regular expression section</A> of this document.<P> + +<DT><A NAME="rename"><FONT SIZE="+1">Rename(old,new)</FONT></A> +<DD> +<P>Rename filename old to new. Similar to the Unix C +rename() function.<P> + +<DT><A NAME="reset"><FONT SIZE="+1">Reset(variable)</FONT></A> +<DD> +<P>Reset moves the internal array pointer for the given array variable to +the first item of the array and returns the value of this item. +This is useful for traversing associative +and non-indexed arrays. See also <A HREF="#end">End()</A> and <A HREF="#next">Next()</A>. +The following example traverses an associative array:<P> +<P> +<PRE> &lt;? + Reset($array); + $i=0; + while($i &lt; count($array)); + echo $array[]; /* pointer automatically moves ahead one */ + $i++; + endwhile; + &gt;</PRE><P> + +<DT><A NAME="return"><FONT SIZE="+1">return(value)</FONT></A> +<DD> +<P>Return exits the current function call and returns the specified value +back to the caller. See the section on <A HREF="#user_funcs">User-Defined Functions</A> +for more information.<P> + +<DT><A NAME="rewind"><FONT SIZE="+1">rewind($fd)</FONT></A> +<DD> +<P>rewind() resets a file pointer identified by the +$fd argument which is the return value of the <A HREF="#fopen">fopen()</A> +call. The file pointer is positioned at the beginning of the file. +See also <A HREF="#ftell">ftell()</A> and <A HREF="#fseek">fseek()</A>.<P> + +<DT><A NAME="rewinddir"><FONT SIZE="+1">rewindDir()</FONT></A> +<DD> +<P>rewindDir moves the current directory pointer back to the +beginning of the directory. Use the <A HREF="#opendir">openDir</A> +function to open a directory before calling this function.<P> + +<DT><A NAME="rmdir"><FONT SIZE="+1">RmDir(dir)</FONT></A> +<DD> +<P>RmDir() removes the given directory. See the <a href="#unlink">Unlink()</a> +function for removing regular files.<P> + +<DT><A NAME="setcookie"><FONT SIZE="+1">SetCookie(name,value,expire,path,domain,secure)</FONT></A> +<DD> +<P>SetCookie() defines a cookie to be sent along with the rest of the header information. +All the arguments except the name argument are optional. If only the name argument is +present, the cookie by that name will be deleted from the remote client. You may also +replace any argument with an empty string (<b>&quot;&quot;</b>) in order to skip that +argument. The expire and secure arguments are integers and cannot be skipped with an empty +string. Use a zero (<b>0</b>) instead. The expire argument is a regular Unix time integer +as returned by the <a href="#time">time()</a> or +<a href="#mktime">mktime()</a> functions. Some examples follow:<P> +<PRE> SetCookie("TestCookie","Test Value"); + SetCookie("TestCookie",$value,time()+3600); /* expire in 1 hour */ + SetCookie("TestCookie",$value,time()+3600,"/~rasmus/",".utoronto.ca",1);</PRE> +<P>Note that the value portion of the cookie will automatically be urlencoded when +you send the cookie, and when it is received, it is automatically decoded and assigned +to a variable by the same name as the cookie name. ie. to see the contents +of our test cookie in a script, simply do:<P> +<PRE> echo $TestCookie;</PRE> + +<DT><A NAME="seterrorreporting"><FONT SIZE="+1">SetErrorReporting(arg)</FONT></A> +<DD> +<P>SetErrorReporting sets the current error reporting state to the +value of <EM>arg</EM>. If non-zero, errors will be printed, and if 0 +they won't be. The function returns the previous error reporting state. +This is a more general way of disabling error +reporting than by preceding individual functions with a '@' character. +See the section on +<A HREF="#quiet">Suppressing Errors from function calls</A> for more +information.<P> + +<DT><A NAME="setlogging"><FONT SIZE="+1">SetLogging(arg)</FONT></A> +<DD> +<P>SetLogging() either enables or disables the logging of access +statistics for a page. If <EM>arg</EM> is +non-zero, logging will be enabled, if zero, disabled.<P> + +<DT><A NAME="setshowinfo"><FONT SIZE="+1">SetShowInfo(arg)</FONT></A> +<DD> +<P>SetShowInfo() either enables or disables the information footer +at the bottom of all pages loaded through PHP. If <EM>arg</EM> is +non-zero, the footers will be enabled, if zero, disabled.<P> + +<DT><A NAME="settype"><FONT SIZE="+1">SetType(variable,type)</FONT></A> +<DD> +<P>SetType sets the type of a variable. The type argument +is one of, &quot;integer&quot;, &quot;double&quot; or &quot;string&quot;. +See also the <A HREF="#gettype">GetType()</A> function.<P> + +<DT><A NAME="shl"><FONT SIZE="+1">shl(n,b)</FONT></A> +<DD> +<P>Shift the value <b>n</b> left <b>b</b> bits.<P> + +<DT><A NAME="shr"><FONT SIZE="+1">shr(n,b)</FONT></A> +<DD> +<P>Shift the value <b>n</b> right <b>b</b> bits.<P> + +<DT><A NAME="sin"><FONT SIZE="+1">Sin(arg)</FONT></A> +<DD> +<P>Sin returns the sine of arg in radians. See also <A HREF="#cos">Cos()</A> +and <A HREF="#tan">Tan()</A><P> + +<DT><A NAME="sleep"><FONT SIZE="+1">Sleep(secs)</FONT></A> +<DD> +<P>Sleep will delay for secs seconds. Similar to the Unix C sleep() +function. See also the <A HREF="#usleep">USleep()</A> function.<P> + +<DT><A NAME="solid_close"><FONT SIZE="+1">Solid_Close(connection_id)</FONT></A> +<DD> +<P>Solid_Close will close down the connection to the Solid server associated +with the given connection identifier.<P> +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_connect"><FONT SIZE="+1">$connection = Solid_Connect(data source name, username, password)</FONT> +<DD> +<P>Solid_Connect opens a connection to a Solid server. Each of the arguments +should be a quoted string. The first parameter (data source name) can be an +empty string, resulting in a connection to the default server on the localhost. +This function returns a connection_id. This identifier is needed by other +Solid functions. You can have multiple connections open at once. This function +will return <STRONG>0</STRONG> on error. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_exec"><FONT SIZE="+1">$result = Solid_Exec(connection_id, query_string)</FONT> +<DD> +<P>Solid_Exec will send an SQL statement to the Solid server specified by +the connection_id. The connection_id must be a valid identifier +that was returned by Solid_Connect. The return value of this function +is an identifier to be used to access the results by other Solid functions. +This function will return <STRONG>0</STRONG> on error. It will return +<STRONG>1</STRONG> when the command executed correctly but are not expected to +returned data (insert or update commands, for example). Note that selects which +return no data will still return a valid result greater than 1. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_fetchrow"><FONT SIZE="+1">Solid_FetchRow(result_id)</FONT> +<DD> +<P>Solid_FetchRow fetches a row of the data that was returned by Solid_Exec. +After Solid_FetchRow is called, the fields of that row can be access with +Solid_Result. Every time Solid_FetchRow is called a new row can be accessed by +Solid_Result. If Solid_FetchRow was succesful (there was a new row), +<STRONG>1</STRONG> is returned, if there are no more rows, Solid_FetchRow will +return <STRONG>0</STRONG>. The return value of Solid_FetchRow can be used as +the condition of a while loop. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_fieldname"><FONT SIZE="+1">Solid_FieldName(result_id, field_number)</FONT> +<DD> +<P>Solid_FieldName will return the name of the field occupying the given column +number in the given Solid result identifier. Field numbering starts from 0. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_fieldnum"><FONT SIZE="+1">Solid_FieldNum(result_id, field_name)</FONT> +<DD> +<P>Solid_FieldNum will return the number of the column slot that corresponds to +the named field in the given Solid result identifier. Field numbering starts at +0. This function will return <STRONG>-1</STRONG> on error. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_freeresult"><FONT SIZE="+1">Solid_FreeResult(result_id)</FONT> +<DD> +<P>Solid_FreeResult only needs to be called if you are worried about using too +much memory while your script is running. All result memory will automatically +be freed when the script is finished. But, if you are sure you are not going to +need the result data anymore in a script, you may call Solid_FreeResult with +the result identifier as an argument and the associated result memory will be +freed. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_numfields"><FONT SIZE="+1">Solid_NumFields(result_id)</FONT> +<DD> +<P>Solid_NumFields will return the number of fields (columns) in a Solid +result. The argument is a valid result identifier returned by Solid_Exec. +This function will return <STRONG>-1</STRONG> on error.<P> +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_numrows"><FONT SIZE="+1">Solid_NumRows(result_id)</FONT> +<DD> +<P>Solid_NumRows will return the number of rows in a Solid result. The argument +is a valid result identifier returned by Solid_Exec. This function will return +<STRONG>-1</STRONG> on error. <B>Large Caveat:</B> +The SOLID SQL server uses ODBC as it's primary (and only) interface. +SolidNumRows() uses SQLRowCount at the low-level to get the number of +rows. SQLRowCount follows the age-old Microsoft +tradition of unnecessary limitations, strange exceptions and other odd things. +This means that the function will only return the number of rows affected +by an INSERT, UPDATE or a DELETE clause. No SELECT! As a workaround you can +try the count() statement of SQL or a while-loop that counts the number +of rows. If you need Solid_NumRows() to figure out how many records to +read after a SELECT clause, try checking the return value from +<a href="#solid_fetchrow">Solid_FetchRow()</a> instead. So instead of:<P> +<PRE> $num = Solid_NumRows(); + $i=0; + while ($i < $num) { + /* print results... */ + $i++; + }</PRE><P> +you might try:<P> +<PRE> while(Solid_FetchRow($result)) { + /* print results... */ + }</PRE> +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="solid_result"><FONT SIZE="+1">Solid_Result(result_id, field name/index)</FONT> +<DD> +<P>Solid_Result will return values from a result identifier produced by +Solid_Exec. The field name specify what cell in the row to return. Instead of +naming the field, you may use the field index as an unquoted number. Field +indices start from 0. +<P> +This function is only available if Solid support has been enabled in PHP.<P> + +<DT><A NAME="sort"><FONT SIZE="+1">Sort(array)</FONT></A> +<DD> +<P>Sort is used to sort a PHP array in ascending order. To sort in descending order, use +the RSort() function. It understands +the three variable types and will sort alphabetically if the array +contains strings, and numerically if the array contains numbers. In +the case of an array which contains a mixture of types, the first type +in the array will specify the sort method. Note that if you are going to +sort an associative array, you should use the <a href="#asort">ASort()</a> +function.<P> + +<DT><A NAME="soundex"><FONT SIZE="+1">Soundex(string)</FONT></A> +<DD> +<P>This function takes a string argument and returns the soundex key + for the string. Soundex keys have the property that words + pronounced similarly produce the same soundex key, and can thus + be used to simplify searches in databases where you know the + pronunciation but not the spelling. This soundex function returns + a string 4 characters long, starting with a letter.<BR> + This particular soundex function is one described by Donald Knuth + in "The Art Of Computer Programming, vol. 3: Sorting And + Searching", Addison-Wesley (1973), pp. 391-392. + <BR> + Example: + <PRE> + Euler and Ellery map to E460 + Gauss and Ghosh map to G200 + Hilbert and Heilbronn map to H416 + Knuth and Kant map to K530 + Lloyd and Ladd map to L300 + Lukasiewicz and Lissajous map to L222 + </PRE> + <P> + +<DT><A NAME="sprintf"><FONT SIZE="+1">Sprintf(format,arg [,arg,arg,arg,arg])</FONT></A> +<DD> +<P>Sprintf returns the string created by the formatted output defined +by the format argument and arg. It is similar to the formatted version +of the <A HREF="#echo">echo</A> command, except this just returns the +string while echo displays it. It is also similar to the C function +by the same name. The difference being that this version does not +accept more than 5 <EM>arg</EM> arguments. If you need to format more than +5 arguments into a single string, simply call sprintf() multiple times +for each group of arguments. Note that the type of the argument doesn't +affect the output. The argument type is automagically converted to match the +type specified in the format string.<P> + +<DT><A NAME="sqrt"><FONT SIZE="+1">Sqrt(arg)</FONT></A> +<DD> +<P>Sqrt returns the square root of arg.<P> + +<DT><A NAME="srand"><FONT SIZE="+1">Srand(integer)</FONT></A> +<DD> +<P>Srand seeds the random number generator. This function takes +any integer as an argument. One choice for a seed value is to use the +<STRONG>date</STRONG> function to give you the current number of seconds +past the minute. Note that this function <B>does not return a value</B>! +This function simply seeds the random number generator for subsequent calls +to the <A HREF="#rand">rand()</A> function. eg.<P> +<PRE> &lt;?srand(date(&quot;s&quot))&gt;</PRE><P> + +<DT><A NAME="strchr"><FONT SIZE="+1">strchr(string,arg)</FONT></A> +<DD> +<P>strchr and <A HREF="#strstr">strstr</A> are actually identical functions. They +can be used interchangeably and both are included for completeness sake. +They will return the portion of the string argument starting at the point +where the given sub-string is found. For example, in the string, +&quot;This is an example string&quot; above, the call: +<TT>&lt;?echo strchr($string,&quot;an &quot;)&gt;</TT> would +return the string: <TT>&quot;an example string&quot;</TT>.<P> + +<DT><A NAME="strtr"><FONT SIZE="+1">strtr(input,set1,set2)</FONT></A> +<DD>strtr() translates each character of &quot;string&quot; that is in +&quot;set1&quot; to the corresponding character in &quot;set2&quot;. +Characters not in set1 are passed through unchanged. When a character +appears more than once in &quot;set1&quot; and the corresponding +characters in &quot;set2&quot; are not all the same, only +the final one is used. When one of &quot;set1&quot; or &quot;set2&quot; +is longer, longer &quot;set?&quot; is truncated to length of shorter +&quot;set?&quot;.<P> + +<DT><A NAME="stripslashes"><FONT SIZE="+1">StripSlashes(arg)</FONT></A> +<DD> +<P>StripSlashes unescapes the string argument. See also +<a href="#addslashes">AddSlashes()</a>.<P> + +<DT><A NAME="strlen"><FONT SIZE="+1">strlen(string)</FONT></A> +<DD> +<P>strlen returns the length of the string.<P> + +<DT><A NAME="strrchr"><FONT SIZE="+1">strrchr(string,arg)</FONT></A> +<DD> +<P>strrchr will search for a single character starting at the end of the +argument string and working its way backwards. It returns the string +starting with the search character if the character was found and an +empty string if it wasn't.<P> + +<DT><A NAME="strstr"><FONT SIZE="+1">strstr(string,arg)</FONT></A> +<DD> +<P>strstr and <A HREF="#strchr">strchr</A> are actually identical functions. They +can be used interchangeably and both are included for completeness sake. +They will return the portion of the string argument starting at the point +where the given sub-string is found. For example, in the string, +&quot;This is an example string&quot; above, the call: +<TT>&lt;?echo strstr($string,&quot;an &quot;)&gt;</TT> would +return the string: <TT>&quot;an example string&quot;</TT>.<P> + +<DT><A NAME="strtok"><FONT SIZE="+1">strtok(string,arg)</FONT></A> +<DD> +<P>strtok is used to tokenize a string. That is, if you have a string like +<STRONG>&quot;This is an example string&quot;</STRONG> you could tokenize this string into +its individual words by using the space character as the token. You would use +the following script code: +<P> +<PRE> &lt;? + $string = &quot;This is an example string&quot;; + $tok = strtok($string,&quot; &quot;); + while($tok); + echo "Word=$tok&lt;br&gt;"; + $tok = strtok(&quot; &quot;); + endwhile; + &gt;</PRE><P> +<P> +Note that only the first call to strtok uses the string argument. Every +subsequent call to strtok only needs the token to use, as it keeps track of where +it is in the current string. To start over, or to tokenize a new string you +simply call strtok with the string argument again to initialize it. Note +that you may put multiple tokens in the <i>arg</i> parameter. The string +will be tokenized when any one of the characters in the argument are found.<P> + +<DT><A NAME="strtolower"><FONT SIZE="+1">strtolower(string)</FONT></A> +<DD> +<P>strtolower converts the string argument to all lower case characters.<P> + +<DT><A NAME="strtoupper"><FONT SIZE="+1">strtoupper(string)</FONT></A> +<DD> +<P>strtoupper converts the string argument to all upper case characters.<P> + +<DT><A NAME="strval"><FONT SIZE="+1">strval(variable)</FONT></A> +<DD> +<P>strval returns the string value of the variable. See also +the <A HREF="#intval">intval()</A> and <A HREF="#doubleval">doubleval()</A> +functions.<P> + +<DT><A NAME="substr"><FONT SIZE="+1">substr(string, start, length)</FONT></A> +<DD> +<P>substr returns a part of the given string. The start position is given +by the start argument. The first position in a string is position 0. And the +length argument specifies the number of characters to return from the start +position.<P> + +<DT><A NAME="sybsql_checkconnect"><FONT SIZE="+1">sybSQL_CheckConnect()</FONT></A> +<DD><P>This function returns 1 if the connection to the database has been established and 0 otherwise.<P> + +<DT><A NAME="sybsql_dbuse"><FONT SIZE="+1">sybSQL_DBuse(database)</FONT></A> +<DD><P>This function issues a Sybase Transact-SQL <b>use</b> command for the +specified database. The only argument to the function is the name of the +database to use. Example: <code>sybsql_dbuse("pubs2");</code> +<P> +The function returns 1 on success and 0 on failure.<P> + + +<DT><A NAME="sybsql_connect"><FONT SIZE="+1">sybSQL_Connect()</FONT></A> +<DD> +<P>This function opens a network connection to the sybase server. This +function depends on several environment variables which must be set by +the caller before calling this function. +<P> +The environment variables are: +<P> +<b>DSQUERY</b> - the alias of the sybase server as defined in the sybase +interface file. +<br> +<b>DBUSER</b> - connect to the sybase server as this user. +<br> +<b>DBPW</b> - password of the user. +<P> +These variables can be set in several ways. If php/fi is running as a CGI +program, then a shell wrapper can be used to set these variables or you can +set these variables directly in the HTML page using the builtin PHP/FI +function <b><a href="#putenv">putenv()</a></b>. +Instead of using the values directly in +<b><a href="#putenv">putenv()</a></b>, the values can be obtained from form +input. The variables can be defined in a file and included in the html files +with PHP/FI +<code><a href="#include">include</a></code> statement. +<p> +The function returns 1 on success and 0 on failure.<P> + +<DT><A NAME="sybsql_fieldname"><FONT SIZE="+1">sybSQL_Exit()</FONT></A> +<DD><P> +This function forces a Sybase connection to be shut down. If not called, the +connection will automatically be closed when the PHP page has been fully parsed, +so calling this function is optional.<P> + +<DT><A NAME="sybsql_fieldname"><FONT SIZE="+1">sybSQL_Fieldname(index)</FONT></A> +<DD><P> +This function returns the field name of a regular result column. The argument +to the function is the field index. Example: <code>sybsql_fieldname(0);</code>. +NOTE: the field index starts at 0. +<P> +If the the result column does not have any name, the function returns an +empty string ("").<P> + +<DT><A NAME="sybsql_getfield"><FONT SIZE="+1">sybSQL_GetField(field)</FONT></A> +<DD><P> +This function gets the value of a specific column of the current result +row. The only argument to the function is the string specifying the field. +Example: <code>$value=sybsql_getfield("@10");</code> +<b>NOTE</b>: <a href="#sybsql_nextrow">sybsql_nextrow()</a> must be called +before calling this function. sybsql_nextrow() must be called if the row +pointer needs to be incremented, because this function only reads the current +row in the row buffer. +<P> +If the specified column has a value, the function returns the value as a +string otherwise the function returns an empty string ("").<P> + +<DT><A NAME="sybsql_isrow"><FONT SIZE="+1">sybSQL_IsRow()</FONT></A> +<DD><P> +This function indicates if the current SQL command returned any rows.<P> +The function returns 1 if the SQL command returned any rows and 0 if the +command didn't return any rows.<P> + +<DT><A NAME="sybsql_nextrow"><FONT SIZE="+1">sybSQL_NextRow()</FONT></A> +<DD><P> +This function increments the row pointer to the next result row.<P> +The function returns 1 as long as there are rows left to read. If there are +no more rows left to read or in case of error the function returns 0.<P> + +<DT><A NAME="sybsql_numfields"><FONT SIZE="+1">sybSQL_NumFields()</FONT></A> +<DD><P> +This function returns the number of fields in a current result row.<P> +The function returns the number of rows in the current result row. If there are +no fields, the function returns 0.<P> + +<DT><A NAME="sybsql_numrows"><FONT SIZE="+1">sybSQL_NumRows()</FONT></A> +<DD><P> +This function returns the number of rows in the current result buffer. +<b>NOTE:</b> +when this function is called, it will seek to the first row right +away, then it will call dbnextrow() until there are no more rows and +increment a internal counter to calculate the number of rows in the +result buffer. Then it points back to the very first row. Therefore, +after calling this function row counter always points to the very +first row. It's ugly but I don't know any other way at this time. +<p> +If there are no rows in the result buffer, the function will return 0.<P> + +<DT><A NAME="sybsql_query"><FONT SIZE="+1">sybSQL_Query()</FONT></A> +<DD><P> +This function submits a Sybase SQL query request to the server. +The only argument to the function is the query string. +Example: +<code>$rc=sybsql_query("select * from authors");</code><P> +The function returns 1, if the query is passed successfully and returns 0 +if the request fails.<P> + +<DT><A NAME="sybsql_result"><FONT SIZE="+1">sybSQL_Result(string)</FONT></A> +<DD><P> +This function prints specific fields of the current result row. The only +argument to the function is a string which holds information about the +fields to be printed. A field is specified with a @ followed by a number. +For example, @0 means first row, @10 means 11th row. Note that the field +number starts at 0. The function is perhaps best illustrated with a +complete example:<P> +<pre>&lt;? + /* + ** assuming all the necessary variables for + ** connection is already set. please note, NO error checking is + ** done. You should always check return code of a function. + */ + + /* connect */ + $rc=sybsql_connect(); + + /* use the pub2 database */ + $rc=sybsql_dbuse(&quot;pubs2&quot;); + + /* send the SQL request */ + $rc=sybsql_query(&quot;select * from authors&quot;); + $i=0; + + /* find the no of rows returned */ + $nrows=sybsql_numrows(); + + /* start table */ + echo &quot;&lt;table border&gt;\n&quot;; + /* + ** print only first and 2nd field + */ + while($i&lt;$nrows) { + sybsql_result(&quot;&lt;tr&gt;&lt;td&gt;@0&lt;/td&gt;@1&lt;/td&gt;&lt;/tr&gt;\n&quot;); + $i++; + } + /* end table */ + echo &quot;&lt;/table&gt;\n&quot;; +&gt;</pre><P> +The above example uses HTML table to format the output. Of course, any +other valid HTML tags can be used.<P> + +<DT><A NAME="sybsql_result_all"><FONT SIZE="+1">sybSQL_Result_All()</FONT></A> +<DD><P> +This function prints all rows in the current result buffer. The result is +printed in a hard coded HTML table format. Note that this function +should not be called inside a loop. The function will print the name of +the columns if there are any column headings in the output.<P> + +<DT><A NAME="sybsql_seek"><FONT SIZE="+1">sybSQL_Seek(row)</FONT></A> +<DD><P> +This function sets the requested row number as the current row in the row +buffer. The only argument to the function is the row number. Example: +<code>$rc=sybsql_seek(10);</code> Note, row number starts at 0.<P> +The function returns 1 if the seek succeeds and 0 if the seek fails. When +all of the rows in the current result buffer have been visited, the row +pointer points to the last row. If it is needed to go backward and visit +some more rows, this function can be used for this purpose.<P> + +<DT><A NAME="symlink"><FONT SIZE="+1">Symlink(target,link)</FONT></A> +<DD> +<P>Symlink() creates a symbolic link. See the <a href="#link">Link()</a> +function to create hard links.<P> + +<DT><A NAME="syslog"><FONT SIZE="+1">Syslog(level,message)</FONT></A> +<DD> +<P> +Syslog() logs messages to the system using UNIX's syslog(3) feature. +See your UNIX man page for more details. See also <a +href="#initsyslog">InitSyslog()</a>, <a href="#openlog">OpenLog()</a> +and <a href="#closelog">CloseLog()</a>. +<P> + +<DT><A NAME="system"><FONT SIZE="+1">System(command_string [,return_var])</FONT></A> +<DD> +<P>System is just like the C <EM>system()</EM> command in that it executes +the given unix command and outputs the result. If a variable is provided as +the second argument, then the return status code of the executed unix command +will be written to this variable. Note, that if +you are going to allow data coming from user input to be passed to this System function, +then you should be using the <A HREF="#escapeshellcmd">EscapeShellCmd()</A> function +to make sure that users cannot trick the system into executing arbitrary commands. +The System() call also automatically flushes the Apache output buffer after each +line of output if PHP is running as an Apache module. +If you need to execute a command and have all the data from the command passed +directly back without any interference, use the <a href="#passthru">PassThru()</a> +function. See also the <A HREF="#exec">Exec</A> function.<P> + +<DT><A NAME="tan"><FONT SIZE="+1">Tan(arg)</FONT></A> +<DD> +<P>Sin returns the tangent of arg in radians. See also <A HREF="#sin">Sin()</A> +and <A HREF="#cos">Cos()</A><P> + +<DT><A NAME="tempnam"><FONT SIZE="+1">TempNam(path, prefix)</FONT></A> +<DD> +<P>TempNam returns a unique filename located in the directory indicated +by path with filename prefix given by prefix. It is identical to the +Unix C tempnam() function.<P> + +<DT><A NAME="time"><FONT SIZE="+1">Time()</FONT></A> +<DD> +<P>Time simply returns the current local time in seconds +since Unix epoch (00:00:00 Jan. 1 1970). It is equivalent to calling +<A HREF="#date">Date(&quot;U&quot;)</A>. If you need better than per-second +granularity, use the <A HREF="#microtime">Microtime</A> function.<P> + +<DT><A NAME="umask"><FONT SIZE="+1">Umask([mask])</FONT></A> +<DD> +<P>Umask(<i>mask</i>) sets PHP's umask to <i>mask</i> &amp; 0777 and +returns the old umask. If PHP/FI is an Apache module, Apache's old +umask is restored when PHP/FI has finished. <i>mask</i> must be +specified in <a href="#octal">octal</a> notation, like for +<a href="#chmod">ChMod()</a>. Umask() +without arguments simply returns the current umask.<P> + +<DT><A NAME="uniqid"><FONT SIZE="+1">UniqId()</FONT></A> +<DD> +<P>UniqId returns a prefixed unique identifier based on current time +in microseconds. The prefix can be useful for instance if you +generate identifiers simultaneously on several hosts that might happen +to generate the identifier at the same microsecond. The prefix can be +up to 114 characters long. +<P> + +<DT><A NAME="unlink"><FONT SIZE="+1">Unlink(filename)</FONT></A> +<DD> +<P>Unlink deletes the given filename. Similar to the Unix C unlink() function. +See the <a href="#rmdir">RmDir()</a> function for removing directories.<P> + +<DT><A NAME="unset"><FONT SIZE="+1">UnSet($var)</FONT></A> +<DD> +<P>UnSet undefines the given variable. In the case of an array, the entire +array is cleared. Individual array elements may also be unset.<P> + +<DT><A NAME="urldecode"><FONT SIZE="+1">UrlDecode(arg)</FONT></A> +<DD> +<P>UrlDecode decodes a string encoded with the <A HREF="#urlencode"> +UrlEncode</A> function. In typical use, it is not necessary to decode +URL Encoded strings because these are automatically decoded when strings +are passed between pages. However, for completeness sake, this function +has been included.<P> + +<DT><A NAME="urlencode"><FONT SIZE="+1">UrlEncode(arg)</FONT></A> +<DD> +<P>UrlEncode encodes any characters from arg which are not one of +&quot;a-zA-Z0-9_-.&quot; by replacing them with %xx where xx is their +ASCII value in hexadecimal. The encoded string is returned.<P> + +<DT><A NAME="usleep"><FONT SIZE="+1">USleep(microsecs)</FONT></A> +<DD> +<P>Sleep will delay for the given number of microseconds. Similar to +the Unix C usleep() function. See also the <A HREF="#sleep">Sleep()</A> +function.<P> + +<DT><A NAME="virtual"><FONT SIZE="+1">Virtual(filename)</FONT></A> +<DD> +<P>Virtual is an Apache-specific function which is equivalent + to &lt;!--#include virtual...--&gt; in mod_include. It performs an + Apache sub-request. It is useful for including CGI scripts or .shtml + files, or anything else that you would parse through Apache + (for .phtml files, you'd probably want to use &lt;?Include&gt;.<P> + +</DL> +<HR> +<H2><A NAME="addfunc">Adding your own internal functions to PHP/FI</A></H2> +It may well be that the set of functions provided by PHP/FI does not +include a particular function that you may need. By carefully following +the steps described below, it is possible for you to add your own +functions to PHP/FI.<P> +<P> +Before you start hacking away at the internals of PHP/FI you need to +grab a copy of the latest version of Bison. Bison is GNU's implementation +of YACC (Yet Another Compiler Compiler). The YACC that came with your +operating system may or may not be good enough, but just to make sure, +go grab Bison. You can find it at <A HREF="ftp://prep.ai.mit.edu/pub/gnu"> +ftp://prep.ai.mit.edu/pub/gnu</A>.<P> +<P> +You should also have a look at the Makefile and turn on debugging. Simply +uncomment the <STRONG>DEBUG</STRONG> line in the Makefile. The output file +of debug information is specified by <STRONG>DEBUG_FILE</STRONG> in <EM>php.h</EM>. +It is by default set to <EM>/tmp/php.err</EM>. You can change this to +suit your needs.<P> +<P> +A final thing you might want to keep in mind is that php runs as the +same user id as httpd on your system, unless of course you are running it +with the setuid bit set, and this httpd user does not generally have +write access to the various directories. This means that if you do something +that causes php to core dump, you will not get a core file. The easy way +around this is to make the directory where you keep your test .html files +writable to all. PHP changes its current directory to the directory of +the .html file it is reading and will thus dump its core there if it can.<P> +<P> +In the following steps we will use the <EM>Time()</EM> function to +illustrate how to add a function.<P> + +<DL><DT><STRONG>Step 1 - Defining the grammar of your Function</STRONG> +<DD> +<P>If your function takes 0 to 6 arguments, there are predefined +grammars available. You can skip this step.<P> + +<P>The grammar of your function is defined in the <EM>parse.raw</EM> file. +The first thing to add is a token. A token is an upper case keyword +which is usually the same as your function name. All the tokens are +defined near the top of the parse.raw file. The order doesn't matter. +Then you need to build your actual YACC grammar rule. Look at the +existing rules and find a function that is similar to the one you are adding. +Keep in mind that most normal functions are standard functions that read their +arguments from the expression stack. Your function will most likely fall into +this group in which case you won't need to touch the <EM>parse.raw</EM> file.<P> + +<DT><STRONG>Step 2 - Adding your function to the lexical analyzer hash table</STRONG> +<DD> +<P>To do this, edit <EM>lex.c</EM> and find the hash table near the top of the +file. Look for the line, <TT>static cmd_table_t cmd_table[22][30] = {</TT>, +which defines the beginning of the hash table. The <TT>[22][30]</TT> defines +the size of the 2 dimensional array which holds the hash table. The 22 is one +greater than the maximum function name length and the 30 refers to the +maximum number of functions in any one hash list. If you exceed either of +these limits, simply increase them right here.<P> +<P> +This hash table would probably rate as the absolute simplest hash table in +the entire world. The hash value is the length of the string of +the function name to be hashed. So, for our <EM>Time()</EM> example, we +need to add an entry for hash value 4. Therefore we add the following +line to the hash list for 4:<P> +<P> +<PRE> { &quot;time&quot;,INTFUNC0,UnixTime },</PRE><P> +<P> +This entry maps a string to the INTFUNC0 token. You can look up the grammar for +the INTFUNC0 token in <EM>parse.raw</EM> and you will see that it is a generic +grammar for an internal function call with 0 arguments. The string, +in quotes above, is the actual string that you will be using in the .html files +to call your function. Keep in mind that PHP/FI function names are +<STRONG>not</STRONG> case sensitive. And the final <B>UnixTime</B> element is the +actual function to be called.<P> + +<DT><STRONG>Step 3 - Write your actual Function</STRONG> +<DD> +<P>You can actually write your function in any language you like, as long +as it is callable through the normal C function call convention and you +have a way of creating either an object file or a library file compatible +with the linker on your system. In general, we will assume that you are +writing your function in C. All the functions that come with PHP/FI have +been written in C. The Time() function, or UnixTime() as it is called +internally in PHP can be found in <EM>date.c</EM> and looks like this:<P> +<P> +<PRE> +void UnixTime(void) { + char temp[32]; + + sprintf(temp,"%ld",(long)time(NULL)); + Push(temp,LNUMBER); +}</PRE><P> +<P> +Note that the function is void. This indicates that it doesn't return +anything. This may seem confusing to you because obviously the function +needs to somehow return the time. The time is returned, but not as the +return value of the function. It is pushed onto what is called an +expression stack. The expression stack is simply a stack of strings +and an associated type. PHP/FI understands only 3 basic variable types: +STRING, LNUMBER and DNUMBER. STRING is a character string, LNUMBER is +a long integer and DNUMBER is a double, or floating point, value. In +this Time() example, the value to be returned is the time expressed in +Unix format (number of seconds since Jan.1 1970) and is thus an integer. +The expression stack only accepts strings, so we sprintf the long integer +into a string and push it onto the stack indicating that it is actually +a long integer with the line: <TT>Push(temp,LNUMBER);</TT><P> + +<DT><STRONG>Step 4 - Add your function prototype to php.h</STRONG> +<DD> +<P>In the bottom half of the <EM>php.h</EM> file you will find a +complete list of prototypes of all the functions in php. They are +grouped by the files in which they appear. Simply add your prototype +to an appropriate place in this file. For our Time() example the +following line is added:<P> +<P> +<PRE>void UnixTime(void);</PRE><P> + +<DT><STRONG>Step 5 - Compile</STRONG> +<DD> +<P>You have to remember to re-make the parser whenever you make a change +to the <EM>parse.raw</EM> file. Type: <STRONG>make parser</STRONG> to +do this. You must have at least version 1.25 of Bison in order to make +the PHP parser. Then do a normal compile by typing: <STRONG>make</STRONG> +once that is done.<P> + +<DT><STRONG>Step 6 - Send me your additions!</STRONG> +<DD> +<P>If you would like your functions added to the next release of +PHP/FI, send them to me. The best way is probably to make a context-sensitive +diff. To do that, you need a copy of a clean unmodified distribution. Simply +do a, <STRONG>diff -c</STRONG> on the files you have changed comparing them +to the original files. Please don't send me a diff of the changes in +<EM>parse.c</EM> since that file is automatically generated. Send me the diff +from <EM>parse.raw</EM> instead.<P> +</DL> +<P> +The Time() example illustrated the steps involved in adding a function. +Chances are that the function you wish to add is quite a bit more +complex than this example. You will probably want to be able to pass +arguments to your function and have it manipulate these arguments in +some manner. You may even want to have it callable in different ways. +These concepts will be illustrated by the PHP/FI crypt() function. +See also the section entitled <A HREF="#hacknotes">Notes for Code Hacks</A> +for some more technical details about writing code for PHP/FI.<P> +<P> +The Crypt() Grammar in <EM>parse.raw</EM>:<P> +<P> +<PRE>%token CRYPT + . + . + . + | CRYPT '(' expr ',' expr ')' + { + if(GetCurrentState(NULL) || inCase || inElseIf) Crypt(1); + } + | CRYPT '(' expr ')' + { + if(GetCurrentState(NULL) || inCase || inElseIf) Crypt(0); + }</PRE><P> +<P> +Here it is shown how to define a grammar which lets you call a function +with either 1 or 2 arguments. You could write different functions +to handle the two cases, or simply send a mode parameter as is done +here to indicate the mode in which the function is called. Note that in +this case you cannot use one of the pre-defined INTFUNCn grammars since your +function can take a variable number of arguments.<P> +<P> +The other aspect that is shown is how to actually represent function +arguments. In most cases you will want to use the <STRONG>expr</STRONG> +identifier. This identifier means that the argument is an expression. +An expression can be a literal value, a function call or a combination +of many expressions. See parse.raw for the complete yacc grammar +definition for expressions for more details.<P> +<P> +The Hash Table entry in <EM>lex.c</EM>:<P> + +<P> +<PRE> { "crypt",CRYPT,NULL },</PRE><P> +<P> +Notice that the last item is a NULL in this case since the function call is +handled in <EM>parse.raw</EM> directly. If you used an INTFUNCn grammar, then +you would put the name of your function in place of this NULL. The actual +Crypt() function in <EM>crypt.c</EM>:<P> + +<P> +<PRE>/* + * If mode is non-zero, a salt is expected. + * If mode is zero, a pseudo-random salt will be selected. + */ +void Crypt(int mode) { +#if HAVE_CRYPT + Stack *s; + char salt[8]; + char *enc; + + salt[0] = '\0'; + if(mode) { + s = Pop(); + if(!s) { + Error("Stack error in crypt"); + return; + } + if(s->strval) strncpy(salt,s->strval,2); + } + s = Pop(); + if(!s) { + Error("Stack error in crypt"); + return; + } + if(!salt[0]) { + salt[0] = 'A' + (time(NULL) % 26); + salt[1] = 'a' + (time(NULL) % 26); + salt[2] = '\0'; + } + enc = (char *)crypt(s->strval,salt); +#if DEBUG + Debug("Crypt returned [%s]\n",enc); +#endif + Push(enc,STRING); + +#else + Error("No crypt support compiled into this version"); +#endif +}</PRE><P> +<P> +The most important aspect of this function is the <STRONG>s = Pop()</STRONG> +call. The arguments to the function must be popped off the expression +stack one by one. When you write a function which takes multiple +arguments, remember that a stack is a LAST-IN, FIRST-OUT data structure. +This means that you will be popping your arguments off the stack in +reverse order. The last argument is popped off first. In the above +example we check to see if we are in the 2 argument mode. If we are, +we pop the argument off the stack and save it. Then we pop the next +argument off the stack. Pop() returns a pointer to a Stack structure (s). +The Stack structure looks like this (from <EM>php.h</EM>):<P> +<P> +<PRE>/* Expression Stack */ +typedef struct Stack { + short type; + unsigned char *strval; + long intval; + double douval; + VarTree *var; + struct Stack *next; +} Stack;</PRE><P> +<P> +The <EM>type</EM> will generally be one of STRING, LNUMBER or DNUMBER. +The <EM>strval</EM>, <EM>intval</EM>, and <EM>douval</EM> components are +the string, integer and double representations of the value respectively. +If the expression is actually a defined variable, the <EM>var</EM> component +contains a pointer to the variable structure which defines this variable.<P> +<P> +In our Crypt() function we are only interested in the string value of +the argument, so we use <EM>s->strval</EM>. Many PHP/FI functions can +do different things depending on the type of the variable simply by +checking <EM>s->type</EM> and using <EM>s->strval</EM>, <EM>s->intval</EM> +and/or <EM>s->douval</EM> appropriately.<P> +<P> +After calling the <STRONG>real</STRONG> crypt() function and getting the +encrypted string, our Crypt() function calls <EM>Push(enc,STRING);</EM> +to push the return value onto the expression stack. It should be noted +that the expression stack is cleared after each PHP/FI line, so if +you push expressions onto this stack that are never popped by anything, +it won't matter.<P> +<P> +The <EM>Debug()</EM> call in the Crypt() example shows how to add debugging +output to your function. Debug() is a varags (variable argument list) +function just like printf.<P> +<HR> +<H2><A NAME="hacknotes">Notes for Code-Hacks</A></H2> +<P>Memory management within PHP/FI is a tricky thing. Since we can run as +a server module, we have to be very careful about memory resources. Not +only do we need to be reentrant, but we also need to be handle the fact +that we can receive a timeout signal at any time at which point we drop out +of the module. We get no warning, and we get no time to free any memory +that we may have allocated. And this memory has to be freed, or the data +space of the httpd process we are linked to could grow indefinitely. +This also applies when PHP is running in CGI mode since it can be set up +to run as a FastCGI persistent process.<P> +<P>The solution is to use sub-pools of memory. These pools are +automatically cleared by Apache when a session is terminated, or in the case +of a FastCGI persistent process, these pools are cleared in <EM>main.c</EM> +every time the FastCGI wrapper loop executes. Three such +pools are used at the moment. They are numbered 0,1 and 2. The sub-pool +number is the first argument to the <EM>emalloc</EM> and <EM>estrdup</EM> +functions.<P> +<DL> +<DT><STRONG>Pool 0 - Session lifespan</STRONG></DT> +<DD>Any memory allocated from this pool will span the entire session. +It is a good idea to keep the use of this pool as low as possible. +For example, if someone makes a while loop that iterates 1000 times and +within this while loop they call something which allocates memory from +pool 0, then this memory will be allocated 1000 times. This is a quick +way to use up all alloted data space.</DD> +<DT><STRONG>Pool 1 - Temporary storage (shortest lifespan)</STRONG></DT> +<DD>If a temporary work buffer is needed for something within a function, +the memory for it must come from this pool. This pool is cleared on every +call to yylex(). ie. the memory is lost just about as soon as you leave +a function.</DD> +<DT><STRONG>Pool 2 - Expression space (medium lifespan)</STRONG></DT> +<DD>This pool exists for the duration of an expression. An expression in +this context being a full PHP/FI command line. It will not get cleared +within functions since the higher level expression which called the +function has not been completed until the function returns. The ClearIt +flag in the yylex() function indicates when it is safe to clear this +pool.</DD> +</DL> +<P>The use of sub-pools completely eliminates the need to explicitly free +memory anywhere in the code, with the one exception being memory allocated +using a regular malloc call by various libraries that could be linked into +PHP. The gdbm library is one such example.<P> + +<? commonFooter(); ?> Index: phpweb/manual/about-notes.php diff -u phpweb/manual/about-notes.php:1.1 phpweb/manual/about-notes.php:1.2 --- phpweb/manual/about-notes.php:1.1 Thu Jul 27 23:32:30 2000 +++ phpweb/manual/about-notes.php Wed Mar 7 16:18:11 2001 @@ -1,5 +1,5 @@ <? -require("shared.inc"); +require_once 'prepend.inc'; commonHeader("Manual Notes"); ?> Index: phpweb/manual/add-note.php diff -u phpweb/manual/add-note.php:1.18 phpweb/manual/add-note.php:1.19 --- phpweb/manual/add-note.php:1.18 Tue Mar 6 11:50:47 2001 +++ phpweb/manual/add-note.php Wed Mar 7 16:18:11 2001 @@ -1,4 +1,5 @@ <? +require_once 'prepend.inc'; $mailto = 'rasmus@php.net'; @@ -18,7 +19,6 @@ require("shared-manual.inc"); -$DISABLE_KICKOUTS=1; commonHeader("Manual Notes"); /* clean off leading and trailing whitespace */ Index: phpweb/manual/admin-notes.php diff -u phpweb/manual/admin-notes.php:1.35 phpweb/manual/admin-notes.php:1.36 --- phpweb/manual/admin-notes.php:1.35 Wed Feb 28 03:58:19 2001 +++ phpweb/manual/admin-notes.php Wed Mar 7 16:18:11 2001 @@ -1,4 +1,5 @@ <? +require_once 'prepend.inc'; $mailto = 'qa@lists.php.net'; $num_entries_per_page = 50; @@ -72,15 +73,13 @@ <? }; - require("shared.inc"); - require("cvs-auth.inc"); - require("email-validation.inc"); + require_once 'cvs-auth.inc'; + require_once 'email-validation.inc'; if(!strstr($MYSITE,"www.php.net")) { Header("Location: http://www.php.net/manual/admin-notes.php"); exit; } - $DISABLE_KICKOUTS=1; commonHeader("Manual Errata Admin"); echo "<P>If you just want to browse the errata, you're better off <A href=\"http://www.php.net/manual/browse-errata.php\">here</A>.\n"; Index: phpweb/manual/browse-errata.php diff -u phpweb/manual/browse-errata.php:1.5 phpweb/manual/browse-errata.php:1.6 --- phpweb/manual/browse-errata.php:1.5 Fri Aug 4 05:41:00 2000 +++ phpweb/manual/browse-errata.php Wed Mar 7 16:18:11 2001 @@ -1,4 +1,5 @@ <? +require_once 'prepend.inc'; $mailto = 'phpdoc@lists.php.net'; @@ -62,8 +63,6 @@ <? }; - - require("shared.inc"); if(!strstr($MYSITE,"www.php.net")) { Header("Location: http://www.php.net/manual/browse-errata.php"); Index: phpweb/manual/index.php diff -u phpweb/manual/index.php:1.2 phpweb/manual/index.php:1.3 --- phpweb/manual/index.php:1.2 Thu Mar 1 13:42:48 2001 +++ phpweb/manual/index.php Wed Mar 7 16:18:11 2001 @@ -1,5 +1,5 @@ <?php -require "shared.inc"; +require_once 'prepend.inc'; $lang = $MIRRORS[$MYSITE][6]; if (is_dir($lang)) { Index: phpweb/manual/set-magic-cookie.php diff -u phpweb/manual/set-magic-cookie.php:1.1 phpweb/manual/set-magic-cookie.php:1.2 --- phpweb/manual/set-magic-cookie.php:1.1 Thu Jul 27 23:32:30 2000 +++ phpweb/manual/set-magic-cookie.php Wed Mar 7 16:18:14 2001 @@ -1,4 +1,6 @@ <? +require_once 'prepend.inc'; + if (isset($user) && isset($pass)) { $MAGIC_COOKIE = base64_encode("$user:$pass"); # we set a cookie good for five years Index: phpweb/manual/html/index.php diff -u phpweb/manual/html/index.php:1.2 phpweb/manual/html/index.php:1.3 --- phpweb/manual/html/index.php:1.2 Thu Mar 1 13:42:48 2001 +++ phpweb/manual/html/index.php Wed Mar 7 16:18:15 2001 @@ -1,5 +1,5 @@ <?php -require "shared.inc"; +require_once 'prepend.inc'; $lang = $MIRRORS[$MYSITE][6]; if (is_dir("../$lang/html")) {
« previous php.mirrors (#4184) next »