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
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>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.