Ok, I'll put one in if you can tell me how. Please remember I'm really new to PHP and haven't had much time free to do much reading up.
I'm testing their existance manually, I think. I'm testing over and over again and if they don't exist in the form I'd know about it. As I'm sure that they exist is it neccessary to test for them using the PHP code? I don't understand the advantages to doing this in my current situation. Are there any?Quote:
If the elements don't exist within the super-global array, notices will be sent to the error log. Test that the elements exist first, then assess the values.
Ok, so what alternative should I know about? I've got very limited experience of PHP and until I come across other options I'm going to make do with what I've got. I don't know how to validate a name or email any better than this.Quote:
And if the e-mail address isn't actually an e-mail address, or the name is just white space?
I do however have more questions:
You suggested this script:
I didn't really understand what you meant by string literal split. I've tried closing and opening the string with quotation marks (') but ever time I do I cause errors.Quote:
Originally Posted by mwinter
For example, I'm trying to write a string (terminology?) called $message1 and I find it convenient to split it into several lines but in doing so I'm causing errors. Anyone who likes could tell me what's causing them in the following code. All of this code is meant to be a definition of $message1.
You'll notice there is another issue involved in this script. I"ve got no idea if I can use if-else statements and echos like this. I hope they at least give the impression of what it is I'm trying to do.PHP Code:$message1 = 'E-mail do Site da Pagina: Fale Conosco\r\n\r\n'
'Nome: {$name}\r\n'
'Cargo: {$company}\r\n'
'Empresa: {$company}\r\n'
'Cidade: {$city} / {$state}'
//if the country is anything other than Brasil state it
if ($country=='Brasil')
{ echo '\r\n\r\n';}
//otherwise leave it out
else
{ echo '\r\n\r\n';}
'Intressa: {$interest}\r\n'
//if there is a message echo it
if ($message=='')
{ echo '\r\n';}
else
{ echo 'Mensagem: '.$message.' \r\n';}
'Deseja Contato Por: {$contactType}\r\n'
'Horario de Contato: {$timeTable}\r\n\r\n'
'Fone: {$tel}\r\n'
'E-mail: {$email}\r\n'
'Site: www.{$site}\r\n';
Thanks to all.
dog

