peuge Posted August 25, 2008 Share Posted August 25, 2008 $body =$name." ".$surname." Has made a booking. Please find the details below \n \nDate Taking:".$date_in."\nDate Returning: ".$date_out."\nNumber of bikes: ".$amnt."\n\nContact Details:\nTel: ".$tel."\nEmail: ".$email."\n\nBike Registration:\n".for ($i=0;$i<$amnt;$i++){echo $available[$i];}."\n"; Hi there, I am having problems sending the values in the $available array with mail(). When I use the above code I get a Parse error: syntax error, unexpected T_FOR in C:\xampp\htdocs\csr\send.php on line 21 I am not using foreach() because I only want a certain number of the array elements to be sent. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/121180-solved-using-an-array-in-the-body-of-mail/ Share on other sites More sharing options...
Drezard Posted August 25, 2008 Share Posted August 25, 2008 its saying you cant use a for statement in the variable declaration. I would say its cause your declaration is too long and doesn't contain enough ()()()'s. (I think). so maybe set something like $for = .... $body = .... $for .... Daniel Link to comment https://forums.phpfreaks.com/topic/121180-solved-using-an-array-in-the-body-of-mail/#findComment-624692 Share on other sites More sharing options...
peuge Posted August 25, 2008 Author Share Posted August 25, 2008 Works! Thanks Link to comment https://forums.phpfreaks.com/topic/121180-solved-using-an-array-in-the-body-of-mail/#findComment-624697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.