hello,
is it possible to do embedded links from a php script?
Check out the code below, when I send the test case to the switch, it will not go to the embedded link #clarence2
Any thoughts?
Thanks,
Tim -
<?php
-
-
$location=$_GET['location']; if (empty($location)) { $location='index'; } changelocation($location); function changelocation($location) { include ('header.php'); echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="750">';echo '<tr>';echo '<td width="750" align="center" valign="top">';
-
-
switch ($location)
-
{
-
case 'index':
-
include ('home.php'); break;
-
-
case 'artists':
-
include ('artists.php'); break;
-
-
case 'artwork':
-
include ('artwork.php'); break;
-
-
case 'location':
-
include ('location.php'); break;
-
-
case 'contact':
-
include ('contact.php'); break;
-
-
case 'aboutus':
-
include ('aboutus.php'); break;
-
-
case 'test':
-
include ('http://www.hermitagegallery.com/artists/test.php#clarence2'); break;
-
-
} include ('footer.php'); }
-
?>
-
5 1548
Sorry you can't call for a "onpagelink" or "bookmarks" on the page, but the main page will display. if you need to display the page with the onpage link use headers
Let me step back and explain a little about the way includes work:
The moment the PHP interpreter encounters and include statement, the PHP interpreter stops processing the current PHP page, and begins executing the code located in the included file. An easy way to imagine this is to say that the entire body of code located in the included PHP file is copied and pasted at that exact point in the code where the include statement is located.
When you call and Include statement, you are not directing the browser; everything happens server-side, and the end user remains at the parent page.
As my compatriot ajaxrand stated, the proper way to redirect a user is to issue a header() call. The only caveat of doing so is that you cannot print any HTML before doing so.
So this will not work then right? Or do I need to move my switch statement around?
I get what your saying but if I just have a redirect statement from a header statement, it will just redirect me to the page I specify without mainting the php script I use for the index, to put my own Header.php and Footer.php files below
just a little lost with headers, since I can get them to work if I put a header redirect before all the code, but it does not maintain the code.
Thanks!
Not sure if headers are going to do what I need. Basically I need to have a case call the page but go to a bookmark/embedded link in the page (mainly cause I am going to have a page for one artist, but some artists have multiple art pieces, so I need an embedded link so on the art page, when they click on a specific piece of art, it takes them to that embedded link, not just the top of that page). I need to be able to display a Header.php (links and toolbar) before I run switch statement, which in turn means html is already ran defeating the header statement and getting me an error.
I think I may have a solution.
For every piece of art, I will create seperate pages. When someone wants to view all the art created by an artist by clicking the link, within the switch case for that artist, I will have a new include for each piece of art.
Under the art section, when they want to view just one piece of art, i will have a seperate switch statement just for that piece of art.
So the art wont be all on one page for each artists, so I wont need to use embedded links or header()s.
Any thoughts if this is a bad idea?
Thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Vio |
last post by:
Hi,
I've been trying to embed (statically) wxPy alongside an embedded py
interpreter on a linux/gtk box.
At one point, for some reason misc.o linking reported "multiple
definitions of...
|
by: max khesin |
last post by:
There has been a long argument as to whether high link density is good
for the users. Some say it is, as it contains more information, the
others say it is confusing. There is statistical study...
|
by: fotis |
last post by:
hello there!
I am playing with embedded python these days. I wrote sth like this:
------------------------------ Code -------------------------------
#include <Python.h>
#include <iostream>...
|
by: unotin |
last post by:
I have an application in ASP that exports to Word using the
Response.ContentType method.
The application references another ASP page through the img tag that uses a
Response.BinaryWrite (of an...
|
by: Chris Stephens |
last post by:
The Spring 2004 copy of our Embedded Development Tools Newsletter is now
available for downloading from our web site
It includes information about......
An affordable USB protocol Analyser
...
|
by: Vladi |
last post by:
Hello everybody,
I have a asp.net 1.1 page which has the following controls:
4 Images whose src points to an image.aspx file which returns a different
jpg from a DB
1 flash object on top of those...
|
by: SAL |
last post by:
Has anyone created Embedded Links programmatically before?
I have a VB.net and ASP.net Web Application developed in VS.net 2003. What
I am trying to do/find is information on how to create an...
|
by: iegeek |
last post by:
Hi all, I know this is a well-worn topic, but in viewing multiple posts
and articles, I still can't find a satisfactory answer.
I have embedded html in an xml file (element data, not attributes)...
|
by: Beowulf |
last post by:
I inherited an existing database application about 6 months ago. I've
finished converting it to use SQL Server 2000 as the backend (MS Access
2002 frontend w/ Userforms+VBA code pointing to the...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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,...
|
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...
| |