Missing " |
Missing " |
tudsy |
Jun 25 2021, 06:57 AM
Post
#1
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
I was wondering what is wrong with the following statement: echo "<td>" . "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' . '</td>'; I cant see it. Thanks for any help. |
pandy |
Jun 25 2021, 07:45 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
Shouldn't the first double quote here be matched by a closing double quote instead of a single one?
"<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>' |
tudsy |
Jun 25 2021, 08:12 AM
Post
#3
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
|
pandy |
Jun 25 2021, 08:19 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
Looks closed to me.
"<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' You have the closing tag for A and the start tag is closed properly too. Or do I miss something? |
tudsy |
Jun 25 2021, 09:21 AM
Post
#5
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Looks closed to me. "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' You have the closing tag for A and the start tag is closed properly too. Or do I miss something? Thanks again. The error is a syntax error: unexpected end of file expecting a t_string ...................... |
tudsy |
Jun 25 2021, 09:21 AM
Post
#6
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Looks closed to me. "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' You have the closing tag for A and the start tag is closed properly too. Or do I miss something? Thanks again. The error is a syntax error: unexpected end of file expecting a t_string ...................... |
tudsy |
Jun 25 2021, 11:06 AM
Post
#7
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Looks closed to me. "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' You have the closing tag for A and the start tag is closed properly too. Or do I miss something? Thanks again. The error is a syntax error: unexpected end of file expecting a t_string ...................... here is the code. view.php ( 5.24k ) Number of downloads: 124 |
pandy |
Jun 26 2021, 05:20 AM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
Above me, I'm afraid. You have to wait for Christian to wake up.
|
Brian Chandler |
Jun 26 2021, 08:51 AM
Post
#9
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
echo "<td>" . "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' . '</td>';
Looks awfully confused. Presumably this is "inside" php (i.e. preceded by a <? tag somewhere), so you have: echo // this echoes the following string(s) "<td>" // will echo <td> . // is the string concatenation operator so it will now echo the next string, from the first " to to closing " "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. " So far then you expect to get <td><a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. I do not think this is what you mean. If you want to echo a bunch of text with just one bit of PHP in it, just switch off php except for the one bit: ?> <td><a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'>Edit</a></td> I think that is what you mean; the php "short form" helps more with readability: <td><a href='edit1.php?id= <?=$data['CustomersArtitemid']?>'>Edit</a></td> I think it is much simpler as far as possible to turn everything that is going to be echoed into a simple variable, like this: $id = $data['CustomersArtitemid']; echo "<td><a href=\"edit1.php?id=$id\">Edit</a></td>\n"; (If you use single quotes you don't have to escape them, but it's more conventional to use double quotes in html, I think.) HTH |
Lo-Fi Version | Time is now: 9th May 2024 - 05:22 PM |