Solved

Variables in Url links....

Posted on 2003-11-17
3
413 Views
Last Modified: 2008-03-06
Hi I am a newbie to PHP...

I like to know how I place a link in Call field below

while ($row = mysql_fetch_assoc($result)) {
echo "<tr><TD BGCOLOR=\"#CCCCCC\">",$row['Call'], "</td><TD BGCOLOR=\"#CCCCCC\">", $row['Title'],"</td><TD BGCOLOR=\"#CCCCCC\">", $row['Author'],"</td></tr>\n";
}

i want to put a link for $row['Call']  

something like this:

<a href="http://somelink.com.au/RNO?Call=$row['Call']">

Cheers

and thanx in advance
0
Comment
Question by:baz_can_fix_it
3 Comments
 
LVL 20

Accepted Solution

by:
Muhammad Wasif earned 30 total points
ID: 9769260
try this
echo "<a href='http://somelink.com.au/RNO?Call=".$row['Call']."'>Your Link</a>";

WASIF
0
 
LVL 19

Assisted Solution

by:Michael701
Michael701 earned 20 total points
ID: 9769266
that looks good

notes: with php4 globals are turned off, in your next page you have to use

echo $_GET['Call']; // WaTcH out for upper/lower case variable names

or you may use the import function, but this allows hackers to set variables in your code, if you don't initialize them it could have adverse effects.

 import_request_variables('g');


also checkout these functions

function clean_post($string)
{
  $string = trim(htmlspecialchars(stripslashes($string), ENT_QUOTES));
  return $string;
}
0
 
LVL 1

Author Comment

by:baz_can_fix_it
ID: 9774679
Thanx  wasifg... Spot On...exactly what I wanted... excelllent answer

Michael701 thank you too for the extra tip... :)

Could you both do me a favour see if you can answer me other question on this page... :)

Cheers

http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20799763.html#9763780


Thank you in advance
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question