Click here to get back home

force users to different pages?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
force users to different pages? Geoff Cox 03-21-2008
Posted by Bergamot on March 21, 2008, 6:56 pm
Please log in for more thread options
Michael Fesser wrote:
> .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

Posted by Michael Fesser on March 21, 2008, 7:12 pm
Please log in for more thread options
.oO(Bergamot)

>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

Posted by Geoff Cox on March 21, 2008, 5:39 pm
Please log in for more thread options
On Fri, 21 Mar 2008 21:02:41 +0000, "Chris F.A. Johnson"

> 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

Posted by Geoff Cox on March 21, 2008, 11:45 am
Please log in for more thread options
On Fri, 21 Mar 2008 09:40:41 -0400, "Jonathan N. Little"

><?php
>
>$links = array('a.html','b.html','c.html','d.html');
>$last=count($links)-1;
>$link=$links[rand(0,$last)];
>
>echo "<a href=\"$link\">Mystery Tour</a>";
>
>?>

I didn't save as .php file!

Any thoughts on this one?

<script type="text/javascript">
function getNextPage(){
var num = Math.random();
if (num<.5) {
location.href="test1/test1.htm";
} else {
location.href="test2/test2.htm";
}

}
</script>

<IMG alt="image" src="assets/images/movelab1.gif"
onClick="getNextPage();">

The reason for the 2 pages is that this web site will have some music
related exercises and we wish to have a kind of control group etc.

Cheers

Geoff

Posted by Jonathan N. Little on March 21, 2008, 1:12 pm
Please log in for more thread options
Geoff Cox wrote:
> On Fri, 21 Mar 2008 09:40:41 -0400, "Jonathan N. Little"
>
>> <?php
>>
>> $links = array('a.html','b.html','c.html','d.html');
>> $last=count($links)-1;
>> $link=$links[rand(0,$last)];
>>
>> echo "<a href=\"$link\">Mystery Tour</a>";
>>
>> ?>
>
> I didn't save as .php file!
>
> Any thoughts on this one?
>
> <script type="text/javascript">
> function getNextPage(){
> var num = Math.random();
> if (num<.5) {
> location.href="test1/test1.htm";
> } else {
> location.href="test2/test2.htm";
> }
>
> }
> </script>
>
> <IMG alt="image" src="assets/images/movelab1.gif"
> onClick="getNextPage();">
>
> The reason for the 2 pages is that this web site will have some music
> related exercises and we wish to have a kind of control group etc.

And what will happen if the visitor has JavaScript disabled?

The server side solution means it doesn't matter.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Similar ThreadsPosted
question about tailored IFrame pages for IE users May 20, 2005, 10:32 am
Safari users, help please September 12, 2005, 7:09 am
Validating Users to a site August 17, 2005, 7:56 pm
Is a "ZIP" extension the ONLY way to force a "SAVE AS" for your PDF? August 10, 2004, 1:43 pm
How to force a page to be into a frame? October 8, 2005, 5:47 am
Force CSS on external site? December 13, 2004, 6:00 pm
force download of a file February 3, 2006, 2:43 pm
force larger image into same February 21, 2008, 3:59 am
Dreamweaver MX - advanced users question. April 4, 2005, 8:59 pm
Image Not Displaying for Some Firefox Users May 31, 2007, 11:21 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap