<HTML ><HEAD ><TITLE >yaz_connect</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="YAZ functions" HREF="ref.yaz.html"><LINK REL="PREVIOUS" TITLE="yaz_close" HREF="function.yaz-close.html"><LINK REL="NEXT" TITLE="yaz_database" HREF="function.yaz-database.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.yaz-close.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.yaz-database.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.yaz-connect" ></A >yaz_connect</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN97596" ></A ><P > (PHP 4 >= 4.0.1)</P >yaz_connect -- Prepares for a connection to a Z39.50 target (server). </DIV ><DIV CLASS="refsect1" ><A NAME="AEN97599" ></A ><H2 >Description</H2 >resource <B CLASS="methodname" >yaz_connect</B > ( string zurl [, mixed options])<BR ></BR ><P > This function returns a connection resource on success; zero on failure. </P ><P > <B CLASS="function" >yaz_connect()</B > prepares for a connection to a Z39.50 target. The <TT CLASS="parameter" ><I >zurl</I ></TT > argument takes the form host[:port][/database]. If port is omitted 210 is used. If database is omitted <TT CLASS="literal" >Default</TT > is used. This function is non-blocking and doesn't attempt to establish a socket - it merely prepares a connect to be performed later when <A HREF="function.yaz-wait.html" ><B CLASS="function" >yaz_wait()</B ></A > is called. </P ><P > If the second argument, <TT CLASS="parameter" ><I >options</I ></TT >, is given as a string it is treated as the Z39.50 V2 authentication string (OpenAuth). </P ><P > If <TT CLASS="parameter" ><I >options</I ></TT > is given as an array the contents of the array serves as options. Note that array options are only supported for PHP 4.1.0 and later. <P ></P ><DIV CLASS="variablelist" ><P ><B ><B CLASS="function" >yaz_connect()</B > options</B ></P ><DL ><DT >user</DT ><DD ><P >Username for authentication. </P ></DD ><DT >group</DT ><DD ><P >Group for authentication. </P ></DD ><DT >password</DT ><DD ><P >Password for authentication. </P ></DD ><DT >cookie</DT ><DD ><P >Cookie for session (YAZ proxy). </P ></DD ><DT >proxy</DT ><DD ><P >Proxy for connection (YAZ proxy). </P ></DD ><DT >persistent</DT ><DD ><P >A boolean. If <TT CLASS="constant" ><B >TRUE</B ></TT > the connection is persistent; If <TT CLASS="constant" ><B >FALSE</B ></TT > the connection is not persistent. By default connections are persistent. </P ></DD ><DT >piggyback</DT ><DD ><P >A boolean. If <TT CLASS="constant" ><B >TRUE</B ></TT > piggyback is enabled for searches; If <TT CLASS="constant" ><B >FALSE</B ></TT > piggyback is disabled. By default piggyback is enabled. Enabling piggyback is more efficient and usually saves a network-round-trip for first time fetches of records. However, a few Z39.50 targets doesn't support piggyback or they ignore element set names. For those, piggyback should be disabled. </P ></DD ></DL ></DIV > </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B >The use of a proxy often improves performance. A Z39.50 proxy is part of the free <A HREF="http://www.indexdata.dk/yaz++/" TARGET="_top" >YAZ++</A > package. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.yaz-close.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.yaz-database.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >yaz_close</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.yaz.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >yaz_database</TD ></TR ></TABLE ></DIV ></BODY ></HTML >