[PHP-DB] Re: [PHP-WIN] How to get the content of a file into the valueof a text column

2001-08-23 Thread Angie Tollerson

Jack,
You just need to check out the fopen and fread functions on php.net/manual

Angie Tollerson
Alliance Technologies
Web Programmer
(515)245-7628
[EMAIL PROTECTED]

>>> "Jack" <[EMAIL PROTECTED]> [EMAIL PROTECTED] 10:02AM >>>
Dear all
Actually i'm trying to get the content of a file, and make it as a default
value of a input text column.
Is there anyway could do it?

Thx
jack
[EMAIL PROTECTED] 



-- 
PHP Windows 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 Database 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-DB] Re: [PHP-WIN] Multi-Task on PHP by submitting a form!

2001-08-20 Thread Angie Tollerson

Jack,
Yes, you can do as many things as you want in a php document before you have die() at 
the end :)
Angie

>>> "Jack" <[EMAIL PROTECTED]> 08/20/01 08:12AM >>>
Dear all
I was trying to get a user input form to insert to a mysql_database and
e-mail to me!
Is it possible to make php perform two task in one single submit button?

The form will post the input --> mail.php.

In the mail.php, i was thinking to add another process just after the mail
process had finish, which will insert the data from the from to
mysql_database.

Thx
Jack
[EMAIL PROTECTED] 



-- 
PHP Windows 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 Database 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-DB] Password Protect page

2001-06-22 Thread Angie Tollerson

I ALWAYS use this set of scripts because they don't have to integrate into your pages. 
 They are a front end check that you just add one line to the top of all your pages 
you want to secure.  The check runs and if they have clearance, THEN your page 
displays.  Very easy to use and customize. you can download them at:
http://www.phpsecurepages.f2s.com/ 

Angie

>>> Jan de Koster <[EMAIL PROTECTED]> 06/22/01 08:35AM >>>

// USED FOR AUTHENTICATION 

 function authenticate_user(){
 Header("WWW-Authenticate: Basic realm=\"[EMAIL PROTECTED]\"");
 Header("HTTP/1.0 401 Unauthorized");
 echo "You are not authorized to enter this section of the site!\n";
 exit;
 }

 if(!isset($PHP_AUTH_USER)) {
 authenticate_user();
 } else {

 $db = mysql_connect("localhost","...","");
 mysql_select_db("...",$db);
 $sql = "SELECT * FROM ... WHERE User='$PHP_AUTH_USER' &&
password='$PHP_AUTH_PW'";
 $r = mysql_query($sql);
 if(@mysql_num_rows($r) < 1){
 authenticate_user();
 }
 }

// USED FOR AUTHENTICATION 

Not sure if this is what you ar looking for, but it works just fine for me. I
picked it off php.net somewhere where there's a very interesting discussion on
the topic. I think I was searching on "authentication".

My pleasure
jan

"Rubanowicz, Lisa" wrote:

> Hi All,
> I have an Admin section for my site (where users fill in web forms and it
> changes the site and upload facility for images) and would like a script
> that does a User Logon page.  Password is enough.  I have created a TABLE in
> my mySQL database called bw_password with two fields id and password.
> Does anyone have a handy script.  I tried but to no avail, I was trying to
> send the header to redirect if the password in the input box matches the
> database password but it kept saying that the header was already sent..  I
> tried Javascript aswell, doing a location.href = "URL" within the "if"
> statement.
> If anyone can send me one they have and I can try and modify it then or at
> least understand it.  I am a beginner so please be nice!!
> Thanks in advance
> Lisa
>
>
> Lisa Rubanowicz
> Case ITC,
> Navan, Ireland
> Tel: #353 (0)46 77663
>
> [EMAIL PROTECTED] 
>
>


-- 
PHP Database 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 Database 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-DB] mssql_fetch_array problem

2001-06-20 Thread Angie Tollerson

Jennifer,
Try this code..I am using the same stuff as you with the exception of mysql instead of 
sql..but it may still work:
";
 }
}
?>
It's kind of a "save as" type of statment but it works for me! I've had no problems 
with that sql statement.
Angie

>>> "Jennifer Arcino Demeterio" <[EMAIL PROTECTED]> 06/20/01 12:17AM >>>
Thanks for all your answers, but, they still seem not to work.  In my query,
the value of countryname is retrieved as expected but the value of countryid
is not.  There seems to be no value retrieved for countryid.  I am using
PHP4 on IIS4 on an NT machine with SQL Server 7 as the database.
"countryname" is of type varchar while "countryid" is type int, indentity,
auto_increment.  I tried listing them by printing the resultset but
countryid still does not have any value.  This could be a quirk that some of
you experienced and I sure would like to hear how you overcame this.

