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 03-24-2005, 10:59 AM Problem getting $id
Sonic's Avatar
Skilled Talker

Posts: 64
Trades: 0
Can anyone tell me why this doesn't work?

PHP Code:
<? echo '<a href=index.php?id=$id>';?> <? echo "$title"?>
I want it to use the table id of the record but all I get is index.php?id=$id displaying, it does what I want it to if I type directly in the the browser index.php?id=75 it will bring up record 75

This is driving me crazy
__________________

Please login or register to view this content. Registration is FREE
Sonic is offline
Reply With Quote
View Public Profile Visit Sonic's homepage!
 
 
Register now for full access!
Old 03-24-2005, 11:25 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
You need to place your variables in double quotes or use concatenation.

PHP Code:
<? echo "<a href='index.php?id=$id'>"?> 

OR

<? echo "<a href='index.php?id=" $id ."'>"?>
EDIT: Spbbblt. Right, I forgot to use single quotes on my href -- fixed.
__________________
—Kyrnt

Last edited by Kyrnt; 03-24-2005 at 02:53 PM..
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 03-24-2005, 02:13 PM
Sonic's Avatar
Skilled Talker

Posts: 64
Trades: 0
Quote:
Originally Posted by Kyrnt
You need to place your variables in double quotes or use concatenation.

PHP Code:
<? echo "<a href="index.php?id=$id"; ?> 

OR

<? echo "
<a href="index.php?id=" $id?>

Thanks for that but unfortunately that doesn't seem to work either
__________________

Please login or register to view this content. Registration is FREE
Sonic is offline
Reply With Quote
View Public Profile Visit Sonic's homepage!
 
Old 03-24-2005, 02:18 PM
Sonic's Avatar
Skilled Talker

Posts: 64
Trades: 0
Sort it now

PHP Code:
<? echo "<a href=index.php?id=$id>";?>
That worked for me

Thanks again
__________________

Please login or register to view this content. Registration is FREE
Sonic is offline
Reply With Quote
View Public Profile Visit Sonic's homepage!
 
Old 03-24-2005, 02:53 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
Spbbblt. Right, I forgot to use single quotes on my href -- fixed.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Reply     « Reply to Problem getting $id
 

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.52422 seconds with 12 queries