473,796 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<?= no longer works after upgrading PHP

17 New Member
I'm trying to figure out what is wrong with my PHP installation, I am running PHP 5 and Apache with mySQL. I have been trying to use
Expand|Select|Wrap|Line Numbers
  1. <?=$filed('$username')?>
within a input box:
Expand|Select|Wrap|Line Numbers
  1.     <td>Login:<?php if($e_username) echo(' <font color="#ff0000">*</font>'); ?></td>
  2.     <td align="right"><input type="text" name="username" style="width:140px;" value="<?=$field[$username]?>">
  3.     </td>
  4.   </tr>
  5.   <tr>
$field is referring to a function that I have and $username
Expand|Select|Wrap|Line Numbers
  1. $username = $_POST['username'];
  2. if empty then $e_username = $true
  3. $field
  4. <?php
  5.     function field($value)
  6.     {
  7.         return str_replace('"', '&quot;', stripslashes($value));
  8.     }
  9.  
  10.     foreach($_POST as $key)
  11.         unset($key);
  12.  
  13.     if($_COOKIE['username'])
  14.     {
  15.         if(mysql_num_rows($q = mysql_query("select clients.clientid, clientdata.name from clients left join clientdata on clientdata.clientid=clients.clientid where clients.username like '{$_COOKIE['username']}' and clients.password='{$_COOKIE['password']}'")))
  16.         {
  17.             $f = mysql_fetch_array($q);
  18.             $account['clientid'] = $f['clientid'];
  19.             $account['name'] = $f['name'];
  20.         }
  21.     }
  22. ?>
I can't get it to work I tried using <?php <?= and <? but I had it working perfectly fine with <?= running PHP 4 I believe can anyone help me out?

Thanks in advance
Sep 10 '07 #1
4 1204
shane3341436
63 New Member
If your codes work for <?php, ?> tags then there must be problem with ur php.ini file. You can uncomment 'short_open_tag ' in ur php.ini file and change it to 'on' state. This allows the short hand <?, ?> tags too
Sep 10 '07 #2
Weisbartb
36 New Member
[PHP]
<?php
phpinfo(-1);
?>
[/php]
Please run that and post the results.

PS: Please use the code and php tags.
Sep 10 '07 #3
pbmods
5,821 Recognized Expert Expert
Heya, post. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=php]
PHP code goes here.
[/CODE]

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).
Sep 10 '07 #4
pbmods
5,821 Recognized Expert Expert
You are trying to use short tags with a PHP installation that likely has short tags turned off.

Try using
Expand|Select|Wrap|Line Numbers
  1. <?php echo $filed('$username'); ?>
instead.

As a sidenote, it's a good idea to wean yourself off of short tags, because once XHTML takes over and HTML goes by the wayside, short tags will interfere with your XML declarations, or more appropriately, properly including XML declarations will break your PHP.
Sep 10 '07 #5

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

Similar topics

2
10569
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
4
2557
by: owen | last post by:
For some reason pop up windows are no longer working on my pc. And no, I dont have any popup killer installed. The problem is across all websites I look at on my browser. Is there any obvious reason this might happen? I haven't changed any settings, but if there's somethign I could check I'd be grateful if someone could point it out to me! Thanks! Owen
55
7311
by: Ton den Hartog | last post by:
Stupid basic question but I find it horribly imposible to find the answer elsewhere... :-( I want to have a piece of text in my HTML page and want to be able to change it in a Javascript function that is called from a button. I think I can use a <div id="t"></div> for this ? Something like
4
7844
by: Andre Majorel | last post by:
I'm trying to make a compact <dl> class à la troff .TP where you have Term Definition of the term. Longer Term Definition of the longer term. i.e. if the <dt> text is shorter than the margin-left, the <dd> is on the same line. Otherwise, the <dd> goes on the next line.
8
5157
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is pulling a name and placing it under the thumbnail (the text is
11
9273
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
3
2038
by: Robert Wierschke | last post by:
Hi I want to overload the operator<< for a class Vector. class Vector { double x; double y; double z;
72
4240
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and c?
5
4029
by: Jay A. Moritz | last post by:
Error: The dependency '<my dll>' in project '<my project>' cannot be copied to the run directory because it would conflict with dependency '<my dll>'. I am getting a dependency error building my application that was using some other namespaces that I had built and incorrectly referenced to the dll instead of the project, but I ended up removing the reference entirely but my project keeps getting the error. How do I tell my project to...
9
5551
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
0
9525
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.