Thanks.

I am posting again the code snippet below:

";
 }
}
?>




-- 
PHP Database 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 Database 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-DB] Any word in how to connect to PPROGRESS db usingPHP.

2001-06-20 Thread Angie Tollerson

Hi there,
We are currently getting PHP to talk to Progress. How you do it is thru ODBC.  You 
have to get a ODBC driver for Progress which you can get straight from Progress 
(Merant driver) for $100 or you can get one from www.openlinksw.com for $500 with 
multitier capabilities.  I will warn you, the current ODBC drivers out there for 
Progress are buggy.  For some reason, when you add new records in the db it will not 
trigger.  So you can't do autoincrement with the Progress DB.  You would have to turn 
off triggers and code in your PHP to find the last number used in the table (if you 
wanted an autoincrementing id number which you almost always do).  There is also an 
option of writing a java that does keeps track of the trigger for you  but we don't do 
java just yet and it sounds complicated.  Let me know if you pursue that what your 
code is.  
 Just keep these things in mind when you are designing your db.  There's also the 
problem with getting the last used record in the db and just adding one.  What if a 
"person" with id of 50 does a bunch of stuff, you have them saved in other table as 50 
doing this and that.  Then person 50 wants to be deleted.  So you delete them and then 
when you add a new person since 49 is the last used number person 51 gets added as 50. 
 NOw when person 51 needs things recorded in the other tables his data gets mixed up 
with the old person 50.  Have I confused you yet? I confused me!  The best solution is 
to keep a table called "id" where you keep track of every id number ever used and 
don't delete from it just becvause the number may get deleted in another table.  Hope 
I haven't totally turned you around! :)
Angie

>>> Hector M Banda <[EMAIL PROTECTED]> 06/19/01 01:09PM >>>
Hi all,

Does any body have any information about how to access a PROGRESS
database using PHP?

I know this has been asked before and I just want to be upto date.

Thanks,

-- 


===
Hector M Banda  
Fax: (425) 790-6379
Irvine Ca, 92618
===

-- 
PHP Database 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 Database 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-DB] odbc errors

2001-05-15 Thread Angie Tollerson

P.S.
One of the users there mentions that she had to open the odbc_free_result INTO a 
variable in order for it to work:
$free_result = odbc_free_result($sql_result);  for example

Angie

>>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>>
i've just upgraded my computer... running win ME ( i know), PWS and PHP
4.0.5 and  access 2000 (odbc) ...  the same set up as my last one... i keep
getting error msg from scripts that worked only last week on the old
setup...
the DB is ok as it will connect  prepare and execute with no error... but
then i get the following msg's


Warning: Supplied argument is not a valid ODBC result resource in
\include\db1.txt on line 18

which is
odbc_result_all($sql_result,"border=1");
nothing to fancy there

and the same message
Warning: Supplied argument is not a valid ODBC result resource in
\include\db1.txt on line 21

which is
odbc_free_result ($sql_result);
again just a basic action... nothing fancy


it's strange as all the other bits of the scripts work with no problems so i
think its the ODBC set up. but that is where i step out of the light in to a
very dark room  and it's driving me nuts...any help or pointers would be
cool...

MTIA
Jello

a copy of the whole script is below






-- 
PHP Database 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 Database 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-DB] odbc errors

2001-05-15 Thread Angie Tollerson

Jello,
You may want to look at some of the user comments on odbc_result_all manual on php.net:
http://www.php.net/manual/en/function.odbc-result-all.php
Some people mentions errors and fixes there for your problem.  I think you are getting 
connected or you would have got your error messages "Couldn't connect" or "Couldn't 
execute".  That error you are getting is a failure to recognize the function and it's 
parameters, NOT that you aren't connected.

Angie

>>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>>
i've just upgraded my computer... running win ME ( i know), PWS and PHP
4.0.5 and  access 2000 (odbc) ...  the same set up as my last one... i keep
getting error msg from scripts that worked only last week on the old
setup...
the DB is ok as it will connect  prepare and execute with no error... but
then i get the following msg's


Warning: Supplied argument is not a valid ODBC result resource in
\include\db1.txt on line 18

