473,385 Members | 1,523 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,385 software developers and data experts.

what 's wrong of the syntax

<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!
Nov 28 '05 #1
7 1127
VS
nick wrote:
<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!


looks like you need to use echo (or one of the other PHP output
functions) with something like:

echo "<a href=\"../" .$code. "/profile.htm\" title=\"" .$name.
"\" target=\"_top\">" .$name. "</a>\n";

--
VS
Nov 28 '05 #2
You are not telling it to output that is why its not working.

try

<html>
<?php
$code="0001";
$name="hello";
printf ('<a herf="../%s/profile.htm" title=%s target="_top">%s</a>',
$code, $name, $name);
?>
</html>

Nov 28 '05 #3
VS wrote:
nick wrote:
<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!

looks like you need to use echo (or one of the other PHP output
functions) with something like:

echo "<a href=\"../" .$code. "/profile.htm\" title=\"" .$name.
"\" target=\"_top\">" .$name. "</a>\n";

$code is integer in there, so how to convert it into string?
Nov 29 '05 #4
nick wrote:
<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!


how to make it open in new windows?
Nov 29 '05 #5
nick wrote:
<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!
how to make it open in new windows?


read: http://www.w3.org/MarkUp/

And specifically: http://www.w3.org/TR/html4/types.html#type-frame-target

/m
Nov 29 '05 #6
nick wrote:
VS wrote:
nick wrote:
<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!


looks like you need to use echo (or one of the other PHP output
functions) with something like:

echo "<a href=\"../" .$code. "/profile.htm\" title=\"" .$name.
"\" target=\"_top\">" .$name. "</a>\n";

$code is integer in there, so how to convert it into string?


You don't need to.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 29 '05 #7
VS
Jerry Stuckle wrote:
You don't need to.


Unless you need the Leading Zero's, in which case, perhaps:

$CODE=sprintf( "%04d", $code );

then output $CODE instead of $code.

--
VS
Nov 29 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: andrew | last post by:
Ok, pretty new to this php stuff, but good with perl/python etc. What is wrong with this php document ??? I get this error: Parse error: syntax error, unexpected $end in...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
3
by: Omar | last post by:
Hi, In the next sentence, what's wrong? <select name='id' onChange="window.location='dePaso.jsp?vuelta=a&nombre=id&anterior=ejecutivo = 'Daniel Perez'&valor='+this.options.value"> IE...
6
by: Daniel Rudy | last post by:
What is wrong with this program? When I try to compile it, I get the following error. Compiler is gcc on FreeBSD. strata:/home/dcrudy/c 1055 $$$ ->cc -g -oe6-3 e6-3.c e6-3.c: In function...
4
by: Nitin Bhardwaj | last post by:
Hello all, I am puzzled by the term 'semantics' ! Well I know about 'syntax of a language' - as defined by its associated grammar Then what is this semantics? What does the C Compiler checks...
9
by: Xiangliang Meng | last post by:
Hi, all. I see a very strange fragment code today. Uint32 enum { a = 100; b = 200; }; NOTE: Uint32 is defined to be 'unsigned' in other source files.
46
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
10
by: Protoman | last post by:
Could you tell me what's wrong with this program, it doesn't compile: #include <iostream> #include <cstdlib> using namespace std; class Everything { public: static Everything* Instance()
3
by: brianbasquille | last post by:
Hello all, Strange little problem here... am just trying to insert some basic information into an Access Database using OleDB. I'm getting a "Syntax error in Insert Into statement" when it...
5
by: Ryan | last post by:
{"POINTID":77902,"MAPID":762,"LONG":-122.21654892,"LAT":"37.1834331019","CITY":"Boulder Creek","STATE":"CA","DIST":5745.4} I get an "invalid label" error... I'm kinda new to this. Thanks!
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.