[PHP] PEAR error

2003-11-16 Thread Joao Andrade

Hey people,

I know there's a list for PEAR also, but it seem there's nobody there...
in 2 days only two messages, so I'll post this here and if there's a better
place for this message, you tell me, alright?
That's the deal:

I've just got into pear, looking for a mail function with SMTP
authentication, well there is one, but it ins't working. I must confess I'm
a mechanical engineer and I've very little knowledge about object oriented
programming (that's what pear is about, aint't it?).
I tried the example I found in the mail() documentation. which is:

require_once('mail.php');

$recipients = '[EMAIL PROTECTED]';

$headers['From']= '[EMAIL PROTECTED]';
$headers['To']  = '[EMAIL PROTECTED]';
$headers['Subject'] = 'Test message';

$body = 'Testando essa bagaca!';

$params['host'] = 'smtp.sao.terra.com.br';
$params['auth'] = true;
$params['username'] = 'joao66br';
$params['password'] = 'mypass';

echo opa;
var_dump($params);
// Create the mail object using the Mail::factory method
$result = $mail_object = Mail::factory('smtp', $params);
if (PEAR::isError($result)) {
print Oops:  . $connection-getMessage() . br\n;
exit;
}

$resultsend = $mail_object-send($recipients, $headers, $body);
var_dump($resultsend);
echo opa;
echo resultsend;
echo resultfactory;
?

and what I get is:

opaarray(4) { [host]= string(21) smtp.sao.terra.com.br [auth]=
bool(true) [username]= string(8) joao66br [password]= string(6)
mypass }

Well the params vector is okay, but nothing below the command
Mail::factory('smtp', $params) seems to be working, not even the simple echo
opa. There must me something going wrong with it, but why doesn't the
error show up, as it would with PHP?
What is the use of the constructs such as PEAR::isError and
Mail::factory what do those :: mean?

Thanks,
Joao.

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



[PHP] mail() in windows (again!)

2003-11-13 Thread Joao Andrade

Hi,

First of all, how can I send a message to this list as the first dealing
with a subject, like a question (I guess this is called a thread)?
Well, I wanted PHP to send an e-mail for me. I read in the documentation
that the mail() functions uses the sendmail aplication. I've also heard this
'sendmail' won't work with windows (Windows rulez!(just to piss those linux
guys off!)). There's a user comment in the documentation page recomending
this argosoft program, but from what I saw in their site this makes the
computer into a mail server, and all I wanna do is have some fun (but not
right now), all I wanna do ist a command line program that will take my
message and send it to my smtp server. Is it so hard to do?
Thanx,

Joao Penna Andrade
Undergraduate, Mechanical Engineering
UNICAMP, Brazil

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



[PHP] POST variables, funny thing

2003-10-27 Thread Joao Andrade

A funny thing was happeng with a GET variable here, after testing it
with an if clause, it would be set to 1, like this, after that:

 if ( $_POST['nova'] =! )

$_POST['nova'] = 1... Is that alright?

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



[PHP] passing variables

2003-10-27 Thread Joao Andrade

Hey everybody,

That's lame but I've been looking for a while and found nothing.
 What are the ways to pass variables to another script? As far as I'm
concerned there are POST and GET variables, and I know they can by set via
HTML forms, but I only know how to pass user input variables. How could I
automaticaly set a POST or GET variable through a script? Is it possible to
set those variables from outside a script? Could an array be passed?
Thankfully,

Joao Penna Andrade
Undergraduate, Mechanical Engineering
UNICAMP, Brazil

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



[PHP] Post variables getting lost

2003-10-26 Thread Joao Andrade

Hey people,

Something odd is happening :) I've this form on a page:

form method=post action=\basics\quotation-add

table
tr
 thAuthor
 tdinput type=text size=30 name=author_name
/tr
tr
 thNew Category
 tdinput type=text size=30 name=new
/tr
tr
 thCategory
 tdselect name=category
   ?php
   $categorias = mysql_query(SELECT DISTINCT category FROM quotations);
   $lincat = mysql_fetch_row ($categorias);
   while ($lincat != false){   //loop through the records enquanto ha linhas
  $cat = $lincat[0];
  echo option value=\.$cat.\.$cat ; //and place it in the select
  $lincat = mysql_fetch_row ($categorias);# pega uma linha
   }

   ?
   /select
/tr
tr
 thQuotation
 tdtextarea name=quote cols=50 rows=8/textarea
/tr
/table
center
input type=submit value=Add
/center
/form

And then I have in quotations-add:

  echo $_POST['category'];
  echo $_POST['new'];
  echo $_POST['author_name'];

  echo $_POST['quote'];

And what I get ist:

Notice: Undefined index: category in C:\Programme\Apache
Group\Apache2\htdocs\basics\quotation-add.php on line 85

Notice: Undefined index: new in C:\Programme\Apache
Group\Apache2\htdocs\basics\quotation-add.php on line 86
asdasdasdasd

Where the 'author_name' and 'quote' POST variables are ok, why aren't
'new' and 'category' coming?

Thanks again,

Joao Penna Andrade
Undergraduate, Mechanical Engineering
UNICAMP, Brazil

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



[PHP] Redirect

2003-10-25 Thread Joao Andrade

Hi there people,

I'm looking for a function that will redirect a browser to another page
after a PHP scrip has run. I tried serching for it in the doc but found
nothing. It shall be similar to Tcl's  ns_returnredirect.
Thanx.

Joao Penna Andrade
Undergraduate, Mechanical Engineering
UNICAMP, Brazil

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



[PHP] manual key generation

2003-10-25 Thread Joao Andrade

Aloha!

I have a script that inserts a new row in a table called quotations,
which has a primary key called quotation_id. quotation_id is an int(11)
type. When I enter:

SELECT MAX(quotation_id)+1 from quotations

I get simply the number 7 (which is ok)

But when I do:

$new_key = mysql_query(SELECT MAX(quotation_id)+1 from quotations)

I get $new_key = Resource id #3

What the hell is that supposed to mean?

Thanx a bunch.

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