Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

hi there i am setting up a simple html php form. the php is:

<?php
$name = $_POST["name"];
$email = $_POST["email"];
$devices  = $_POST["devices"];
$games = $_POST["games"];
$apps =$_POST["apps"];
$beta = $_POST["beta"];

$stuff = array();
//($stuff, "<html>", "name=", $name, "<br />",
array_push($stuff, "<html>", $name, "<br />", $email, "<br />", $devices, "<br />", $games, "<br />", $apps , "<br />", $beta, "</ html>);
mail ( "[email protected]", "Add me to the mailing listt!!!", $stuff);

and i get

Parse error: syntax error, unexpected T_STRING in /home/nickp/public_html/email/form.php on line 12

any ideas?

share|improve this question
1  
Just take a good look at the syntax highlighting right here on SO... – deceze Dec 20 '12 at 9:12
check the array_push syntax – Rafee Dec 20 '12 at 9:13
1  
These questions make me sad. – Ben Dec 20 '12 at 9:13
1  
Are you coding in NOTEPAD??? – Salman A Dec 20 '12 at 9:13
Start reading php error while development. Error itself provide enough solution to problem.. :) – Suresh Kamrushi Dec 20 '12 at 9:14
show 2 more comments

closed as too localized by deceze, Salman A, Glavić, Bill the Lizard Dec 20 '12 at 19:07

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

You forgot closing " to last < /html>

array_push($stuff, "<html>", $name, "<br />", $email, "<br />", $devices, "<br />", $games, "<br />", $apps , "<br />", $beta, "</ html>");
share|improve this answer

You forgot to close quotes (") in array_push function.

Here is the solution...

array_push($stuff, "<html>", $name, "<br />", $email, "<br />", $devices, "<br />", $games, "<br />", $apps , "<br />", $beta, "</ html>");
mail ( "[email protected]", "Add me to the mailing listt!!!", $stuff);

I recommend you to use some good editor. This will help you to prevent such silly error.

share|improve this answer
array_push($stuff, "<html>", $name, "<br />", $email, "<br />", $devices, "<br />", $games, "<br />", $apps , "<br />", $beta, "</ html>");
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.