views:

73

answers:

2

It's probably something simple I am not seeing because I've stared at it too long.

Any ideas? It's throwing on line 119, I've indicated it below

Parse error: syntax error, unexpected T_STRING in /home6/cleanai4/public_html/act.php on line 119

I'm just trying to format a phone number.

Thanks for the help in advance.

     if(isset($submit)):
  $db = mysql_connect("localhost", "#######", "#######");
  mysql_select_db("###########", $db);
  $date = date("Y-m-d"); 
  $address = $street . ", " . $city . " " . $zip;
Line 19-> $phonetmp = '('substr($phone, 0, 3)')' . substr($phone, 3, 3) . '-' . substr($phone, 6);
  $phone = $tmp;
  $sql = "INSERT INTO ########
  VALUES(NULL,'$name', '$address', '$email',  '$phone', '$info', '$sign', '$date' )";
  mysql_query($sql);
  print("<h2>We appreciate your support</h2>\n");
  print("<b>Now, spread the word</b><hr>\n");
 endif;
+6  A: 

You're missing the concatenation after the first part of $phonetmp, should be '(' . substr($phone, 0 , 3) . ')'...

Also note: unless you have a variable called $tmp outside of the code segment, you're setting $phone to an undeclared variable. And make sure you sanitize user inputs!

munch
right on, thanks.
jon
+2  A: 

That's not a password I'm seeing in the mysql_connect call is it? ;)

mmsmatt
oops, thanks for the heads up, hah :)
jon