473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Error when assembling a link

Hi,

I am assembling navigation links for an online article. The code works
fine for WIN IE 6 users, but not for NN4, or Mac IE5 users. When it
works, the resulting link looks like this:

http://www.mydomain.com/pr3/article2.php

On the machines with trouble, we get this:

/pr3/\\\\www.mydomain.com\\pr3\\article2.php

(Sorry for the dummy URL - I can't share the page yet)

As you can see, the link is now relative, and the slashes are working
out poorly. Is there a rule or technique I am missing that could make
this calculation work for the older browsers?

Thanks,

Matt
The relevant code is:

$page_num=1;
$page_location='http:\\\www.mydomain.com\\pr3\\';
$prev_page=$page_num-1;
$next_page=$page_num+1;
if ($prev_page == 0) {
$prev_page_link=NULL;
$prev_page_label=NULL;
}
else {
$prev_page_link = $page_location .'article'. $prev_page . '.php';
$prev_page_label = '< ' . $prev_page;
}
if ($next_page > $num_pages) {
$next_page_link=NULL;
$next_page_label=NULL;
}
else {
$next_page_link = $page_location .'article'. $next_page . '.php';
$next_page_label =$next_page . ' >';

echo ('<td width="380px" align="right"><h3> Article
Navigation:</h3></td>');
echo ("<td align=\"left\"><h3><a
href=\"$prev_page_link\">$prev_page_label</a> $nbsp $page_num $nbsp <a
href =\"$next_page_link\">$next_page_label</a></h3></td></tr>");
Jul 17 '05 #1
1 1694
sk
Why are you using backslashes in $page_location? See the second line of
your script. http:// is valid. http:\\ is not. Windows IE is forgiving
about this sometimes. Other browsers and the HTTP spec are not.

Matthew White wrote:
I am assembling navigation links for an online article. The code works
fine for WIN IE 6 users, but not for NN4, or Mac IE5 users. When it
works, the resulting link looks like this:

http://www.mydomain.com/pr3/article2.php

On the machines with trouble, we get this:

/pr3/\\\\www.mydomain.com\\pr3\\article2.php
.....
The relevant code is:

$page_num=1;
$page_location='http:\\\www.mydomain.com\\pr3\\';


Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark A. Washburn | last post by:
/* Test4 WARNING THIS PROGRAM NEVER ENDS DUE TO JAVA COMPILER ERROR Neither Sun JDK 1.1.8 nor JDK 1.4.1 compiler will output *any* error or warning A disassembly of the class file shows...
1
by: mccoyn | last post by:
I'm porting an old project to use .NET. When I try to link in a static library (.lib) that has a single managed class in it. I get the following errors: LINK : error LNK2020: unresolved token...
2
by: Mary | last post by:
Hello, I am having a problem with the cl compiler. I have written a C class (RegConnect.c) which uses Win32 API functions such as RegOpenKey, RegCloseKey etc. Initially when I was trying to...
10
by: Gary Hughes | last post by:
I'm getting the following error when attempting to link a managed C++ dll. I can't find any reference to these errors with google. Can anyone help? I've included the class definition causing the...
31
by: JAKE | last post by:
I'm pretty new to ansi c and I'm stuck I'm trying to assemble a string in a called function. I need to send it three different data types and return the assembled string. I've been getting errors...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
9
by: Ratfish | last post by:
I'm getting a "2014:: Commands out of sync; you can't run this command now" error on a php page when I try to call a second stored procedure against a MySQL db. Does anyone know why I might be...
9
by: =?ISO-8859-1?B?UOlw6g==?= | last post by:
I have a page that inserts these values in the table... $fundo_nome = $_POST; $fundo_link = $_POST; $fundo_activo = $_POST; $sql = sprintf("INSERT INTO relatorio_fundo(fundo_nome,...
2
by: xxsassxx31 | last post by:
Hello....beforehand I want to thank you for your help regarding the problems I can't seem to fix. I am using Windows Vista and I have run scandisk/disk defrag/computer cleanup with various programs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.