Re: [PHP] Clear POST variables

2006-02-16 Thread Mike Tuller
I am not using a session, and redirecting I think would be a bad way  
of doing this because of the potential hit that the server would take  
for every insert. I have done a few pages like this, and never ran  
into this situation. Now I need to go back and fix this. Basically  
all I have is this.


add.php

Name: 

?>

Then in insert.php I have this:

if ($_POST['name'] !== "")
{
$name = $_POST['name'];

$query = "insert into Locations
(name)
values
('$name)";

mysql_query($query, $link) or die 
(mysql_error());
}

This is how I learned in some book somewhere. Is everyone saying that  
I need to either use sessions, or redirect so that when someone  
refreshes insert.php, it doesn't submit the information again? To me  
it seems that there has to be a more efficient way. I don't  
understand the token thing that some are suggesting.






On Feb 16, 2006, at 4:39 PM, Curt Zirzow wrote:


On Thu, Feb 16, 2006 at 01:23:23PM -0600, Richard Lynch wrote:

On Thu, February 16, 2006 9:07 am, Mike Tuller wrote:

How do I clear out the POST variables, or the variables that I have
set from the POST variables, so that when the page is refreshed it
will not resubmit.  I have tried unset() and have tried to set it to
and
empty value, but it doesn't seem to work.


You can't clear out the POST variables -- they are SENT by the  
browser

to you.

The simplest solution is to set up a one-time-use token and embed  
that

in your FORM data:



I usually use a session based token but i guess it the result is
the same.

Curt.
--
cat .signature: No such file or directory

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




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



Re: [PHP] Clear POST variables

2006-02-16 Thread Mike Tuller
What I have is a page that you enter the information in, and when you  
click on submit, it goes to another page that has the code to enter  
it into the database and says "Thank You, you submitted   
information. Are you saying that I should redirect to another page  
after that?


On Feb 16, 2006, at 9:14 AM, Dan Parry wrote:

Submit the data to a page that just inserts it into the DB  
(validating it
first, natch) then do a header(location) to the thank you (or  
whatever) page


This also fixes 'page expired' warnings

HTH

Dan

-Original Message-----
From: Mike Tuller [mailto:[EMAIL PROTECTED]
Sent: 16 February 2006 15:07
To: php list
Subject: [PHP] Clear POST variables

I have a page that submits form information into a database, and  
all is

good, but someone testing the page pointed out something to me that I
didn't notice. I have a form that sends you to another page that  
submits

the data into a database. If you refresh the page, the information is
submitted again. Here is what I have.

 $name = $_POST['name'];
 $address = $_POST['address'];
 $city = $_POST['city'];
 $state = $_POST['state'];
 $zipcode = $_POST['zipcode'];
 $phone = $_POST['phone'];
 $notes = $_POST['notes'];

 $query = "insert into Locations
 (name, address, city, loc_state,
main_phone, zipcode, notes)
 values
 ('$name', '$address', '$city',
'$state', '$phone', '$zipcode',
'$notes')";

 mysql_query($query, $link) or die
(mysql_error());


How do I clear out the POST variables, or the variables that I have
set from the POST variables, so that when the page is refreshed it
will not resubmit.  I have tried unset() and have tried to set it  
to and

empty value, but it doesn't seem to work.


Thanks.

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




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



[PHP] Clear POST variables

2006-02-16 Thread Mike Tuller

I have a page that submits form information into a database, and all is
good, but someone testing the page pointed out something to me that I
didn't notice. I have a form that sends you to another page that submits
the data into a database. If you refresh the page, the information is
submitted again. Here is what I have.

$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$phone = $_POST['phone'];
$notes = $_POST['notes'];

$query = "insert into Locations
(name, address, city, loc_state,  
main_phone, zipcode, notes)

values
('$name', '$address', '$city',  
'$state', '$phone', '$zipcode',

'$notes')";

mysql_query($query, $link) or die  
(mysql_error());



How do I clear out the POST variables, or the variables that I have  
set from the POST variables, so that when the page is refreshed it

will not resubmit.  I have tried unset() and have tried to set it to and
empty value, but it doesn't seem to work.


Thanks.

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



Re: [PHP] CSS Switching

2006-01-09 Thread Mike Tuller

Yes, I think we all deserve at least one Mulligan on Mondays.


On Jan 9, 2006, at 1:43 PM, John Nichel wrote:


Jay Blanchard wrote:

[snip]
Ah, but then it would be a CSS question, and not a PHP one.  ;)
[/snip]
Touche'! But then we wouldn't be kinder and gentler


We'd have an excuse...it is Monday afterall.

OP : A print css sheet would save you another trip to the server.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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




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



Re: [PHP] CSS Switching

2006-01-09 Thread Mike Tuller

Thanks. This is perfect.


On Jan 9, 2006, at 12:07 PM, John Nichel wrote:


Mike Tuller wrote:
I am drawing a blank on how to go about doing this for some  
reason. I  have a page that pulls info from a database, and I want  
to have a  version for viewing, and a version fro printing. Since  
the data is  dynamic, I need to keep the data, but be able to  
switch the  stylesheet. Can someone give me a push in the right  
direction as to  how they would go about this?


Print This Page



--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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




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



Re: [PHP] CSS Switching

2006-01-09 Thread Mike Tuller
Because I wasn't sure the best way to pass the information to a  
separate page. What John has is different than the direction I was  
thinking, but will work.



On Jan 9, 2006, at 12:17 PM, Jay Blanchard wrote:


[snip]
Why don't you make a prit.php file that handles all the dynamic  
content and

displays it with the CSS file you want.
[/snip]

Using a print stylesheet prevents a round trip to the server for  
the data.




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



[PHP] CSS Switching

2006-01-09 Thread Mike Tuller
I am drawing a blank on how to go about doing this for some reason. I  
have a page that pulls info from a database, and I want to have a  
version for viewing, and a version fro printing. Since the data is  
dynamic, I need to keep the data, but be able to switch the  
stylesheet. Can someone give me a push in the right direction as to  
how they would go about this?


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



[PHP] Browser on server doesn't refresh

2006-01-06 Thread Mike Tuller
This is a perplexing problem. I am running OS X on my laptop, and I  
have created a script running locally that when I click submit, a  
page loads to show what was submitted and then I have a link that  
will take me back to the original page. When I run the script  
locally, everything works. When I put the script on my OS X Server  
and run the script, and click on the link to go back, the information  
is not updated. I have to refresh the page.


I have tried this in different browsers, and on different systems and  
the same results happen. I have Apache 1.3.33 on both systems, and  
PHP 5.04 on my laptop and 4.3.11 on the server. Is there some setting  
in Apache that would cause the page not to refresh?



thanks.

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



Re: [PHP] Re: Set variable outside of scope (redo)

2006-01-06 Thread Mike Tuller

Thanks. That is what I needed. That part works now.


On Jan 5, 2006, at 4:09 PM, comex wrote:


if ($row[range] != "")

This should be $row['range'], not $row[range], although it doesn't
make a difference unless you define a constant named range.


Your problem isn't actually scope, it's that your PHP script is being
called twice.  Once to show the form, once to submit it.  The second
time, your script doesn't have any of the things you set the first
time.



If you put that in your delete form, you could use $_POST['id'] to get
the proper id.

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





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



Re: [PHP] set variable to go outside scope

2006-01-05 Thread Mike Tuller

It's more like this:

if
{
$x=1;
echo $x;
}
elseif
{
echo $x;
}

On Jan 5, 2006, at 1:51 PM, Jay Blanchard wrote:


[snip]
The list listing is in an if/elseif statement where if something is
set, display the table that has the data, and elseif you click on the
delete button, you would delete the data in the row of the table that
is is the if statement. One part of the data is in the if scope, and
the other is in the elseif scope.

I hope that makes sense.
[/snip]

Nope.

Are you asking if the following $row[id]'s are in the same scope?

if($foo){
   $row[id];
}elseif($bar){
   $row[id];
}

If so, the answer is yes.



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



[PHP] Set variable outside of scope (redo)

2006-01-05 Thread Mike Tuller

Excuse the last post, I didn't have all the code it there.

I have a table listing items in a database, and have a delete button
next to each item, and I want to be able to click on the delete and
delete only that record in the database and then reload the page
where it would display the updated information. Here is part of the
code I have.

// list elements one by one until there are no more in the database
while ( $row=mysql_fetch_array($result2) )
{
if ($row[range] != "")
{
echo "


$row[id]
$row[range]



";
}
}
echo "";

echo "




Add Range: $row[id]





";



}
elseif (isset($_POST['deleteRange']))
{

$query = "delete from district.ip_range where id = $row[id]";

mysql_query($query, $link) or die (mysql_error());

echo "Record ".$row[id]." has beed deleted.";

}

They key I am using to find the record I want to delete is the the
$row[id], but that is out of the scope of where the variable is set.
Is there a way to set a variable so that it goes outside the scope?

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



Re: [PHP] set variable to go outside scope

2006-01-05 Thread Mike Tuller
The list listing is in an if/elseif statement where if something is  
set, display the table that has the data, and elseif you click on the  
delete button, you would delete the data in the row of the table that  
is is the if statement. One part of the data is in the if scope, and  
the other is in the elseif scope.


I hope that makes sense.


On Jan 5, 2006, at 1:28 PM, Jay Blanchard wrote:


[snip]
They key I am using to find the record I want to delete is the the
$row[id], but that is out of the scope of where the variable is set.
Is there a way to set a variable so that it goes outside the scope?
[/snip]

What do you mean by "out of the scope of where the variable is  
set"? If the
$row[id] is data in the database (which it should be) it is not a  
scope

issue at all.



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



[PHP] set variable to go outside scope

2006-01-05 Thread Mike Tuller
I have a table listing items in a database, and have a delete button  
next to each item, and I want to be able to click on the delete and  
delete only that record in the database and then reload the page  
where it would display the updated information. Here is part of the  
code I have.


echo "";

echo "

		\"addrange\">



Add Range: $row[id]
	\" />
	value=\"Add Range\" />




";



}
elseif (isset($_POST['deleteRange']))
{

$query = "delete from district.ip_range where id = $row[id]";

mysql_query($query, $link) or die (mysql_error());

echo "Record ".$row[id]." has beed deleted.";

}


They key I am using to find the record I want to delete is the the  
$row[id], but that is out of the scope of where the variable is set.  
Is there a way to set a variable so that it goes outside the scope?


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



Re: [PHP] Timezone and DST

2006-01-05 Thread Mike Tuller
I hate doing this, but you could use Javascript to use the date and time set
on the clients computer. You can't control how they have it set though.


On 1/5/06 1:13 PM, "Mark Steudel" <[EMAIL PROTECTED]> wrote:

