Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 12-08-2009, 04:29 PM href
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Hi

Why this:

Code:
 
<td width="38" align='center' bgcolor='#FFFFFF'><span class="style2"><a href="main3.php?id=<? "$id"; ?>"</a></span></td>

...does not shows the ID value and of course cannot give order to go to main3.php.


Help!!!
josil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-08-2009, 04:45 PM Re: href
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I see three things wrong here, the main one is that you forgot to call echo (or print).

The second one is that you are using short tags (<?), this won't cause a problem in your case, but you still shouldn't do it (some PHP installations do not have short tags enabled).

The third is that it is unnecessary to surround your variable with quotes. This also won't cause a problem, but there is no point in doing it.

This is what the code should look like:
PHP Code:
<?php echo $id?>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 12-08-2009, 05:10 PM Re: href
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Quote:
Originally Posted by NullPointer View Post
I see three things wrong here, the main one is that you forgot to call echo (or print).

The second one is that you are using short tags (<?), this won't cause a problem in your case, but you still shouldn't do it (some PHP installations do not have short tags enabled).

The third is that it is unnecessary to surround your variable with quotes. This also won't cause a problem, but there is no point in doing it.

This is what the code should look like:
PHP Code:
<?php echo $id?>

Thanks for your reply.

If I do not use href situation I can see the ID value.

<span class="style2><?php echo $id ?>"></span>

even without this ;

Immediatley I add the href, disappears the ID value

I've tried...

1.
<span class="style2"><a href="main3.php?id=<?php echo $id; ?>"></a></span> FAIL

2.
<span class="style2"><a href="main3.php?id=<?php echo "$id"; ?>"></a></span> FAIL

3.

<span class="style2"><a href='main3.php?id=<?php echo $id; ?>'></a></span> FAIL

4.

<span class="style2"><a href='main3.php?id=<?php echo '$id;' ?>'></a></span> FAIL


The Dream Weaver keeps giving me the code with yellow color underneath sayni that is en error.

But I cannot find where.
josil is offline
Reply With Quote
View Public Profile
 
Old 12-08-2009, 05:15 PM Re: href
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Maybe because you do not have anything inside the link tag, that is between > and </a>?

<span class="style2"><a href="main3.php?id=<?php echo $id; ?>">Link</a></span>
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 12-08-2009, 05:22 PM Re: href [RESOLVED]
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Quote:
Originally Posted by lizciz View Post
Maybe because you do not have anything inside the link tag, that is between > and </a>?

<span class="style2"><a href="main3.php?id=<?php echo $id; ?>">Link</a></span>

Peple.

What dahm that I am. Of course.....

Thanks a million.

Xau
josil is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to href
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15412 seconds with 12 queries