Re: [PHP-DB] suggestions

2005-03-03 Thread Matt M.
> Hello
> 
> I need to dev a small app and I can think of a couple different ways to 
> handle it but not sure the best way.  I need to register those who come to 
> our site that want to download .pdf's. They will fill out some information 
> before I redirect to the pdf.
> 
> I'm thinking the best way to handle this is sessions, but is it appropriate 
> to store all of the users info - so that if he downloads 2 items - I can 
> re-populate the fields so he doesnt have to? So if they click on an 
> additional pdf I'll need to somehow check for the session and re-populate 11 
> fields, and they will only have to fill in one field at that time.
> 
> Or would cookies be better ?  I need to store probably 11 different form 
> variables. Also - would you store the variables in an array in the session? 
> This seems neat and tidy...
> 
> Hope this is clear.
> 
> Any advice/guidance/sample scripts would be appreciated.

I think sessions would be perfect for this

http://us3.php.net/session is a good place to start

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



Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Matt M.
On Tue, 22 Feb 2005 10:47:43 -0600, Matt M. <[EMAIL PROTECTED]> wrote:
> > if ($_POST['op'] != 'ds') {
> > $display_block = "
> > 
> > Your E-mail Address:
> > 
> >subscribe
> >unsubscribe
> > 
> > 
> > ";
> > }
> 
> try:
> 
> if (isset($_POST['op']) && $_POST['op'] != 'ds')
> 

sorry for 2 emails, looks like you would want
if (!isset($_POST['op']) || $_POST['op'] != 'ds')

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



Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Matt M.
> if ($_POST['op'] != 'ds') {
> $display_block = "
> 
> Your E-mail Address:
> 
>subscribe
>unsubscribe
> 
> 
> ";
> }


try:

if (isset($_POST['op']) && $_POST['op'] != 'ds')

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



Re: [PHP-DB] referencing external functions

2005-02-15 Thread Matt M.
> and am trying to use it in this links3.php
> 
>  include('functions.php') or die (mysql_error());
> ?>
> 
> but I keep getting the error message
> *Warning*: main(1): failed to open stream: No such file or directory in
> *C:\Accounts\dbadream\wwwRoot\links3.php* on line *4*
> *Warning*: main(): Failed opening '1' for inclusion
> (include_path='.;c:\php4\pear') in
> *C:\Accounts\dbadream\wwwRoot\links3.php* on line *4*
> 
> Can anyone explain what is wrong. Both files are in the same directory
> and and both have the normal permissions set to access.

try the absolute path and try require_once() instead of include().

Also "or die (mysql_error());" is not going to get you anything.  That
is the text of the error message from previous MySQL operation.

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



Re: [PHP-DB] $_GET of array variables

2005-01-05 Thread Matt M.
> $_GET['simplevariable']  but am not having much luck with anything like:
> 
> $_GET["arrayvariable$a"] (1-dimensional array) or
> $_GET["arrayvariable$a$b"] (2-dimensional array)
> 
> (I've tried several other odd syntaxes such as
> $_GET["arrayvariable[$a][$b]"].  Also it's not an \" situation.)

have you tried
$_GET["arrayvariable"][$a]
or 
$_GET["arrayvariable"][$a][$b]

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



Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Matt M.
> > $csvfile = file("http://foo.com/foolist.csv";);

and this 

fopen("http://foo.com/foolist.csv";, "r");

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



Re: [PHP-DB] Parsing CSV files into a MySQL Table

2004-11-02 Thread Matt M.
> // 
> mysql_connect (localhost, foouser, foologin);
> 
> mysql_select_db (footest1);
> 
> $csvfile = file("http://foo.com/foolist.csv";);
> 
> foreach($csvfile as $line_no => $datastring) {
> $data = explode (",", $datastring);
> $foo1 = $data[0];
> $foo2 = $data[1];
> $foo3 = $data[2];
> $foo4 = $data[3];
> $foo5 = $data[4];
> $foo6 = $data[5];
> $foo7 = $data[6];
> 
> mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4, foo5, foo6, 
> foo7)
> VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5', '$foo6', 
> '$foo7')");
> }
> 
> //?>

try this

mysql_connect (localhost, foouser, foologin);

mysql_select_db (footest1);

$csvfile = file("http://foo.com/foolist.csv";);