> Im just using it to set defaults on a QuickForm date element.
> 
> -Original Message-
> From: Mike Tuller [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 05, 2006 11:02 AM
> To: Mark Steudel
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Timezone and DST
> 
> Are you just displaying the time, or is this for submission in a database?
> 
> 
> On Jan 5, 2006, at 12:50 PM, Mark Steudel wrote:
> 
>> Hi All,
>> 
>> I've got a little problem where our servers are in PST but the
>> customer operates in Hawaii (-10 GMT). I believe I can just get the
>> time for them by doing something like
>> 
>> date("d H i", strtotime('now -2 hours') );
>> 
>> But here's the catch, how should I deal with day light savings ( DST)
>> . In hawaii they don't observer DST, but in Washington State we do.
>> 
>> We're on php 4.x so I can't use the  date_default_timezone_set
>> <http://us2.php.net/manual/en/function.date-default-timezone-
>> set.php>  that
>> was added in PHP 5
>> 
>> Thanks, Mark
>> 
>> --
>> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
>> http://www.php.net/unsub.php
>> 
>> 

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



Re: [PHP] Timezone and DST

2006-01-05 Thread Mike Tuller
Are you just displaying the time, or is this for submission in a  
database?



On Jan 5, 2006, at 12:50 PM, Mark Steudel wrote:


Hi All,

I've got a little problem where our servers are in PST but the  
customer
operates in Hawaii (-10 GMT). I believe I can just get the time for  
them by

doing something like

date("d H i", strtotime('now -2 hours') );

But here's the catch, how should I deal with day light savings  
( DST) . In

hawaii they don't observer DST, but in Washington State we do.

We're on php 4.x so I can't use the  date_default_timezone_set
  that

was added in PHP 5

Thanks, Mark

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




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



Re: [PHP] Date Calculation

2004-10-28 Thread Mike Tuller
Ok, so here is what I have. Please check to see if there is a better 
way. There are a lot of database calls to me.


$ethernet_address = "00:01:93:8e:69:50";
$db_connect = mysql_connect( $host, $login, $password ) or die 
(mysql_error());
$db_select = mysql_select_db($database_name) or die (mysql_error());

$query = "SELECT * FROM hardware_assets WHERE ethernet_address = 
'$ethernet_address'";
$result = mysql_query($query, $db_connect) or die (mysql_error());

while ($row = mysql_fetch_array( $result ))
{
	$timestamp = $row["script_ran"];
	$timequery = "SELECT SEC_TO_TIME(UNIX_TIMESTAMP() - 
UNIX_TIMESTAMP('$timestamp')) as diff";
	$timeresult = mysql_query($timequery, $db_connect) or die 
(mysql_error());
	$time = mysql_result($timeresult, 0, 0);
	
	$secondquery = "SELECT TIME_TO_SEC('$time')";
	$secondresult = mysql_query($secondquery, $db_connect) or die 
(mysql_error());
	$seconds = mysql_result($secondresult, 0, 0);

echo $seconds;
}
?>
This returns the seconds since the timestamp was set for the row where 
the ethernet address of the computer is equal to $ethernet_address. I 
can then do the math so that I can display the hours or minutes. I can 
even have it so that when the time is too long, it displays in red, or 
bold, or whatever I want.


On Oct 28, 2004, at 3:14 PM, Tom Rogers wrote:
Hi,
Friday, October 29, 2004, 4:51:20 AM, you wrote:
MT> I have a shell script that inserts the unix date and time that the
MT> script ran into a MySql database. For example Thu Oct 28 13:41:33 
CDT
MT> 2004. I would like to have my web page do the math so that it 
displays
MT> the time since the script ran. How can I do the math so that the 
web
MT> page will display something like the script ran 1500 seconds ago.

MT> Thanks,
MT> mike
You can do something like this (replace date with column name no 
quotes)

$result = mysql_query("SELECT SEC_TO_TIME(UNIX_TIMESTAMP() - 
UNIX_TIMESTAMP('2004-10-01 13:45:00')) as diff");

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


Re: [PHP] Date Calculation

2004-10-28 Thread Mike Tuller
I guess.
Are you telling me that I should take the timestamp, convert it to 
epoch time, the us the time function to get the current epoch time, 
then subtract the timestamp epoch time from the current epoch time? I 
think that is what you are saying.

I know I can get the current epoch time in php with time(). How do I 
convert the timestamp in the database to epoch time, or find the epoch 
time in bash? If I can't do it in either, then I am subtracting apples 
from oranges.

On Oct 28, 2004, at 2:32 PM, Jay Blanchard wrote:
[snip]
That's not quite what I am talking about. I looked at that already.
I can could also put the date and time that the script was ran into the
MySql database by have a TIMESTAMP field in the database.
[/snip]
You can use that to convert your time in the DB, get the current time
when seeking as epoch time, subtract one from the otherno?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Date Calculation

2004-10-28 Thread Mike Tuller
I have a shell script that inserts the unix date and time that the 
script ran into a MySql database. For example Thu Oct 28 13:41:33 CDT 
2004. I would like to have my web page do the math so that it displays 
the time since the script ran. How can I do the math so that the web 
page will display something like the script ran 1500 seconds ago.

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


Re: [PHP] Date Calculation

2004-10-28 Thread Mike Tuller
That's not quite what I am talking about. I looked at that already.
I can could also put the date and time that the script was ran into the 
MySql database by have a TIMESTAMP field in the database.

I would like to compare the date and time of timestamp in the database 
to the current time and come up with the difference in seconds. Then I 
could show on the web page that the script was run x many seconds ago. 
From that I could do the calculations to show that it was x minutes, 
xhours, etc.


On Oct 28, 2004, at 1:52 PM, Jay Blanchard wrote:
[snip]
I have a shell script that inserts the unix date and time that the
script ran into a MySql database. For example Thu Oct 28 13:41:33 CDT
2004. I would like to have my web page do the math so that it displays
the time since the script ran. How can I do the math so that the web
page will display something like the script ran 1500 seconds ago.
[/snip]
http://us2.php.net/manual/en/function.strtotime.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Authentification Help

2004-07-08 Thread Mike Tuller
I have created a script that authenticates to an Active Directory 
server. This script works when I try to login, but the problem is that 
I have to bind to be able to get "my" dn to be able to authenticate, 
but I need authenticate first to be able to get "my" dn. Chicken before 
the egg problem.

In the ldap_bind(), I have entered "my" dn to be able to authenticate 
for now, but with this I am the only person that would be able to 
login.

I could bind to the server twice, once to get an individuals "dn" , set 
the variable, and then once I have the "user's" dn I could bind again 
as that user, but this seems like it would cause a lot of overhead. 
Does anyone have a better way to do this than bind twice?

 $dn = "OU=Anoka-Hennepin,DC=ah,DC=isd11";
$filter = "(samaccountname=" . $username . "*)";
$ad = ldap_connect("ldap://172.22.1.20";)
  or die("Couldn't connect to AD!");