which is
odbc_result_all($sql_result,"border=1");
nothing to fancy there

and the same message
Warning: Supplied argument is not a valid ODBC result resource in
\include\db1.txt on line 21

which is
odbc_free_result ($sql_result);
again just a basic action... nothing fancy


it's strange as all the other bits of the scripts work with no problems so i
think its the ODBC set up. but that is where i step out of the light in to a
very dark room  and it's driving me nuts...any help or pointers would be
cool...

MTIA
Jello

a copy of the whole script is below






-- 
PHP Database 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 Database 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-DB] Autoincrement Question

2001-05-11 Thread Angie Tollerson

hmmm, that's interesting...I believe you are right about the version glitch.  I went 
to another database we have running on another server, it has 3.22.32 as you do.  When 
I delete the last record and then add one it DID NOT reuse the number, but 
incrememented! 
However, v.33 IS NOT reusing numbers that have been deleted anywhere up to the last 
record. So it is working partway at least. I suppose it could be a glitch that needs 
to be reported on .33 .  I will submit it to mysql.com. 
Thanks!
Angie


>>> Miles Thompson <[EMAIL PROTECTED]> 05/11/01 09:17AM >>>
Angie,
Is there a bug here? How do you "re-add" a fourth record? Is 3.22.33 a 
development or a stable version?
With MySQL 3.22.32, and table type of MyISAM I did not get re-use of the 
auto_increment keys , no matter where the records were deleted or inserted.
Miles

At 03:24 PM 5/10/01 -0500, Angie Tollerson wrote:
>I am also doing it on 3.23.33 with MyISAM recover options off, is that 
>what is happening? like I said...if I delete record one, and add a fourth 
>record, It DOES NOT add it as 1.  But as 5.  however, if I delete 4, then 
>add a fourth again, it sets it as 4.  I'm not sure if that has anything to 
>do with my MyISAM settings or not..but there you go.
>
> >>> CC Zona <[EMAIL PROTECTED]> 05/10/01 03:11PM >>>
>[quotes restored to bottom-posting order, for clarity]
>
> > > > > If I have a database that has three records and I delete the entire
> > > > > third record, when another record is then added will the auto 
> increment
> > > > > number be 3 or 4? Thanks.
>
> > > > I will be 3 Jeff :)
>
> > > Only if the auto increment values started at zero.  Otherwise, the 
> number
> > > will be 4.
>
> > That is true if you delete a row in between other records..if you delete 2
> > the fourth record added would be 4, not 2.  BUT..in the default 
> installation
> > of mysql, if you delete the last record the auto increment will fill it's
> > place..trust me, I just tried it :)
>
>What version of MySQL and table type are you getting that on?  I just tried
>it with a MyISAM table in 3.23.33 (insert, immediate delete, immediate
>insert), and the pk incremented as expected.  No re-use of values.
>
>--
>CC
>
>--
>PHP Database 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 Database 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 Database 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 Database 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-DB] Autoincrement Question

2001-05-10 Thread Angie Tollerson

I am also doing it on 3.23.33 with MyISAM recover options off, is that what is 
happening? like I said...if I delete record one, and add a fourth record, It DOES NOT 
add it as 1.  But as 5.  however, if I delete 4, then add a fourth again, it sets it 
as 4.  I'm not sure if that has anything to do with my MyISAM settings or not..but 
there you go.

>>> CC Zona <[EMAIL PROTECTED]> 05/10/01 03:11PM >>>
[quotes restored to bottom-posting order, for clarity]

> > > > If I have a database that has three records and I delete the entire
> > > > third record, when another record is then added will the auto increment
> > > > number be 3 or 4? Thanks.

> > > I will be 3 Jeff :)

> > Only if the auto increment values started at zero.  Otherwise, the number 
> > will be 4.

> That is true if you delete a row in between other records..if you delete 2 
> the fourth record added would be 4, not 2.  BUT..in the default installation 
> of mysql, if you delete the last record the auto increment will fill it's 
> place..trust me, I just tried it :)

What version of MySQL and table type are you getting that on?  I just tried 
it with a MyISAM table in 3.23.33 (insert, immediate delete, immediate 
insert), and the pk incremented as expected.  No re-use of values.

-- 
CC

-- 
PHP Database 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 Database 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-DB] Autoincrement Question

2001-05-10 Thread Angie Tollerson

