LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2006, 03:08 PM   #1
ckoniecny
Member
 
Registered: Oct 2005
Posts: 162

Rep: Reputation: 30
$_POST Data to ldap_search()


Here is my dilemma. I cannot get the ldap_search() below to accept the POST'ed data from the HTML code below. Whats the deal?

Code:
<HTML>
<HEAD>
<TITLE>TEST</TITLE>
</HEAD>
<BODY>
<form action="ldapsearch.php" method="POST" />
Employee name: <input type="text" name="Employee_Name" /><br>
<input type="submit" />
</BODY>
</HTML>

PHP Code:
$ldap_usr ldap_search($ldap_con'dc=ods,dc=annarbornews,dc=com'$_POST['Employee_Name']); 

What am I doing wrong?
 
Old 03-08-2006, 05:02 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
it may be that you never close your form.. </form>

edit> and also the open tag for the form should read
<form action="ldapsearch.php" method="POST">
not
<form action="ldapsearch.php" method="POST" />
 
Old 03-08-2006, 05:57 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by ckoniecny
Here is my dilemma. I cannot get the ldap_search() below to accept the POST'ed data from the HTML code below. Whats the deal?
PHP Code:
$ldap_usr ldap_search($ldap_con'dc=ods,dc=annarbornews,dc=com'$_POST['Employee_Name']); 
What am I doing wrong?
You should follow ldap-filter syntax for the third argument of ldapsearch():
Code:
$ldap_usr = ldap_search($ldap_con, 'dc=ods,dc=annarbornews,dc=com', '(cn=' . $_POST['Employee_Name'] . ')');
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP if(isset($_POST[\'submit\'])) wont evaluate true ALInux Programming 1 11-07-2005 04:22 AM
Large file upload - $_POST empty in PHP PsychosisNode Linux - Software 1 01-23-2005 07:32 AM
PHP : $_POST['choice$i'] doesnt work WindowsBurner Programming 7 12-18-2004 08:06 AM
Home Office Biotech Data Mining - Data Collection Adler Linux - General 20 11-03-2004 04:17 AM
Can you use $_GET & $_POST on the same page? patpawlowski Programming 3 02-05-2004 05:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration