Jump to content

[SOLVED] Missing somthing...


Recommended Posts

Im pretty sure its simple but my editor pushes it onto 2 lines on on the input form line, what do i need to do?

 

<?php

$sql = "SELECT * from tblbasicform";
$res = mysql_query($sql) or die(mysql_error());

echo "<table border=2>";
echo "<tr> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Location</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td><td>New</td></tr>";
while($row = MYSQL_FETCH_ARRAY($res))
{

echo "<tr><td>".$row['name']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['buissnes_name']."</td>";
echo "<td>".$row['location']."</td>";
echo "<td>".$row['latitude']."</td>";
echo "<td>".$row['longitude']."</td>";
echo "<td>".$row['type']."</td>";
echo "<form>";
echo "<td><INPUT type="button" value="New Window!" onClick="window.open('http://www.google.com','mywindow',
'width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')"></td></tr>";
echo "</form>";
}


?>

 

my editor makes it look like that

 

error message

 

 

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/nexodom/public_html/website/wifi.php on line 142

Link to comment
https://forums.phpfreaks.com/topic/129608-solved-missing-somthing/
Share on other sites

You need to escape the quotes within your string

 

The following

echo "<td><INPUT type="button" value="New Window!" onClick="window.open('http://www.google.com','mywindow',
'width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')"></td></tr>";

 

Should be

echo "<td><INPUT type=\"button\" value=\"New Window!\" onClick=\"window.open('http://www.google.com','mywindow',
'width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')\"></td></tr>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.