while (($data = fgetcsv($csvfile, 1000, ",")) !== FALSE) {
   $foo1 = $data[0];
   $foo2 = $data[1];
   $foo3 = $data[2];
   $foo4 = $data[3];
   $foo5 = $data[4];
   $foo6 = $data[5];
   $foo7 = $data[6];

   mysql_query ("INSERT INTO 'footable' (foo1, foo2, foo3, foo4,
foo5, foo6, foo7)
   VALUES '$foo1', '$foo2', '$foo3', '$foo4', '$foo5',
'$foo6', '$foo7')");
}

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



Re: [PHP-DB] How to send a SID in a security way

2004-10-22 Thread Matt M.
> How can I send a SID (SessionID) in a security way from one page to another?
> Is it "security" to do this?

not sure what exactly you want.  You could just use cookies, dont
allow it to be in form fields or query strings.

you could use ssl.

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



Re: [PHP-DB] Two session for the same user, possible?

2004-10-21 Thread Matt M.
> Is it possible to have two sessions for the same user in php? If yes, how
> can I implement this?
> 
> I am currently using one without problem. However, when I try to create a
> second session, the first one is lost.

could you post some code.  I am not sure I follow what you are doing.

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



Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Matt M.
where is your insert statement? I am guessing it is after your loop


if ( is_array( $_SESSION['l_industry'] ) ) {
foreach ( $_SESSION['l_industry'] as $p ) {
$query = "INSERT INTO Profiles_Industries (ProfileID,IndID) VALUES
($LID, $p)";
/This is where your insert statement should
be**/
} //foreach ( $_SESSION['l_industry'] as $p )
} //if ( is_array( $_SESSION['l_industry'] ) )

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



Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Matt M.
if ( is_array( $_SESSION['l_industry'] ) ) {
foreach ( $_SESSION['l_industry'] as $p ) {
$query = "INSERT INTO Profiles_Industries (ProfileID,IndID) VALUES
($LID, $p)";
} //foreach ( $_SESSION['l_industry'] as $p )
} //if ( is_array( $_SESSION['l_industry'] ) )

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



Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Matt M.
> if ( is_array( $_SESSION['l_industry'] ) ) {
> foreach ( $_SESSION['l_industry'] as $p ) {
> $query = "INSERT INTO Profiles_Industries (ProfileID,
> IndID)
> VALUES ($LID, $p)";
> }

do you have a } for the if statement?

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



Re: [PHP-DB] pdf

2004-10-15 Thread Matt M.
> i want to how i can save the data retrieved from mysql through php in pdf
> format.

http://www.fpdf.org/

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



Re: [PHP-DB] Help: First Time Form with Sessions

2004-10-08 Thread Matt M.
> Warning: session_start(): Cannot send session cookie -
> headers already sent by (output started at
> /home/lurkkcom/public_html/Multi2Return.php:2) in
> /home/lurkkcom/public_html/Multi2Return.php on line 3

read a little more about sessions.

session_start is trying to set a cookie but output has already
started, giving you this warining.

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



Re: [PHP-DB] code example to store PHP session data in mySQL ?

2004-10-06 Thread Matt M.
> where can I find a working example that shows me how to implement PHPSESSION
> with MySQL as stor?

i know adodb has session functions, download it a nd take a look

maybe here http://www.devarticles.com/c/a/MySQL/Developing-Custom-PHP-Sessions/
also try google.

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



Re: [PHP-DB] Multi Page Form

2004-10-04 Thread Matt M.
> Not sure if I posted about this yesterday, anyway new
> question.
> I'm building a multi page form.  So I"m using hidden
> fields and echoing them to the next page in the loop.
> 
> Now someone tells me this is dangerous.
> "because someone can save the final page (with most
> of the hidden values) locally, edit it, then load it
> and submit from it to your final page, overcoming ALL
> your previous validations. (yes, this is possible
> for someone that knows how to ditch the HTTP_REFERRER
> information)"
> 
> So, a) guess  I'd like to see if this is true.  I
> thought HTTP_REFERRER was the server variable for
> grabbing everything before the script.  Aside from
> that there is nothing in the URL.
> 
> I see these forms quite a bit.  What do people think ?

just use sessions instead of hidden fields
http://us4.php.net/session

dont use HTTP_REFERER for anything.  It can and is not sent many times
and is also not reliable.

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



Re: [PHP-DB] microsoft access

2004-10-01 Thread Matt M.
> Does anyone know of a good online source for using php and microsoft
> access.
> I don't want to have to use asp.
> Thank you for your time.

you could use com objects with Microsoft ADO

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