$bd = ldap_bind($ad, "CN=Tuller\, 
Mike,OU=Staff,OU=LCDC,OU=Anoka-Hennepin,DC=ah,DC=isd11",$password)
  or die("Couldn't bind to AD!");

$result = ldap_search($ad, $dn, $filter);
$entries = ldap_get_entries($ad, $result);
for ($i=0; $i<$entries["count"]; $i++)
{
echo $entries[$i]["dn"];
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Active Directory Authentification

2004-07-07 Thread Mike Tuller
I have been working on this all day, and am not getting this to work. I 
am creating an application where a user would authenticate against 
Active Directory. Yesterday I was able to get PHP to connect to the AD 
server and display entries using this script.


// PHP script to connect to the Active Directory Server a return a 
result
// used for testing Active Directory connections.

$dn = "OU=Staff,OU=LCDC,OU=Anoka-Hennepin,DC=ah,DC=isd11";
$attributes = array("displayName", "department");
$filter = "(cn=*)";
$ad = ldap_connect("ldap://myadserver";)
  or die("Couldn't connect to AD!");
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
$bd = ldap_bind($ad, "CN=Tuller\, 
Mike,OU=Staff,OU=LCDC,OU=Anoka-Hennepin,DC=ah,DC=isd11","password")
  or die("Couldn't bind to AD!");

$result = ldap_search($ad, $dn, $filter, $attributes);
$entries = ldap_get_entries($ad, $result);
for ($i=0; $i<$entries["count"]; $i++)
{
echo $entries[$i]["displayname"]
 [0].", ".$entries[$i]["department"][0]."";
}
ldap_unbind($ad);
?>
Everything lists correctly. I looked on the web, and in the mailing 
lists, and between the two have come up with this script to 
authenticate. I have a web page with forms to enter the username and 
password.


$dn = 'OU=Staff,OU=LCDC,OU=Anoka-Hennepin,DC=ah,DC=isd11';
function ldap_authenticate()
{
$username = $_POST['username'];
$password = $_POST['password'];
if ($username != "" && $password != "")
{
if (! ($ad = ldap_connect("172.22.1.20")))
{
die("Could not connect to LDAP server!");
}
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
if (! ldap_bind( $ad, "CN=Tuller\, 
Mike,OU=Staff,OU=LCDC,OU=Anoka-Hennepin,DC=ah,DC=isd11", $password))
{
	die("Unable to bind to server!");
}
if (! ($r = ldap_search( $ad, $dn, 'cn=' . $username)))
{
	die("Nothing Found!");
}
if ($r)
{
$result = ldap_get_entries( $ad, $r);
if ($result[0])
{
if (ldap_bind( $ds, $result[0][$dn], $password) )
{
return $result[0];
}
}
}
}
}

if (($result = ldap_authenticate()) == NULL) {
echo('Authorization Failed');
exit(0);
}
echo('Authorization success');
print_r($result);
?>
When I run everything though, I get this error:
Warning: ldap_search(): Search: No such object in 
/Library/Apache2/htdocs/ldap/auth.php on line 23
Nothing Found!

I have looked at this for too long, and now am to the point where I am 
out of ideas. Could someone look at this and see if they can figure out 
what I am doing wrong here?

Thanks,
Mike Tuller
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mysql_num_rows

2003-04-04 Thread Mike Tuller
I can't believe I forgot that. time to go home for the week.

thanks.

On Friday, April 4, 2003, at 04:28 PM, J J wrote:

oh and your SQL statement is wrong:

SELECT * FROM table WHERE  you are missing the
FROM...


--- Mike Tuller <[EMAIL PROTECTED]> wrote:
I can't get mysql_num_rows to work for some reason.
Here is a snippet
of what I have
$department_name = $_POST['department_name'];

$select_query = "SELECT * WHERE department_name =
'$department_name'";
$select_result = mysql_query($select_query,
$db_connect);
$select_total_rows = mysql_num_rows($select_result);
if ($select_total_rows<1)
{
$insert_query = " insert into departments
(department_name)
   
 values

('$department_name')";
   
 
mysql_query($insert_query, $db_connect) or die
(mysql_error());
I am getting back an error mysql_num_rows():
supplied argument is not a
valid MySQL result resource. I have looked over it
again and again, and
can't see what is wrong. Can anyone else see where
the problem might be?
Mike

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


__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com


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


[PHP] mysql_num_rows

2003-04-04 Thread Mike Tuller
I can't get mysql_num_rows to work for some reason. Here is a snippet 
of what I have

$department_name = $_POST['department_name'];

$select_query = "SELECT * WHERE department_name = '$department_name'";
$select_result = mysql_query($select_query, $db_connect);
$select_total_rows = mysql_num_rows($select_result);
if ($select_total_rows<1)
{
$insert_query = " insert into departments (department_name)
   
 values

('$department_name')";
   
 
mysql_query($insert_query, $db_connect) or die (mysql_error());
I am getting back an error mysql_num_rows(): supplied argument is not a 
valid MySQL result resource. I have looked over it again and again, and 
can't see what is wrong. Can anyone else see where the problem might be?

Mike

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


[PHP] Includes confusion

2003-04-04 Thread Mike Tuller
I can't figure this out. I have a line where I include a file

include "/Library/WebServer/includes/database_connection.inc";

I want to have this declared in one location, so that I don't have to 
change multiple lines if I ever move the application, everything works 
fine except inside functions. So if I have the following:

include "/Library/WebServer/includes/database_connection.inc";

function list_search_results()
{
// my code that lists search results
}
The functions returns an error, but if I do this:

function list_search_results()
{
include "/Library/WebServer/includes/database_connection.inc";
// my code that lists search results
}
Everything works fine. Shouldn't the function be able to use the 
include file when it is declared outside the function?

Mike

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


[PHP] Select all that contains in MySql

2003-04-03 Thread Mike Tuller
I have built a search function that searches a table for all items that 
match what you enter into the search field. I would like it to return 
all items that contain a certain string rather that matches. For 
example, I want to have it so that if I enter M in the search field, it 
will return all items that start with M.

Here is what I have so far.

$query = "SELECT * FROM software_assets WHERE $searchType LIKE 
'$search' ";

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


Re: [PHP] Register_globals question

2003-03-18 Thread Mike Tuller
Well, I know it has something to do with register_globals, because it 
only starts working when I turn register_globals on. If it is off, the 
script doesn't work.

Here is the php file that calls to the class. It doesn't seem to have 
anything that is global, but as I said before, I am not very familiar 
with this.



  mysql_connect("localhost","username","password");
  mysql_select_db("MyDatabase");
  // this is a dump variable just for demonstration purposes
  $cod= 5;
  // how many rows do you want per page???
  $step = 10;


  # Include class file
  include ("pn.class.php");
  # the sql query without Limit
  $sql = "select asset_id, developer, title, version, platform from 
software_assets ORDER BY asset_id";
  $res= mysql_query( $sql );
  $total = mysql_num_rows( $res );

  # initiate class
  # parameters explanation
  # 1st param : the sql query without Limit expretion
  # 2nd param : number of elements to display per page.
  # 3rd param : current page; this should be null
  # 4rth param : total rows of query
  //$buttons = new pn_buttons( $sql, $step, $page );
  $buttons = new pn_buttons( $sql, $step, $page, $total );
  # $buttons->limited_query is the sql query with limit expretion
  # class create this
  $res = mysql_query ($buttons->limited_query);
  echo "
  
";
 // table headers describing columns
  echo "
  
		
			Asset ID
			Developer
			Software Title
			Version
			Platform
		
		";

  // list elements one by one until there are no more in the database
  while ( list ( $asset_id, $developer, $title, $version, $platform ) = 
mysql_fetch_row($res) ){
  echo "
		
		$asset_id
		
		$developer
		
		$title
		
		$version
		
		$platform
		
		
		";
  }

  // close table once list elements loop is finished
  echo "";
  // Beginning of prev/next buttons. Will be centered in the table.
  echo"
  
  

";
  # Create Prev and next buttons
  # parameters explanation
  # 1st param : the page that displays results with ?  at the end
  # 2nd param : additional url parameters e.g. cid=$cid&top=$top
  # 3rd param : Text to display in next link
  # 4th param : Text to display in previous link
  $buttons->make_buttons("pn_classexample.php?","cid=$cod","Next 
Results", "Previous Results");

  # display previous and next links
  echo $buttons->previous_button . "    " 
.$buttons->next_button;

  # display current page number and total pages number
  echo "Page ". $buttons->current_page . " of  ". 
$buttons->query_total_pages;
  echo "";
  echo  $buttons->count_all_pages("pn_classexample.php?","cid=$cid");

?>






On Tuesday, March 18, 2003, at 11:02 AM, CPT John W. Holmes wrote:

I found a class that allows you to have a multiple page listing, where
it displays a certain number of items, and then you click on the next
page to show the next results. I found that it needs to have
register_globals turned on. I am learning, and would like to have
someone look at the class to tell me where in this class
register_globals is required. I have emailed the person that created
the class, I am just trying to understand this.
Mike

Here is the class code:



class pn_buttons{

   /* Public Variables */
   var $query_total_pages = 0;
   var $limited_query;
   var $next_button;
   var $previous_button;
   /* Functions */
   function pn_buttons($sql, $step, $page=0){
   $result = mysql_query( $sql );
   $query_total_rows = mysql_num_rows( $result );
   // if query return some rows
  if ( $query_total_rows>0 ){
  if ( $query_total_rows%$step!=0 ){
 $total_pages = intval( $query_total_rows/$step)+1;
  }else{
 $total_pages = $query_total_rows/$step ;
  }
  $this->query_total_pages = $total_pages;

  // if page is set
  if ( empty($page) ) {
 $from = 0;
 $this->current_page= 1;
  }else{
 if ( $page <= $this->query_total_pages ) {
  $from = $step * ( $page - 1 );
  $this->current_page= $page;
 }else{
  $from = 0;
  $this->current_page= 1;
 }
  }
  $this->limited_query = $sql . " LIMIT ". $from .", ".
$step;
   }
   } // end  function

   // create previous and next buttons
   function make_buttons( $link, $link_params, $txt_next="next",
$txt_previous="previous", $image="" ){
   if ( $this->query_total_pages>1 ){

   if ( ($this->current_page < $this->query_total_pages) 
&&
($this->current_page>1) ){
   $next_page = $this->current_page+1;
   $prev_page = $this->current_page-1;
   $next_lnk = "$txt_next";
   $prev_lnk = "$txt_previous";
   }else if( ($this->current_page <
$this->query_total_pages) && ($this->current_page==1) ){
  

[PHP] Register_globals question

2003-03-18 Thread Mike Tuller
I found a class that allows you to have a multiple page listing, where 
it displays a certain number of items, and then you click on the next 
page to show the next results. I found that it needs to have 
register_globals turned on. I am learning, and would like to have 
someone look at the class to tell me where in this class 
register_globals is required. I have emailed the person that created 
the class, I am just trying to understand this.

Mike

Here is the class code:



class pn_buttons{

  /* Public Variables */
  var $query_total_pages = 0;
  var $limited_query;
  var $next_button;
  var $previous_button;
  /* Functions */
  function pn_buttons($sql, $step, $page=0){
  $result = mysql_query( $sql );
  $query_total_rows = mysql_num_rows( $result );
  // if query return some rows
 if ( $query_total_rows>0 ){
 if ( $query_total_rows%$step!=0 ){
$total_pages = intval( $query_total_rows/$step)+1;
 }else{
$total_pages = $query_total_rows/$step ;
 }
 $this->query_total_pages = $total_pages;

 // if page is set
 if ( empty($page) ) {
$from = 0;
$this->current_page= 1;
 }else{
if ( $page <= $this->query_total_pages ) {
 $from = $step * ( $page - 1 );
 $this->current_page= $page;
}else{
 $from = 0;
 $this->current_page= 1;
}
 }
 $this->limited_query = $sql . " LIMIT ". $from .", ". 
$step;
  }

  } // end  function

  // create previous and next buttons
  function make_buttons( $link, $link_params, $txt_next="next", 
$txt_previous="previous", $image="" ){

  if ( $this->query_total_pages>1 ){

  if ( ($this->current_page < $this->query_total_pages) && 
($this->current_page>1) ){
  $next_page = $this->current_page+1;
  $prev_page = $this->current_page-1;
  $next_lnk = "$txt_next";
  $prev_lnk = "$txt_previous";
  }else if( ($this->current_page < 
$this->query_total_pages) && ($this->current_page==1) ){
  $next_page = $this->current_page+1;
  $prev_page = "";
  $next_lnk = "$txt_next";
  $prev_lnk = "";
  }else if( $this->current_page >= $this->query_total_pages 
){
  $next_page = "";
  $prev_page = $this->current_page-1;
  $next_lnk = "";
  $prev_lnk = "$txt_previous";
  }
  $this->next_button = $next_lnk;
  $this->previous_button = $prev_lnk;
  }

  } // end function

  // display all pages
  function count_all_pages( $link, $link_params ){
  for ($i=1; $i<=$this->query_total_pages; $i++){
  if ($i==$this->current_page){
  echo "[$i]";
  }else{
  echo "[$i]";
  }
  }
  }
} // end Class

?>

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


[PHP] Setting session variables from value in database

2003-03-13 Thread Mike Tuller
I have a login page and have sessions working so that if a user is in 
the database, they can login. I want to also add a "user_type" to the 
session so that I can have regular staff see certain things, and 
admin's see other things, but I can't seem to pull the information out 
of the database.

Here is part of what I have.

$query = "select * from users where username='$username' and 
password='$password' ";
$result = mysql_query($query);
$num = mysql_num_rows($result);

$row = mysql_fetch_array($result);

$_SESSION['user_type'] = $row['user_type'];
$user_type = $_SESSION['user_type'];
if ($num > 0 )
{
$_SESSION['valid_user'] = $username;
$valid_user = $_SESSION['valid_user'];
}
Now if I tell it to print $valid_user, it shows the user logged in, but 
if I try to print $user_type I don't get anything in return. Any ideas 
as to what I am doing wrong? I have tried a separate query for the 
mysql_fetch_array, and that didn't seem to work either.

Mike



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


Re: [PHP] Check to see if mysql_fetch_array result is empty

2003-03-12 Thread Mike Tuller
That was it. Thanks.

On Thursday, March 13, 2003, at 07:13 AM, Michael Roger C. Bianan wrote:

Hi,

It's a logical error in your IF stmt.

---
if ($num = 0)
{
echo "There are no matches for your search. Please try again.";
}
else
{
---

that should have been if ($num == 0) .

Notice the two = (==).

Thanks,

Miches:)

-Original Message-----
From: Mike Tuller [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 12:43 PM
To: [EMAIL PROTECTED]
Cc: php mailing list list
Subject: Re: [PHP] Check to see if mysql_fetch_array result is empty
Ok. I have it changed, but I have something wrong here, because when I
there result is 0, it doesn't print out the message that I want. If I
have it print out the result, it says 0. It has to be something simple,
but I can't see what is wrong.
	if ($num = 0)
	{
		echo "There are no matches for your search. Please try again.";
	}
	else
	{
	
		while ($row = mysql_fetch_array( $db_query ))
		{
		
			echo "
			
href=\"editsoftwareasset.php?id=$row[asset_id]\">$row[asset_id]
			
			$row[developer]
			
			$row[title]
			
			$row[version]
			
			$row[platform]
			
			\n";
		}
	}

On Thursday, March 13, 2003, at 05:45 AM, Michael Roger C. Bianan  
wrote:

Mike,

Use mysql_num_rows($db_query) ;

- returns no of rows in the result set.

- if none, returns 0.

Thanks,

Miches

-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 11:17 AM
To: php mailing list list
Subject: [PHP] Check to see if mysql_fetch_array result is empty
How can I check to see if a mysql_fetch_array is empty. I have a  
search
page, and want to have it so that when there are no matches, it  
returns
a message saying that there were no matches, and if there are, then
display them. Here is what I have so far to give you an idea as to  
what
I am trying to do.

Thanks
-
$query = "SELECT * FROM software_assets WHERE $searchType LIKE
'$search' ";
$db_query = mysql_query($query, $db_connect) or die (mysql_error());

while ($row = mysql_fetch_array( $db_query ))
{
if $row = NULL
{
echo "There were no results that match your query. Please try
again";
}
else
{
echo "
$row[asset_id]

$row[developer]

$row[title]

$row[version]

$row[platform]

\n";
}
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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


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


Re: [PHP] Check to see if mysql_fetch_array result is empty

2003-03-12 Thread Mike Tuller
Ok. I have it changed, but I have something wrong here, because when I  
there result is 0, it doesn't print out the message that I want. If I  
have it print out the result, it says 0. It has to be something simple,  
but I can't see what is wrong.

	if ($num = 0)
	{
		echo "There are no matches for your search. Please try again.";
	}
	else
	{
	
		while ($row = mysql_fetch_array( $db_query ))
		{
		
			echo "
			$row[asset_id]
			
			$row[developer]
			
			$row[title]
			
			$row[version]
			
			$row[platform]
			
			\n";
		}
	}

On Thursday, March 13, 2003, at 05:45 AM, Michael Roger C. Bianan wrote:

Mike,

Use mysql_num_rows($db_query) ;

- returns no of rows in the result set.

- if none, returns 0.

Thanks,

Miches

-----Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 11:17 AM
To: php mailing list list
Subject: [PHP] Check to see if mysql_fetch_array result is empty
How can I check to see if a mysql_fetch_array is empty. I have a search
page, and want to have it so that when there are no matches, it returns
a message saying that there were no matches, and if there are, then
display them. Here is what I have so far to give you an idea as to what
I am trying to do.
Thanks
-
	$query = "SELECT * FROM software_assets WHERE $searchType LIKE
'$search' ";
	$db_query = mysql_query($query, $db_connect) or die (mysql_error());
	
	while ($row = mysql_fetch_array( $db_query ))
	{
		if $row = NULL
		{
			echo "There were no results that match your query. Please try  
again";
		}
		else
		{
			echo "
			
href=\"editsoftwareasset.php?id=$row[asset_id]\">$row[asset_id]
			
			$row[developer]
			
			$row[title]
			
			$row[version]
			
			$row[platform]
			
			\n";
		}
	}

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


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


[PHP] Check to see if mysql_fetch_array result is empty

2003-03-12 Thread Mike Tuller
How can I check to see if a mysql_fetch_array is empty. I have a search  
page, and want to have it so that when there are no matches, it returns  
a message saying that there were no matches, and if there are, then  
display them. Here is what I have so far to give you an idea as to what  
I am trying to do.

Thanks
-
	$query = "SELECT * FROM software_assets WHERE $searchType LIKE  
'$search' ";
	$db_query = mysql_query($query, $db_connect) or die (mysql_error());
	
	while ($row = mysql_fetch_array( $db_query ))
	{
		if $row = NULL
		{
			echo "There were no results that match your query. Please try again";
		}
		else
		{
			echo "
			$row[asset_id]
			
			$row[developer]
			
			$row[title]
			
			$row[version]
			
			$row[platform]
			
			\n";
		}
	}

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


[PHP] Search all data in database

2003-03-11 Thread Mike Tuller
I am wanting to add a simple search field where you enter your search 
and it searches the whole database, not just one column. It would be 
easy for one column ( SELECT * FROM clients WHERE first_name = 
'$first_name';) but how do I search the whole table? Do I have to 
search each column one by one or is there an easier, more efficient way 
of doing this?

Thanks,

Mike

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


[PHP] Configure with register_globals on

2003-03-07 Thread Mike Tuller
I am running OS X 10.2 and am trying to work with PHP and Adobe GoLive. 
GoLive tells me that I don't have PHP running, which I do, and on 
Adobe's site someone said that register_globals needs to be on. I know 
that this is not something that should be done, but I want to see if 
this is the problem with GoLive saying PHP is not installed. I don't 
have a php.ini file to change the values for register_globals to be on, 
so what do I need to add when I run configure to have register_globals 
turned on?

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


[PHP] Forms and MySql date

2003-02-20 Thread Mike Tuller
I have a form that I want to enter a date into a MySql database. I
currently have the column in the database set as Date, and can't seem
to get the date I enter into the text field to go into the database
using the format yymmdd. I could change the column to varchar, and then
it would enter, but this will be a database that I want to keep track
of purchases, and if it is entered in as text, I wouldn't be able to do
calculations such as showing how old something is.

How can I have a text field where a person enters the date and have
that information entered into the database?

Mike


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




[PHP] Sessions

2003-02-03 Thread Mike Tuller
In an earlier post I wanted to carry an id number that I had in
$HTTP_GET_VARS into another script. I was told that one way would be to
store the number in the session.

My question is how can I store a variable inside a session? In my books
and in the documentation I see things about the global $_SESSION array,
and see examples using $_SESSION['visits'], but where can I store the
value of something like the id number of a record in a database.

What I have is a page that lists records in a database. In this case it
happens to be an asset database. I have a hypertext link for the
asset_id. I click on the link and it adds the id number to the url like
this:

$row[asset_id]

I then use $HTTP_GET_VARS to get the record's information and fill in
the fields in editsoftwareasset.php so that I can edit the information.

$query = "select * from assets where asset_id = '$HTTP_GET_VARS[id]'";

I am stuck when I go to save the information because I can't get the
$HTTP_GET_VARS to to carry onto the script for processing the changed
information. One way I could do it is with a hidden field, but I would
like to do it within sessions. How can I store the asset_id in the
session?

Thanks,

Mike


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




[PHP] Question

2003-01-31 Thread Mike Tuller
I am working from an example in a book that has the following and is 
not explained very well:

# read results of query, then clean up
while ($row = mysql_fetch_row($result))
{
	print ("\n");
	for ($i = 0; $i < mysql_num_fields ($result); $i++)
	{
		# escape any special characters and print
		printf ("%s\n", htmlspecialchars ($row[$i]));
	}
	print ("\n");
}

I understand most of what is going on here except for this line:

printf ("%s\n", htmlspecialchars ($row[$i]));

Can someone explain to me what the %s is?

Mike


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



Re: [PHP] HTTP_GET_VARS[]

2003-01-30 Thread Mike Tuller
I am using PHP 4.3.0. it looks a little confusing because I am not 
using the $_POST when calling variables, but that is because before 
that script I have this.

$title = $_POST['title'];
$version = $_POST['version'];
$developer = $_POST['developer'];
$serial_number = $_POST['serial_number'];
$platform = $_POST['platform'];

For me it makes things easier to read.

I changed what you said, and it still doesn't update anything. I even 
added echo $HTTP_POST_VARS['id']; to check to see if there was any 
value, but the echo statement doesn't return anything.

Can I carry the HTTP_POST_VARS to another page, or do I need to use 
hidden fields or something?


On Thursday, January 30, 2003, at 10:10 AM, Matt Schroebel wrote:

-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 11:02 AM
Subject: [PHP] HTTP_GET_VARS[]



The issue I am
having now is that I have the editsoftwareassest.php's form
action set
to POST to a script called updatesoftwareasset.php that is
supposed to
take the values from the fields in editsoftwareasset.php and
update the
information. I have the following statement sent to the database.

$query = "UPDATE assets SET title = '$title', version = '$version',
developer = '$developer', serial_number = '$serial_number',  WHERE
asset_id = '$HTTP_GET_VARS[id]'" ;


Change the var to '{$HTTP_POST_VARS['id']}' (with the curly braces 
since
the array reference is inside a double quoted string.  If your version
of php is 4.1.2 or higher, you really ought to use '{$_POST['id']}'
since it's a magic global and easier to use since you won't have to
declare it global inside functions.




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




[PHP] HTTP_GET_VARS[]

2003-01-30 Thread Mike Tuller
I have created a page for editing a row in a MySql database where first 
I have a page listing the items in the table, and have the id as a 
hypertext link that then on then opens the editing page with the 
correct information using HTTP_GET_VARS[id] where the URL is 
http://127.0.0.1/asset/editsoftwareasset.php?id=3. The issue I am 
having now is that I have the editsoftwareassest.php's form action set 
to POST to a script called updatesoftwareasset.php that is supposed to 
take the values from the fields in editsoftwareasset.php and update the 
information. I have the following statement sent to the database.

$query = "UPDATE assets SET title = '$title', version = '$version', 
developer = '$developer', serial_number = '$serial_number',  WHERE 
asset_id = '$HTTP_GET_VARS[id]'" ;

The $HTTP_GET_VARS[id] variable doesn't seem to carry to this script. I 
tested the sql statement by by having the asset_id = '3', and it 
updated the record, but the HTTP_GET_VARS didn't. How can I have the 
editsoftwareasset.php POST to the updatesoftwareasset.php and carry the 
HTTP_GET_VARS variable so that I can update the correct record?

I hope all of this makes sense.


Mike


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



Re: [PHP] $HTTP_GET_VARS

2003-01-17 Thread Mike Tuller
Nevermind. When copying my code to show you I noticed I have 
HTTP_GET_VARS, instead of $HTTP_GET_VARS, and now everything works.

Time to go home I guess.


On Friday, January 17, 2003, at 04:22 PM, Rick Emery wrote:


Show us your code
- Original Message -
From: "Mike Tuller" <[EMAIL PROTECTED]>
To: "php mailing list" <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 4:05 PM
Subject: [PHP] $HTTP_GET_VARS


I am following an example in a book and have run into a problem with a
script that I am trying to run under PHP 4.3.0. What I have is a page
that you click on an id number that is from a listing in a database,
and it is supposed to take you to a page to edit that item. I have the
id sent in the url (http://127.0.0.1/asset/editasset.php?id=3) and the
book says to use $HTTP_GET_VARS to take that id and display the record
for editing on a separate page. When I use $HTTP_GET_VARS nothing is
returned, and I am thinking that I can't use $HTTP_GET_VARS in PHP
4.3.0, so what do I need to use?

Thanks,
Mike


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




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




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




[PHP] $HTTP_GET_VARS

2003-01-17 Thread Mike Tuller
I am following an example in a book and have run into a problem with a 
script that I am trying to run under PHP 4.3.0. What I have is a page 
that you click on an id number that is from a listing in a database, 
and it is supposed to take you to a page to edit that item. I have the 
id sent in the url (http://127.0.0.1/asset/editasset.php?id=3) and the 
book says to use $HTTP_GET_VARS to take that id and display the record 
for editing on a separate page. When I use $HTTP_GET_VARS nothing is 
returned, and I am thinking that I can't use $HTTP_GET_VARS in PHP 
4.3.0, so what do I need to use?

Thanks,
Mike


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



[PHP] List items in table with a hypertext link

2003-01-16 Thread Mike Tuller
I have been looking for an example of how to create a listing of items 
in a table where you have the first item in the list have a link so 
that when you click on it, it will open a page for editing the contents 
of that item. So for instance you have a list of employees, and you 
want to change their phone number you could go to the list and click on 
the employee id number and it would open a page where you can edit the 
employee information.

I haven't been able to find a good example of this, so if anyone knows 
where I could find one, please let me know.

Mike


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



Re: [PHP] Sessions error

2003-01-08 Thread Mike Tuller
That did it! Thanks.


On Wednesday, January 8, 2003, at 05:16 AM, Ford, Mike [LSS] wrote:


-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]]
Sent: 08 January 2003 01:23

I am working with sessions, and following an example in a book and am
getting an error that I am not sure of. I have an html doc
that has the
fields for username and password and the information entered goes to
this script.


[...]

	if ($num > 0 )
	{
		$valid_user = $_POST[username];
		session_register("valid_user");
	}

// PHP script to create the html for the login page
if (session_is_registered("valid_user"))

[...]


Warning :  Unknown(): Your script possibly relies on a session
side-effect which existed until PHP 4.2.3. Please be advised that the
session extension does not consider global variables as a source of
data, unless register_globals is enabled. You can disable this
functionality and this warning by setting session.bug_compat_42 or
session.bug_compat_warn to off, respectively. in Unknown on line 0

What does this mean, and what am I doing wrong?


Well, you're not necessarily doing anything wrong -- as the warning 
says, your script *possibly* relies on...

What's happened is that in version 4.3.0, a bug in session variable 
handling was fixed -- but the fix changes the way session variables 
behave in certain situations, and PHP has detected that you *may* have 
coded in a way that is sensitive to those changes.  If you understand 
the issues (and I'm not 100% sure I do!) and are *sure* you're not 
relying on them, then you can set the session.bug_compat_* values in 
php.ini as specified.

The best way of avoiding this error, however, is to drop the use of 
session_register() and friends, and switch to using the $_SESSION[] 
array -- so the fragment of code I've left in above would become:

	if ($num > 0 )
	{
		$_SESSION['valid_user'] = $_POST['username'];
	}

// PHP script to create the html for the login page
if (isset($_SESSION["valid_user"]))

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211



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




[PHP] Sessions error

2003-01-07 Thread Mike Tuller
I am working with sessions, and following an example in a book and am 
getting an error that I am not sure of. I have an html doc that has the 
fields for username and password and the information entered goes to 
this script.


session_start();

// set variables needed
$username = $_POST['username'];
$password = $_POST['password'];

$connection = mysql_connect( 'localhost', 'username', 'password' ) or 
die (mysql_error());
$db = mysql_select_db( "database", $connection) or die (mysql_error());

	
$query = "select * from users where username='$username' and 
password=('$password')";
$result = mysql_query($query);
$num = mysql_num_rows($result);
	
	if ($num > 0 )
	{
		$valid_user = $_POST[username];
		session_register("valid_user");
	}

// PHP script to create the html for the login page
if (session_is_registered("valid_user"))
{
	echo "You are logged in as: $valid_user ";
	echo "Log out";
}
else
{
	if (isset($username))
	{
		// if they have tried and failed to login
		echo "Could not login with the username $username.";
	}
	else
	{
		// They have not tried to login yet or have logged out
		echo "You are not logged in. Please click on the link below to go 
back to the login form.";
	}
}
?>

Back to Login Form



Everything works except for when I login correctly, it shows that I am 
logged in, but at the bottom I get this message.

Warning :  Unknown(): Your script possibly relies on a session 
side-effect which existed until PHP 4.2.3. Please be advised that the 
session extension does not consider global variables as a source of 
data, unless register_globals is enabled. You can disable this 
functionality and this warning by setting session.bug_compat_42 or 
session.bug_compat_warn to off, respectively. in Unknown on line 0

What does this mean, and what am I doing wrong?

Thanks,
Mike


Re: [PHP] Advice needed

2002-07-13 Thread Mike Tuller

After much thought, I think I have figured out what I am going to do. I am
going to create on the first page, a place to add the hardware type, and
that will add a row to the database, and create the key I need. It will then
go to another page where I can enter the information, and I will have the
key to be able to do the volume stuff that I want. So I would have a
dropdown menu to select the type of hardware and and add hardware button
only.

This would also allow me to make this front end more customizable. For
instance if I have a drop down that contains workstation, server, printer,
etc. I could write the code so that when workstation is selected, and I hit
add, it brings up the page to enter workstation information. If I select
printer, then I can enter printer information. If later I decide to add
other items, even if they aren't computer related, I could with ease.

If anyone see a problem with this idea, let me know. I think this would
work, but I haven't started coding yet.

Mike

- Original Message -
From: "Alberto Serra" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 12, 2002 10:35 PM
Subject: Re: [PHP] Advice needed


> ðÒÉ×ÅÔ!
>
> Mike Tuller wrote:
> > So I would have the progressive key inside the addvolume window? Can you
> > explain how to go about doing this?
>
> How you organize your HTML output should *never* interfere with the way
> you organize your data, they are two different things and must be kept
> well separated. In a perfect world design, process flow and datamodeling
> should be free to evolve without stepping into each other's way. It's
> obviously impossible to fully meet this condition in the real world, but
> one should always try and get as close to it as he can.
>
> Just do this:
>
> Think of your data as a temporary table, in which you have two keys:
> 1) the real key, whenever available (will be blank on the stuff you
> haven't written in the database yet)
> 2) a progressive key, assigned by your php scripts by some means
>
> You just have the two keys constantly in your forms as hidden fields, so
> that at process time you can still tell which is which when it comes to
> relations, even if you do not have an already established relation
> system (which is the case on new data).
>
> So:
> you load your hdw components, they all have a db id already, so your
> dataset will look like this:
>
> 1) hdw 1, its real id, your own internal key (say 1), rest of the data
> 2) hdw 2, its real id, your own internal key (say 2), rest of the data
> ...
>
> you add a new component and save the result on a temporary table, now
> your temporary dataset is:
>
> 1) hdw 1, its real id, your own internal key (say 1), rest of the data
> 2) hdw 2, its real id, your own internal key (say 2), rest of the data
> 3) hdw new, no real id, your own internal key (say 3), rest of the data
> ...
>
> You add a new volume and stock the data on a second temporary table,
> which contains:
>
> 1) vol 1, no real id, your own hdw internal key (should be 3 since you
> are adding to the last new hdw), your own internal volume id (say 1),
> rest of the data
>
> You can repeat this step all over as much as you want (like fully
> building up a number of new disks, volumes or whatever), and have it as
> multilayered as you want (it will just take as many temporary tables as
> are the real tables involved).
>
> Once your user finally reviews his/her data (say you entered a totally
> new system, reviewed it and felt satisfied with it) he will have a
> "fire" button somewhere.
>
> At this point your final script just takes the data off the temporary
> tables and uses them to build the real thing.
>
> Notice that this way you also sort of implemented a transaction. Not a
> real one, since it will not protect you if your final script fails at
> runtime. Yet you can be sure no unconsistent data from unterminated
> sessions will ever enter your stable datamodel, and that's were 99.99%
> of the risk would come from.
>
> ðÏËÁ
> áÌØÂÅÒÔÏ
> ëÉÅ×
>
>
> @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@
>
> LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
> lOrD i'M sHiNiNg...
> YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Advice needed

2002-07-12 Thread Mike Tuller

So I would have the progressive key inside the addvolume window? Can you
explain how to go about doing this?


- Original Message -
From: "Alberto Serra" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 12, 2002 8:56 PM
Subject: Re: [PHP] Advice needed


> ðÒÉ×ÅÔ!
>
> Mike Tuller wrote:
> > The hardwareID is created in MySql when the information entered for the
hardware is submitted, which hasn't been done yet.
>
> You don't need it immediately. Just have a progressive key (like
> 1,2,3,4...) stored in a hidden field along with the new info you are
> getting. Once you'll process the final result you will substitute it
> with the values assigned by your DB engine. Sort of "temporary primary
> key", if you want :)
>
> ðÏËÁ
> áÌØÂÅÒÔÏ
> ëÉÅ×
>
> @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@
>
> LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
> lOrD i'M sHiNiNg...
> YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




[PHP] Advice needed

2002-07-12 Thread Mike Tuller

I am trying to develop a front end to a database that will be used for entering 
information about the computer systems I take care of. It would be easy to do if it 
weren't for one problem. I want to list information about the drives that are in each 
system. There could be one, two, or 10 drives, so I want to have it generate a new 
table row for each drive. That I can do. The issue I run into is how best to create 
the interface. Right now I have a page where everything is entered on one page. 

I have two tables in the database. One for the basic hardware information, and one for 
the volume information. The volume table has a field for the hardwareID so that I can 
tie the volumes to the hardware, and with a separte table, I can have as many drives 
as I want. The problem with this is that when I click on a hyperlink to open a window 
for adding a volume, I need a hardwareID to be able to tie the volume information to 
the hardware. The hardwareID is created in MySql when the information entered for the 
hardware is submitted, which hasn't been done yet.

I could break this up into multiple pages, where I enter the basic information, and 
then I will have an ID created to use so that I can add the volumes, but this could 
get messy. Is there a better way of doing this?

This is confusing to follow, I know. Here is a link to the page I am talking about so 
that you can get an idea of what I am talking about. 
http://bowser.homedns.org/assets/addasset.html  About 1/3 the way down, you will see 
an Add Volume link that will take you to the addvolume page.

Thanks in advance,

Mike



Re: [PHP] Populate Popup Menu from Database

2002-07-01 Thread Mike Tuller

Thanks for the tip.

> From: Erik Price <[EMAIL PROTECTED]>
> Date: Mon, 1 Jul 2002 17:05:39 -0400
> To: Mike Tuller <[EMAIL PROTECTED]>
> Cc: php mailing list <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Populate Popup Menu from Database
> 
> 
> On Monday, July 1, 2002, at 04:22  PM, Mike Tuller wrote:
> 
>> Thanks. Here is what I did for future reference.
> 
> Good.  What you chose to do is exactly what I do except for one
> thing... :
> 
>> $sql = "select department_name from Departments";
> 
> I generally grab the primary key column value as well, in the same
> query, and then I use that as the "value" attribute for the 
> tags:
> 
>> while($row = mysql_fetch_array($sql_result))
>> {
>> $department = $row["department_name"];
>> echo "$department";
>> 
>> }
> 
> while ($row = mysql_fetch_assoc($result)) {
> $dept_id = $row['department_id'];
> $dept_name = $row['department_name'];
> echo "$department_name\n";
> }
> 
> The reason I do this is because I end up using the ID far more than the
> "name" of a database record -- while I might echo the "name" to the user
> where needed (such as in the above dropdown listbox), the ID comes in
> handy as a reference in hyperlinks, form fields, etc -- it provides
> something that I've discovered is really missing in writing HTML-based
> applications: a unique handle on an object.  This is very hard to
> replicate given the statelessness of HTTP, but with a database record's
> primary key, you always have this unique identifier by which to refer to
> the object.  and a number is more pithy than a name.
> 
> It'll avoid situations where someone enters the same "name" value twice,
> too.  But it's not really a big deal unless you're doing a lot of work
> with a lot of data.
> 
> 
> Erik
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Populate Popup Menu from Database

2002-07-01 Thread Mike Tuller

Thanks. Here is what I did for future reference.


 -- Select a Department -- 

$department";

}
?>





> From: Erik Price <[EMAIL PROTECTED]>
> Date: Mon, 1 Jul 2002 09:18:12 -0400
> To: Mike Tuller <[EMAIL PROTECTED]>
> Cc: php mailing list <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Populate Popup Menu from Database
> 
> 
> On Saturday, June 29, 2002, at 11:41  AM, Mike Tuller wrote:
> 
>> What is here is beyond my understanding, and seems like it is a little
>> much
>> for what I need.
>> 
>> Here is what my database table looks like:
>> 
>> Departments
>> department_id
>> department_name
>> 
>> I just want to list the department name in the popup.
> 
> although I wrote this instruction in response to a question about
> integrating the listbox with javaScript, ignore the JS stuff, and you
> will see how to dynamically populate a listbox with database data:
> 
> http://marc.theaimsgroup.com/?l=php-general&m=102503848224300&w=2
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Populate Popup Menu from Database

2002-06-29 Thread Mike Tuller

To let everyone know, I did apologize to Mr. Wong. I misunderstood what he
was trying to ask me. I took it as he was saying "It's easy, what is "your"
problem" rather than "What "is" your problem" .

> From: Chris Shiflett <[EMAIL PROTECTED]>
> Date: Sat, 29 Jun 2002 13:50:14 -0500
> To: Mike Tuller <[EMAIL PROTECTED]>
> Cc: php mailing list <[EMAIL PROTECTED]>, Jason Wong
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Populate Popup Menu from Database
> 
> Mike Tuller wrote:
> 
>> I only ask questions if I have tried to do something myself already. I am
>> not looking for someone to do something for me. When I do ask a question
>> though, I feel I deserve at least a little respect. If you want to be an
>> ass, do it somewhere else.
>> 
> It seems *you* are the one being an ass and needing to "do it somewhere
> else."
> 
> If you can't have enough respect for people trying to help you by
> answering the simplest of questions (that should have been given in your
> original question anyway), you don't deserve an answer.
> 
> Here are Mr. Wong's questions again (very appropriate questions at
> that). Perhaps if you offer him a sincere apology, thank him for his
> time, and *answer* *his* *questions*, he might be willing to forgive
> your poor attitude and offer you some help.
> 
>>> There are two things you need to know:
>>> 
>>> 1) How to construct a select list in HTML
>>> 2) How to retrieve the info from the db
>>> 
>>> What are you having problems with?
>>> 
> If you don't know a damn thing, that's fine. An appropriate answer would
> be, "I neither know how to construct a select list in HTML nor how to
> retrieve information from a database."
> 
> Chris
> 


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




Re: [PHP] Populate Popup Menu from Database

2002-06-29 Thread Mike Tuller

I only ask questions if I have tried to do something myself already. I am
not looking for someone to do something for me. When I do ask a question
though, I feel I deserve at least a little respect. If you want to be an
ass, do it somewhere else.

> From: Jason Wong <[EMAIL PROTECTED]>
> Organization: Gremlins Associates
> Reply-To: [EMAIL PROTECTED]
> Date: Sat, 29 Jun 2002 23:54:22 +0800
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Populate Popup Menu from Database
> 
> On Saturday 29 June 2002 23:41, Mike Tuller wrote:
>> I have some popup menus and want the items in the menu to be populated from
>> a database. In this case I have a table that contains a listing of
>> departments. I have a page that I can go in and add/delete departments, and
>> want the changes to reflect in the menu the next time you go to the page.
>> 
>> I searched for examples and found this:
>> 
>> http://marc.theaimsgroup.com/?l=php-general&m=97628169623096&w=2
>> 
>> What is here is beyond my understanding, and seems like it is a little much
>> for what I need.
>> 
>> Here is what my database table looks like:
>> 
>> Departments
>> department_id
>> department_name
>> 
>> I just want to list the department name in the popup.
> 
> There are two things you need to know:
> 
> 1) How to construct a select list in HTML
> 2) How to retrieve the info from the db
> 
> What are you having problems with?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> /*
> The only rose without thorns is friendship.
> */
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Populate Popup Menu from Database

2002-06-29 Thread Mike Tuller

Thanks. I thought the example I found was a little to complicated for
something like this.


> From: "Cal Evans" <[EMAIL PROTECTED]>
> Date: Sat, 29 Jun 2002 11:03:16 -0500
> To: "Mike Tuller" <[EMAIL PROTECTED]>, "php mailing list"
> <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Populate Popup Menu from Database
> 
> Hi Mike,
> 
> Check out ADODB. It's a database abstraction layer for PHP that has
> functions to do this. (php.weblogs.com)  Otherwise it's kinda easy to do
> this, here's some psuedo-code that shoudl get you going.
> 
>  // Make your connection to your database
> // Select * from department
> ?>
> 
>  //While !EOF
> ?>
>   $rs->fields['departmentName']; ?>
> ?>
>  // loop
> ?>
> 
> 
> =C=
> 
> *
> * Cal Evans
> * Journeyman Programmer
> * Techno-Mage
> * http://www.calevans.com
> *
> 
> 
> -Original Message-
> From: Mike Tuller [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 29, 2002 10:42 AM
> To: php mailing list
> Subject: [PHP] Populate Popup Menu from Database
> 
> 
> I have some popup menus and want the items in the menu to be populated from
> a database. In this case I have a table that contains a listing of
> departments. I have a page that I can go in and add/delete departments, and
> want the changes to reflect in the menu the next time you go to the page.
> 
> I searched for examples and found this:
> 
> http://marc.theaimsgroup.com/?l=php-general&m=97628169623096&w=2
> 
> What is here is beyond my understanding, and seems like it is a little much
> for what I need.
> 
> Here is what my database table looks like:
> 
> Departments
>   department_id
>   department_name
> 
> I just want to list the department name in the popup.
> 
> 
> Thanks,
> Mike
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




[PHP] Populate Popup Menu from Database

2002-06-29 Thread Mike Tuller

I have some popup menus and want the items in the menu to be populated from
a database. In this case I have a table that contains a listing of
departments. I have a page that I can go in and add/delete departments, and
want the changes to reflect in the menu the next time you go to the page.

I searched for examples and found this:

http://marc.theaimsgroup.com/?l=php-general&m=97628169623096&w=2

What is here is beyond my understanding, and seems like it is a little much
for what I need.

Here is what my database table looks like:

Departments
department_id
department_name

I just want to list the department name in the popup.


Thanks,
Mike


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




Re: [PHP] LDAP support for 4.0.5

2001-05-02 Thread Mike Tuller

I didn't see that anyone had responded to your question. You need to install
OpenLDAP. It is the only opensource one that I know.

Mike

> From: "Walgamotte, David" <[EMAIL PROTECTED]>
> Date: Tue, 1 May 2001 15:03:25 -0500
> To: [EMAIL PROTECTED]
> Subject: [PHP] LDAP support for 4.0.5
> 
> Can anyone direct me as to what source is needed to compile ldap support
> into php ? I get the error ldap.h not found when performing a configure
> *options on php4.0.5. The server does not have an LDAP directory installed
> which makes perfect sense. I need to find an opensource solution that works
> well with php.
> 
> Thanks in advance for any assistance !!
> 
> David 
>  
> 


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




[PHP] printable output of array

2001-04-26 Thread Mike Tuller

I had what I thought was a great idea in creating a downloadable phone
directory using PHP to connect to the LDAP server and gather the info for
output. I originally wanted to have it create a PDF document, and still
would, but I don't think that you can create multiple page documents with
PHP and PDFlib. Please correct me if I am wrong.

Does anyone know what might be the best way to accomplish this project? We
have 4200 employees total.

Thanks


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




[PHP] Array question

2001-04-26 Thread Mike Tuller

I am trying to pull info from an Exchange LDAP server to make a dynamically
created phonebook, and am having trouble with one field. I think the problem
is that the script I have has everything pulled in an array, and all but the
field I am having problems with are strings. The telephoneNumber would be
integer. Would this cause the telephoneNumber info to not show up when I
view it through a web browser?

Here is the script I have.

";

print "";

for ($i=0; $i<$info["count"]; $i++) {

print "";
print "";
print $info[$i]["cn"][0];
print "";
print "";
print $info[$i]["title"][0];
print "";
print "";
print $info[$i]["department"][0];
print "";
print "";
print $info[$i]["telephoneNumber"][0];
print "";
print "";

  }

ldap_close($dir);
?>


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




[PHP] Ldap question

2001-04-25 Thread Mike Tuller

I am trying to pull info from an Exchange LDAP server to make a dynamically
created phonebook, and am having trouble with one field. I think the problem
is that the script I have has everything pulled in an array, and all but the
field I am having problems with are strings. The telephoneNumber would be
integer. Would this cause the telephoneNumber info to not show up when I
view it through a web browser?

Here is the script I have.

";

print "";

for ($i=0; $i<$info["count"]; $i++) {

print "";
print "";
print $info[$i]["cn"][0];
print "";
print "";
print $info[$i]["title"][0];
print "";
print "";
print $info[$i]["department"][0];
print "";
print "";
print $info[$i]["telephoneNumber"][0];
print "";
print "";

  }

ldap_close($dir);
?>


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




[PHP] LDAP listing from Exchange

2001-04-25 Thread Mike Tuller

I am having troubles displaying all the information I need from an Exchange
server. I can display name, department, title, but can't get the phone
number to show up. Can someone show me a script that will pull the object
identifiers from the server so that I can make sure I have everything set
right?

Thanks.


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




[PHP] LDAP listing from Exchange

2001-04-25 Thread Mike Tuller

I am having troubles displaying all the information I need from an Exchange
server. I can display name, department, title, but can't get the phone
number to show up. Can someone show me a script that will pull the object
identifiers from the server so that I can make sure I have everything set
right?

Thanks.


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




Re: [PHP] Webmin

2001-03-16 Thread Mike Tuller

Webmin uses templates, so you could create anything you want. If you go into
Webmin configuration under the Webmin tab, you will see templates. When you
go in there you will see a menu for current theme. It should have Calderas
theme. That at least means they are open to template creation.

I agree though, it would be nice in PHP, but I think that you can still do a
little more system level scripting in Perl right now.


> From: Michael Kimsal <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Fri, 16 Mar 2001 11:33:46 -0500
> To: [EMAIL PROTECTED]
> Subject: [PHP] Webmin
> 
> Although I somewhat agree with the webmin sentiment,
> after having tried to do simple maintenance on a cobalt for someone,
> it seems a real dog for anything outside the normal scope of what
> they want you to do.  We needed to edit an httpd.conf file,
> but there doesn't seem to be a way to do it.  Ditto for restarting Apache.
> Add a MIME type?  No dice.
> 
> Webmin is not the slickest interface, but seems to offer a lot of flexibility.
> 
> Rather than rewriting something, perhaps you could vounteer to design
> a better interface for existing webmin stuff.
> 
> A PHP-based version of webmin would be nice, but it's already a rather
> developed project, and after considering how to do it myself, I realized
> there's a whole hell of a lot of configurations and systems to have to
> consider beyond my few linux distros.
> 
> John Huggins wrote:
> 
>> You mention a large desire for a good web based administrator.  I wonder if
>> there is a version of a web based system administrator available that works
>> like Cobalt, but can be installed on any hosting setup.  Have you folks
>> heard of such a thing?  I am aware of Webmin, but am not too impressed with
>> it yet.
>> 
>> I have toyed with the idea of writing my own.  Jamie, what items do you feel
>> must be controllable in a web hosting account administration panel?  Yes, we
>> all know the basics, like email, dns, etc. but a bulleted list would be a
>> good start at organizing a development effort.
>> 
>> John
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] ldap_search()

2001-03-09 Thread Mike Tuller

Ok. That makes sense. I have the structure printed out, so I shouldn't have
a problem.

> From: "Nick Talbott" <[EMAIL PROTECTED]>
> Date: Thu, 8 Mar 2001 08:21:15 -
> To: "Mike Tuller" <[EMAIL PROTECTED]>, "php mailing list"
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP]  ldap_search()
> 
> Mike
> 
> The purpose of setting the basedn is to say "search in this branch of the
> directory".
> 
> The only person who can really tell you what basedn to use is whoever
> designed or manages the structure of your LDAP server.  Having said that, a
> base dn is commony something like ...
> o=Your Organisation,c=US
> 
> Some LDAP managers also make consistent use of the "ou" or
> "organizationalUnit" attribute to provide a further logical division of the
> directory.  If your directory is organised this way, and you want to
> restrict your search to just one ou in the organisation, you might set the
> basedn for the search to be
> ou=Whatever Section,o=Your Organisation,c=US
> 
> HTH
> 
> Nick Talbott
> IT Policy and Strategy Manager, Powys County Council, UK
> 
> email [EMAIL PROTECTED]
> FAX +44 (0) 1597 824781
> web http://www.powys.gov.uk and http://www.powysweb.co.uk
> 
> 
> -Original Message-
> From: Mike Tuller <[EMAIL PROTECTED]>
> To: php mailing list <[EMAIL PROTECTED]>
> Date: 08 March 2001 01:03
> Subject: [PHP] ldap_search()
> 
> 
>> Sorry about this, but I don't know much about LDAP, and the book I have
>> doesn't tell me much.
>> 
>> I was shown the following script to grab information from an LDAP server
> and
>> display the results in a phonebook type format.
>> 
>> 
>> 
>> > $ldapserver = "ldap.something.com";
>> $basedn = "dc=something, dc=com";
>> 
>> $dir =ldap_connect($ldapserver);// Connect to server
>> 
>> if ($dir) {
>>  ldap_bind($dir);  // Bind to the server
>>  $result = ldap_search($dir, $basedn, "sn=*");  // query connection, set
>> the base and look for any sn
>> 
>>  $info = ldap_get_entries($dir, $result);  // The results get sent to the
>> $info object
>> 
>>  for ($i=0; $i<$info["count"]; $i++) {// Count is a ldap feature that
>> contains the length of the resultset
>>echo $info[$i]["cn"][0]; // choose any parameter you want see here
>>  }
>> 
>>  ldap_close($dir);
>> }
>> ?>
>> 
>> 
>> 
>> 
>> The problem I am running into I think is that I work for a school district,
>> and I don't have a .com address. I have anoka.k12.mn.us. I tried to put in
>> $basedn = "dc=anoka, dc=k12, dc=mn, dc=us"; but I still receive an error on
>> ldap_search. Am I doing this correctly?
>> 
>> Mike
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
>> 
> 


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




[PHP] ldap_search()

2001-03-07 Thread Mike Tuller

Sorry about this, but I don't know much about LDAP, and the book I have
doesn't tell me much.

I was shown the following script to grab information from an LDAP server and
display the results in a phonebook type format.








The problem I am running into I think is that I work for a school district,
and I don't have a .com address. I have anoka.k12.mn.us. I tried to put in
$basedn = "dc=anoka, dc=k12, dc=mn, dc=us"; but I still receive an error on
ldap_search. Am I doing this correctly?

Mike


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




[PHP] LDAP Listing

2001-02-27 Thread Mike Tuller

I want to create a list of everyone on the LDAP server, and none of the
examples I have in my books seems to work. What functions should I use to
connect to the server, and list users in the LDAP to create a phone book
type list to print out? Could someone also give me some sort of example that
I can look at?

Mike Tuller


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




Re: [PHP] PDF Problems

2001-02-22 Thread Mike Tuller

Do you have any idea when 4.0.5 will be out?

> From: "Mathias Meyer" <[EMAIL PROTECTED]>
> Date: Thu, 22 Feb 2001 10:57:31 +0100
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] PDF Problems
> 
>> -Original Message-
>> From: Mike Tuller [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, February 22, 2001 12:01 AM
>> To: Michael Stearne; Sam Goin
>> Cc: php mailing list
>> Subject: Re: [PHP] PDF Problems
>> 
>> If anyone knows how to fix this please let me know.
>> 
> In fact the Maintainers of the PDFlib-Extension in PHP change from PHP
> 4.0.5. That means, that those functions, already mentioned in the manual
> will work from then on I guess. I also wondered why those functions are
> mentioned, although they do not work yet.
> 
> The fix you mentioned, was not really correct, because the
> comment-parser at php.net replaces the  trouble with html-tags I guess. The fix describes there was just how to
> do an example pdf with for example php4.0.4pl1 and pdflib 3.0.3, because
> there is no pdf_new() in this versions. it worked fine for me and I hate
> the thought of changing my just finished pdf-project to the new
> functions.
> 
> you'll find a short text about pdflib and php 4.0.5 at
> 
> http://www.php.net/manual/en/ref.pdf.php
> 
> There is a small text with the heading "Confusion with old PDFlib
> Versions".
> 
> best regards from germany.


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




Re: [PHP] PDF Problems

2001-02-21 Thread Mike Tuller

After spending a lot of time on this I think I almost have it figured out. I
don't think it is a problem with the install.

A found on php.net where when using pdflib 3.03, pdf_new() doesn't work. The
fix is at the bottom of http://www.php.net/manual/en/ref.pdf.php It says to
change pdf_new() to the following:


> Date: Wed, 21 Feb 2001 17:31:45 -0500
> To: Sam Goin <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PDF Problems
> 
> What OS and glibc version?  There are problems with the set-up in RH7.
> 
> Michael
> 
> 
> Sam Goin wrote:
> 
>> Hi,
>> 
>> I am running PHP4.04pl1, pdflib3.03, jpeg6b, tiff3.5.5, apache1.3.17.
>> 
>> Some of the pdf functions work, but others don't, such as pdf_new().
>> 
>> Does anybody know what the problem is? I have been all over the
>> documentation, email archives, and support discussions at phpbuilder.com
>> 
>> thanks,
>> 
>> Sam
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] PDF Functions

