[PHP] strings and \n

2002-01-25 Thread Greg Sidelinger

Ok I'm having a problem with the new line char \n in strings.  I'm
trying to contrast an email that gets sent with the mail() function.
Here is what I'm doing.
 
$message = line1\n;
$message .= line2\n\n;
$message .= line3\n;
...
$message = lne99;
 
mail (email, subject, $message);
 
 
but when the email is received not all the new lines r taken. Can anyone
help me.  Also where can I get a list of all the special chars like \n
and what they meain.
 
Greg



RE: [PHP] strings and \n

2002-01-25 Thread Greg Sidelinger

\r\n or \n\r is not helping.  The thing that confuses me is that some of
the \n lines work just fine while others do not. So if anyone give give
me a hint y it is not working all the time please send me email.

Greg

-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 25, 2002 3:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] strings and \n

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Greg Sidelinger blurted
 Ok I'm having a problem with the new line char \n in strings.  I'm
 trying to contrast an email that gets sent with the mail() function.
 Here is what I'm doing.
  
 $message = line1\n;
 $message .= line2\n\n;
 $message .= line3\n;
  
 but when the email is received not all the new lines r taken. Can
anyone
 help me.  Also where can I get a list of all the special chars like \n
 and what they meain.

I think you need to try \r\n (poss. other way round)
That should do it.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8UcZYHpvrrTa6L5oRAuliAJ4vouXleTkRY6IvSva2xS6BBnJHMgCeKHJW
n3BzuUtk5LYJ3gra3SqxnXs=
=fgqQ
-END PGP SIGNATURE-

-- 
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] mysql_fetch_array

2001-12-30 Thread Greg Sidelinger

Ok I have use mysql_fetch_array to dump the results of a select query with a
join in it.
if my tables contain a column with the same name how can I distinguish from
them.  I'm used to
table_name.value method in other languages but when I tried
$row['table_name.value'] I don't get any values.
can anyone point me in the right direction.



-- 
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] mysql update query

2001-12-04 Thread Greg Sidelinger

I'm having trouble getting an update query to work
 
Here is what I'm doing
 
$result = mysql_query(update table set value1='$value1',
value2='$value2' where id='$id');
 
It is not updating the database.  All the $vars have values and I'm
using the correct columns names.  Could someone please point me in the
correct direction because I have been trying different things for a
while but can't seem to get it to work.
 
Greg



[PHP] Objects and sessions

2001-11-26 Thread Greg Sidelinger

Can someone tell me how to store a class in a session var.   I want to
test to see if it has been defined and if not create it.  I'm having
problems with it right now.
 
This is what I'm trying currently
 
?
Class a
{ 
var $temp;
 
function a() 
{ 
$this-temp=1;
}
}
 
session_start();
 
if ( !isset( $c )
{
$c = new a();
session_register(a);
}
?
 
later on I get errors about the class functions being undefined.Can
anyone please point me in the right direction on how to register my
objects as session vars.



[PHP] Ojects and sessions

2001-11-25 Thread Greg Sidelinger

I'm trying to store some classes that I created in session variables.  I
want to test for the object at the beginning of each page and if it does
not exist I want to create it.
 
I have the class definitions in a separate file that is included before
session_start()
But when I try to access the object I get an error.
Here is what I am trying right now.  This is from an example in the
Docs.
 
?
include_once('class.inc');
session_start();
 

if(session_is_registered(a)) 
{ 
$a = $HTTP_SESSION_VARS[a];
}
else
{
$a = new cart();
session_register(a);
$HTTP_SESSION_VARS[a] = $a;
}
?
 
Can some one please point me in the right direction on how to get
objects stored in my session vars.
 
Greg Sidelinger