473,396 Members | 1,590 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,396 software developers and data experts.

Appending #anchor with other variables

Hi all, and apologies if this is a newbie type question, I am one.

I need to get a page to go to a paticular <a name=""> tag. It works fine
with no variables passed eg: myscript.php#top, but I need to append other
info and just can't work out how to do it.

TIA
Nov 4 '05 #1
5 4451
You could add your variables to the querystring like

script.php#top?myvar=thevar&myvar1=thevar2

and then retrieve them on the script.php page using

$myvar = $_GET["thevar"];

$myvar1 = $_GET["thevar2"];

Happy coding :)

Joe
"Pseud O'Nym" <no*******************@notyahoo.co.uk> wrote in message
news:43***********************@ptn-nntp-reader02.plus.net...
Hi all, and apologies if this is a newbie type question, I am one.

I need to get a page to go to a paticular <a name=""> tag. It works fine
with no variables passed eg: myscript.php#top, but I need to append other
info and just can't work out how to do it.

TIA

Nov 4 '05 #2

"Joe Molloy" <mo********@hotmail.com> wrote in message
news:VT*****************@news.indigo.ie...

Thank you, I just looked at $_GET on php.net and now understand. :) OTOH, I
think maybe I'll make a form with a POST method, and hidden inputs for my
vars, in the places I now have hrefs with appended variables. The contents
of the address bar for my, very simple, site is starting to make a Google
look like child's play .
You could add your variables to the querystring like

script.php#top?myvar=thevar&myvar1=thevar2

and then retrieve them on the script.php page using

$myvar = $_GET["thevar"];

$myvar1 = $_GET["thevar2"];

Happy coding :)

Joe
"Pseud O'Nym" <no*******************@notyahoo.co.uk> wrote in message
news:43***********************@ptn-nntp-reader02.plus.net...
Hi all, and apologies if this is a newbie type question, I am one.

I need to get a page to go to a paticular <a name=""> tag. It works fine
with no variables passed eg: myscript.php#top, but I need to append other info and just can't work out how to do it.

TIA


Nov 4 '05 #3
Joe Molloy wrote:
Joe
"Pseud O'Nym" <no*******************@notyahoo.co.uk> wrote in message
news:43***********************@ptn-nntp-reader02.plus.net...

Hi all, and apologies if this is a newbie type question, I am one.

I need to get a page to go to a paticular <a name=""> tag. It works fine
with no variables passed eg: myscript.php#top, but I need to append other
info and just can't work out how to do it.

TIA

You could add your variables to the querystring like

script.php#top?myvar=thevar&myvar1=thevar2

and then retrieve them on the script.php page using

$myvar = $_GET["thevar"];

$myvar1 = $_GET["thevar2"];

Happy coding :)

It appears to be a moot point now for the OP (is going to use POST), but
the fragment identifier (#top) should be at the end of the URI string -
after the variables.

script.php?myvar=thevar&myvar1=thevar2#top

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
Nov 4 '05 #4
"Chuck Anderson" <we************@seemy.sig> wrote in message
news:Qo********************@comcast.com...
wrote:
It appears to be a moot point now for the OP (is going to use POST), but
the fragment identifier (#top) should be at the end of the URI string -
after the variables.

script.php?myvar=thevar&myvar1=thevar2#top


I would still like to know how to get this to work, for future reference.

I notice that the server on which the script is run, and which is outside my
control, has register_globals set on. So I don't need to use $_GET to return
appended variables, but could this be why the fragment identifier is being
ignored?
Nov 5 '05 #5
"Pseud O'Nym" <no*******************@notyahoo.co.uk> wrote in message
news:43***********************@ptn-nntp-reader02.plus.net...
"Chuck Anderson" <we************@seemy.sig> wrote in message
news:Qo********************@comcast.com...
wrote:
It appears to be a moot point now for the OP (is going to use POST), but
the fragment identifier (#top) should be at the end of the URI string -
after the variables.

script.php?myvar=thevar&myvar1=thevar2#top

I would still like to know how to get this to work, for future reference.

I notice that the server on which the script is run, and which is outside

my control, has register_globals set on. So I don't need to use $_GET to return appended variables, but could this be why the fragment identifier is being
ignored?


Oops, sorry chaps! It does work as above, I had an if else back to front. :(
Nov 5 '05 #6

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

Similar topics

1
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I...
3
by: ehm | last post by:
I have encountered an issue that has me totally confused. I have a page where the user clicks on a hyper-text link and is then directed towards another page (passing additional variables, etc.). If...
6
by: Daniele Baroncelli | last post by:
Hi guys, I would like to change the text in an anchor. es. from <a id="idanchor">oldtext</a> to
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
10
by: elibol | last post by:
Hi, Is there an event that fires when the back or forward button on a browser is pressed? I need an event to fire when someone clicks the back or forward button after an anchor has been set. ...
5
by: Randy Webb | last post by:
The list below has the current section number, proposed anchor name, and then the current title of that section. Some make sense, some don't. There are a few that don't have proposed anchor names...
3
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
0
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,...

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.