2001-02-18 Thread Mike Tuller

Ok. I have done everything I have been told to do, found on the web, and I
can think of other than bringing in a voodoo priest to get this going. I'll
try to explain what I have done so far.

I have a system with RedHat 7.0 installed, and am trying to get PDFlib to
work with PHP 4.04. The configure script I am using is as follows:

./configure --with-mysql=/usr/local --with-config-file-path=/www/conf
--with-apache=../httpd --enable-track-vars--with-system-regex=yes
--with-gd   --with-jpeg-dir=/usr  --with-png-dir=/usr   --with-zlib-dir=/usr
--with-pdflib=/usr/local--with-tiff-dir=/usr

Configure runs fine, make runs without errors, make install too. When I go
to bring up the test page of the clock, I get this.

Fatal error: Call to undefined function: pdf_new() in
/www/servers/pdfclock.php on line 7

I have taken the advice of others to not use the rpm of apache and have
compiled it myself. I also spent the time removing RedHat 7 and putting 6.2
back on. Only to find that if anything needs updating, that dependency
problems forced me to go back to 7.0 anyway.

I have updated the system library and specified at
http://www.phpbuilder.com/columns/perugini20001026.php3?page=2

It still doesn't work! I finally decided to try using ClibPDF. That runs
into the same problem at the same spot.