That is true if you delete a row in between other records..if you delete 2 the fourth 
record added would be 4, not 2.  BUT..in the default installation of mysql, if you 
delete the last record the auto_increment will fill it's place..trust me, I just tried 
it :)


>>> CC Zona <[EMAIL PROTECTED]> 05/10/01 02:07PM >>>
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Angie Tollerson") wrote:

> I will be 3 Jeff :)
> 
> 
> >>> "Jeff Oien" <[EMAIL PROTECTED]> 05/10/01 01:13PM >>>
> If I have a database that has three records and I delete the entire
> third record, when another record is then added will the auto increment
> number be 3 or 4? Thanks.

Only if the auto_increment values started at zero.  Otherwise, the number 
will be 4.

In answer to the question the poster seems to really be asking: 
auto_increment doesn't go back and re-use values from deleted rows.  What 
if you have data in other tables where a foreign key ties (undeleted) data 
in that table to the deleted row in the first table?  If the value was 
re-used, then the data in the second table would suddenly be establishing a 
bogus relationship to the new data in the first.

-- 
CC

-- 
PHP Database 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 Database 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-DB] Autoincrement Question

2001-05-10 Thread Angie Tollerson

I will be 3 Jeff :)


>>> "Jeff Oien" <[EMAIL PROTECTED]> 05/10/01 01:13PM >>>
If I have a database that has three records and I delete the entire
third record, when another record is then added will the auto_increment
number be 3 or 4? Thanks.
Jeff Oien

-- 
PHP Database 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 Database 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-DB] Edit a file from a PHP form

2001-05-02 Thread Angie Tollerson

Hmm, Allen, this may be overwhelming , but what you are trying to do would be ideal 
with XML files and manipulating them with PHP and XSL style sheets. I am doing the 
exact same thing you are with these technologies.  Your XML page looks just like a 
text file but with tags, like this:



  C Test Name
  Colorado
  D
  Address Test
  City Test
  State Test
  Zip Test
  Phone Test
  Fax Test
  Name One


With multiple entries, then using PHP and XSL style sheets you can grab individual 
tags and edit them, you can delete a whole "project" or "employee" in your case, add 
them, SORT them in alphabetical order, numberical..the possibilities are endless. PHP 
already has a XML and XSL parser built in depending on your server op system you may 
need to install the dll's for them or compile them.  But it is very smooth and fast 
and not too hard to learn.  If you know PHP you are half way there.  Hope I haven't 
confused the issue more.  But trying to use PHP get lines and substrings and such in a 
plain .csv is really inefficient and LIMITED.

Tinuviel

>>> "Allen May" <[EMAIL PROTECTED]> 05/02/01 09:28AM >>>
I would like to edit a list from a PHP form.
Can someone point me to a good tutorial??

I have walked-through a tutorial that showed me how to successfully pull the
contents of  text file and display the whole contents. I want to view the
contents and then edit a specific line of in a list.

So, if I have list of employees and their telephone numbers, I'd like to be
able to search the contents and display the employees phone number then
allow me to edit the phone number and save it back to the list.

I know I can do this with MySQL but I need to keep the source data in a text
file.

Thanks for any suggestions.

-Allen
[EMAIL PROTECTED] 



-- 
PHP Database 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 Database 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-DB] Sessions ???

2001-05-02 Thread Angie Tollerson

Dave,
What you need to do is make sure that the variable: $topidID is being set to a value 
first (before you register it you must get it from the table.  Once it is set you need 
to register it as you did BUT WITHOUT the $. So it will say:



Make sure that session_start is ALWAYS before any headers in your html page, BUT 
register does NOT have to be.  It can be declared anywhere in the page as long as you 
have set the value in it already.  Also, on every page that will ever access topidID 
you must have session_start() at the top.  But not session_register, as the value has 
already been registered. HINT: if you want to change the value of topidID just set 
it's value and then call a register right after you do that. 

Hope this helps!


>>> "DC" <[EMAIL PROTECTED]> 05/02/01 07:53AM >>>
Hi All
I have a ? about setting a session.

I have a functions.inc file and at the top have put my session statment that
looks like this.



$topicID comes from my mysql db.

What i am trying to do is set the $topicID of my message board so that when
a sucessful post has been made the visitor can click on a link that show the
right board by topicID.

so the link will look like this...

http://localhost/forums/view.php?topicID=3 

I am banging away trying to make this work

Any help in the meantime is as always appreciated

Thank You In Advance

dave C



-- 
PHP Database 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 Database 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]