Re: [PHP-DB] Names with apostrophe's

2004-09-29 Thread Matt M.
> echo(" href='user_book_results_detail.php?book=$row[book]>$row[book] td>");

http://us4.php.net/urlencode

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



Re: [PHP-DB] File Mime Type Function

2004-09-23 Thread Matt M.
> I've looked around for a while, does anyone know of a PHP function
> already built in to the install that gets the Mime type of a file on
> the server?

you might try this

http://pear.php.net/package/MIME_Type/

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



Re: [PHP-DB] Warning message -- session side-effect

2004-08-27 Thread Matt M.
> 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

you have any code examples.  Try looking into using the $_SESSION array.

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



Re: [PHP-DB] Postgresql Performance

2004-08-19 Thread Matt M.
On Thu, 19 Aug 2004 18:12:16 -0500, Norma Ramirez
<[EMAIL PROTECTED]> wrote:
> Hi all, I have a problem with a small software in Postresql, through the
> time the database become slower and slower so, quick solution: pg_dump,
> dropdb, createdb and pg_dump again but this software is becoming important
> and such procedure is not a very reliable way to improve the performance, I
> have tried with some commands like Vacuum and Analyze but non of this seems
> to work as good as drop database and create again.
> 
> Can any one give me some advices?

1. vacuum and analyze would be my suggestions but you say you have tried that.
2. maybe upgrade your postgres version
3. try a postgres mailing list

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



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Matt M.
> > I have another option that might work for you also.  Go to MySQL's website
> > and grab their ODBC driver and use that to pull data directly into Excel.
> > That's what I do and the end result tends to be a lot cleaner than going
> > through cvs or other MySQL exports.
> 
> I was not sure that this was a mysql db.

sorry for the second email, I see now in the subject of the email it
is mysql, stupid me.

You could also try an excel com object to do this.

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



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Matt M.
> I have another option that might work for you also.  Go to MySQL's website
> and grab their ODBC driver and use that to pull data directly into Excel.
> That's what I do and the end result tends to be a lot cleaner than going
> through cvs or other MySQL exports.

I was not sure that this was a mysql db.

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



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Matt M.
> I'm having a dilemma (Now that I have power back after the hurricane hit us
> directly in Orlando).  Anyway, I need to export a database table to Excel, I
> can do it as a .txt file without a problem, but I can't seem to get it to
> put each column into a separate cell when I try to export as an .xls form, I
> think I have this line formed incorrectly for an XLS file, can anyone see if
> I need to use any special characters rather than a comma?
> 
> fwrite($filesession,"$id,$new,$recno,$category,$product,$description,$unit,$
> certificate,$instock,$orderpt,$ordernow,$vendor,$unitcost,$unitsell\015\012"
> );
> 


either output the data as a csv which you are doing (on windoze name
the file with a .csv extension) or take a look at
http://pear.php.net/package/Spreadsheet_Excel_Writer

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



Re: [PHP-DB] sendmail

2004-08-02 Thread Matt M.
On Mon, 2 Aug 2004 14:31:49 -0400, Aaron Todd <[EMAIL PROTECTED]> wrote:
> So far, I have been doing ok with PHP.  I feel that I have picked it up
> rather easily.  But now I need some help.  I am trying to use the sendmail
> functions to send data entered in a form to my email address.  Currently its
> not working at all.  I am getting a

have you tried 

mail()

http://us4.php.net/manual/en/function.mail.php

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



Re: [PHP-DB] Printing selected characters (strcnt?)

2004-07-15 Thread Matt M.
> $first_name = $_POST['first_name'];
> $last_name  = $_POST['last_name'];
> $name = $first_name . ' ' . $last_name
> $rma = ?strcnt($last_name), 1 . Datetime(?) // takes the 1st character from
> $last_name and adds datetime in format of 715041200

$rma = substr ($last_name, 0 , 1).Your.Datetime;

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



Re: [PHP-DB] Conditional explode?

2004-07-01 Thread Matt M.
On Thu, 1 Jul 2004 14:05:49 -0500, Shiloh Madsen
<[EMAIL PROTECTED]> wrote:
> 
> Can I use explode in a conditional manner? I.E., can i have it explode on a space, 
> but only if the space is not encased in double quotes?

I would use http://www.php.net/preg_split

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



Re: [PHP-DB] How to define array variable while accessing it ???

2004-06-28 Thread Matt M.
>   " value="" >

setup your checkbox something like this:

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php