Fatal error: Call to undefined function: cpdf_open() in
/www/servers/pdftest.php on line 2

So this tells me that there is probably not anything wrong with PDFlib or
ClibPDF, that it is something that I am not doing or something else. PHP is
working fine though, and if I compile with Mysql or anything else, they work
fine.

If anyone has anymore advice on how to get this PDFlib working, please let
me know.


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




Re: [PHP] PDF Functions

2001-02-15 Thread Mike Tuller

I did that yesterday, but didn't help. I've reinstalled RedHat 6.2 now, so
it is moot for me.



> From: Mathias Meyer <[EMAIL PROTECTED]>
> Date: Thu, 15 Feb 2001 12:52:53 +0100
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: RE: Re: [PHP] PDF Functions
> 
>> -Original Message-
>> From: Chris Carbaugh [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, February 15, 2001 1:39 AM
>> To: Mike Tuller; Michael Stearne
>> Cc: php mailing list
>> Subject: Re: Re: [PHP] PDF Functions
>> 
>> Redhat's *.0 releases are known to be problematic.  They are usually
>> pretty much bleading edge, meaning they're buggy.
>> 
> Thats might not really a problem. A few days ago I successfully compiled PHP
> 4.0.4 with PDFlib 3.0.3 on RedHat 7. When I tried it on Mandrake 7.2 I
> failed, but on RH7 it compiled without any problems. Maybe a description of
> the installed libraries would help here.
> 
> An ldconfig is important after installing PDFlib and configuring PDFlib with
> --enable-shared-pdflib too.
> 
> Best Regards.
> Mathias Meyer
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] PDF Functions

