• Welcome to DNForum.com - Domain Investor Forum, Free Domain Marketplace and a community for 45+ domain pros
    If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the oldest global domain name community on the internet and continues to grow every day. There are over 45,000 domainers on DNForum doing everything from buying domains, selling domains, using our free in-house built tools, learning about domains and discussing domains. Take a minute and Register.

php help!

Status
Not open for further replies.

Mr Webname

Oldbie
The Originals
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?
 
Carrige return and not newline?

"$comments\r" should do it then. for example.
 
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.
 
Why can't you add a \n after the variable?
 
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!).
 
Is that the actual code?

Is it sending all this to your email?
 
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
 
Doesn't like any of that - get:
"Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ......."
 
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.
 
can you post the code giving the error ?
 
you put

"$comments\n" .

and get that error?
 
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"
 
try

$comments . "\n" .

then, but

"$comments\n" .

so posting the exact code after your edits may help spot what went wrong.
 
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" .
 
Try this..

($comments .\n)
 
Problem solved - F$ on the way to theparrot and cyphix - small token of appreciation, thanks both. :-)
 
Dang & I just made you a new script lol :-(
 
Status
Not open for further replies.
Back
Top Bottom