Solved

Variables in Url links....

Posted on 2003-11-17
3
411 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now