2001-02-15 Thread Mike Tuller

I will as soon as the final release comes out. I don't want to rely on the
beta now. Even though it is very stable. It will be nice to have standard
hardware for a change.

Mike

> From: Michael Stearne <[EMAIL PROTECTED]>
> Date: Thu, 15 Feb 2001 00:53:22 -0500
> To: [EMAIL PROTECTED]
> Cc: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] PDF Functions
> 
> I'm waiting on OS X also.  (I'm running it now.) But I need to get a RH
> setup working for a client.  BTW PHP4, mySQL and Apache work fine of the
> OS X PB so you might try installing PDF on that (I haven't yet though).
> 
> Michael
> 
> 
> Chris Carbaugh wrote:
> 
>> OS X?  What's that? :)  Damn Mac PPC somethin or other I just
>> don't get it..
>> 
>> In the mean time, I'd say 6.2 is a good bet.
>> 
>> Good Luck,
>> 
>> Chris
>> 
>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>> Date: Wed, 14 Feb 2001 19:03:05 -0600
>>> To: <[EMAIL PROTECTED]>, Michael Stearne <[EMAIL PROTECTED]>
>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>> Subject: Re: [PHP] PDF Functions
>>> 
>>> I decided on my way home tonight to ditch 7.0 and go back to 6.2. I
>>> think
>>> that it is the only way to get anything done. When 7.1 or later comes
>>> out
>>> then I can go back. Thanks for your help.
>>> 
>>> When OS X finally ships I will be happy.
>>> 
>>> Mike
>>> 
>>>> From: Chris Carbaugh <[EMAIL PROTECTED]>
>>>> Reply-To: [EMAIL PROTECTED]
>>>> Date: Wed, 14 Feb 2001 19:39:04 EST
>>>> To: Mike Tuller <[EMAIL PROTECTED]>, Michael Stearne
>>>> <[EMAIL PROTECTED]>
>>>> Cc: php mailing list <[EMAIL PROTECTED]>
>>>> Subject: Re: Re: [PHP] PDF Functions
>>>> 
>>>> 
>>>> Well, first let me say that I'm kind of surprised I'm the only one
>>>> trying to help you guys out.  It seems not many folk are into
>>> PHP/PDF?
>>>> 
>>>> Any how,
>>>> 
>>>> Redhat's *.0 releases are known to be problematic.  They are
>>> usually
>>>> pretty much bleading edge, meaning they're buggy.
>>>> 
>>>> The last time I compiled PHP with PDF support, was a few weeks ago.
>>>  It
>>>> was on RedHat 6.2, PHP 4.0.2, and PDFLIB, as a CGI or a stand alone
>>>> executable.  The config was pretty much ./configure
>>>> --with-pgsql=/usr/local/pgsql --with-pdf=/usr/local/bin  (I really
>>>> think that was it, note I did NOT point right to the libpdf.so).  I
>>>> also added /usr/local/lib to /etc/ld.so.conf and did a ldconfig.
>>>> 
>>>> That's really all I did.  RH 6.2, source tarballs of Apache 1.3.12,
>>> PHP
>>>> 4.0.2, pdflib 3.03, postgresql 7.0.2.
>>>> 
>>>> If everything configs/builds correctly, I would blame RH 7.0
>>>> 
>>>> While I would like to install RH 7.0 and figure out what's up, I
>>> just
>>>> don't have the time.  I would suggest, A) you try to install
>>> PHP/PDF as
>>>> a CGI under your current install.  This allows the simplest
>>> install.
>>>> If that doesn't work, try RH 6.2 or some other distro?
>>>> 
>>>> Good Luck,
>>>> 
>>>> Chris
>>>> 
>>>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>>>> Date: Wed, 14 Feb 2001 17:45:28 -0600
>>>>> To: Michael Stearne <[EMAIL PROTECTED]>
>>>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>>>> Subject: Re: [PHP] PDF Functions
>>>>> 
>>>>> Exactly!!! I have gone back and redone everything 3 or 4 times,
>>> and
>>>>> am on
>>>>> day 3 of this. I watch while I configure, and it says that it is
>>>>> working,
>>>>> but when I go to check. I still get an error.
>>>>> 
>>>>> 
>>>>>> From: Michael Stearne <[EMAIL PROTECTED]>
>>>>>> Date: Wed, 14 Feb 2001 18:01:20 -0500
>>>>>> To: [EMAIL PROTECTED]
>>>>>> Cc: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
>>>>>> <[EMAIL PROTECTED]>
>>>>>> Subject: Re: [PHP] PDF Functions
>>>>>> 
>>>>>> 
>>&g

Re: [PHP] PDF Functions

2001-02-14 Thread Mike Tuller

I decided on my way home tonight to ditch 7.0 and go back to 6.2. I think
that it is the only way to get anything done. When 7.1 or later comes out
then I can go back. Thanks for your help.

When OS X finally ships I will be happy.

Mike

> From: Chris Carbaugh <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Wed, 14 Feb 2001 19:39:04 EST
> To: Mike Tuller <[EMAIL PROTECTED]>, Michael Stearne
> <[EMAIL PROTECTED]>
> Cc: php mailing list <[EMAIL PROTECTED]>
> Subject: Re: Re: [PHP] PDF Functions
> 
> 
> Well, first let me say that I'm kind of surprised I'm the only one
> trying to help you guys out.  It seems not many folk are into PHP/PDF?
> 
> Any how,
> 
> Redhat's *.0 releases are known to be problematic.  They are usually
> pretty much bleading edge, meaning they're buggy.
> 
> The last time I compiled PHP with PDF support, was a few weeks ago.  It
> was on RedHat 6.2, PHP 4.0.2, and PDFLIB, as a CGI or a stand alone
> executable.  The config was pretty much ./configure
> --with-pgsql=/usr/local/pgsql --with-pdf=/usr/local/bin  (I really
> think that was it, note I did NOT point right to the libpdf.so).  I
> also added /usr/local/lib to /etc/ld.so.conf and did a ldconfig.
> 
> That's really all I did.  RH 6.2, source tarballs of Apache 1.3.12, PHP
> 4.0.2, pdflib 3.03, postgresql 7.0.2.
> 
> If everything configs/builds correctly, I would blame RH 7.0
> 
> While I would like to install RH 7.0 and figure out what's up, I just
> don't have the time.  I would suggest, A) you try to install PHP/PDF as
> a CGI under your current install.  This allows the simplest install.
> If that doesn't work, try RH 6.2 or some other distro?
> 
> Good Luck,
> 
> Chris
> 
> On Wed, 14 Feb 2001, Mike Tuller wrote:
>> Date: Wed, 14 Feb 2001 17:45:28 -0600
>> To: Michael Stearne <[EMAIL PROTECTED]>
>> From: Mike Tuller <[EMAIL PROTECTED]>
>> Subject: Re: [PHP] PDF Functions
>> 
>> Exactly!!! I have gone back and redone everything 3 or 4 times, and
>> am on
>> day 3 of this. I watch while I configure, and it says that it is
>> working,
>> but when I go to check. I still get an error.
>> 
>> 
>>> From: Michael Stearne <[EMAIL PROTECTED]>
>>> Date: Wed, 14 Feb 2001 18:01:20 -0500
>>> To: [EMAIL PROTECTED]
>>> Cc: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
>>> <[EMAIL PROTECTED]>
>>> Subject: Re: [PHP] PDF Functions
>>> 
>>> 
>>> 
>>> Chris Carbaugh wrote:
>>> 
>>>> 
>>>> 
>>>> I have had problems in the past with RedHat's RPMs.  They seem to
>> put
>>>> things in weird places.  And just removing them and starting fresh
>> with
>>>> source always seems to work.  Besides, once you have built from
>> source
>>>> a few times, it's really a piece of cake, and much less
>> frustrating
>>>> than screwing with RPMs.
>>>> 
>>> 
>>> I am in the same situation except I have compiled from all the
>> sources (not
>>> RPMS) and I still get hung up when I try to include PDF.  My system
>> is a
>>> new install of RH 7 with the updates that up2date suggests (gcc,
>> etc.).  I
>>> have compiled and installed PHP with PDF no problem on RH 6.2.  I
>> think the
>>> issue is something specific to RH7. I hope RH 7.1 fixes it.  I
>> think at
>>> this point I am going back to 6.2
>>> 
>>> Michael
>>> 
>>> 
>>> 
>>>> 
>>>> Chris
>>>> 
>>>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>>>> Date: Wed, 14 Feb 2001 15:49:44 -0600
>>>>> To: <[EMAIL PROTECTED]>, php mailing list
>>>>> <[EMAIL PROTECTED]>
>>>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>>>> Subject: Re: [PHP] PDF Functions
>>>>> 
>>>>> The reason why I needed the RPM is because no matter what I
>> tried, I
>>>>> couldn't get PHP to compile for the Apache rpm on Redhat 7. If at
>> all
>>>>> possible, I like to use the rpms so that they can be easily
>> updated.
>>>>> 
>>>>> I have done everything everyone has suggested, and I still get an
>>>>> error. I
>>>>> have even compiled PHP and still I can't use PDFlib. What next?
>>>>> 
>>>>> Here is the updated config script that I used.
>>>>> 
>>>>>  ./co

Re: [PHP] PDF Functions

2001-02-14 Thread Mike Tuller

Exactly!!! I have gone back and redone everything 3 or 4 times, and am on
day 3 of this. I watch while I configure, and it says that it is working,
but when I go to check. I still get an error.


> From: Michael Stearne <[EMAIL PROTECTED]>
> Date: Wed, 14 Feb 2001 18:01:20 -0500
> To: [EMAIL PROTECTED]
> Cc: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] PDF Functions
> 
> 
> 
> Chris Carbaugh wrote:
> 
>> 
>> 
>> I have had problems in the past with RedHat's RPMs.  They seem to put
>> things in weird places.  And just removing them and starting fresh with
>> source always seems to work.  Besides, once you have built from source
>> a few times, it's really a piece of cake, and much less frustrating
>> than screwing with RPMs.
>> 
> 
> I am in the same situation except I have compiled from all the sources (not
> RPMS) and I still get hung up when I try to include PDF.  My system is a
> new install of RH 7 with the updates that up2date suggests (gcc, etc.).  I
> have compiled and installed PHP with PDF no problem on RH 6.2.  I think the
> issue is something specific to RH7. I hope RH 7.1 fixes it.  I think at
> this point I am going back to 6.2
> 
> Michael
> 
> 
> 
>> 
>> Chris
>> 
>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>> Date: Wed, 14 Feb 2001 15:49:44 -0600
>>> To: <[EMAIL PROTECTED]>, php mailing list
>>> <[EMAIL PROTECTED]>
>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>> Subject: Re: [PHP] PDF Functions
>>> 
>>> The reason why I needed the RPM is because no matter what I tried, I
>>> couldn't get PHP to compile for the Apache rpm on Redhat 7. If at all
>>> possible, I like to use the rpms so that they can be easily updated.
>>> 
>>> I have done everything everyone has suggested, and I still get an
>>> error. I
>>> have even compiled PHP and still I can't use PDFlib. What next?
>>> 
>>> Here is the updated config script that I used.
>>> 
>>>  ./configure   --prefix=/usr   --with-config-file-path=/etc
>>> --disable-debug   --enable-pic   --enable-shared
>>> --enable-inline-optimization   --with-apxs=/usr/sbin/apxs
>>> --with-exec-dir=/usr/bin   --with-regex=system   --with-gettext
>>> --with-gd
>>> --with-jpeg-dir=/usr   --with-png   --with-zlib   --with-gdbm
>>> --enable-debugger   --enable-magic-quotes   --enable-safe-mode
>>> --enable-sockets   --enable-sysvsem   --enable-sysvshm
>>> --enable-track-vars
>>> --enable-yp   --enable-ftp   --enable-wddx   --with-mysql
>>> --with-xml
>>> --with-pdflib=/usr/local/lib   --with-tiff
>>> 
>>> 
>>>> From: Chris Carbaugh <[EMAIL PROTECTED]>
>>>> Reply-To: [EMAIL PROTECTED]
>>>> Date: Wed, 14 Feb 2001 15:08:02 EST
>>>> To: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
>>>> <[EMAIL PROTECTED]>
>>>> Subject: Re: [PHP] PDF Functions
>>>> 
>>>> 
>>>> How about in /etc/ld.so.conf you make sure /usr/lib is in there.
>>>> 
>>>> Then run /sbin/ldconfig.
>>>> 
>>>> Also, why bother with the source RPM?  I would rather just get the
>>>> source tarball direct from PHP.net and run with it.
>>>> 
>>>> Chris
>>>> 
>>>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>>>> Date: Wed, 14 Feb 2001 12:07:50 -0600
>>>>> To: php mailing list <[EMAIL PROTECTED]>
>>>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>>>> Subject: [PHP] PDF Functions
>>>>> 
>>>>> I finally got everything to install on RedHat 7, but I can't do
>>>>> anything
>>>>> with pdflib like I had expected.
>>>>> 
>>>>> I get back Fatal error: Call to undefined function: pdf_new() in
>>>>> /var/www/html/pdfclock.php on line 7. Line 7 is $pdf = PDF_new();
>>>>> 
>>>>> This is rather frustrating that every time I try to install PHP on
>>> a
>>>>> machine
>>>>> it takes me a week to get it going.
>>>>> 
>>>>> Here is what I have for the config from the srpm after
>>> modification
>>>>> as
>>>>> instructed earlier.
>>>>> 
>>>>> ../configure \
>>>>> --prefix=%{_prefix} \
>>>>> --with-config-file-path=%{_sysconfdi

Re: [PHP] PDF Functions

2001-02-14 Thread Mike Tuller

The reason why I needed the RPM is because no matter what I tried, I
couldn't get PHP to compile for the Apache rpm on Redhat 7. If at all
possible, I like to use the rpms so that they can be easily updated.

I have done everything everyone has suggested, and I still get an error. I
have even compiled PHP and still I can't use PDFlib. What next?

Here is the updated config script that I used.

 ./configure   --prefix=/usr   --with-config-file-path=/etc
--disable-debug   --enable-pic   --enable-shared
--enable-inline-optimization   --with-apxs=/usr/sbin/apxs
--with-exec-dir=/usr/bin   --with-regex=system   --with-gettext   --with-gd
--with-jpeg-dir=/usr   --with-png   --with-zlib   --with-gdbm
--enable-debugger   --enable-magic-quotes   --enable-safe-mode
--enable-sockets   --enable-sysvsem   --enable-sysvshm   --enable-track-vars
--enable-yp   --enable-ftp   --enable-wddx   --with-mysql   --with-xml
--with-pdflib=/usr/local/lib   --with-tiff


> From: Chris Carbaugh <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Wed, 14 Feb 2001 15:08:02 EST
> To: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] PDF Functions
> 
> 
> How about in /etc/ld.so.conf you make sure /usr/lib is in there.
> 
> Then run /sbin/ldconfig.
> 
> Also, why bother with the source RPM?  I would rather just get the
> source tarball direct from PHP.net and run with it.
> 
> Chris
> 
> On Wed, 14 Feb 2001, Mike Tuller wrote:
>> Date: Wed, 14 Feb 2001 12:07:50 -0600
>> To: php mailing list <[EMAIL PROTECTED]>
>> From: Mike Tuller <[EMAIL PROTECTED]>
>> Subject: [PHP] PDF Functions
>> 
>> I finally got everything to install on RedHat 7, but I can't do
>> anything
>> with pdflib like I had expected.
>> 
>> I get back Fatal error: Call to undefined function: pdf_new() in
>> /var/www/html/pdfclock.php on line 7. Line 7 is $pdf = PDF_new();
>> 
>> This is rather frustrating that every time I try to install PHP on a
>> machine
>> it takes me a week to get it going.
>> 
>> Here is what I have for the config from the srpm after modification
>> as
>> instructed earlier.
>> 
>> ../configure \
>> --prefix=%{_prefix} \
>> --with-config-file-path=%{_sysconfdir} \
>> --disable-debug \
>> --enable-pic \
>> --enable-shared \
>> --enable-inline-optimization \
>> $* \
>> --with-exec-dir=%{_bindir} \
>> --with-regex=system \
>> --with-gettext \
>> --with-gd \
>> --with-jpeg-dir=%{_prefix} \
>> --with-png \
>> --with-zlib \
>> --with-gdbm \
>> --enable-debugger \
>> --enable-magic-quotes \
>> --enable-safe-mode \
>> --enable-sockets \
>> --enable-sysvsem \
>> --enable-sysvshm \
>> --enable-track-vars \
>> --enable-yp \
>> --enable-ftp \
>> --enable-wddx \
>> --with-mysql  \
>> --with-xml \
>> --with-pdflib=/usr/lib/lipdf.so.0 \
>> --with-tiff 
>> 
>> Can someone look at this and tell me what else I need to put in to
>> get this
>> to work?
>> 
>> Mike
>> 
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail:
>> [EMAIL PROTECTED]
>> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] PDF Functions

