Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to construct a url 1

Status
Not open for further replies.

mancroft

Programmer
Joined
Oct 26, 2002
Messages
267
Location
GB
Hello

Am trying to construct a url using the code below:
and i can't get the $parturl string to attach to the bit after the ?
Any ideas, please?

Code:
$parturl = "xxx";

echo '<a href = edit.php? . $parturl\" target=\"_blank\">';
 
You have to watch your quotation marks, particularly when using single quotes.

Also, if you're using single quotes as the string delineator, you don't have to escape interior double quotes. In fact, the use of single quotes to limit a string will make '\"' be printed as "backslash doublequote" beause strings inside single quotes are not interpolated.

Try:

Code:
$parturl = "xxx";

echo '<a href="edit.php?somevariablename=' . $parturl . '" target="_blank">';



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top