473,804 Members | 3,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.my domain.com\\pr3 \\';
$prev_page=$pag e_num-1;
$next_page=$pag e_num+1;
if ($prev_page == 0) {
$prev_page_link =NULL;
$prev_page_labe l=NULL;
}
else {
$prev_page_link = $page_location .'article'. $prev_page . '.php';
$prev_page_labe l = '< ' . $prev_page;
}
if ($next_page > $num_pages) {
$next_page_link =NULL;
$next_page_labe l=NULL;
}
else {
$next_page_link = $page_location .'article'. $next_page . '.php';
$next_page_labe l =$next_page . ' >';

echo ('<td width="380px" align="right">< h3> Article
Navigation:</h3></td>');
echo ("<td align=\"left\"> <h3><a
href=\"$prev_pa ge_link\">$prev _page_label</a> $nbsp $page_num $nbsp <a
href =\"$next_page_l ink\">$next_pag e_label</a></h3></td></tr>");
Jul 17 '05 #1
1 1715
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.my domain.com\\pr3 \\';


Jul 17 '05 #2

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

Similar topics

4
2157
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 no reference to the readyInst label.
1
4347
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 (0600000E) PatInfo::.ctor LINK : error LNK2020: unresolved token (0600000F) PatInfo::Finalize LINK : fatal error LNK1120: 2 unresolved externals I've striped everything out of this library except for the single class which has an empty constructor...
2
5842
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 create a dll, using the cl compiler I was getting many unresolved external errors, Example 1 below (8 in total, 7 to do with the registry function calls and 1 from wsprintfA call) as I hadn't included the AdvAPI32.lib file. So I created a LINK...
10
9530
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 errors below. Everything compiles fine and all the types are defined, it appears that the template type itga::order_collection::iterator is causing the trouble. Gary.
31
2003
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 such as... 28 C:\Dev-Cpp\assemble.c conflicting types for 'assemble' 3 C:\Dev-Cpp\assemble.c previous declaration of 'assemble' was here 30 C:\Dev-Cpp\assemble.c syntax error before "a" here's what I have so far....
9
9717
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 master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
9
2950
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 getting this error? The error doesn't occur on my development box where I use the 'root' db user, but does occur in production where I'm using a non- root user record to establish a connection. I'm essentially opening a connection at the top of...
9
1382
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, fundo_link, fundo_activo) VALUES (%s, %s, %s)", mysql_real_escape_string($fundo_nome), mysql_real_escape_string($fundo_link),
2
2106
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 so all of that is taken care of for a possible "solution". I looked on various help and resource sites but can't seem to fix my problems! First off, I don't know what is going on with my rar files but I have winrar and 7zip and everything was...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.