2001-02-14 Thread Mike Tuller

I finally got everything to install on RedHat 7, but I can't do anything
with pdflib like I had expected.

I get back Fatal error: Call to undefined function: pdf_new() in
/var/www/html/pdfclock.php on line 7. Line 7 is $pdf = PDF_new();

This is rather frustrating that every time I try to install PHP on a machine
it takes me a week to get it going.

Here is what I have for the config from the srpm after modification as
instructed earlier.

./configure \
--prefix=%{_prefix} \
--with-config-file-path=%{_sysconfdir} \
--disable-debug \
--enable-pic \
--enable-shared \
--enable-inline-optimization \
$* \
--with-exec-dir=%{_bindir} \
--with-regex=system \
--with-gettext \
--with-gd \
--with-jpeg-dir=%{_prefix} \
--with-png \
--with-zlib \
--with-gdbm \
--enable-debugger \
--enable-magic-quotes \
--enable-safe-mode \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-track-vars \
--enable-yp \
--enable-ftp \
--enable-wddx \
--with-mysql  \
--with-xml \
--with-pdflib=/usr/lib/lipdf.so.0 \
--with-tiff 

Can someone look at this and tell me what else I need to put in to get this
to work?

Mike




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




[PHP] PHP 4 on RedHat 7

2001-02-13 Thread Mike Tuller

