Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.
Sedo.com

php help!

Status
Not open for further replies.

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
As you will probably see from this need for help I don't know php!
I am hacking a short email form and need to make carriage returns in the following:-

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
CR needed here

"------------------------- NAME -------------------------\n\n" .
$name .
and here

"------------------------- EMAIL -------------------------\n\n" .
$email .
and here
"\n\n------------------------------------------------------------\n" ;



Anyone help please?
 

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
theparrot said:
Carrige return and not newline?

"$comments\r" should do it then. for example.


hmmm - maybe I do need newline then!
I actually want to stop the "--------" coming straight after the comment (etc) fields so that I get "-------" under rather than alongside.
 

cyphix

Level 9
Legacy Platinum Member
Joined
Jan 20, 2003
Messages
3,609
Reaction score
1
Why can't you add a \n after the variable?
 

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
Doesn't like either of the following - returns error:-

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments\n .

OR

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .\n


Is the "." of any significance (again remember I don't know php!).
 

cyphix

Level 9
Legacy Platinum Member
Joined
Jan 20, 2003
Messages
3,609
Reaction score
1
Is that the actual code?

Is it sending all this to your email?
 

theparrot

Level 6
Legacy Exclusive Member
Joined
Mar 24, 2004
Messages
589
Reaction score
0
Mr Webname said:
Doesn't like either of the following - returns error:-

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments\n .

OR

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .\n


Is the "." of any significance (again remember I don't know php!).


try
"$comments\n"

the . is to concatenate the strings... it you look at the "$http_referrer\n" . line, that is doing what you want. you want to put the quotes around the others like that
 

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
Doesn't like any of that - get:
"Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ......."
 

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
cyphix said:
Is that the actual code?

Is it sending all this to your email?


Yes the actual code is as per my first post but when the results are mailed to me it doesn't neatly place each field under the other.
 

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
theparrot said:
you put

"$comments\n" .

and get that error?

Yes I do.

With the \n" removed I get no error but the output via email returns:-

------------------------- COMMENTS -------------------------

test------------------------- NAME -------------------------

test------------------------- EMAIL -------------------------

test

------------------------------------------------------------

You see the problem with lines "NAME" and "EMAIL"
 

theparrot

Level 6
Legacy Exclusive Member
Joined
Mar 24, 2004
Messages
589
Reaction score
0
Mr Webname said:
Doesn't like either of the following - returns error:-

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments\n .

this should be

"$comments\n" .

OR

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .\n

or this version should be

$comments . "\n" .
 

cyphix

Level 9
Legacy Platinum Member
Joined
Jan 20, 2003
Messages
3,609
Reaction score
1
Try this..

($comments .\n)
 

Mr Webname

Oldbie
Legacy Exclusive Member
Joined
Jan 29, 2003
Messages
3,743
Reaction score
0
Problem solved - F$ on the way to theparrot and cyphix - small token of appreciation, thanks both. :)
 

cyphix

Level 9
Legacy Platinum Member
Joined
Jan 20, 2003
Messages
3,609
Reaction score
1
Dang & I just made you a new script lol :-(
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members Online

Sedo - it.com Premiums

IT.com

Premium Members

Premium Members

MariaBuy

Our Mods' Businesses

UrlPick.com

*the exceptional businesses of our esteemed moderators

Top Bottom