HighDots Forums  

force users to different pages?

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss force users to different pages? in the HTML forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Geoff Cox
 
Posts: n/a

Default Re: force users to different pages? - 03-21-2008 , 04:39 PM






On Fri, 21 Mar 2008 21:02:41 +0000, "Chris F.A. Johnson"
<cfajohnson (AT) gmail (DOT) com> wrote:

Quote:
Or use the safer and more portable printf instead of the
deprecated echo:

printf '<a href="%s">Mystery Tour</a>\n' "$link"
Chris,

I couldn't get above to work so after trying various combinations the
following is OK.

printf("<a href='%s'>Mystery Tour</a>",$link);

Seem OK to you?

Cheers

Geoff


Reply With Quote
  #12  
Old   
Chris F.A. Johnson
 
Posts: n/a

Default Re: force users to different pages? - 03-21-2008 , 04:46 PM






On 2008-03-21, Michael Fesser wrote:
Quote:
.oO(Chris F.A. Johnson)

Or use the safer and more portable printf instead of the
deprecated echo:

Deprecated? Safer? More portable? What are you talking about?
I was talking about something completely different. My apologies;
please ignore my post.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


Reply With Quote
  #13  
Old   
Bergamot
 
Posts: n/a

Default Re: force users to different pages? - 03-21-2008 , 05:11 PM



Michael Fesser wrote:
Quote:
.oO(Chris F.A. Johnson)

printf '<a href="%s">Mystery Tour</a>\n' "$link"

please remove the quotes
around the $link variable - quoting a single variable is just stupid.
Aren't the quotes around the $link variable part of the <a> code, i.e.
for quoting the href attribute value?

--
Berg


Reply With Quote
  #14  
Old   
Michael Fesser
 
Posts: n/a

Default Re: force users to different pages? - 03-21-2008 , 05:19 PM



..oO(Bergamot)

Quote:
Michael Fesser wrote:
.oO(Chris F.A. Johnson)

printf '<a href="%s">Mystery Tour</a>\n' "$link"

please remove the quotes
around the $link variable - quoting a single variable is just stupid.

Aren't the quotes around the $link variable part of the <a> code, i.e.
for quoting the href attribute value?
No. The same in PHP would be

printf('<a href="%s">Mystery Tour</a>\n', "$link");

The quotes for the href attribute are already in the first parameter,
the format string. The second parameter is just the value for the %s
placeholder. For PHP "$link" is a double-quoted string with an embedded
variable. But since there are no other characters in the string, the
quotes are pointless and just cause an unnecessary parsing overhead.

Micha


Reply With Quote
  #15  
Old   
Bergamot
 
Posts: n/a

Default Re: force users to different pages? - 03-21-2008 , 05:56 PM



Michael Fesser wrote:
Quote:
.oO(Bergamot)
Michael Fesser wrote:
.oO(Chris F.A. Johnson)

printf '<a href="%s">Mystery Tour</a>\n' "$link"

please remove the quotes
around the $link variable - quoting a single variable is just stupid.

Aren't the quotes around the $link variable part of the <a> code, i.e.
for quoting the href attribute value?

No.
Duh - my eyes were looking at "%s" but the brain substituted "$link"

--
Berg


Reply With Quote
  #16  
Old   
Michael Fesser
 
Posts: n/a

Default Re: force users to different pages? - 03-21-2008 , 06:12 PM



..oO(Bergamot)

Quote:
Michael Fesser wrote:
.oO(Bergamot)
Aren't the quotes around the $link variable part of the <a> code, i.e.
for quoting the href attribute value?

No.

Duh - my eyes were looking at "%s" but the brain substituted "$link"
OK.

Micha


Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.