I'm at a loss for this one. I can't seem to get PHP 4 on RedHat 7. I can get
the rpm to install and work, but if I try to configure myself, it never
works. Everything says to configure with apxs, but there is no apxs. What is
strange though is if I look at how the rpm configures PHP, it configures it
with apxs and it works!

I want to configure PHP with PDF support, so I can't just use the rpms. If
anyone has any suggestions, let me know. That is other that trying to
configure apache manually. I've been down that road before, and don't want
to do it again.

Mike


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




Re: [PHP] <> Flash + PHP <>

2001-01-20 Thread Mike Tuller

www.thickbook.com is a good start. Last I looked it covered Flash 4, and
Flash 5 is quite a bit different.

Basically you have PHP print the variables in HTML and Have Flash parse
that. Flash can't directly parse PHP variables. It's not difficult once you
figure it out.

Mike

> From: "Abe Asghar" <[EMAIL PROTECTED]>
> Reply-To: "Abe Asghar" <[EMAIL PROTECTED]>
> Date: Fri, 19 Jan 2001 14:41:27 -
> To: "PHP General List" <[EMAIL PROTECTED]>
> Subject: [PHP] <> Flash + PHP <>
> 
> Hey Guys,
> 
> Anybody have any good links for Flash with PHP simple stuff.
> 
> Any tutorials or general links that maybe useful.
> 
> Thanks,
> Abe
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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