php-windows Digest 2 Jul 2003 16:34:31 -0000 Issue 1805

Topics (messages 20645 through 20656):

Making search functions (Search engine newbie)
        20645 by: Bobo Wieland
        20653 by: Svensson, B.A.T. (HKG)
        20654 by: Svensson, B.A.T. (HKG)

Admin pages as simple as possible...
        20646 by: Bobo Wieland
        20647 by: Bobo Wieland
        20650 by: Seung Hwan Kang

Re: Undefined variables
        20648 by: Jupiter Wen
        20652 by: Stephen

Re: SQL Server - 255 field size limit in PHP ?
        20649 by: DessieD

Just testing something - please ignore
        20651 by: DessieD

COM Object help- have working .asp example - Paymentech
        20655 by: Marty Yantzie

Connect Active Directory using LDAP... please help :)
        20656 by: Vince C

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
How do I best implement search functions on my site? (just local search). All info 
that should be searched is in a MySQL table. I wan't both a simple search that 
searches everything and one advanced seach form. What I need to know is how to set up 
the SQL-query. I've only done searches with full textindex before. But this is 
different. If I for instance has a feild with a latin name for something and someone 
spells it wrong when they are searching how do I fix this so that the search function 
still will return the most likely result?

Some tutorials online?!



.b [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
You need (or you might want to use) sounding if you want to do "spell error" searches.
There might be something mentioned about this in the MySQL documentation.

> -----Original Message-----
> From: Bobo Wieland [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 02, 2003 9:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Making search functions (Search engine newbie)
> 
> 
> How do I best implement search functions on my site? (just local
> search). All info that should be searched is in a MySQL table. I wan't
> both a simple search that searches everything and one advanced seach
> form. What I need to know is how to set up the SQL-query. I've only done
> searches with full textindex before. But this is different. If I for
> instance has a feild with a latin name for something and someone spells
> it wrong when they are searching how do I fix this so that the search
> function still will return the most likely result?
> 
> Some tutorials online?!
> 
> 
> 
> .b [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---
Errata: soundexing

> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 02, 2003 3:11 PM
> To: Bobo Wieland; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Making search functions (Search engine newbie)
> 
> 
> You need (or you might want to use) sounding if you want to do "spell error" 
> searches.
> There might be something mentioned about this in the MySQL documentation.
> 

--- End Message ---
--- Begin Message ---
I want my client to be able to update his site him self, and I want it to be as simple 
as possible for him. I think I will save the data as XML in a MySQL db (since I've 
allready made the parser for presenting the XML data...)

Now the problem is this; If my client wants to publish a new article on the site he 
will fill in a form. One textfield for the headline and a textarea for the text. But 
if he wants this article to have multiple (sub)headlines - how should this be 
implemented? He should preferbly not have to write xml or xhtml himself.

Any ideas? How do you generally approch this kind of problem?



.b [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I want my client to be able to update his site him self, and I want it to be as simple 
as possible for him. I think I will save the data as XML in a MySQL db (since I've 
allready made the parser for presenting the XML data...)

Now the problem is this; If my client wants to publish a new article on the site he 
will fill in a form. One textfield for the headline and a textarea for the text. But 
if he wants this article to have multiple (sub)headlines - how should this be 
implemented? He should preferbly not have to write xml or xhtml himself.

Any ideas? How do you generally approch this kind of problem?



.b [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Bobo Wieland wrote:
I want my client to be able to update his site him self, and I want it to be as simple as possible for him. I think I will save the data as XML in a MySQL db (since I've allready made the parser for presenting the XML data...)

Use table field names as an xml tag. and display it as a XML format. eg. id, title, content in a table

<xml>
<id>1</id>
<title>PHP is great</title>
<content>I agree</content>
<published>02-07-2003</published>
</xml>


Now the problem is this; If my client wants to publish a new article on the site he will fill in a form. One textfield for the headline and a textarea for the text. But if he wants this article to have multiple (sub)headlines - how should this be implemented? He should preferbly not have to write xml or xhtml himself.

XML schema is going to be an answer.



Any ideas? How do you generally approch this kind of problem?




.b [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
You may edit c:\windows\php.ini, and change

[php]
error_reporting= E_ALL;

to

[php]
error_reporting= E_PARSE;

Good luck! :)

Jupiter Wen

"Jorge L." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I bought a book on PHP, and in one of the examples it declares a variable
> without assigning it a variable, then it uses the gettype() method to show
> that the result would be "NULL". Well, when I test the script I get the
> following error:
>
> Notice: Undefined variable: testing in C:\Program Files\Apache
> Group\Apache2\htdocs\test.php on line 7
>
> A few months ago I remember that the script would run without a problem (I
> had to stop reading it and I picked it up again), but now it seems that I
> have to assing a value to variables before I can use them. Is this a
change
> from a recent PHP update? I looked at their update section but I can't
find
> anything that says this is something new. Or is this something that I have
> to set in php.ini?
>
> Thanks for your help
> George
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>



--- End Message ---
--- Begin Message ---
Personally, I would use
error_reporting  =  E_ALL & ~E_NOTICE
instead of E_PARSE; Both will get rid of the annoying "empty variable"
notices, but your solution also gets rid of a number of important error
messages that really are needed. If the website is available to members of
the public, then error messages should go to a log file and not to the
browser, so you will still want to know about problems in your code! (EG:
such as using an array function on a string... using your setting won't tell
you you've made the mistake!)

Stephen

----- Original Message ----- 
From: "Jupiter Wen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 5:22 PM
Subject: [PHP-WIN] Re: Undefined variables


> You may edit c:\windows\php.ini, and change
>
> [php]
> error_reporting= E_ALL;
>
> to
>
> [php]
> error_reporting= E_PARSE;
>
> Good luck! :)
>
> Jupiter Wen
>
> "Jorge L." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I bought a book on PHP, and in one of the examples it declares a
variable
> > without assigning it a variable, then it uses the gettype() method to
show
> > that the result would be "NULL". Well, when I test the script I get the
> > following error:
> >
> > Notice: Undefined variable: testing in C:\Program Files\Apache
> > Group\Apache2\htdocs\test.php on line 7
> >
> > A few months ago I remember that the script would run without a problem
(I
> > had to stop reading it and I picked it up again), but now it seems that
I
> > have to assing a value to variables before I can use them. Is this a
> change
> > from a recent PHP update? I looked at their update section but I can't
> find
> > anything that says this is something new. Or is this something that I
have
> > to set in php.ini?
> >
> > Thanks for your help
> > George
> >
> > _________________________________________________________________
> > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
>
>
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--- End Message ---
--- Begin Message ---
Thanks Flint...

and thanks also to Louis Gree.  I changed the type in SQL Server from
varchar to text and it sorted out the problem.

Cheers

Des


"Flint Doungchak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
.
Dessie,

The deal is that the default microsoft libraries that are used as a part of
the module (the mssql module) doesn't support varchar beyond 255 chars.
Although SQL Server does, since the library doesn't, you're kinda screwed.
You could use ADO. I know that the person who works on the SQL server module
is working on a fix, but that fix entails not use the microsoft sql server
library. I think the play is to use Free DTS at some point. Don't recall.
That could be a while.

That's the deal. Sorry.

-Flint


-----Original Message-----
From: DessieD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 01, 2003 2:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] SQL Server - 255 field size limit in PHP ?


Hi

Im new to PHP so may be an obvious workaround to this.  Not sure if it could
be a bug in PHP..

I have a SQLServer table that contains a large nvarchar field (size: 2000).
My php code to retireve and display this field is something like (dont have
code to hand right now):

$quote = mssql_fetch_array($query);
echo $quote[0];

The problem is that only the first 255 characters are getting returned by
PHP !?  The mssql_fetch_array function creates the returned array so its not
something I can manually size etc.

Anyone seen this before, or offer any comments ??

Thanks

D



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



--- End Message ---
--- Begin Message ---
Just testing something - please ignore

Will remove this shortly..



--- End Message ---
--- Begin Message ---
I am trying to setup an small ecommerece site.  I would like to use php
to accomplish this.  I have been able to get the .asp example to work
fine but am having trouble getting the asp converted to php.  Am i
heading in the right direction?  Any ideas?

Here is a trimmed version of the PHP that I am trying to use.

<?
 $trans = new COM("Paymentech.Transaction")or die("Unable to instanciate
Payment Transaction");
 $trans->Type = 'CC.Authorize';
 $trans->Field('MessageType')='AC;
 $trans->Field('MerchantID')='1234567890123';
 $trans->Field('BIN')='000002';
 $trans->Field('AccountNum')='1234567890123';

 $Resp = $trans->Process();
?>
------------------------------------------------------------------------
-----
Here is the ASP that works

<%
 Dim trans
 Set trans = Server.CreateObject ("Paymentech.Transaction")
 
    trans.Type = "CC.Authorize"
    trans.Field("MessageType") = "A"
  
    trans.Field("MerchantID") = Request("MerchantID")
    trans.Field("BIN") = Request("BIN")
    trans.Field("AccountNum") = Request("AccountNum")
    trans.Field("OrderID") = Request("OrderID")
    trans.Field("Amount") = Request("Amount")
    trans.Field("Exp") = Request("ExpDate")
    trans.Field("AVSname") = Request("AVSName")
    trans.Field("AVSaddress1") = Request("AVSAddress1")
    trans.Field("AVScity") = Request("AVScity")
    trans.Field("AVSstate") = Request("AVSstate")
    trans.Field("AVSzip") = Request("AVSzip")
    trans.Field("Comments") = Request("Comments")
    trans.Field("ShippingRef") = Request("ShippingRef")
     
 Set Resp = trans.Process ()
%> 

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

I tried to connect to Active Directory (AD) by using php. I heard that it
could use LDAP to achieve it.  I have written some code on my machine
(Win2000) and try to connect to AD.  It looks like the it could connect,
bind, and even search (I determined base on the line I placed).  However, it
return 0 entries.  If I used the same filter and use utilites "lpd.exe" on
Windows 2000 Server (the AD machine).  I could return some entries. I am
hestitating whether do I made some mistake on my program, or something other
than my code.  Does anyone know what the problem is?  Any comment are
welcome!  Thanks!

Vince

P.S. Here is my code:

<HTML>
<HEAD>
<!-- brandcheck.php -->
<TITLE> Brand New Checking..........  </TITLE>
</HEAD>

<BODY>

<p><font size ="4">AD Test</font></p>
<table width ="100%" border="1" cellspacing="0" cellpadding="0">

<?php
$ldaphost= "company.com";

if(!($ldap = ldap_connect($ldaphost,389))){
 die("ldap server cannot be reached");
} else {
 $oudc = " dc=company, dc=com";
 $dn2 = "";
 $password = "";
 echo "<p>Connected and ready to bind...";
 if (!($res = @ldap_bind($ldap, $dn2, $password))) {
  print(ldap_error($ldap) . "<BR>");
  die ("Could not bind the $dn2");
  echo "<p>Couldn't bind ....";
 } else {
  echo "<p>Binded and Ready to search....";
  echo "<br>LDAP = $ldap";
  echo "<br>oudc = $oudc";

 // $filter="(&(objectClass=user)(objectCategory=person)(|(sn=sorg)))";
 $filter= "sn=*";
  $sr=ldap_search($ldap,$oudc,$filter);
  echo "<p>number of entries found: " . ldap_count_entries($ldap, $sr) .
"<p>";
  echo "<br>filter = $filter";
  echo "<br>sr=$sr";

  if (!$sr) {
   die("<p>search failed\n");
  } else {
   echo "<p> Searched and ready for get entries.....";
   $info= ldap_get_entries($ldap, $sr);

   for ($i=0; $i<$info["count"]; $i++) {
    print ("<TR>");
    print ("<TD width=15%>" . $info[$i]["cn"][0] . " " . $info[$i]["sn"][0]
. "</TD>");
    print ("<TD width=85%>" . $info[$i]["mail"][0] . "</TD>");
    print ("</TR>");
    print "<br>In the display FOR loop";
   }
   echo "<br> After loop.....";
  }
 }
 ldap_unbind($ldap);
 echo "<p>LDAP unbinded....";
}

?>
</table>
</BODY>

</HTML>

Thanks in advance!  Vince



--- End Message ---

Reply via email to