473,386 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

problem in syntax

Hi,

i used the below sentence

echo "<td><a href=<?=$row['designer_number']?>>".$row['first_name']."</a></td>";

In that i got the error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/local/etc/httpd/sites/tanbo.com/abstractgamearchive/mockup/designers.php on line 169

what's the mistake in that.Plz tell that.
Apr 21 '08 #1
5 1345
Markus
6,050 Expert 4TB
Hi,

i used the below sentence

echo "<td><a href=<?=$row['designer_number']?>>".$row['first_name']."</a></td>";

In that i got the error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/local/etc/httpd/sites/tanbo.com/abstractgamearchive/mockup/designers.php on line 169

what's the mistake in that.Plz tell that.
Youre trying to execute php inside php.
Change it to:
[php]
echo "<td><a href={$row['designer_number']}>{$row['first_name']}</a></td>";
[/php]
Apr 21 '08 #2
TheServant
1,168 Expert 1GB
And use <?php instead of just <?
<? can be used for XHTML and will be depreciated in the next php version I have heard.
Apr 21 '08 #3
Markus
6,050 Expert 4TB
And use <?php instead of just <?
<? can be used for XHTML and will be depreciated in the next php version I have heard.
Interesting - where have you heard this?
Apr 21 '08 #4
ronverdonk
4,258 Expert 4TB
Anyway, to be deprecated or not, it is very dangerous to use the short-hand tag of php (<?), because you never know whether the server, at which your script eventually is going to run on, has this short-hand option (short_open_tag ) enabled.

So I would always advise to use the full directive, e.g. <?php.

This directive also affects the shorthand <?= , which is identical to <? echo . Use of this shortcut also requires short_open_tag to be on.

Ronald
Apr 21 '08 #5
TheServant
1,168 Expert 1GB
Interesting - where have you heard this?
Just checked it again and turned out they aren't doing that anymore. Th plan was to: Remove support for <?, <% and <script language="PHP"> and add "<?php =$var?>" but it looks like they are only going to get rid of <% which noone uses anyway.

Thanks for asking, I wouldn't have looked for ages if you hadn't!
Apr 22 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

68
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1, 2), this isn't really intuitive to me! Also I...
7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
5
by: Drifter | last post by:
The quote below is part of the information i want to save to a MS Access database - or update, as the case may be. The original database was built a long time ago, and looking at the code for...
4
by: Toonman | last post by:
I'm trying to use a couple of variables in a stored procedure. Things work fine when I hard code the data into the variables and also work fine when I use the variable in the WHERE clause and hard...
4
by: ---- | last post by:
Here are my files (problem follows the code): -------------------------------------------------------------------------- // Group.h #ifndef GROUP_H #define GROUP_H class Group { public:
3
by: krzychu | last post by:
Hi, I have installed brand new platform - Zope-2-7-6, Python 2.4.1, Plone 2.0.5, OS Debian 1:3.3.6-2. After import a old Plone site from the following platform Zope-2-7-4, Python 2.3.3, Plone...
3
by: Gwarg | last post by:
Hello I hope someone has encountered this and knows what the problem is. I've taken over an mfc ocx project and i am normally not an mfc programmer. I was trying to change settings to allow me...
2
by: Shashank | last post by:
Hi, I am passing a tcpdump filter to a function which compiles the filter using pcap_compile and then sets it. Here is the filter, ip>=0x0000 and ip <=0xd9295a3 and ip >=0x0000 and ip...
0
by: Cameron.MacNeil.024 | last post by:
Hi folks, hopefully you'll be able to help me with this problem I'm having. I have a bunch of xml files with format similar to the following: <?xml-stylesheet href='syntax.xsl'...
49
by: Bert | last post by:
Problem is documented at http://ace.delos.com/usacoprob2?a=deAhyErCKsK&S=gift1 Why doesn't this work? /* ID: albert.4 LANG: C TASK: gift1 */
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.