Current location: Hot Scripts Forums » Programming Languages » PHP » PHP Link


PHP Link

Reply
  #1 (permalink)  
Old 03-08-05, 08:01 PM
Crackboy Crackboy is offline
New Member
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Link

Hello guys!
I want to do a link using php but I can't get it to work.
What I want to do is :
Query mysql for info
Do a link like *blabla.php?=idnumberhere*
But I can't find a way to make a link with php in it.
Here's an example of what I want to do :
Code:
<table width="60%">
<tr>
<td colspan="2"><b><? print $row["title"]; ?> - <? print stripslashes($row["author"]); ?></b></td>
</tr>
<tr>
<td width="43%"><b><? print stripslashes($row["date"]); ?> - <a href=blabla.php?id=<? print stripslashes($row["id"]); ?>>Click Here!</a></b><BR><BR></td>
</tr>
</table>
So well.. that's it.
Is there a way to do this? I want to do something so user can send tutorials about a game and then people can check them by clicking on the link. My only problem is making the link now
Thanks to everybody who will help me!
Crackboy


Edit : Ho god now I'm dumb, I just figured I had forgotten a > and now it work with the above example... Well anyway maybe this thread will help someone who knows
Reply With Quote
  #2 (permalink)  
Old 03-09-05, 11:04 AM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
Glad you figured it out.
Code:
<a href=blabla.php?id=<?= $row["id"] ?>>Click Here!</a>
This will work as well. <?= $something ?> is shorthand for <?php echo($something) ?>.

Also, echo should be used instead of print unless you need to return a value depending on whether the output of your string was successful or not. A discussion of the difference between echo and print from the PHP documentation.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Script that lists contents of director + generates download link? eNforcer Script Requests 1 01-15-05 07:01 AM
Link exchange for PHP sites rfaulds Traffic Exchange 0 08-11-04 04:52 AM
How do you add a link n PHP bayside PHP 2 06-27-04 10:30 AM
PHP script to change URL link weekly hculbert Script Requests 0 01-23-04 03:48 PM
PHP - Windows Authentication link Mista Script Requests 3 12-29-03 06:09 PM


All times are GMT -5. The time now is 05:35 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.